SDD++ — System Overview A discipline of spec-driven development, mechanical enforcement, honest measurement, and human ownership. Version 0.4.0 (draft) — 2026-05-22.

Human-owned AI may draft / suggest Measurement data Mechanical gate
v0.3 SHIPPED plan lifecycle, challenge block, acceptance gate, MCP server, findings, schema validation
v0.4 ACTIVE DEV mutation gate, penalty ledger, calibration tracking, benchmark suite, author/reviewer separation
v0.5 PLANNED graduated autonomy, mandatory callouts, automated blameless incident review, recurrency

1 · The six principles (the load-bearing layer)

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.

P1

Governance is embedded, not sidecar

Rules live in the repo (.governance/), run in CI, gate the merge button. No separate system to log into.

P2

Specs are executable contracts

YAML frontmatter is the contract. Tests are the proof. Markdown alone is not a spec.

P3

Authority must be bounded

Every plan declares what it does not do. Every task gives the AI a paths-it-cannot-touch list.

P4

Evidence is required for trust

Change → plan → task → capability → principle. Chain auditable, not promised.

P5

AI is a collaborator, not an author

AI drafts; humans own. AI is required to challenge weak premises before complying. Sycophancy is a failure mode.

P6 · Measurement substrate

Measurement is part of the artifact

Every change carries downstream cost attributed back to it. Mutation kill rate is load-bearing. Output without outcome is unaudited risk.

2 · Repository architecture

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.

Global wiki/ — cross-project, organization-wide

wiki/ # GLOBAL · not inside any project repo principles.md # the six principles · human-owned · org-wide coding-standards.md # tribal knowledge: errors, logging, naming · human-owned findings/ <id>.md # discoveries · AI files as `suspected`; humans confirm · org-wide _templates/ # starter scaffolds: contracts, plans, specs, finding entries projects/ # cross-team project bridges + retrospectives research/ # research notes, position papers, hypothesis logs reference/ # design principles · design patterns · golden examples meetings/ # meeting notes, action items, decisions of record inbox/ # unsorted bootstrap content awaiting categorization

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

Per-project .governance/ — inside each repo

.governance/ # PROJECT-LOCAL · lives inside each repo capabilities/ REGISTRY.yaml # active + roadmap + deprecated · human-owned <feature>/ spec.md # cases + DoD + NFR + mutation threshold · human-owned contracts/ <task-id>.contract.md # AI-drafted task-level structured contract (v0.4) plan/ <task-id>.plan.md # AI-drafted plan · 6-field challenge · human-accepted arch_spec.md # whole-system architecture · human-owned instructions.md # project-specific AI rules · human-owned progress.md # auto-generated session-state snapshot signals.json # time-series: calibration · Net Velocity · per-iteration metrics .progress-log.yaml # append-only event log AGENTS.md # at repo root · loads instructions.md + global wiki refs

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

3 · The SDLC workflow (agent-led · human at decision points)

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.

Two modes ship with the framework. Standard mode keeps humans at three gates (spec accept, feasibility direction, push). Bob mode (custom configuration) auto-decides spec accept, feasibility direction, and plan accept when calibration history + risk class meet declared thresholds — humans remain at push for high-risk capabilities. Mode comparison is at the end of this section (§3a).
PHASE 1
Spec contract
step 1
PHASE 2
Feasibility
step 2
PHASE 3
Plan & Build
steps 3–4
PHASE 4
Self-iterate
step 5 · loop
PHASE 5
Review
step 6
PHASE 6
Push
step 7
PHASE 7
Close & operate
steps 8–9
PHASE 1 Spec contract agent drafts structured contract from minimal human input · human accepts
1

Agent drafts the spec contract

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.

AI drafts contract
schema-validated
human accepts (or revises)
Bob mode auto-accepts if calibration & risk thresholds met
PHASE 2 Feasibility analysis agent considers code · no-code · human · hybrid · existing capability
2

Agent runs feasibility analysis

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:

  • Code path — implement from scratch in the relevant capability.
  • No-code path — configure an existing tool, workflow, or capability rather than writing code (often the right answer; almost never considered today).
  • Human path — the request is better solved by a person doing something once rather than building software (one-off data fixes, manual review, communication).
  • Hybrid path — partial code + manual workflow, or extend an existing capability rather than build a new one.

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.

AI runs analysis
capability registry consulted
human picks path
Bob mode auto-picks if one path dominates by a declared margin
PHASE 3 Plan & Build agent drafts plan with enhanced challenge block · then implements
3

Plan with enhanced challenge block

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:

  • understood_request — the agent's restatement of the contract in its own words. If the restatement is wrong, the human catches it before the agent writes a line.
  • concerns — at least one substantive concern about the contract, the implementation path, or the surrounding system. "No concern surfaced because…" is explicitly required if the agent has nothing — silence is not allowed.
  • alternatives_considered — at least one alternative implementation the agent considered and rejected, with the reason.
  • causal_attribution v0.4 — the agent's claim about cause and effect: what produces the current state, what this change will cause downstream, what failure modes follow from each design decision. Forces the agent to commit to a falsifiable causal model rather than a list of features. When the change later produces an incident, the causal attribution becomes the artifact that explains whether the agent's model of the world was right or wrong.
  • trajectory_argument v0.4 — the agent's argumentative claim about where this spec is heading and why this change is the right next step on that trajectory. Structured as a conjecture with horizons: what I am sure about (testable now), what I think but cannot yet verify, what I know I don't know, what I might be wrong about. Each tier carries different review weight. The "I might be wrong" tier is the highest-signal field — it explicitly names which assumptions, if falsified, would force restructuring versus minor adjustment.
  • do_not_modify — the paths-the-AI-cannot-touch list, declared up front.

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.

AI drafts plan
sdd validate · same schema as contract
human accepts (or revises)
Bob mode auto-accepts if calibration + risk OK
4

Agent codes the implementation

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.

AI implements
do_not_modify enforced
findings auto-loaded
human pairs / redirects
PHASE 4 Self-iteration ("the separate game") agent runs mutation + penalty preview + author/reviewer split · loops until thresholds met
5

Agent self-iterates — the separate game

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:

  1. Schema validation — 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.
  2. Mutation kill rate against the capability's declared threshold. Surviving mutants drive new test cases.
  3. Penalty preview — does this change touch high-penalty-history code? Does it match patterns from prior incidents in signals.json? Agent flags risk before merge.
  4. Author/reviewer split — a structurally separate reviewer-AI (different prompt, context, model) critiques the author-AI's work. The reviewer checks the plan's causal_attribution against the implementation: does the code actually produce the causes the plan claimed? Disagreements are surfaced. v0.4
  5. Contract conformance — every case_id in the contract has at least one test that exercises it; every NFR has an assertion. The trajectory_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.

AI author + AI reviewer
mutation + penalty preview
runs autonomously
v0.4 mutation · penalty · author/reviewer
The separate game agent's QA on its own output 1 · Author AI writes code + tests against contract 2 · Mutation kill vs threshold · mutmut/Stryker/pitest 3 · Penalty preview touches high-risk paths? 4 · Reviewer AI structurally separate critique · disagreement → human 5 · Contract conformance every case_id covered 6 · Loop or hand off iterate · or surface to human
The agent's own QA pass — humans see only the output of this loop, not the iterations.
PHASE 5 Review human reads dashboards · not lines · judgment-only
6

Human review — metrics-driven, not line-by-line

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:

  • Mutation diff — new surviving / killed / resurrected mutants vs main.
  • Capability kill-rate trajectory — does this change move the verification surface?
  • Penalty preview — predicted attribution risk based on path-history similarity.
  • Reviewer-AI disagreements — any unresolved critiques from the separate game.
  • Calibration alignment — does the agent's stated confidence match its historical curve?
  • Zero-kill test flags — tests that added compliance lines without raising the surface.

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.

human judgment only
dashboard-driven
not line-by-line
PHASE 6 Push decision push or no-push · the primary remaining human decision
7

Push or no-push

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.

human push/no-push
env-gated CD on push
Bob mode auto-push for low-risk capabilities meeting all thresholds; high-risk always human
PHASE 7 Close & operate agent session-close bookkeeping · production measurement loop
8

Session close — agent updates state, findings, and scores

At the end of the coding session, the agent (not the human) does the bookkeeping:

  • Updates progress.md — what the session accomplished, what's still in flight, what to pick up next.
  • Files findings as suspected — anything non-obvious surfaced during build (a gotcha, a behavior quirk, a missing case in the contract). Humans confirm asynchronously.
  • Records the score — agent's confidence claim vs. observed outcome of the iteration loop, attached to the plan/contract. Feeds the per-agent calibration curve in signals.json.
  • Logs the trail — appends to .progress-log.yaml with the session's MCP tool calls, mutation results, and reviewer-AI verdicts.
AI writes
progress.md · findings/* · signals.json
9

Operations — production measurement loop

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

penalty + calibration
AI + human confirm findings
drift detection

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.

3a · Modes — standard vs Bob (custom)

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.
Bob mode is not "AI runs the team." The two remaining human gates — dashboard review and push for high-risk — are the load-bearing ones. Bob mode removes the gates that were ceremony (typing-accept-into-CLI) and keeps the gates that are judgment. The point is to free human attention for the decisions only humans should be making, not to eliminate human responsibility.

4 · The five CI gates (mechanical, not social)

Compliance is adjudicated by the bot. The human reviewer is freed to focus on judgment. All five must pass before a reviewer is assigned.

GATE 1

Schema validation

Every frontmatter block conforms to the JSON Schema bundled with the tool.

GATE 2

Contract tests

The capability's executable test suite passes. Cases by type: positive, negative, invariant, boundary, regression, performance, security, idempotence.

GATE 3

Ownership disclosure

PR template's checkboxes are populated. Named human owner is recorded.

GATE 4

Protected paths

Specs cannot be modified without the spec-change label. do_not_modify list is respected.

GATE 5 v0.4

Mutation threshold

Capability's declared minimum mutation kill rate is met. Adapters: mutmut, Stryker, pitest. See §5a for the full timeline.

5 · The measurement substrate v0.4 ACTIVE DEV

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.

Penalty bookkeeping

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.

writes to → plan.penalty_ledger
rolls up into → signals.json
CLI → sdd ledger ingest / contest

Verification surface index

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.

tools → mutmut · Stryker · pitest
writes to → signals.json
CLI → sdd mutation

Calibration tracking

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.

reads → plan.confidence + plan.outcome
writes to → signals.json
CLI → sdd calibration
FRAMING METRIC · COMPUTED FROM signals.json
Net Velocity = output rate × verification surface × calibration accuracy ÷ penalty accrual

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.

5a · Mutation testing — when it runs and what it does v0.4

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.

PRE-PR

sdd validate runs locally

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.

CI · GATE 5

Mutation threshold gate in GitHub Actions

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.

PR REVIEW

Mutation diagnostic (the reviewer view)

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.

CONTINUOUS

Drift detection in sdd doctor

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.

5b · Penalty ledger — the 90-day post-merge timeline v0.4

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.

DAY 0

Merge — outcome recorded

sdd plan outcome --id <plan> --outcome success|partial|failure. Penalty horizon opens. The penalty_ledger block on the plan is initialized to empty.

DAY 1–90

Automated attribution

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.

DAY 0+7

Contestation window (per event)

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.

DAY 30+

Calibration curves regenerated

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.

DAY 90

Penalty horizon closes

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.

6 · The LLM ↔ Wiki reading map v0.3 SHIPPED

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.

↓ AI READS (via MCP server)

What the LLM consumes

AGENTS.md
canonical AI rules, auto-loaded
auto-load at session start
progress.md
token-efficient session-state snapshot
get_progress()
wiki/principles.md
six principles · background context
get_principles()
wiki/coding-standards.md
tribal patterns: errors, logs, naming
get_coding_standards()
capabilities/<id>/spec.md
parent capability spec for the task
get_spec(capability)
wiki/findings/*.md
prior team learnings · filtered by capability + tag
list_findings(cap, tag)
capabilities/REGISTRY.yaml
active + roadmap + deprecated capabilities
get_capability_registry()
arch_spec.md
whole-system architecture
get_arch_spec()

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.

↑ AI WRITES (only via these two channels)

What the LLM may produce

plan/<task>.plan.md
as status: draft only · must include challenge block
propose_plan()
wiki/findings/<id>.md
as status: suspected only · human confirms
suggest_finding()

Mechanically forbidden to AI

accept_plan
MCP surface has no such tool · acceptance is human-only CLI
REFUSED
edit principles.md
schema rejects AI handle in authored_by
REFUSED
edit spec.md
protected-paths CI check; plan.do_not_modify list
REFUSED
edit coding-standards.md
human-owned · same protected-paths gate
REFUSED
confirm finding
AI can only file as suspected; confirmation requires human
REFUSED

6a · The findings lifecycle

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

findings/<id>.md
Suspected
AI files via suggest_finding()
→
sdd findings confirm
Confirmed
human runs CLI · status flips
→
list_findings(cap, tag)
Surfaced
auto-loaded by future AI sessions

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.

6b · The global LLM-wiki — cross-project, organization-wide v0.5

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.

↓ Global llm-wiki structure

Six top-level directories

llm-wiki/ _templates/ # starter scaffolds: contracts, plans, specs, finding entries projects/ # cross-team project bridges, retrospectives, decisions research/ # research notes, position papers, hypothesis logs reference/ # design principles · design patterns · golden examples meetings/ # meeting notes, action items, decisions of record inbox/ # unsorted bootstrap content awaiting categorization

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.

↑ Content categories the agent reads

What lives in there

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.

7 · Authority matrix — what AI can do, what humans must do

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.

ActionAIHumanMechanism
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

8 · MCP integration — how AI sessions actually connect

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.

AI assistant

Cursor / Claude Code / Copilot / Aider

sdd serve (MCP server)

14 tools · stdio transport

.governance/

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_plan

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

9 · A single AI session, end to end

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.

AI ASSISTANT MCP SERVER (sdd serve) WIKI + REPO — global llm-wiki (read) — project .governance/ (read + write) 1 · Session start AGENTS.md auto-loaded progress.md available + global llm-wiki ref 2 · Load context selective MCP reads no whole-tree dump global + project wiki 3 · Draft contract structured spec contract cases · NFRs · threshold schema-validated 4 · Feasibility code · no-code · human checks REGISTRY + golden examples 5 · Draft plan challenge block: + causal_attribution + trajectory_argument 6 · Implement code + tests bounded by do_not_modify 7 · Self-iterate ↻ the separate game mutation + penalty + author/reviewer 8 · Session close status + wiki entry + score for analysis all via MCP loops on threshold miss get_progress() list_wiki(cap, tag) get_spec(cap) get_principles() propose_contract() NEW v0.4 get_capability_registry() get_golden(name) get_pattern(name) propose_plan() with 6-field challenge direct filesystem (no MCP for code writes) sdd validate (contract+plan) sdd mutation sdd ledger preview record_progress() suggest_wiki_entry() record_outcome() record_session_end() llm-wiki/reference/ llm-wiki/_templates/ GLOBAL · read .governance/wiki/* project · read contracts/<task> .contract.md project · written as draft REGISTRY.yaml project · read llm-wiki/reference/ golden/ + patterns/ GLOBAL · read plan/<task> .plan.md project · draft + 6-field challenge src/... code + tests project · only allowed paths signals.json per-iteration metrics mutation · penalty · review progress.md wiki/<id>.md (suspected) signals.json (score) + inbox/ if pattern may suggest promotion — Solid arrow: persistent write · Dashed arrow: MCP call / read-only / direct filesystem write — Purple: global llm-wiki / measurement substrate · Terracotta: project .governance/ · Gold: new v0.4 MCP tool — Agent never writes to principles.md, coding-standards.md, capability spec.md, or llm-wiki/reference/. Writes are limited to: contracts/, plans/ (drafts), src/, signals.json, progress.md, wiki/<id>.md (suspected), and optionally llm-wiki/inbox/ (proposed pattern promotions). — The self-iteration loop in step 7 runs the contract + plan through sdd validate, not just the plan. Contracts are first-class schema citizens.

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.

10 · What v0.4 added (the measurement substrate)

New in v0.4

Coming in v0.5+ (CRM)

Drawn from aviation safety culture. The framework imports operational discipline from industries that already converged on it.