Goal
Establish the durable, repo-local run-state folder + findings-persistence schema that the resumable run (A), synthesis (B), and cleanup (C) all build on.
Implementation Sketch
Add a durable run-root under the repo (.impl-hygiene-run/<run_id>/) owned by state.py (scratch IO SSOT per workflow-ownership.md §2). Persist the run cursor (file_index/batch_index) + the accumulated verified-findings set as an append-safe JSON/JSONL artifact. Gitignore .impl-hygiene-run/. The folder is the single resume + synthesis substrate.
Spec References
workflow-ownership.md §2 (state.py owns scratch IO); script-first.md §4 (runtime layout); .claude/rules/state-discipline.md §1 (durable state location).
Work Items
- Add the durable
.impl-hygiene-run/<run_id>/run-root + findings-persistence schema to state.py (cursor + accumulated findings); gitignore the folder. - pytest: round-trip persist + load of run-state (cursor) + accumulated findings to/from the durable folder.
Items
- Add the durable, repo-local
.impl-hygiene-run/<run_id>/run-root + findings-persistence schema to state.py: persist the run cursor (file_index/batch_index) AND the accumulated verified-findings RECORDS (full finding objects the synthesis phase consumes, not just emitted finding IDs). Make the write atomic + torn-write-detectable by adopting the existing BUG-07-064 write-ahead-journal durability pattern (flock + os.replace/fsync; prior art in scripts/plan_corpus/bug_tracker/) rather than the current plain write_text. Gitignore.impl-hygiene-run/. - pytest: (a) happy-path round-trip persist + load of run-state (cursor) + accumulated finding RECORDS to/from the durable
.impl-hygiene-run/<run_id>/folder; (b) atomic-write guarantee (no partial/half-written state file is ever observable, e.g. via the os.replace rename); (c) torn-write detection on load (a truncated/corrupt persisted artifact is rejected at resume rather than silently yielding lost findings).
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “impl-hygiene-review-run-lifecycle/s-cfc86840” }, “generated_at”: “2026-06-21T16:21:39.130777+00:00”, “graph_state”: { “head_sha”: “45796766”, “last_code_import_at”: “2026-06-21T16:17:17.476Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:impl-hygiene-review-run-lifecycle/s-cfc86840] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/impl-hygiene-review-run-lifecycle” } } }
(full dossier: walking-skeleton—s-cfc86840.intel.json)