# YachtMemory Source Catalog v2 — Fault/Restart Review 0.1.0

**Isolated additional integration test; not signed, not deployed to Wildbad, not connected to the production Sync Receiver.**

Adds a complete, separately named test receiver based on 0.1.0 with two *test-only* fault hooks immediately before the transaction COMMIT. The database name remains hard-pinned to `yachtmemory_catalog_v2_test`. The opt-in script inserts a uniquely identified **synthetic test vessel** and six fixture revisions, preserving the existing Wildbad v2 test data (revisions 1/2). The script is one-shot: it refuses to run when the synthetic test vessel already exists. It does not delete any data, create/drop schemas, change production programs, or use external network access.

## Coverage
- Exception after writing active pointer and inventories but before COMMIT: automatic `rollBack`, previous active revision and history unchanged; retry activates.
- SIGKILL in the same place: MySQL connection closes and InnoDB rolls back; retry activates. Requires `posix_kill` in CLI PHP; otherwise **NOT PASS**, exits code 2.
- Identical finalize retry, duplicate chunk retry, later revision activation, delayed older *pending* snapshot finalization, preserved history.

**Limitations:** SQL code still has no production authentication/ACK integration. The SIGKILL test is not a power-loss/fsync durability test; the controlled checkpoint is just before COMMIT and does not exercise failures after COMMIT but before acknowledgement, simultaneous competing processes, or MySQL server crash. The test additionally stages revision 5, activates revision 6 first, and finalizes revision 5 as `superseded`. If any test fails, inspect partial synthetic rows in isolated DB; do not drop DB.

## YMServer instructions

Extract this folder into `/var/www/app.yachtmemory.net` and review the full new receiver / script. Then run:

```bash
cd /var/www/app.yachtmemory.net/YM-Source-Catalog-v2-Fault-Tests-0.1.0-REVIEW
php -l receiver/ym-catalog-v2-fault-test-receiver.php
bash -n tests/mysql_fault_test_review.sh
sha256sum receiver/ym-catalog-v2-fault-test-receiver.php
cat tests/mysql_fault_test_review.sh
```

Only after review: `bash tests/mysql_fault_test_review.sh` (needs `sudo mysql` and `sudo php`; only isolated DB). No production DB mutation.
