fix(orchestrator): persist spec_path on spec-phase pass (ADR-004) #30
Reference in New Issue
Block a user
Delete Branch "feat/S1-spec-path-persist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes ADR-004: persist
spec_pathon spec-phase pass so build/review/dashboard can read it from the row instead of hitting disk every time.Background
Today the spec-refiner writes the spec file to
data_dir/specs/<project>/<story>.spec.mdand returns the path in verdict feedback. Butcycle.py:set_phase()never copies that path onto thework_items.spec_pathcolumn.Build phase works only because
_find_spec_file()happens to use the same slug convention by luck — fragile, undocumented, and would silently break if the slug convention ever changes.Changes
src/damascus/cycle.py: 3-line branch in Txn 3 verdict-write block. Whenverdict == "pass"andphase == "spec", copyverdict_feedback["spec_path"]intoextra_fields.tests/test_spec_path_persistence.py: two new tests covering both ACs:test_pass_verdict_persists_spec_path: on pass, row'sspec_pathmatches the verdict feedback.test_non_pass_verdict_does_not_persist: on non-pass (e.g.spec_ambiguous), row'sspec_pathis unchanged.No schema migration.
_find_spec_filefallback remains as defense in depth.References
wiki/decisions/ADR-004-persist-spec-path-on-pass.mdwiki/decisions/research/adr-004-spec-path-research.md/root/damascus-bugfixes-q4-2026-prds/_bmad-output/planning-artifacts/stories/S1-persist-spec-path-on-spec-pass.mdTest plan
pytest tests/test_spec_path_persistence.py -vexits 0pytest tests/ -qexits 0 (no regressions)SELECT spec_path FROM work_items WHERE id = <row>returns the on-disk pathOut of scope
_find_spec_filesemantics.spec_path.scripts/backfill_spec_paths.py) — separate PR if needed.