Skip to content

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.

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.

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.

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?”

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.

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.

One recipe, compiled from validated models:

Terminal window
ctxbrew check --gate # the five failure modes, measured, in CI
ctxbrew gate --evidence # the verdict, hash-chained and receipted

The 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.