OBJ-A of the Backlog Remediation Programme, and its first code objective.
Extracts the transactional write discipline that was buried inside
_ttg_apply_transition_locked into scripts/lib/manifest-write.sh — lock, validate,
temp-rename, read-back, double compare-and-swap — and makes all six manifest
writers call it. Repoints the hand-rolled status readers at one implementation.
The thesis is shared MACHINERY, never shared AUTHORITY (ADR-031):
task-transition.sh remains the sole sanctioned STATUS writer, red-run.sh the sole
writer of ## Red-Run Evidence, close-objective.sh the sole writer of
scripts/** there are exactly two set_task_status call sites and both write a
snapshot, never a live manifest.
Enrols tests/test-manifest-write-integrity.sh as RULES.md §15's sixteenth bound
entry point — one walk of scripts/** under two tokens, covered only when BOTH
conform:
manifest-writers: 73 scanned, 68 skipped, 5 checked, 0 findings
status-readers: 73 scanned, 56 skipped, 17 checked, 0 findings
Also ships, from two rounds of PR review (27 findings, all addressed): a rollback
that restores pre-write bytes at the original mode; --expect-hash, which extends
the CAS window back to the caller's own read and makes red-run's exit 7 mean what
it documents; a bounded lock retry in place of a single attempt; review-gate
violations recorded whether or not the manifest write landed; and reconciliation
that reports a divergence it cannot quarantine instead of skipping in silence.
Closes #105 #108 #140 #169 #203 #226 #227 #241
Suite: 123 scanned, 123 checked, 0 findings.