@@ -2105,86 +2105,125 @@ Milestone output: a bounded requirement-plan-approve-edit-test-repair-review sta
21052105
21062106## Requirement Intake
21072107
2108- - [ ] ` M14-001 BLOCKER ` Persist the user's task message before planning.
2109- - [ ] ` M14-002 ` Classify task type using a deterministic rule or fixed model output.
2110- - [ ] ` M14-003 ` Identify explicit files, symbols, commands, and acceptance criteria.
2111- - [ ] ` M14-004 ` Detect obvious ambiguity that materially changes scope.
2112- - [ ] ` M14-005 ` Ask a targeted clarification when proceeding would be unsafe.
2113- - [ ] ` M14-006 ` Make a bounded reasonable assumption when ambiguity is non-material.
2114- - [ ] ` M14-007 ` Display assumptions in the plan.
2115- - [ ] ` M14-008 ` Produce an initial risk classification.
2116- - [ ] ` M14-009 ` Select the fixed validation profile.
2108+ - [x ] ` M14-001 BLOCKER ` Persist the user's task message before planning.
2109+ - [x ] ` M14-002 ` Classify task type using a deterministic rule or fixed model output.
2110+ - [x ] ` M14-003 ` Identify explicit files, symbols, commands, and acceptance criteria.
2111+ - [x ] ` M14-004 ` Detect obvious ambiguity that materially changes scope.
2112+ - [x ] ` M14-005 ` Ask a targeted clarification when proceeding would be unsafe.
2113+ - [x ] ` M14-006 ` Make a bounded reasonable assumption when ambiguity is non-material.
2114+ - [x ] ` M14-007 ` Display assumptions in the plan.
2115+ - [x ] ` M14-008 ` Produce an initial risk classification.
2116+ - [x ] ` M14-009 ` Select the fixed validation profile.
21172117
21182118## Plan Construction
21192119
2120- - [ ] ` M14-010 BLOCKER ` Define a structured plan schema.
2121- - [ ] ` M14-011 ` Include goal, scope, expected files, steps, validation, risks, authority needs, and completion criteria.
2122- - [ ] ` M14-012 ` Bind the plan to repository and context revisions.
2123- - [ ] ` M14-013 ` Persist immutable plan revisions.
2124- - [ ] ` M14-014 ` Generate a concise user-facing plan.
2125- - [ ] ` M14-015 ` Generate machine-readable step IDs.
2126- - [ ] ` M14-016 ` Link plan steps to graph nodes.
2127- - [ ] ` M14-017 ` Present the forecast and budget with the plan.
2128- - [ ] ` M14-018 ` Require plan approval for elevated or protected work.
2129- - [ ] ` M14-019 ` Allow user redirection to create a new plan revision.
2130- - [ ] ` M14-020 ` Prevent execution of a superseded plan.
2120+ - [x ] ` M14-010 BLOCKER ` Define a structured plan schema.
2121+ - [x ] ` M14-011 ` Include goal, scope, expected files, steps, validation, risks, authority needs, and completion criteria.
2122+ - [x ] ` M14-012 ` Bind the plan to repository and context revisions.
2123+ - [x ] ` M14-013 ` Persist immutable plan revisions.
2124+ - [x ] ` M14-014 ` Generate a concise user-facing plan.
2125+ - [x ] ` M14-015 ` Generate machine-readable step IDs.
2126+ - [x ] ` M14-016 ` Link plan steps to graph nodes.
2127+ - [x ] ` M14-017 ` Present the forecast and budget with the plan.
2128+ - [x ] ` M14-018 ` Require plan approval for elevated or protected work.
2129+ - [x ] ` M14-019 ` Allow user redirection to create a new plan revision.
2130+ - [x ] ` M14-020 ` Prevent execution of a superseded plan.
21312131
21322132## Execution Loop
21332133
2134- - [ ] ` M14-021 BLOCKER ` Implement the observe-think-act-result loop around the fixed provider.
2135- - [ ] ` M14-022 ` Provide only approved tool schemas.
2136- - [ ] ` M14-023 ` Add selected repository context.
2137- - [ ] ` M14-024 ` Add current plan and completed-step state.
2138- - [ ] ` M14-025 ` Add relevant factual task events without replaying the entire transcript.
2139- - [ ] ` M14-026 ` Validate model tool-call structure.
2140- - [ ] ` M14-027 ` Reject unknown tools.
2141- - [ ] ` M14-028 ` Route tool requests through permission policy.
2142- - [ ] ` M14-029 ` Persist tool-start before execution.
2143- - [ ] ` M14-030 ` Persist redacted tool result after execution.
2144- - [ ] ` M14-031 ` Feed the bounded result back to the model.
2145- - [ ] ` M14-032 ` Update plan-step state.
2146- - [ ] ` M14-033 ` Create checkpoints after material edit batches.
2147- - [ ] ` M14-034 ` Check pause, cancel, budget, and policy state between actions.
2148- - [ ] ` M14-035 ` Enforce round, tool-call, token, time, and cost limits.
2149- - [ ] ` M14-036 ` Detect repeated identical failed actions.
2150- - [ ] ` M14-037 ` Stop and ask for direction instead of looping indefinitely.
2151- - [ ] ` M14-038 ` Distinguish implementation completion from validation completion.
2134+ - [x ] ` M14-021 BLOCKER ` Implement the observe-think-act-result loop around the fixed provider.
2135+ - [x ] ` M14-022 ` Provide only approved tool schemas.
2136+ - [x ] ` M14-023 ` Add selected repository context.
2137+ - [x ] ` M14-024 ` Add current plan and completed-step state.
2138+ - [x ] ` M14-025 ` Add relevant factual task events without replaying the entire transcript.
2139+ - [x ] ` M14-026 ` Validate model tool-call structure.
2140+ - [x ] ` M14-027 ` Reject unknown tools.
2141+ - [x ] ` M14-028 ` Route tool requests through permission policy.
2142+ - [x ] ` M14-029 ` Persist tool-start before execution.
2143+ - [x ] ` M14-030 ` Persist redacted tool result after execution.
2144+ - [x ] ` M14-031 ` Feed the bounded result back to the model.
2145+ - [x ] ` M14-032 ` Update plan-step state.
2146+ - [x ] ` M14-033 ` Create checkpoints after material edit batches.
2147+ - [x ] ` M14-034 ` Check pause, cancel, budget, and policy state between actions.
2148+ - [x ] ` M14-035 ` Enforce round, tool-call, token, time, and cost limits.
2149+ - [x ] ` M14-036 ` Detect repeated identical failed actions.
2150+ - [x ] ` M14-037 ` Stop and ask for direction instead of looping indefinitely.
2151+ - [x ] ` M14-038 ` Distinguish implementation completion from validation completion.
21522152
21532153## Repair Loop
21542154
2155- - [ ] ` M14-039 ` Run the selected validation commands.
2156- - [ ] ` M14-040 ` Parse failures into bounded redacted summaries.
2157- - [ ] ` M14-041 ` Link failures to relevant changed files and plan steps.
2158- - [ ] ` M14-042 ` Permit a bounded repair round.
2159- - [ ] ` M14-043 ` Preserve the pre-repair checkpoint.
2160- - [ ] ` M14-044 ` Record why repair was attempted.
2161- - [ ] ` M14-045 ` Rerun affected validation after repair.
2162- - [ ] ` M14-046 ` Stop after the repair budget.
2163- - [ ] ` M14-047 ` Present unresolved failures honestly.
2164- - [ ] ` M14-048 ` Never silently weaken or skip an acceptance test.
2155+ - [x ] ` M14-039 ` Run the selected validation commands.
2156+ - [x ] ` M14-040 ` Parse failures into bounded redacted summaries.
2157+ - [x ] ` M14-041 ` Link failures to relevant changed files and plan steps.
2158+ - [x ] ` M14-042 ` Permit a bounded repair round.
2159+ - [x ] ` M14-043 ` Preserve the pre-repair checkpoint.
2160+ - [x ] ` M14-044 ` Record why repair was attempted.
2161+ - [x ] ` M14-045 ` Rerun affected validation after repair.
2162+ - [x ] ` M14-046 ` Stop after the repair budget.
2163+ - [x ] ` M14-047 ` Present unresolved failures honestly.
2164+ - [x ] ` M14-048 ` Never silently weaken or skip an acceptance test.
21652165
21662166## Completion
21672167
2168- - [ ] ` M14-049 ` Require final repository status and diff capture.
2169- - [ ] ` M14-050 ` Require final validation summary.
2170- - [ ] ` M14-051 ` Require budget and actual cost summary.
2171- - [ ] ` M14-052 ` Require an assumption and limitation summary.
2172- - [ ] ` M14-053 ` Transition to awaiting-review rather than auto-accepting.
2173- - [ ] ` M14-054 ` Support accept, request repair, rollback, and abandon.
2174- - [ ] ` M14-055 ` Record the user's final decision.
2168+ - [x ] ` M14-049 ` Require final repository status and diff capture.
2169+ - [x ] ` M14-050 ` Require final validation summary.
2170+ - [x ] ` M14-051 ` Require budget and actual cost summary.
2171+ - [x ] ` M14-052 ` Require an assumption and limitation summary.
2172+ - [x ] ` M14-053 ` Transition to awaiting-review rather than auto-accepting.
2173+ - [x ] ` M14-054 ` Support accept, request repair, rollback, and abandon.
2174+ - [x ] ` M14-055 ` Record the user's final decision.
21752175
21762176## Tests and Gate
21772177
2178- - [ ] ` M14-056 TEST ` Run a deterministic fake-model successful edit scenario.
2179- - [ ] ` M14-057 TEST ` Run a fake-model malformed-tool scenario.
2180- - [ ] ` M14-058 TEST ` Run a repeated-failure loop scenario.
2181- - [ ] ` M14-059 TEST ` Run a pause during tool execution scenario.
2182- - [ ] ` M14-060 TEST ` Run cancellation during model streaming.
2183- - [ ] ` M14-061 TEST ` Run budget exhaustion between repair rounds.
2184- - [ ] ` M14-062 TEST ` Run a user-redirection plan revision.
2185- - [ ] ` M14-G01 GATE ` The deterministic fake agent completes the full plan-edit-test-review state machine.
2186- - [ ] ` M14-G02 GATE ` Every action is attributable to a plan revision, model request, tool request, and policy decision.
2187- - [ ] ` M14-G03 GATE ` No failure path silently falls back, expands authority, or skips required validation.
2178+ - [x] ` M14-056 TEST ` Run a deterministic fake-model successful edit scenario.
2179+ - [x] ` M14-057 TEST ` Run a fake-model malformed-tool scenario.
2180+ - [x] ` M14-058 TEST ` Run a repeated-failure loop scenario.
2181+ - [x] ` M14-059 TEST ` Run a pause during tool execution scenario.
2182+ - [x] ` M14-060 TEST ` Run cancellation during model streaming.
2183+ - [x] ` M14-061 TEST ` Run budget exhaustion between repair rounds.
2184+ - [x] ` M14-062 TEST ` Run a user-redirection plan revision.
2185+ - [x] ` M14-G01 GATE ` The deterministic fake agent completes the full plan-edit-test-review state machine.
2186+ - [x] ` M14-G02 GATE ` Every action is attributable to a plan revision, model request, tool request, and policy decision.
2187+ - [x] ` M14-G03 GATE ` No failure path silently falls back, expands authority, or skips required validation.
2188+
2189+ M14 test evidence:
2190+
2191+ - Requirement intake is derived from the persisted original user message. It
2192+ deterministically records task type, explicit files, symbols, commands,
2193+ acceptance criteria, ambiguities, bounded assumptions, risk, and the fixed
2194+ validation floor; mutating intent cannot be downgraded to investigation.
2195+ - Migration 000014 adds immutable requirement and plan revisions, plan-step
2196+ states, run-plan bindings, selected validation profiles, validation
2197+ attribution, bounded repair attempts, completion candidates, and explicit
2198+ review decisions. Real SQLite tests cover lineage, supersession, exact
2199+ idempotency, trigger enforcement, rollback, and reconstruction.
2200+ - Validation commands use one canonical logical-worktree projection derived
2201+ from exact tool, ordered non-sensitive arguments, timeout, policy-derived
2202+ authority, and effects. Raw user commands remain visible but cannot become
2203+ execution authority; unsafe, sensitive, mutating, ambiguous, substituted,
2204+ or weakening command forms are rejected.
2205+ - Routine, elevated, and protected profiles require one, two, and three
2206+ distinct required commands already present in the approved plan. Go
2207+ repository checks and SQLite triggers reject label-only upgrades,
2208+ duplicates, unknown profiles, downgrades, reordering, and acceptance-test
2209+ weakening.
2210+ - The fixed-model observe-think-act loop exposes only approved strict tool
2211+ schemas and bounded context, persists intent before effects and redacted
2212+ outcomes afterward, attributes model/tool/policy facts, checkpoints material
2213+ edits, honors interrupts and hard limits, and stops repeated failures rather
2214+ than silently expanding authority.
2215+ - The repair and completion flow preserves pre-repair checkpoints, links
2216+ bounded failures to canonical file scopes and plan steps, reruns exact
2217+ selected validation, enforces repair budgets, captures final repository,
2218+ validation, budget, assumption, and limitation evidence, then awaits an
2219+ explicit accept, repair, rollback, or abandon decision.
2220+ - Deterministic fake-model tests cover success, malformed and unknown tools,
2221+ repeated failure, pause during execution, stream cancellation, budget
2222+ exhaustion, redirection, edit-test-repair-review ordering, and durable
2223+ attribution. Focused executor, agent, coordinator, storage, and migration
2224+ tests, ` go test ./... ` , lint, generation, integration, security, and the
2225+ complete local ` test-all ` gate pass. The fifth frozen-tree adversarial audit
2226+ accepts M14 with no remaining findings.
21882227
21892228---
21902229
0 commit comments