Plan artifact: evidence-checked multi-component design plans#13
Merged
Conversation
The agent can now maintain a plan of record for multi-component designs: a full-snapshot update_plan tool validated against the transcript (unique label-safe ids, interface coverage + connected graph, no silent drops, evidence-checked done transitions), persisted in the tool result and kept verbatim across compaction. Loop enforcement: stopping with unfinished components injects one deterministic follow-up (never twice without an intervening run); with an active plan the CAD budget is per component bucket under a 3x global ceiling, and probe runs (COMPONENT = "probe") drain only the ceiling. Probe runs also stop displacing the deliverable: they no longer publish to the viewer, script panel, or artifact store, and never become the conversation's verification badge. Prompt gains the planning discipline (plan-first trigger, evidence-first done, physical-coherence rule) and the UI renders the live plan card plus a plan-check chip for injected nudges.
…stic COMPONENT = "lid" (or a list; "probe" for diagnostics) is parsed from the script and echoed in measurements together with the raw CHECKS entries - the evidence link update_plan uses to accept done transitions. A malformed declaration fails the gate as component_block. CHECKS vocabulary grows what per-component plan gates need: hole_through/ hole_blind accept a target child (census runs on that child alone, so a pin-occupied bore still classifies by the component's own geometry), a new hole_internal kind counts buried bores, and clearance takes max_mm so touching (max 0) and controlled fits become assertable. Clearance diagnostics now flag floating children: a child whose every pairwise state is apart is listed under measurements.floating - the unsupported-part defect the plate-stack stress test shipped undetected.
…nce stop-gate The first live re-run proved the machinery works (plan-first, per-component gates, evidence-checked done, voluntary assembly run) and also that it was not enough: the agent re-modeled the same sealed "open-top" cavity and its planned checks (holes, bbox, symmetry) were structurally blind to it - check authorship shares the geometry author's blind spot. Two structural answers: - update_plan now requires every buildable component to carry a volume check targeting itself, with range_mm3 no looser than 1.5x. The expected volume is derived from the component's INTENT (open top -> open volume), so wrong topology fails numerically. Loose ranges are rejected. - A plan with interfaces only counts as finished once one gate-passed run declared ALL components together (where clearances are actually measured); stopping without that draws an assembly nudge. The live run hit exactly this window: both components done, interfaces unverified. Fake plan-flow scenario and fixtures updated accordingly; e2e green.
Codex review (P2 on PR #13): hasAssemblyEvidence accepted any gate-passed run that merely declared all component ids, so an assembly script that omitted the planned clearance checks satisfied the stop-gate with the interfaces never measured - the same authorship blind spot the component evidence rule closes, left open for interfaces. The all-components run's echoed CHECKS must now contain each clearance interface's entry (either endpoint order; bounds must match the plan). Captive interfaces compile to no measurable check and are carried by the all-components run itself. Interfaces with an abandoned endpoint are ignored. Prompt states the assembly script must include the interface entries verbatim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The agent can now maintain a plan of record for multi-component designs, enforced by the loop rather than trusted on prose:
update_plantool — full-snapshot plan (goal, components, interfaces). Validation: unique label-safe ids, every component held by an interface (or an explicit free-floating reason) with a connected interface graph, no silent drops (removing unfinished work requires a stated abandon reason), and evidence-checkeddone: a component can only be marked done after a gate-passed run declared it via the newCOMPONENTblock and ran its planned checks verbatim.{"kind": "volume", "range_mm3": [lo, hi], "target": id}withhi <= 1.5x lo. Volume is the cheapest topology detector; deriving it from intent before building is what actually catches sealed cavities and eaten floors (see Why).COMPONENT = "probe"marks diagnostics: they never advance the plan, never displace the deliverable in the viewer/script/artifact store, never become the conversation's verification badge, and only drain the global ceiling.COMPONENTblock parse + echo,targeton hole checks (per-child census), newhole_internalkind,max_mmon clearance (touching is now assertable), and afloatingflag on children with no touching/interpenetrating partner.Simple single-part requests are untouched: no plan, byte-identical behavior.
Why
Live stress tests of complex assemblies showed the loop building well but verifying blind: a gearbox base whose "open top" was accidentally sealed by a full-slab flange passed the gate, all self-authored checks, and every view (the lid occluded it), and the agent confidently reported it correct. A plate-stack run also shipped a top plate touching nothing.
The plan artifact closes this structurally: per-component builds are verified where defects are visible, progress claims require gate evidence, interfaces are first-class and must be measured, and the volume requirement forces the agent to do the arithmetic its feature-level checks skip. In live verification the same prompt that previously produced the sealed housing now yields an open one — the agent derives the expected volume first and models accordingly, and the measured volumes match the derivation exactly.
Notes for review
update_plantool result (details.plan), not a custom message role: tool results are already persisted/replayed, and the compaction cut now never passes the newest accepted plan. Deviation rationale is in the commit messages.COMPONENTclient-side (the abort happens before the harness runs); the harness echo remains the only trust anchor for evidence — a lying declaration can waste budget but cannot fake progress._resolve_targetalso matches the result's own label so a solo component run satisfies the same targeted checks as the assembly run (the evidence rule requires byte-identical checks in both).test_plan_component.py; one pinned normalization expectation intest_checks.pyupdated (hole specs now carrytarget). No golden.json changes (new measurement keys are additive).plan-flow.spec.ts(fake LLM); live-verified end-to-end with a real model on the gearbox assembly.🤖 Generated with Claude Code