Skip to content

feat(aidd-refine): check the persisted brainstorm brief and link each action to the next - #1336

Draft
blafourcade wants to merge 8 commits into
nextfrom
feat/1084-brainstorm-brief-contract
Draft

blafourcade wants to merge 8 commits into
nextfrom
feat/1084-brainstorm-brief-contract

Conversation

@blafourcade

@blafourcade blafourcade commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🎯 What & why

The brief aidd-refine:01-brainstorm keeps in a file is now checked against its template, and each action links the next one, so a model that reads only what a link points to still reaches the template.

🛠️ How it works

  • scripts/contract.json holds one rule, BRAINSTORM-01, the engine's template op on assets/discovery-brief.md:
    • sections Clear, Assumed and Open, each optional, in that order;
    • no comment or {{…}} slot left.
  • Scoped to aidd_docs/**/brainstorm.md, as 02-challenge is: the turn-end artifact hook aidd-refine already ships judges a written brief. conclude also runs validate-brainstorm.cjs when the user keeps the brief in a file, so a host without the hook still checks it.
  • Links go one way: capture to explore, explore to conclude. Conclude's "explore more" stays unlinked.
  • The skill is rewritten in the skill generator's format: the router keeps only its diagram and transversal rules, one of which produces the brief on stop. validate-skill.cjs goes from 11 findings to 0, and the baseline drops the five brainstorm entries.

🧪 How to verify

  • node --test scripts/__tests__/check/brainstorm-contract.test.js: a good brief passes with LF and CRLF; an unknown or reordered section, a comment or a slot left are each refused by BRAINSTORM-01 only.
  • node plugins/aidd-context/skills/04-skill-generate/scripts/validate-skill.cjs plugins/aidd-refine/skills/01-brainstorm exits 0.
  • Real hosts, one scripted dialogue (idea, one answer, stop, approve and keep in a file):
Run Brief on stop File passes the contract Check run by the model
Claude Code haiku, plugin loaded yes yes yes
Codex gpt-6-luna × 3 2 with the template's headings, 1 with ### headings 3/3 3/3
OpenCode deepseek-v4.1-flash-free yes yes yes
  • Interactive Claude Code haiku in tmux, plugin loaded: one question per turn, each with a leaning and its tradeoff; stop produced the brief; "File." wrote it and ran the check. Asked to add a ## Risks section, the model wrote it, the Stop hook refused it on BRAINSTORM-01, and the model moved the line under Open.

⚠️ Heads-up

  • mistral-medium-2604 was not run: it is not offered to the account used. mistral-small-2603 answers stop with one word and writes the brief inside the skill folder, the small-model limit refactor(aidd-refine): lean the brainstorm skill for small models #1072 already records.
  • Before the format rewrite, Luna answered stop with one sentence; a transversal rule is what changed. Codex gpt-6-luna, 3 runs each, the brief on stop: 0/3 with the stop case only in the diagram and in explore's loop, 3/3 with the rule "When the user says stop or asks for a summary, produce the brief in the chat." Without it Luna reads stop as quitting.
  • When the user asks for a section the template lacks, the hook wins over the request: the model offered the user a choice, then the hook fixed the file before the user answered.

🔗 Linked issue

Closes #1084

✅ I certify

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

🤖 Generated with Claude Code

blafourcade and others added 8 commits November 24, 2026 05:45
… action to the next (#1084)

The brief written to aidd_docs/**/brainstorm.md is checked against assets/discovery-brief.md through a contract: sections Clear, Assumed and Open, each optional and in order, status: approved in the front matter, no comment or slot left. The template gains that front matter, which persistence already required. The turn-end hook judges a written brief on every host, and conclude runs validate-brainstorm.cjs when the user keeps the brief in a file. Capture links to explore and explore to conclude, never back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tor's format (#1084)

The router keeps only the diagram, its boxes the action paths, and the transversal rules. Explore and capture end on the step that links the next action, a case is a sub-item, and the stop rule names the conclude file. The baseline drops the five brainstorm entries this fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er report checks do (#1084)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ring form (#1084)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…the diagram already draws (#1084)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…lies it on every turn (#1084)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant