Skip to content

The ContextBrew SDLC

Our agentic development lifecycle, leveled. This is a description of a practice already in production on the ContextBrew repository, published so others can copy it — not a proposal.

Prior art: ASDLC (LogicSRC, CC BY 4.0) independently describes the same inversion from first principles; we cite it, map to it below, and claim the part they don’t ship: the machine that enforces it.

When agents write most of the code, the scarce resources stop being engineering hours. They become human attention and trunk stability. Everything in this methodology follows from defending those two: isolation before parallelism, the gate is a program not a person, and every escape becomes a permanent automated check.

We did not adopt this premise from a spec — three separate production incidents in one quarter (below) taught it to us the expensive way. That is also why this page exists: LogicSRC’s ASDLC describes the discipline; this repo runs it, and this page is the leveled, evidence-linked description of how.

Traditional SDLC assumption ContextBrew practice Enforced by
Unit of work: a ticket A claim, worked in its own worktree; multiple claims in parallel across sessions Worker-mode discipline; ctxbrew worktree merge
Isolation: branch per developer Worktree per claim on one checkout; the host stays clean Same, plus the PreToolUse hook
Safety net: human review of every diff The gate is a program: lint-staged, index-clobber checker, schema regeneration, CI — all before a commit can land The pre-commit chain
Destructive git as a normal tool Hard-refused: git stash, git reset, branch switching, git clean, force-push, git branch -D exit blocked at the tool boundary PreToolUse hook (ctxbrew hooks init / ctxbrew hooks doctor)
Stage everything, commit later Stage explicit paths only; sweep-staging shapes (git add -A, git commit -a) are blocked Same hook + written rules
Done: merged Landed and verified: staged set verified before the commit, commit content verified after, impact-scoped check passes, CI green Concurrent-session rules
After an escape: postmortem document After an escape: a permanent automated check, confirmed to fail, before the incident closes The ratchet (below)
Tooling warns and proceeds The tooling refuses. A checker that can fail open is itself a defect (we ratcheted that, too) Fail-closed checker fix, 2026-09-13

Frame → Fan out → Gate locally → Land → Verify → Ratchet → Promote. The loop is the point.

  1. Frame. The one phase where being wrong is expensive. Every unit of work starts as a written task spec with What / Acceptance / Refs / Verify. If the scope can’t be written, it isn’t understood yet.
  2. Fan out. Each claim gets its own worktree. Sessions run in parallel by default — during the week of 2026-09-06 this repo absorbed 763 commits in seven days, 42 on Sep 12 alone, from concurrent sessions. Parallelism is the normal state, which is exactly why the gate must be a program: no human reads 763 diffs.
  3. Gate locally. The pre-commit chain runs lint-staged, the index-clobber checker, and — when core parser files are staged — regenerates every JSON schema output and stages them into the same commit (see File Schemas). The PreToolUse hook refuses destructive git vectors before they execute.
  4. Land. Scoped staging; the staged file set must show exactly your paths; commit; then verify the landed commit matches what you staged. In multi-session windows this is a hard gate, not a formality — the shared index is process-global state.
  5. Verify. An impact-scoped check confirms the change touched only expected symbols and flows; tests and CI confirm behavior. A commit whose content you didn’t verify is stopped, not built upon.
  6. Ratchet. Every escape — production regression, landed-work loss, checker failure — becomes a permanent automated check before the incident closes, and the check itself must be confirmed to fail when the bug is reintroduced. See receipts below.
  7. Promote. The worktree merges back; docs, lessons, and written contracts absorb whatever the incident taught.

We claim Level 3 (below) on the repo-engineering lane, and the claim is evidence, not intent. Three incidents, three permanent checks:

Escape What got away The permanent check Confirmed-to-fail?
bf866d06 (Jul 2026) Three scattered SIGINT handlers each stopped a service and returned — make dev left the terminal in raw mode after Ctrl+C Centralized shutdown coordinator installShutdownHandlers(services) in packages/boot, unit-tested, wired into both apps’ server hooks; signal-handling rule in the written contracts Yes — coordinator behavior is unit-tested; reintroducing a bare handler now violates a written contract with a test behind it
2026-09-07 (three landed-work losses in one week) Sessions committing from stale/partial indexes swept other sessions’ files into deletions and reverts The index-clobber checker in the pre-commit chain — blocks staged deletions of tracked files and staged reverts Yes — and when the checker itself escaped (printed dozens of fatal: lines yet exited 0 on 2026-09-13), the ratchet ratcheted: its probes were rewritten fail-closed, every git failure now exits non-zero, and the suite landed in the repo test suite + a CI job
2026-09-13 (a scoped 4-file commit landed as 232 files) A concurrent session’s staging swept into the same commit because the git index is process-global; the stash-based lint hook then silently dropped 3 of 4 staged files The pre-commit hook snapshots the staged path set before linting and blocks the commit if the set changed (content may change; the set may not); before/after commit-verification rules written into the contracts Yes — the guard fires on any set mutation between snapshot and commit; ctxbrew hooks doctor smoke-tests the hook end-to-end

Product-level escapes do not yet follow this loop systematically — see the honest self-assessment below.

Cumulative. Level 3 is the claim that matters, and the only one that requires evidence rather than intent.

  • L0 — Serial. One agent at a time; a human reviews each change. Fine for a weekend project; it does not survive 763 commits a week.
  • L1 — Isolated. Worktree per unit of work, local gate before landing (typecheck, tests, lint). The gate is starting to become a program.
  • L2 — Hard-gated parallel. Multiple sessions in parallel as the normal state, and the tooling refuses rather than warns: destructive git vectors blocked at the hook; sweep-staging shapes blocked; pre-commit chain runs the full programmatic gate; staged set verified before commit and landed content verified after.
  • L3 — Ratcheted. Every recent escape on the lane has a permanent automated check, confirmed to fail on reintroduction, with the receipt linked. On this repo, the repo-engineering lane is at L3 with the three receipts above (the 2026-09-07 row documents a ratchet of the ratchet — the strongest evidence a loop is actually closed).

We publish our own levels and map, rather than adopt or ignore.

ASDLC (LogicSRC, CC BY 4.0) ContextBrew counterpart Where it lives
Frame: agent restates scope, names what it is leaving out Task spec with What/Acceptance/Refs/Verify before any code The task-file convention
Fan out: a concern per agent, a worktree per agent on one checkout Worker-mode discipline; worktree per claim; host stays clean Written repo contracts
Gate locally: “the gate is a program, not a person” Pre-commit chain: lint-staged + index-clobber + schema regeneration; PreToolUse hook refuses destructive vectors .husky/pre-commit, repo scripts
Merge → release → verify live (“Prod, because staging lies”) Land → verify: staged-set check, post-commit content check, impact-scoped check, CI — with the same refusal posture, aimed at a different scarce resource (trunk stability of a monorepo with parallel sessions) Concurrent-session rules
The ratchet rule The ratchet, with receipts table above — plus the meta-ratchet (a failed-open checker became a fail-closed one with a test suite) This page
Conformance levels L0–L3 Our levels above; same names, evidence-linked claims This page
“The tooling refuses rather than warns” Doctrine, stated and enforced — and when a refusal mechanism itself fails open, that is an escape like any other ctxbrew hooks doctor, the fail-closed checker fix

Where we diverge on purpose. ASDLC optimizes a product’s path to production (“verified live is done”); the ContextBrew SDLC optimizes a monorepo with many concurrent agent sessions — our hardest production problem to date has not been deploying, but landing work without clobbering parallel sessions. The shared spine is the same: isolation before parallelism, the gate is a program, every escape ratchets.

The enforcement primitives are product, not docs: ctxbrew hooks init installs the PreToolUse refusals, ctxbrew hooks doctor smoke-tests them (including confirming the hook fails closed on a synthetic git stash), and the graph-engineering rules ship in our repo-contract templates. If you run agents against your own repo, those three are the L2 floor; the ratchet habit is what takes you to L3 — and no tool can do that part for you, only make it unavoidable to skip.

The gate that this lifecycle defends is made of the instruments described on two sibling pages: Oracles and Rubrics (the two-axis trust taxonomy — machine pass/fail vs attributed judgment, and the dividing rule between them) and Drift (the five-signal sweep and the auditable Drift Score that measure whether brewed knowledge is still true). Where the practice sits on the spec-driven-development map — and the principles it enforces — are narrated on The Three Levels of SDD and The Seven Principles. The SDLC keeps the trunk stable; those pages keep the canon true.