The AI SDLC and the Context Engine
The first six months we ran agents on production code, the failure mode wasn’t hallucination. It was amnesia. The same model would propose the same already-rejected approach in week eight that it had proposed in week three. It would reach for a deprecated API the team had migrated off in the previous quarter. It would invent an internal style convention that had never existed because the prompt didn’t carry the actual one. None of these were model-quality problems. They were context problems.
The Context Engine is SprintLoop’s answer: a five-dimension layered context bundle that travels with every agent dispatch, refuses to ship when policy fails, and learns from every closed lane.
The five dimensions
A SprintLoop dispatch carries a BMAD bundle (Brief, Memory, Architecture, Decisions — five dimensions in practice, but the acronym predates the addition of Style and got grandfathered in). The dimensions:
| Dimension | What it captures | Where it lives |
|---|---|---|
| Product | The user-facing feature spec, acceptance criteria, edge cases | Linked Issue, the lane brief, product wiki |
| System | Architecture diagrams, repo map, service boundaries, ownership | Auto-extracted from the repo + manual edits |
| Style | Coding conventions, naming, error handling, log formats | Repo .sprintloop/style.md + linter configs |
| Policy | Hard rules — security, compliance, deprecated APIs, banned dependencies | Workspace policy file, signed by the owner |
| Memory | Past lane outcomes, rejected approaches, accepted patterns | Auto-derived from closed lanes + sign-off notes |
Each dimension feeds the dispatched agent through a different mechanism. Product and System usually go in the system prompt. Style is offered as a tool the agent can query (style.lookup("error handling for HTTP clients")). Policy is enforced before dispatch and at every tool invocation. Memory is retrieved on demand via vector search.
How a dispatch assembles the bundle
When you click Dispatch, the workspace runs a context build:
- Pull Product. The lane brief, plus any linked Issue’s acceptance criteria, plus any explicit reference docs the dispatcher attached.
- Pull System. A repo map is extracted on every push; the dispatch grabs the slice relevant to the lane’s scope claim. If the agent will touch
apps/api/auth/**, it gets the auth service’s directory tree, ownership tags, and immediate dependencies — not the whole monorepo. - Pull Style. Whatever’s in
.sprintloop/style.mdplus extracted configs from.eslintrc,.prettierrc,pyproject.toml, etc. - Pull Policy. Always. There’s no way to opt out. Policy violations cause the dispatch to abort before any token is spent.
- Pull Memory. A vector search over closed lanes that touched overlapping paths or used overlapping language. Limited to the most recent 90 days by default; tunable per workspace.
The bundle is signed and attached to the lane’s start entry. When the lane closes, you can pull up the bundle and see exactly what the agent had to work with.
Policy: the hard fail
Most dimensions are advisory. Policy is not.
A policy file looks like this — a real fragment from a customer in healthcare:
forbid: - paths: ["src/lib/legacyAuth/**"] reason: "Legacy auth path; rewrite blocked until migration finishes 2026-Q2" - dependencies: ["moment", "request"] reason: "Banned: replace with date-fns / native fetch"require: - test_coverage_delta: ">= 0" - reviewer: "security" on_paths: ["**/auth/**", "**/billing/**"]When a dispatch’s bundle build hits a policy clause, two things happen depending on the clause type:
- Pre-dispatch hard fail.
forbid.pathsorforbid.dependenciesclauses that would obviously be triggered by the brief abort dispatch immediately. The dispatcher sees a banner naming the rule and the reason; no tokens are spent. - Runtime hard fail. The harness can still try — it might not know the policy applies to a specific file until it reads it. When it tries to write a forbidden path, the storage layer returns
POLICY_DENIEDwith the rule name. The agent sees the denial in its tool log and either redirects or stalls. - Sign-off hard fail.
require.reviewer: "security"enforces that a security reviewer (human or agent) signed off before the lane can close. No exception path. The merge button stays disabled.
The reason policy is the only hard-fail dimension is regulatory: a workspace under SOC 2 / HIPAA / PCI scope cannot have an “advisory” rule that an agent can talk its way past. If your policy says “don’t touch billing without a security reviewer,” the system enforces that mechanically.
Memory: how learning compounds
The interesting dimension over time is Memory. Every closed lane writes a few signals back into the workspace’s memory store:
- Approved patterns. Code the lane shipped that the reviewer signed off on, embedded for retrieval.
- Rejected approaches. Sign-off notes saying “this works but we don’t do it this way” become negative examples.
- Failed assumptions. When the agent guessed wrong about the codebase and the human corrected it, the correction is stored as a Q&A pair.
- Domain vocabulary. Names, abbreviations, acronyms specific to the team’s domain that don’t appear in any public training set.
Memory retrieval is scoped to the workspace. It does not leak across customers. It is encrypted at rest with the workspace’s own key.
The compounding effect is real but slow — three to four weeks of active use before you see the agent stop making the same mistake twice. The signals you can see directly: the Memory tab on each closed lane shows which past lanes the dispatch retrieved, and the diff page shows which Memory entries were cited in the agent’s commit message.
Editing the bundle
You can edit the bundle directly from the dispatch dialog: click Inspect bundle, see the assembled prompt and tool spec, edit any dimension inline, save and dispatch. Edits are scoped to a single dispatch — they don’t mutate the underlying source. If you want a permanent edit, change .sprintloop/style.md, the policy file, the system map, etc., and re-extract.
The Inspect bundle view is also the fastest way to debug a dispatch that’s behaving strangely. If the agent reaches for a deprecated API, the bundle probably didn’t carry the policy that bans it. If the agent invents a style convention, the bundle’s Style dimension was thin. The bundle is the truth; the agent’s behavior is downstream.
What’s next
The Context Engine is one half of how a SprintLoop dispatch makes good decisions. The other half is the Review Committee — the panel of reviewer agents that grade the diff before it ever reaches a human.