The Context Frankenstack
Every team wiring AI agents into a real codebase eventually assembles the same pile: a memory folder the agents write into, a prose spec nobody can check, a vector index over last month’s code, and a wall of rules living in system prompts. Each piece is reasonable. Together they are a Frankenstack — and it fails in five named, checkable ways.
The pattern to distrust: context that is assembled per session from artifacts nobody validates. The alternative is context that is brewed once from typed, validated models and poured the same way for every agent — with provenance attached and gates behind it.
The five failure modes
Section titled “The five failure modes”1. Memory rot
Section titled “1. Memory rot”Agent memory is prose, written by agents, patched by agents. Nothing
notices when a recorded “fact” stops being true — the code moves, the
memory stays, and the next session inherits confident staleness.
ContextBrew’s answer: decisions are recorded as proposed with
file:line evidence, and ctxbrew check measures staleness
deterministically — the memory knows it is rotting.
2. Unverifiable specs
Section titled “2. Unverifiable specs”A markdown spec cannot fail. No machine can check that the code matches
it, so the spec’s authority decays to whoever wrote it last. ContextBrew’s
answer: requirements live in typed formats (CBRL, DDD, ACM) with parsers,
validators, and a release gate — a spec either passes ctxbrew gate or
blocks the build.
3. Per-session reassembly
Section titled “3. Per-session reassembly”When every session rebuilds its own context from grep results and memory folders, two agents on the same repo believe different things — and neither belief is inspectable. ContextBrew’s answer: the recipe is the shared artifact. Brew once; every agent pours the same context, and the brew ledger answers “what did this agent see?”
4. Governance in the prompt
Section titled “4. Governance in the prompt”Rules that live in a system prompt are suggestions with good manners — one edit, one drift, and the guardrail is gone. ContextBrew’s answer: permissions and guardrails are authored artifacts (ABSL trust tiers, ACM access rules) that compile to real enforcement — policy engines, rate limits, approval gates — not prose.
5. Drift without instruments
Section titled “5. Drift without instruments”The stack’s pieces rot at different rates, and nothing measures the gap
between what the agents believe and what the repository is. A diff view
is not drift detection. ContextBrew’s answer: named instruments
(ctxbrew check) with one auditable drift score — inputs shown, weights
pinned, CI-gated via --gate.
What replaces it
Section titled “What replaces it”One recipe, compiled from validated models:
ctxbrew check --gate # the five failure modes, measured, in CIctxbrew gate --evidence # the verdict, hash-chained and receiptedThe claim is not that assembled context never works — it is that it fails in ways nobody can see. Brewed context fails loudly, at brew time, where it is cheap.
Next Steps
Section titled “Next Steps”- Drift — the instruments behind failure mode five
- Release Gates — evidence bundles and CI receipts
- The Seven Principles — the doctrine the Frankenstack violates
