fix(#1863): use named flags for state.* calls in executor + workflows (#1873)

* fix(#1863): use named flags for state.* calls in executor + workflows

The named-only state-command router (parseNamedArgs) silently drops
positional args, so state.cjs threw its required-arg error and
metrics/decisions/blockers/session continuity were never recorded.

Convert record-metric / add-decision / add-blocker / record-session in
agents/gsd-executor.md to the named-flag form (mirroring execute-plan.md),
and fix the two remaining positional record-session calls in
gsd-core/workflows/milestone-summary.md and forensics.md. Recapture the
golden-install-parity fixtures and size baselines for the edited files.

Also fix a pre-existing detached-rebuild handle leak in
tests/graphify-auto-update.slow.test.cjs: three dispatch tests returned
after observing only the synchronous "running" status without awaiting the
detached rebuild's terminal state. That leak was latent until the new
#1863 regression block's added runtime shifted --test-force-exit timing
and surfaced it as a non-zero chunk exit. The three tests now await
terminal status via the file's existing waitForBuildStatus helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(#1863): add changeset

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Tom Boucher <trekkie@nomorestars.com>
This commit is contained in:
Behruz Nassre Esfahani
2026-07-02 10:01:10 -07:00
committed by GitHub
parent 8751379cfc
commit 7bef6a6496
24 changed files with 154 additions and 68 deletions

View File

@@ -691,7 +691,7 @@ Do NOT skip. Do NOT proceed to state updates if self-check fails.
</self_check>
<state_updates>
After SUMMARY.md, update STATE.md using `gsd-tools query` state handlers (positional args; see `sdk/src/query/QUERY-HANDLERS.md`):
After SUMMARY.md, update STATE.md using `gsd-tools query` state handlers (named flags; see `sdk/src/query/QUERY-HANDLERS.md`):
```bash
# Advance plan counter (handles edge cases automatically)
@@ -702,16 +702,17 @@ gsd_run query state.update-progress
# Record execution metrics (phase, plan, duration, tasks, files)
gsd_run query state.record-metric \
"${PHASE}" "${PLAN}" "${DURATION}" "${TASK_COUNT}" "${FILE_COUNT}"
--phase "${PHASE}" --plan "${PLAN}" --duration "${DURATION}" \
--tasks "${TASK_COUNT}" --files "${FILE_COUNT}"
# Add decisions (extract from SUMMARY.md key-decisions)
for decision in "${DECISIONS[@]}"; do
gsd_run query state.add-decision "${decision}"
gsd_run query state.add-decision --summary "${decision}"
done
# Update session info (timestamp, stopped-at, resume-file)
# Update session info (stopped-at, resume-file; timestamp set automatically)
gsd_run query state.record-session \
"" "Completed ${PHASE}-${PLAN}-PLAN.md" "None"
--stopped-at "Completed ${PHASE}-${PLAN}-PLAN.md" --resume-file "None"
```
```bash
@@ -738,7 +739,7 @@ gsd_run query requirements.mark-complete ${REQ_IDS}
**For blockers found during execution:**
```bash
gsd_run query state.add-blocker "Blocker description"
gsd_run query state.add-blocker --text "Blocker description"
```
</state_updates>