Files
msd-core/get-shit-done
Tom Boucher 6cba62b39d fix(#397): preserve executor-authored STATE.md fields (template-default-only replacement) (#422)
Introduces KNOWN_TEMPLATE_DEFAULTS and KNOWN_STATUS_PATTERNS in state-document.cjs
to enumerate every string a GSD handler writes.  stateReplaceFieldIfTemplate
consults this table and only replaces the field when the existing value is a known
template default (or absent) — executor-authored values are left untouched.

Wire-in:
- record-session: Resume File now only overwritten when caller passes --resume-file
  OR existing value is 'None'.  Router no longer defaults resume_file to 'None'
  before calling the handler.
- advance-plan (both branches): Status and Last Activity guarded via
  stateReplaceFieldIfTemplate.
- updateCurrentPositionFields: Status and Last activity in the Current Position
  section guarded; bare ISO date shape is the trigger for replacement, prose
  narrative is preserved.
- planned-phase: Status and Last Activity guarded the same way.

Regression tests (7 cases) in tests/bug-397-state-preserve-executor-authored.test.cjs
cover each data-loss shape; all 106 existing state.test.cjs tests still pass.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 23:03:15 -04:00
..