feat(#2632): executor actuals and the closed estimate-calibration loop (#2672)

* feat(#2632): record executor actuals and close the estimate calibration loop

* fix(#2632): calibrate against the raw projection so the loop converges

* test(#2632): add closed-loop convergence guard and codify the feedback-loop rule

* fix(#2632): pair calibration samples per plan; atomic write; amend adr

* chore(#2632): backfill changeset pr to 2672

* fix(#2632): retry renameSync on transient windows errnos and clean up the temp
This commit is contained in:
Tom Boucher
2026-07-26 16:28:56 -04:00
committed by GitHub
parent 920a5f3f06
commit bd570618d4
37 changed files with 943 additions and 147 deletions

View File

@@ -638,7 +638,16 @@ This file is the canonical output of this step. The orchestrator reads `.plannin
**Use template:** @~/.claude/gsd-core/templates/summary.md
**Frontmatter:** phase, plan, subsystem, tags, dependency graph (requires/provides/affects), tech-stack (added/patterns), key-files (created/modified), decisions, metrics (duration, completed date), status (`status: complete` — required so the audit-open scanner recognises the summary as done).
**Frontmatter:** phase, plan, subsystem, tags, dependency graph (requires/provides/affects), tech-stack (added/patterns), key-files (created/modified), decisions, metrics (duration, completed date), status (`status: complete` — required so the audit-open scanner recognises the summary as done), and `actuals` (#2632).
**`actuals` (required when the plan carried an `estimate`):** record what the phase ACTUALLY cost, on the SAME scale the estimate used — `estimateTokens` (chars/4) over the realized diff, NOT a harness token count. Mixing scales measures the measurement methods, not the miss.
```yaml
actuals:
tokens: 74000 # chars/4 over the files you actually changed
tasks: 5 # tasks completed
commits: 7 # commits made
```
These pair with the plan's `estimate` to calibrate future estimates (ADR-2629). Do not round to look closer to the estimate — a flattering number corrupts every later projection.
**Title:** `# Phase [X] Plan [Y]: [Name] Summary`

View File

@@ -293,8 +293,8 @@ See @~/.claude/gsd-core/references/planner-guidance.md for dependency graph buil
Full rules: @~/.claude/gsd-core/references/context-budget.md (Phase Sizing). Read before sizing.
- **2-3 tasks per plan.** **ALWAYS split if:** >3 tasks, multiple subsystems, or any task touching >5 files.
- **Emit `estimate`** in PLAN.md frontmatter: run the `estimate-calibration` query, multiply your raw
token projection by its calibration factor, and copy its `confidence` verbatim — derived from the
- **Emit `estimate`**: run `estimate-calibration`; `tokens` = raw projection x factor, `raw_tokens` = that
projection before the factor (calibration measures actual/raw), `confidence` verbatim — derived from
sample count, never self-rated.
- **Over the smart-zone budget?** Re-slice: tracer + expansion slices. Advisory, never a block.
@@ -318,6 +318,7 @@ user_setup: [] # Human-required setup (omit if empty)
estimate: # Projected execution cost (see Estimate Emission)
tokens: 60000 # calibrated projection
raw_tokens: 30000 # pre-factor projection
tasks: 3 # task count the projection assumes
confidence: low # low | med | high — DERIVED from sample count, never self-rated