Validate wireframe fences and teach the Planner to write them #433
- MA
PR 3 of the wireframe fences stack (base: #431 parser).
**Merge order: land this after PR 2 (editor renderer).** This PR tells the Planner to write `wireframe` fences; until the renderer exists they show as plain code.
## What changed - **Server validation** (`apps/server/src/plan/edit.ts`): `introducedDiagramError` becomes `introducedFenceError` over a per-language `FENCE_VALIDATORS` map (`seecode`, `wireframe`). Same semantics as before: only fences an edit introduces or changes are validated; an unchanged malformed fence a person left is carried through unrelated edits and moves. Retention is now keyed by language + body, so a retained seecode fence cannot excuse an identical wireframe body. Wireframe refusals list up to 3 problems with fence-relative line numbers (bounded ~470 chars). Covers `edit_plan` and MCP `update_document` (via `edit.replace`). Seecode messages are unchanged. - **Planner prompt** (`apps/server/src/agent/planner.ts`): `WIREFRAME_AUTHORING` after `DIAGRAM_AUTHORING`: grammar summary, label rules, the Implementation panel example, and "Never draw one with box-drawing characters or ASCII art in a text fence." - **External agents**: wireframe section + example in `skills/creating-chopin-plans/SKILL.md`; contract test parses the example. - **Assessment**: `seecode-assessment.ts` takes an optional `wireframe` mode and records whether the saved document has the fence and any box-drawing characters. Not run (live model). - **Docs**: "Diagrams and wireframes" section in `docs/hosted-agent.md`.
Not covered (unchanged from seecode): `create_document` does not validate diagram fences.
## Tests - `edit.test.ts`: rejects introduced invalid wireframe with line number; keeps human-left broken one; language-scoped retention; `replace` validates changed wireframes. - `planner.test.ts`: prompt includes the section and the rule, example parses, every `WIREFRAME_KINDS` kind is named. - `bun test` (4246 pass), `bun run types`, `bun run ci` pass.
馃 Generated with [Claude Code](https://claude.com/claude-code)
Unknown GitHub usercommitted 6ac2be02a684last month on GitHub
Unknown GitHub usercommitted ed95f07d400dlast month on GitHub
Unknown GitHub usercommitted 443240cd8fealast month on GitHub
Unknown GitHub usercommitted a432a1b2de40last month on GitHub
MaggieAppletonautomatic-base-change-succeededlast month on GitHub