fix(#3968): measure commit claims at all three surfaces — ledger, verifier BLOCKER, porcelain HANDOFF (#4230)

* test(#3968): commit claims must be measured against git, never narrated

* fix(#3968): measure commit claims at all three surfaces

Emitted-Drift-Ack-Growth: gsd-executor.md — #3968 plan commit ledger and measured commits contract (held under the agent size cap)
Emitted-Drift-Ack-Growth: verify-work.md — #3968 commit-claim reconciliation with the same rev-list instrument
Emitted-Drift-Ack-Growth: pause-work.md — #3968 uncommitted_files from git status --porcelain

* fix(#3968): retired slash syntax, allowlist line pin, git-compare test pin

* fix(#3968): persist the ledger on disk and reconcile with the same rev-list instrument

Emitted-Drift-Ack-Growth: gsd-executor.md — #3968 plan commit ledger and measured commits contract (held under the agent size cap)
Emitted-Drift-Ack-Growth: verify-work.md — #3968 commit-claim reconciliation with the same rev-list instrument

* fix(#3968): hold the gsd-executor size cap with a compact ledger contract

Emitted-Drift-Ack-Growth: gsd-executor.md — #3968 plan commit ledger and measured commits contract (held under the agent size cap)

* fix(#3968): allowlist pin and HALT regex track the final prose

* chore(#3968): changeset for measured commit claims

* chore(#3968): backfill changeset pr number

* fix(#3968): quote the BASE expansion (SC2086)

* ci: raise the test-lane budget 21 to 32 minutes (measured cost grew past the cap)

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-03 05:43:16 -04:00
committed by GitHub
parent d5f8191f66
commit 3639ab0431
8 changed files with 137 additions and 7 deletions

View File

@@ -106,13 +106,23 @@ timestamp=$(gsd_run query current-timestamp full --raw)
"decisions": [
{"decision": "{what}", "rationale": "{why}", "phase": "{phase_number}"}
],
"uncommitted_files": [],
"uncommitted_files": ["XY path", "..."], # #3968: MEASURED — see below
"next_action": "{specific first action when resuming}",
"context_notes": "{mental state, approach, what you were thinking}"
}
```
Any recorded `async_jobs` entries are the primary resume context on the next session — check them first before treating a PLAN-without-SUMMARY as incomplete work.
**`uncommitted_files` is measured, never asserted (#3968).** Populate it from an actual call,
not from memory — a narrated `[]` over a dirty tree is how 14 plans' worth of uncommitted
code went invisible in the wild:
```bash
UNCOMMITTED=$(git status --porcelain)
# One array entry per line ("XY path"); truncate the list at 50 entries and note the
# elided count, but NEVER round it to empty — a non-empty porcelain output is the single
# most load-bearing fact a resume session needs.
```
</step>
<step name="write">

View File

@@ -172,6 +172,27 @@ ls "$phase_dir"/*-SUMMARY.md 2>/dev/null || true
```
Read each SUMMARY.md to extract testable deliverables.
**Commit-claim reconciliation (#3968).** A SUMMARY's `commits:` frontmatter is a MEASURED
number (the executor derives it from its on-disk plan commit ledger and records the base as
`plan_head_before:`), and this is where that claim is checked against reality with the SAME
instrument — the executor's own narration is never the last word. For each `*-SUMMARY.md`:
```bash
BASE=$(grep -oE '^plan_head_before: [0-9a-f]{7,40}' "$SUMMARY_FILE" | awk '{print $2}')
CLAIMED=$(grep -oE '^commits: [0-9]+' "$SUMMARY_FILE" | grep -oE '[0-9]+' || echo absent)
ACTUAL=$(git rev-list --count "${BASE}"..HEAD)
```
- A `commits: absent` or `plan_head_before: absent` SUMMARY (pre-#3968 legacy) is reported as
a WARNING with the measured git state, not a mismatch.
- `ACTUAL == CLAIMED` is consistent. `ACTUAL == CLAIMED + 1` is ALSO consistent: the
SUMMARY/metadata commit itself lands after the executor measured, so exactly one
post-measurement commit is expected.
- Anything else is a **BLOCKER** — the phase must not read as done: real project evidence
(#3968) showed 14 plans declaring `commits: 1` with zero git activity, their code sitting
uncommitted and one `git reset --hard` from loss. Record it as `commit_claim_mismatch`
with both numbers and the SUMMARY path; a mismatch means either the executor narrated
instead of measuring or commits were lost after the fact — both require reconciliation
before the phase can pass.
</step>
<step name="extract_tests">