Skip to content

Add context-pack.sh: one file per build step, brain wired into the build loop - #187

Draft
MendixMau wants to merge 5 commits into
masterfrom
exp/context-pack
Draft

MendixMau wants to merge 5 commits into
masterfrom
exp/context-pack

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

A helper used to put its own context together: read the brief, DESCRIBE entities one at a time, look for an example, guess the folder. Every lookup sends the whole conversation again. This PR makes that a single step. The module brief gets a ### Build steps table, with one row per dispatch listing what the step builds, what it reads, the example to copy, and the brain slice. The new project-bin/context-pack.sh <Module> <Step> turns that row into one file. The file holds the folder from the folder plan, the why from mxcli brain brief, the arch constraints, and live DESCRIBEs of every element the step reads, of the example, and of anything the step changes. The brief only names elements; the model describes them, and the pack is never committed. If a name is not in the model, the script exits 1 and lists it, so the problem shows up at dispatch time. iterative-build-loop.md now turns on mxcli brain at build start and gives every dispatch a pack. mdl-agent reads the pack first and records any why it learns with brain capture. Also included: a routing row (render-routing re-run), an install-manifest entry and a CHANGELOG line.

Field evidence

A/B on a scratch copy of a real app. Each arm built the same bulk-accept microflow with the same brief and the same brain, 3 helper runs per arm.

Arm Tokens (mean) Tool calls Time
With pack ~130k 13 60 s
Without pack ~144k 21 101 s
  • Result: about 9% fewer tokens, about 40% fewer tool calls and about 40% less time with the pack.
  • Quality was the same in both arms. All 6 runs passed mxcli check, exec'd with 0 new mx errors and used the planned folder.
  • The script exits 0 when the pack is complete, 2 for an unknown step, and 1 for a name that is not in the model. All three were verified.
  • Probed on single-tree and two-tree (app/) layouts.
  • Not yet run on Windows.

Checklist

  • CHANGELOG line under ## Unreleased
  • bin/render-routing.sh --check clean
  • bin/check-scripts.sh, bin/check-portability.sh clean
  • Leak guard clean; manual grep clean
  • Windows / Git Bash run

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

… brain into the build loop

The module brief gains a Build steps table; context-pack.sh turns a row into a
pack (folder plan, brain brief, arch constraints, live DESCRIBEs, example).
A/B on a real app's scratch copy, 3 runs each: ~9% fewer tokens, ~40% fewer
tool calls and less time, same quality (0 new mx errors, planned folder).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau
MendixMau marked this pull request as draft October 1, 2026 08:32
claude added 4 commits October 1, 2026 09:08
…, nested brain headings

Field run: 10 helper runs on a real app's scratch copy across five step
kinds; page runs went from 1 and 3 CE2421 errors to 0 and 0 with the
watch-out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
… longer escalate for a folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
The pack only looked for architecture/modules/<Module>-brief.md. The
toolkit's own convention and real specs use <Module>/module-brief.md,
so every dispatch there exited 2 and the helper got no pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
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.

2 participants