The method rests on six principles, each enforced mechanically wherever possible. Principle 6 (Measurement) sits underneath the other five as the substrate that grades whether they are working.
Rules live in the repo (.governance/), run in CI, gate the merge button. No separate system to log into.
YAML frontmatter is the contract. Tests are the proof. Markdown alone is not a spec.
Every plan declares what it does not do. Every task gives the AI a paths-it-cannot-touch list.
Change → plan → task → capability → principle. Chain auditable, not promised.
AI drafts; humans own. AI is required to challenge weak premises before complying. Sycophancy is a failure mode.
Every change carries downstream cost attributed back to it. Mutation kill rate is load-bearing. Output without outcome is unaudited risk.
Two layers. The global wiki/ sits outside any single repo — it is organization-wide, holds the principles, the coding standards, the accumulated findings, and the reference patterns shared across every team. The per-project .governance/ lives inside each repo and holds only what is specific to that codebase: capabilities, plans, contracts, architecture, progress, signals. Color marks ownership: human-owned (load-bearing), AI may draft / suggest, measurement data, auto-generated.
wiki/ — cross-project, organization-wideThe wiki is shared across every project in the organization. A finding filed by one team becomes context for every other team's agent sessions. A pattern matured in one project's inbox/ can be promoted to reference/ and adopted org-wide.
.governance/ — inside each repoSchemas live inside the sdd-plus-plus Python package, not in the repo. Adopters get schema upgrades by upgrading the tool — no copy-paste-into-every-repo fragmentation. The agent reads from both the global wiki and the project's .governance/ on every session, via the MCP server.
SDD++ is agent-led at most steps. The human is not the universal reviewer; the human is the decision-maker at a small set of gates — spec contract acceptance, feasibility direction, and push/no-push. Everything else is the agent's work, including the self-iteration loop where the agent runs mutation tests + penalty validation against its own output before any human sees it. The framework name for this self-loop is the separate game: the agent's own QA pass on its own output, distinct from the human review.
The human supplies a minimal trigger — a one-line goal, parent capability, why now. The agent does the work of translating that into a structured spec contract: cases by type (positive, negative, invariant, boundary, security, idempotence), acceptance criteria, NFRs, mutation kill-rate threshold, risk class, declared confidence shape, and the protected-paths list. The output is YAML + frontmatter, schema-validated, machine-checkable — not a natural-language requirements document. Saved as contract.status: draft.
Validation runs immediately: sdd validate checks the spec contract against the same schema discipline as plans — missing required fields, contradictory values, out-of-range thresholds, broken cross-references all fail at the contract level before the human ever sees it. The validator is not a plan-only tool; contracts are first-class citizens of the schema layer.
Why the agent and not the human: natural-language requirements have been the worst-engineered artifact in software for forty years. A structured contract is something an LLM is genuinely good at producing, and something a human can review in seconds (missing fields are mechanical). The human's job is to accept or revise, not to author from scratch.
Before any code is written, the agent assesses how this contract should be fulfilled. The analysis explicitly considers four paths, with a recommendation and reasoning:
The agent also surfaces existing capabilities that already do this or part of it via the capability registry — preventing duplicate builds. Output is a feasibility report attached to the contract, with the recommended path and rejected alternatives explained.
Before writing code, the agent drafts a plan against the accepted spec contract. The plan is its own schema-validated artifact (plan/<task-id>.plan.md) — sdd validate checks it the same way it checks contracts. The challenge block on the plan has six required fields. The first three are the existing core; the last three are the v0.4 additions that move the challenge from compliance theater into actual reasoning:
The plan is saved as status: draft. sdd validate rejects the plan if any of the six fields are empty or contradict each other. A plan whose causal_attribution contradicts the spec contract's NFRs, or whose trajectory_argument claims an assumption is "sure" when the contract marks it as "might be wrong", fails validation mechanically.
The agent implements against the accepted contract and plan. AGENTS.md auto-loads; the agent reads the parent capability spec, fetches relevant findings via list_findings(capability, tag), conforms to coding-standards.md. The plan's do_not_modify list constrains paths. The agent writes both production code and tests against the named case_ids in the contract — but the tests will be evaluated in Phase 4 by mutation testing, so writing tautological "tests that please code" doesn't pass the gate.
Human involvement here is light: pairing for context-sensitive judgment calls, naming intent for tricky names, redirecting if the agent goes off-piste. The agent does the typing.
This is the phase the human currently does, badly. The agent runs its own QA pass on its own output in a separate loop, before the human sees anything. Five checks run on a cycle until thresholds are met or the agent declares blocked:
sdd validate --strict runs against the spec contract and the plan, not just the plan. Drift between contract and plan (a plan that claims to fulfill a case_id that does not exist in the contract, or contradicts a contract NFR) fails immediately.signals.json? Agent flags risk before merge.causal_attribution against the implementation: does the code actually produce the causes the plan claimed? Disagreements are surfaced. v0.4trajectory_argument's "sure" tier must have testable evidence; the "might be wrong" tier must have explicit instrumentation if it ships.The loop runs autonomously. Each iteration writes results to signals.json. The agent stops when all five thresholds are met, when no further iteration improves them, or when it produces an explicit "blocked, need human" hand-off with reasons. The output is a Phase-5-ready package: code + tests + mutation report + penalty preview + reviewer-AI critique + contract/plan validation log.
The human does not re-read every line of AI code. The self-iteration loop already did the line-level work. The human reads a review dashboard:
The human's job: judgment-only — architectural fit, business sense, edge cases the contract didn't cover, follow-ups to file as findings. Compliance was already settled by gates and the separate game.
The human's load-bearing decision. Push: merge + deploy via CD pipeline (env-gated by risk class). No-push: send back to the agent with structured feedback (which dashboard signal failed, what to address); the loop returns to Phase 4. There is no "approve with comments" middle state — every PR is either pushed or returned, mechanically.
At the end of the coding session, the agent (not the human) does the bookkeeping:
progress.md — what the session accomplished, what's still in flight, what to pick up next.suspected — anything non-obvious surfaced during build (a gotcha, a behavior quirk, a missing case in the contract). Humans confirm asynchronously.signals.json..progress-log.yaml with the session's MCP tool calls, mutation results, and reviewer-AI verdicts.Production observability feeds the substrate. Downstream events accrue to penalty_ledger over the 90-day horizon (bisect, SAST, rollbacks). Capability kill-rate drift tracked in signals.json; sdd doctor surfaces drift. New gotchas file as suspected findings; humans confirm; the wiki accumulates. Per-agent calibration curves regenerate weekly. v0.4 penalty ledger v0.5 automated blameless incident review · recurrency
The cycle returns to Phase 1: operations data drives new spec contracts — penalty patterns reveal weak capabilities, confirmed findings prompt contract updates, drift detection triggers a renewal court (v0.5). The lifecycle does not end at deployment; deployment is the midpoint.
The framework ships with two configurable modes. Standard mode keeps humans at three gates (spec accept, feasibility direction, push). Bob mode (a custom configuration named for its first piloted user) auto-decides spec accept, feasibility direction, and plan accept when calibration history and risk class meet declared thresholds. The push decision narrows but does not disappear in Bob mode — high-risk capabilities still require human push.
| Decision point | Standard mode | Bob mode (custom) | Notes |
|---|---|---|---|
| Spec contract content (case_ids, NFRs, threshold) | agent drafts | agent drafts | Always agent-drafted; humans don't write structured contracts from scratch. |
| Spec contract accepted | human | auto if calibration + risk OK | Bob auto-accepts when agent's per-capability calibration ≥ threshold and capability risk class is low/medium. |
| Feasibility analysis | agent runs | agent runs | Always agent-led. Output is the report. |
| Feasibility direction picked (code / no-code / human / hybrid) | human picks | auto if one path dominates | Bob auto-picks when one path wins by a declared margin (default 2× confidence delta). |
| Plan drafted | agent drafts | agent drafts | Always agent-drafted with challenge block. |
| Plan accepted | human | auto if calibration + risk OK | Mirrors the spec contract gate. |
| Implementation | agent codes | agent codes | Always agent. Human pairs/redirects but does not type the bulk. |
| Self-iteration loop (the separate game) | agent runs | agent runs | The QA pass on agent output. Never human in either mode. |
| Human review (dashboard-driven judgment) | human | human | Both modes. The dashboard is what makes review tractable. |
| Push to deploy | human always | auto for low-risk · human for high-risk | Bob auto-pushes only when (a) capability risk class ≤ medium, (b) self-iteration loop passed all four checks, (c) agent calibration ≥ threshold, (d) no reviewer-AI disagreements pending. |
| Session close (status, findings, scores) | agent writes | agent writes | Always agent. Bookkeeping is not a human job. |
| Penalty contestation | human | human | Always human. Contestation is a judgment about attribution, not a routine action. |
Compliance is adjudicated by the bot. The human reviewer is freed to focus on judgment. All five must pass before a reviewer is assigned.
Every frontmatter block conforms to the JSON Schema bundled with the tool.
The capability's executable test suite passes. Cases by type: positive, negative, invariant, boundary, regression, performance, security, idempotence.
PR template's checkboxes are populated. Named human owner is recorded.
Specs cannot be modified without the spec-change label. do_not_modify list is respected.
Capability's declared minimum mutation kill rate is met. Adapters: mutmut, Stryker, pitest. See §5a for the full timeline.
Three coupled mechanisms compose into a single framing metric. Every other discipline in the framework is graded by it. All three are in active development in v0.4 — the schemas, the data stores, and the CLI surfaces all exist; the field validation does not.
Downstream costs (incidents, security findings, rollbacks, test rewrites) attribute back to the generating plan. Automated where possible (git bisect, SAST cross-reference, rollback records); contested cases get a 7-day patent-office-style review window. Normalized by risk class so engineers on high-stakes code aren't perversely penalized.
Mutation kill rate is load-bearing. Every capability declares a minimum in its spec.md frontmatter. Mutation runs on every PR touching the capability. AI-generated tests that don't raise the kill rate are flagged (zero-kill flags). Used both as a hard CI gate AND a diagnostic for code review.
The plan schema's confidence and outcome fields are aggregated per agent, per capability, per change-class. sdd calibration surfaces curves. Sample-size normalized — a new tool with 10 plans isn't graded against a tool with 1000.
Not a score to optimize. A dashboard to read. Five plans with 90% mutation kill / 0 reverts / 0 calibration failures beat twenty plans with 60% kill / 3 reverts / 2 calibration failures. The first is paying its bills; the second is racking up debt that the team will service later.
Mutation testing fires at three distinct moments in the workflow, each playing a different role. The same data feeds both the CI gate and the diagnostic view for code review.
The engineer runs sdd validate before opening the PR. Mutation adapter runs against changed files; if the capability's declared kill-rate threshold is missed, validation exits non-zero locally. The engineer sees the surviving mutants before sending the PR to review, with enough time to add boundary or error-path tests.
The same adapter runs on the CI runner. PRs that drop the kill rate below the declared minimum fail CI. No human reviewer is assigned until this gate passes. Results are written to signals.json for the capability's trajectory.
The reviewer sees, alongside the diff: mutation diff (new surviving / resurrected / killed mutants for this PR), capability kill-rate trajectory over the rolling window, test additions with kills-per-test (zero-kill tests highlighted as presumptively redundant), and equivalent-mutant flags needing verification. Attention is mechanically routed to the parts of the change the test suite does not defend.
A capability whose kill rate drifts from 87% → 73% over a quarter is a leading indicator of spec rot. The framework tracks per-capability mutation kill rate over time in signals.json and surfaces the trajectory in sdd doctor. Stability of kill rate while complexity rises is paradoxically suspicious: the new code is not being challenged.
Once a plan reaches status: executed, the framework opens its 90-day penalty horizon. Downstream events are attributed automatically where possible, with structured contestation for ambiguous cases.
sdd plan outcome --id <plan> --outcome success|partial|failure. Penalty horizon opens. The penalty_ledger block on the plan is initialized to empty.
As downstream events occur, the framework attributes them to plans:
bug fixes via git bisect,
security findings via SAST output cross-reference,
rollbacks via the existing changeset record,
customer escalations via incident-link tagging.
Each event appends to the plan's penalty_ledger block, with severity, risk-class multiplier, accrued value, and contestation flag.
For each attributed event, the originator may dispute within 7 days. Disputes go to a third-party reviewer modeled on patent-office opposition procedure. After 7 days the attribution is final unless contested.
Per-agent calibration curves in signals.json are recomputed weekly from the rolling window of (confidence, outcome, penalty) triples. sdd calibration --agent <handle> surfaces the curve. Mis-calibrated agents have their confidence allowance discounted on future plans.
The plan's ledger freezes. Events attributed after day 90 are recorded as historical context on the capability but do not accrue against the plan itself. The 90-day default is configurable per-capability for products with longer or shorter feedback loops.
Gaming surfaces and their mitigations: avoidance of hard problems mitigated by risk-class normalization (high-stakes systems carry smaller multipliers); mis-attribution mitigated by 7-day contestation; discouraging exploration mitigated by a separate probe track where accrual is suppressed; bureaucratic overhead mitigated by automating attribution wherever bisect or change-impact analysis can do the work.
The .governance/wiki/ tree is the team's institutional knowledge. An AI session reads from it selectively (via MCP), can only write back through two narrow channels (plan draft, suspected finding), and is mechanically blocked from authoring anything else. Knowledge accumulates instead of being re-derived every session.
Selective. The LLM does not load the whole .governance/ tree — that is the §2.9 token-bloat anti-pattern. Each MCP call is scoped to the immediate task.
status: draft only · must include challenge blockstatus: suspected only · human confirmsThe findings/ subdirectory is the only place where AI contributions enter the wiki. The lifecycle is three states: suspected (AI-filed) → confirmed (human-validated) → surfaced (resurfaced to future sessions via MCP). This is the channel that converts AI-discovered gotchas into team-owned institutional knowledge.
A typical example: an AI session implementing rate limiting on /signup hits a Redis flapping issue during a deploy; the engineer asks the AI to file it; the AI saves the entry to the wiki as status: suspected; the engineer confirms with sdd wiki confirm; six months later, a different AI session on a different rate-limit task auto-loads the same entry via list_wiki(capability='users', tag='rate-limit') and adopts the connection-pool warmup pattern from the start. Tribal knowledge stops being tribal.
The .governance/wiki/ inside each repo is the project-local wiki — team-specific gotchas, findings, capability specs. Above it sits the global LLM-wiki: a cross-project, organization-wide knowledge layer that every team's agents read from. The global wiki holds the patterns, principles, and templates that survive any single project's lifetime. Same access discipline as the project wiki: agents may read freely, may suggest entries into inbox/, and may not author the curated layers without human confirmation.
An entry matures through promotion: lands in inbox/, gets reviewed and lifted into research/ or meetings/, and — once it has earned canonical status — moves to reference/. The promotion path is itself a kind of mortality discipline for knowledge: entries that are not promoted within a horizon get archived.
reference/principles/.reference/patterns/.reference/golden/..governance/ tree, template AGENTS.md, template contract/plan scaffolds. Reduces cold-start time for new repos. Lives in _templates/bootstrap/.meetings/.research/.Project-local vs global: the project-local .governance/wiki/findings/ holds team-specific gotchas tied to a particular codebase. The global llm-wiki/reference/ holds patterns and principles that survive any single team. A pattern matures by being noticed in a project's findings, promoted to the global inbox/ when it looks reusable, reviewed into research/ when it's been tested by a second team, and finally landing in reference/ as a canonical pattern. This is how organizational knowledge climbs out of any single repo.
The MCP tool surface and the schema together enforce the boundary. AI cannot accept its own plans; AI cannot author specs; AI can suggest findings only as suspected. Mechanical, not social.
| Action | AI | Human | Mechanism |
|---|---|---|---|
Author principles.md | ✗ | ✓ | Schema rejects AI handle in authored_by.human |
Author coding-standards.md | ✗ | ✓ | Same schema gate |
Author capability spec.md | ✗ | ✓ | Same schema gate; protected-paths CI check |
| Draft plan | ✓ | ✓ | propose_plan MCP tool saves as draft only |
| Populate challenge block | ✓ | ✓ | Schema requires non-empty concerns + alternatives |
| Accept plan | ✗ | ✓ | sdd plan accept --by @<handle> CLI-only; MCP has no equivalent tool |
| File finding | ~ | ✓ | AI may file as status: suspected only; human confirms |
| Read findings, specs, standards | ✓ | ✓ | MCP tools: list_findings, get_spec, get_progress |
| Implement code | ✓ | ✓ | Constrained by plan's do_not_modify list |
| Write tests | ✓ | ✓ | Bound to named case_ids; mutation gate validates the tests defend the spec |
| Sign PR ownership statement | ✗ | ✓ | PR template + ownership-disclosure CI check |
| Record plan outcome | ✗ | ✓ | sdd plan outcome CLI-only |
| Contest penalty attribution | ✗ | ✓ | Originator may dispute within 7-day window; human reviewer adjudicates |
SDD++ exposes itself to AI assistants via the Model Context Protocol. Cursor, Claude Code, Copilot, and Aider all auto-load AGENTS.md at session start and connect to the sdd serve MCP server for token-efficient tool access.
Cursor / Claude Code / Copilot / Aider
14 tools · stdio transport
The repo's governance tree
Available MCP tools (load-bearing subset):
get_progress list_findings(capability=…) get_spec(capability=…) propose_plan record_progress record_session_end suggest_finding get_capability_registry get_coding_standards accept_planThe accept_plan tool deliberately does not exist. AI cannot accept its own plans. Acceptance is a human-only CLI operation: sdd plan accept --id <plan> --by @<handle>.
The eight-step agent-led lifecycle from §3, projected as a swim-lane. Three lanes: the AI assistant (top), the MCP server in the middle, and a combined wiki + repo lane at the bottom. The wiki lane distinguishes global llm-wiki sources (cross-project, read for principles · patterns · golden examples) from project-local .governance/ artifacts (the agent's writes land here). New v0.4 MCP tools are marked in gold.
Two new flows visible here vs. the v0.3 swim-lane: (1) the global llm-wiki is now a read source distinct from the project repo, contributing principles, patterns, and golden examples to context loading and feasibility analysis; (2) at session close the agent may suggest a pattern for promotion into llm-wiki/inbox/ — the channel by which a team-specific finding climbs out into shared organizational knowledge.
sdd mutation CLI + per-capability kill-rate thresholds in spec.md frontmatter.plan.penalty_ledger block, auto-populated by sdd ledger ingest from bisect / SAST / rollback records.sdd calibration CLI surfacing per-agent calibration curves from signals.json.sdd benchmark running B1–B10 against a configured tool (§8.1 of the whitepaper).Drawn from aviation safety culture. The framework imports operational discipline from industries that already converged on it.