Expand description
Surgical, byte-preserving sync of the ## Execution State header bullets.
Backs three callers so the durable execution-state Markdown stays in step
with the runtime run-state.json at the workflow’s two transitions:
plan-issue record openwrites the- Tracking issue:URL once the live issue exists (soplan-archive discovercan infer the provider ref).plan-issue record closewrites the terminal state back (- Status:,- Last updated:,- Branch/commit/PR:) so the in-repo file is final after closeout, not transient-stale untilplan-archive migrate.plan-tooling exec-state-syncexposes the same routine as an on-demand repair command for existing bundles.
Scope is intentionally narrow, mirroring crate::ledger: only the named
- <Label>: bullets inside the ## Execution State section are touched and
every other byte of the file is preserved verbatim. The ## Task Ledger
rows are owned by crate::ledger and the existing close-ready
ledger-rows-pending gate, so this module never rewrites them.
Structs§
- Bullet
Change - One bullet change record, surfaced in JSON output.
- Sync
Report - Aggregate outcome of a sync.
changedis true when at least one bullet was patched or inserted (i.e. the file content differs). - Terminal
State - Terminal-state fields written back at closeout.
Enums§
- Bullet
Action - What happened to a single bullet during a sync.
- Exec
State Error
Constants§
- BRANCH_
LABEL - LAST_
UPDATED_ LABEL - STATUS_
LABEL - TRACKING_
ISSUE_ LABEL - Canonical bullet labels this module syncs.
Functions§
- is_
placeholder - True when
valueis empty or a known “not yet recorded” placeholder. - sync_
tracking_ issue - Write-if-missing/placeholder/mismatch the
- Tracking issue:bullet to the canonical autolinkedurl. Idempotent: a re-run with the same URL is a no-op. Used byrecord openand by the self-heal path. - tracking_
issue_ value - Return the current
- Tracking issue:value inside## Execution State, orNonewhen the bullet is absent. The angle-bracket autolink wrapper is stripped so callers compare bare values. - writeback_
terminal - Write the terminal-state bullets back at closeout. Only the fields present
in
stateare touched. Byte-preserving and idempotent. Withdry_runthe change set is computed and reported but the file is left untouched.