← back to Fentucci Naturals
docs/TK-11664-restore-map.md
53 lines
# TK-11664 restore map — cadence rc propagation + build-drafts sample-only durability
Date: 2026-09-17 · Lane-5 sledgehammer pass · All changes LOCAL + reversible.
## What changed (3 files, 1 commit)
1. `scripts/cadence-golive.sh` — captures go-live.py's exit code, writes
`rc=$rc` into the log's `=== done` marker, and `exit $rc` so launchd
records a FAILED status when the tranche crashes (the false-green swallow:
previously the wrapper always exited 0 even when go-live.py died with
FileNotFoundError:'psql' — ticket finding #3, second half). The PATH export
itself was already fixed in ce29b0e; this change makes future failures
VISIBLE instead of silently swallowed.
2. `scripts/cadence-import.sh` — same rc propagation for the import cadence
(create-drafts.py failures previously also swallowed to exit 0).
3. `scripts/build-drafts.py` — TK-11664 item 6 (durability gap): quote-only
rows (tags include `quotes`) no longer MINT the $0.00 "Per Yard" variant.
The payload shape for Fentucci is now SAMPLE-ONLY ($4.25 Sample = sole
orderable item, CMO-Paris precedent), matching what go-live.py step 3a
leaves live after its delete. A future re-scrape adding new colorways can
no longer re-mint fresh $0 Per Yard variants (the TK-11635 population
mechanism). Rows without the `quotes` tag keep the old two-variant shape.
4. `data/shopify-drafts.jsonl` — regenerated by build-drafts.py (504 rows, all
sample-only). Files-only output; consumed only by create-drafts.py (which
is a no-op: created.jsonl already holds all 504 SKUs) and retown-collisions
docs. NO Shopify/PG write was fired by this change.
## Validation
- `bash -n` both wrappers OK; `py_compile` build-drafts.py OK.
- 5/5 harness tests (/tmp/tk11664-wrapper-test.sh):
import wrapper no-op exits 0; wrapper pattern propagates child rc (7/0);
dry-run under launchd-minimal PATH reaches DRY-RUN (psql resolves);
negative control: old minimal PATH still crashes (causality proof).
- Regenerated drafts: 504/504 rows have ≥1 Sample, 0 Per-Yard variants,
0 zero-weight variants; create-drafts gate asserts pass on the new shape.
- go-live.py `peryard` lookup degrades to None → 3a delete becomes a no-op
(nothing requires the bare-sku variant to exist).
## Restore
- Scripts + jsonl: `git revert <this commit>` (or
`git checkout <prev-sha> -- scripts/cadence-golive.sh scripts/cadence-import.sh scripts/build-drafts.py && python3 scripts/build-drafts.py`).
- Pre-edit snapshots also at /tmp/tk11664-restore-{build-drafts.py,cadence-golive.sh,cadence-import.sh}.
- No external system state was modified, so nothing else to restore.
## NOT taken (out of lane, stays gated)
- Rotation activator `quotes` exemption rework (item 5) — fleet-wide
activation semantics across all vendors → Steve's call.
- Any Shopify variant delete (TK-11635's 462 live $0 Per Yard variants) —
separate gated memo, canary-first condition pending Steve.
- Rotation-activator refusal of $0-only sellable (item 4) — same gate.