Skip to content

Commit 3d71bad

Browse files
committed
Complete bounded agent planning and execution
Implement M14-001 through M14-062 and gates M14-G01 through M14-G03. Change-Log: CL-20260730-062 Dev-Log: DL-20260730-063
1 parent 494f366 commit 3d71bad

27 files changed

Lines changed: 18157 additions & 66 deletions

CHANGELOG

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ Dev-Log:
3030

3131
Entries
3232
-------
33+
Change-ID: CL-20260730-062
34+
Date: 2026-07-30
35+
Type: Bounded agent planning, execution, repair, and review
36+
Request-or-TODO: M14-001 through M14-062 and M14-G01 through M14-G03
37+
Outcome: Added deterministic requirement intake, immutable structured plans,
38+
a fixed-provider observe-think-act loop, exact validation profiles, bounded
39+
repair, completion evidence, and explicit review decisions
40+
Affected-behavior: Persisted user intent now controls risk, scope, plan,
41+
approved tools, exact executable validation, repair limits, and completion.
42+
Every effect is attributable to durable plan, model, tool, and policy facts;
43+
failures stop without silent fallback, authority expansion, validation
44+
weakening, or automatic acceptance.
45+
Compatibility-or-migration: Adds migration 000014 for requirement and plan
46+
revisions, run-plan bindings, plan-step state, validation selection and
47+
attribution, repair attempts, completion candidates, and review decisions;
48+
schema version advances from 13 to 14.
49+
Verification: Deterministic full-state-machine and boundary tests, real SQLite
50+
constraints and reconstruction, executor/agent/coordinator/storage focused
51+
suites, go test ./..., lint, generation, integration, security, and complete
52+
local test-all gates pass. Five adversarial refinement rounds end in ACCEPT
53+
on the frozen migration checksum.
54+
Dev-Log: DL-20260730-063
55+
3356
Change-ID: CL-20260730-061
3457
Date: 2026-07-30
3558
Type: Fixed routing, forecasting, and exact budget enforcement

DEVLOG

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,55 @@ Next-safe-step:
2424

2525
Entries
2626
-------
27+
Dev-Log: DL-20260730-063
28+
Date: 2026-07-30
29+
Status: Complete
30+
Change-ID: CL-20260730-062
31+
Request-or-TODO: M14-001 through M14-062 and M14-G01 through M14-G03
32+
Goal: Compose persisted requirements, immutable plans, the fixed provider,
33+
mediated tools, hard budgets, bounded repair, and explicit review into the
34+
smallest reliable coding-agent state machine
35+
Assumptions: M14 retains the frozen provider/model/effort policy; plans and
36+
validation are approved before effects; physical task-worktree paths and
37+
run identities are not known at intake; adaptive routing and multi-agent
38+
runtime topology remain deferred
39+
Decisions: Derive requirement analysis from the stored original message;
40+
close step kinds and completion tools; bind plans to repository, context,
41+
policy, forecast, and budget revisions; project validation through one
42+
canonical logical-worktree contract while retaining raw commands only for
43+
user visibility; derive authority from policy semantics; require stronger
44+
profile labels to carry broader distinct required commands already approved
45+
in the plan; persist effect intent before execution and redacted outcomes
46+
afterward; checkpoint material edits; reconstruct completion only from
47+
durable step and validation evidence; require an explicit final decision
48+
Files-or-schemas: Migration 000014 and generated schema/build metadata;
49+
executor validation-plan projection; agent loop, limits, tool schemas,
50+
repair, validation, and completion contracts; coordinator persistence and
51+
state-machine composition; requirement, plan, execution, validation,
52+
repair, completion, and review repositories; milestone tests and evidence
53+
Validation: Executor, agent, coordinator, storage, and migration focused suites,
54+
go vet, go test ./..., git diff checks, deterministic fake-provider G01,
55+
real-SQLite triggers and recovery reconstruction, lint, generation, fast,
56+
integration, security, and complete local test-all pass. Frozen checksum
57+
7c304b402772e0fa688ee838a86c1ddda54008bfd48b76bec1f22b5ed9b468a0
58+
receives independent round-five ACCEPT.
59+
Failures-or-discarded-approaches: Adversarial rounds rejected model-authored
60+
completion without durable proof, checkpoint ordering gaps, weak limit
61+
accounting, caller-forged requirement and plan fields, unsafe path-prefix
62+
scope, incomplete failure linkage, raw validation labels detached from
63+
executable requests, mutation misclassification, exact-only profile floors,
64+
label-only assurance upgrades, and plans that could not reach validation
65+
binding. Each accepted finding now has a deterministic invariant and
66+
regression. Caller-authored display authority, sensitive command arguments,
67+
silent test weakening, and auto-acceptance were rejected.
68+
Known-limitations: Browser E2E remains intentionally unavailable until the
69+
M16 GWC harness. M15 must add production checkpoint persistence, cooperative
70+
interruption, divergence-aware resume, crash classification, and patch
71+
preservation before the frontend milestone may begin.
72+
Next-safe-step: Commit and publicly verify M14, then complete M15's checkpoint,
73+
pause/cancel, resume, and recovery gates before implementing the mapped M16
74+
GoWebComponents v5 shell.
75+
2776
Dev-Log: DL-20260730-062
2877
Date: 2026-07-30
2978
Status: Complete

TODOS.md

Lines changed: 104 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)