A second way in: adopting a codebase you already have

Everything below this section starts from an empty folder — ./init.sh creates the project. Adoption is the other entrance, for a codebase that already exists with its own history, its own pipeline and its own habits. It has its own driver, and it never calls init.sh's project creator. If this is you, read this section first, then join the journey at the phase adoption lands you in.

Read this before you plan around adoption

Adoption is half built. The driver, the tier question, the reverse intake's confirmation arm, the state writes, the adoption stamp with its loss detection, the commit-time enabling arms, the test-debt ledger and the collision archive all ship and all work. The assessment — the requirements interview, the fitness verdict and the plan — does not exist, and neither do the CI carve-out or the Adoption Record. The certification pass is retired rather than pending: with no claimed rung and no derived landing it has nothing left to certify against. The driver prints a labelled NOT DONE block for each unbuilt one during the run, naming the work package that owns it. The full list is at the end of this section. Adoption is Act 2 of four — Scout surveys, this driver prepares and lands the project at phase 0, and the assessment that follows is a Claude Code session that has not been built yet.

Step A · Scout — the read-only survey that comes first

It writes nothing

bash scripts/scout.sh --root ../their-app. Scout changes nothing in the tree it is pointed at — no cache, no state file, no marker. Its only writes are a private working directory under $TMPDIR and, when you ask with --out DIR, exactly two files: scout-report.json and scout-report.md.

Run it, read it, walk away. Nothing is installed and nothing is decided.

Runs from the framework clone

Scout is not copied into scaffolded projects and does not need the framework installed in the project it is surveying — a survey that requires installing the thing it surveys is not a survey. It sources no core library and does not need jq.

Seven sections

stack (languages, build files, test command), phaseMap (an artifact ladder over the project's own evidence), reality (five probes), secrets, collisions, testsBaseline, intakePrefill. sectionsNotEmitted survives as an empty array rather than being deleted — "we have not looked" and "we looked and it was clean" are different claims.

Secrets: full history, value never printed

Scout scans every commit, not just current files. Findings are a field-allowlist projection (rule, file, commit, fingerprint, line, date, description) — there is no secret field in the schema to forget to strip, and the commit message is refused outright.

A missing scanner is reported as a missing scanner. With gitleaks off PATH, status is tool-unavailable and findingCount is null — not 0.

Branch protection is unknown, not no

Scout makes no authenticated calls to your git host and will not use your credentials, so it cannot see whether your main branch is protected. It says "unknown" and means it.

The one thing that runs your code

--run-tests runs the project's own test command once, output discarded, bounded by SCOUT_TEST_TIMEOUT (default 300s). It is off unless you ask. Scout's read-only guarantee covers Scout — it does not cover your test suite.

Exit codes: 0 a scan completed (findings are not errors — a report full of secrets still exits 0); 2 bad usage or an unreadable target. See docs/scout.md.

Step B · The adoption driver, and the one question

A separate driver, on purpose

bash scripts/adopt-project.sh (options: --root, --scan-report FILE, --re-add PATH, --version, --help). It can consume a Scout report instead of re-scanning.

It is not init.sh --brownfield because init.sh's interactive path has unguarded overwrite sites. The driver never calls create_project() — those sites are unreachable by construction rather than by audit.

The one question the scan cannot answer

The scan's findings are shown first as evidence that decides nothing, each line carrying its own confidence. Then one question, and it is not about your code: "Who is this project for?" — "Just me, or me and a few people I know" / "A company, a client, or people who are paying for it". That answer sets the project's enforcement tier, and it is asked because it is the one thing no amount of reading the code can determine.

There is no default and no skip. With no answer the run prints [REFUSED] and stops: "Adoption did not begin. Nothing was committed and nothing was written." — or [BLOCKED], when the run had already written files, which then names the count (# BL-225-REFUSE-HONEST).

Everything lands at phase 0

Every adopted project starts at current_phase: 0 — not at a phase derived from its artifacts, not at one you claimed, and not provisionally. It then goes forward through the ordinary gates like any other project.

The driver used to ask how far along you were and place you accordingly. That question is deleted, and so is the idea of computing an answer in its place: you are using this framework because you are not already following a formal process, so grading your own position within one is asking the wrong person.

Why landing low costs you nothing

A phase is not a score — it is a statement about which gates were crossed with evidence. The gates are cumulative, so a project placed at 3 without that evidence simply fails its own next gate. Landing at 0 costs you the walk through Phase 0 and buys a project whose recorded position is true.

Nothing the scan learned is thrown away: the artifact ladder, the test-debt census and the reality probes all become a head start on the Phase 0 questions, never a shortcut past them.

Reverse intake — three classes, one of them asked here

Scan-derived answers are prefilled with their provenance and you keep or change them. That is the only class this step asks. Judgement answers and the data classification are recorded blank and labelled — they belong to the assessment, a conversation with an agent rather than a form.

The classification is still mandatory, just later. The Phase 1→2 ZDR gate is a hard FAIL without it — a real failure, not a warning — and it fires whenever the project's phase reads 2 or more, however it got there. An adopted project starts at 0, below that gate. The gates are cumulative and keyed to evidence, so arriving at a rung without the evidence fails on the evidence regardless of what moved you there. Today the gate refuses an adopted project earlier still, on a missing APPROVAL_LOG.md that adoption does not yet write — a real refusal, but one that names the approval log rather than the classification. The run hands you bash scripts/resume.sh, whose kickoff prompt names the classification as not optional.

A halted run leaves you MORE enforced, never less

The write order is phase-state.json → intake → manifest.json, and it is chosen because the two half-states are not symmetrical: phase-state without a manifest leaves the gates live at the strictest tier (blocked, safe), while a manifest without phase-state makes the gate skip entirely. Writing phase-state first means every interruption lands in the safe row.

Staging is an explicit file list — never git add -A — so work you had in progress stays unstaged and untouched.

Exit codes: 0 adoption completed; 1 adoption did not complete (a refusal, a blocker, or a halt); 2 bad usage or an unusable target. See docs/adoption.md.

Step C · What adoption turns on from day one

The adoption stamp

One additive adoption block in .claude/manifest.json — five keys: the flag, the timestamp, the anchor commit, the scan report's hash and a schema version. Written once, from one call site, never re-stamped; a second stamp attempt is refused rather than overwriting the anchor, and an empty evidence hash is refused outright.

The scenario, the landed phase and the certification lists are gone from the record — the first two with the question and the placement that produced them, and the lists because the certification pass they belonged to is retired rather than pending.

Loud loss detection — and it blocks

The manifest has a wholesale writer in a different repository (a repair path that regenerates it from an upstream key set carrying none of this framework's keys), so a lost stamp cannot be prevented from here. It is therefore reported loudly instead. The witness is the copy committed at HEAD, which a working-copy regeneration does not touch.

check-phase-gate.sh prints an Adoption Stamp Integrity block and, on loss, increments issues — so the gate genuinely fails, deliberately and not merely cosmetically.

Functions soif_adoption_integrity_lost / soif_adoption_report_loss; the blocking increment carries the marker # BF-ADOPT-GATE-ISSUES.

The TDD exemption, and its bound

You cannot go back and write the tests first for code written in 2023, so that one requirement gets an exemption — bounded to the adoption run itself. It applies only while the stamp's anchor commit equals HEAD and the manifest committed at HEAD does not yet record the adoption. Once the adoption commit lands the exemption closes permanently and every later commit is post-adoption by construction.

From that commit on, an adopted project gets the same commit-time treatment as a scaffolded one — including the tier-keyed TDD ordering block.

Function soif_adoption_pre_adoption_commit; the bound carries the marker # BF-ADOPT-BOUND.

The test-debt ledger and its ratchet

The exemption does not stand alone: adoption measures your untested-file set once into .claude/test-debt.json and then holds you to two forward rules — non-growth (the set may not gain a member) and touch-repays (a ledgered file you modify must leave the set in the same commit).

Both are floored on the enforcement tier: silent at no, a warning at light, a refusal at strict. Exit codes: 0 clean or a non-blocking tier, 2 unusable (no ledger, no git repo, no jq), 3 blocked by non-growth, 4 blocked by touch-repays.

Nothing invokes it on commit yet — verified: no call site exists outside the driver that sources it. Today it is adopt-test-debt.sh --check by hand or from a CI step. WP7 owns the commit-time hook.

The collision archive

Before any framework writer runs, the files it would land on are copied into .claude/adoption-archive/<UTC-timestamp>-<pid>/ with a MANIFEST.json and a MANIFEST.md beside them. The population is your AI-layer surfaces — Claude settings, .claude/skills/*/SKILL.md, MCP connections — and every non-.sample file in .git/hooks/. Nothing is deleted, only files that exist are archived, and every entry carries a restore line you can paste.

The run then discloses it in full — every path, not a count. --re-add <path> puts one back byte-for-byte at its recorded mode, after a warning and a confirmation with no default and no skip, and records the choice as an adoption_event row in .claude/bypass-audit.json.

The archive is scanned before anything is staged

.git/hooks/ is not tracked by git; .claude/ is. Committing an archived hook could take a credential git had never seen and put it in your history — adoption would create the leak. So the archive is scanned with gitleaks before staging, and a matching entry is written to disk but kept out of the commit.

Four reasons withhold an entry, each named in the MANIFEST: secret-match; not-scanned (gitleaks absent or the scan failed — the whole archive is withheld, because "nobody looked" is not "clean"); original-gitignored; gitignored.

A pattern scanner is a mitigation, not a proof. It recognises credential shapes; an internal hostname, a proxy URL or a customer name matches nothing. Read the MANIFEST before you push.

What adoption does NOT do yet — read this before you rely on it

Re-derived from the driver's own adopt_stub_* notices rather than copied from prose, because this line has moved twice and will move again. Two of the bullets below are not driver notices and are marked as such — the retired certification pass, which nothing prints any more, and the closing caveat. Every other bullet names its owner during the run, and two of those fire only when the run encounters the condition (a framework-script collision, and a secrets scan with something to report).

What you do

  • Clone the repository and run ./init.sh.
  • Answer prompts (approve each tool install).
  • Optional: run ./init.sh --dry-run first to preview.
1

One-Command Setup

Installs everything the framework needs on your machine.

./init.sh
Produces: a project folder with all templates, pipelines, and a fresh git repo.

What the framework does

  • Checks four prerequisites — Git, Node.js, jq, Docker — and offers to install any missing (all but Git are prompt-and-install).
  • Resolves the tool matrix for your platform and offers the security tools that apply at this phase: Semgrep, gitleaks and Snyk for every project. Lighthouse rides along for web — but it is a performance tool in the matrix, not a security one, and it is gated to the standard and full tracks, so a Light-track web project is never offered it. Anything the matrix marks for a later phase is deferred, not offered — OWASP ZAP is a Phase 3 DAST tool, so init records it and moves on.
  • Clones the Development Guardrails for Claude Code (git hooks + session rules).
  • Generates your project folder, CI + release pipelines, CLAUDE.md, and about ten state artifacts under .claude/. The three that matter most: .claude/phase-state.json (phase + gate dates), .claude/process-state.json (build-loop / UAT / Phase 3 ledger, and where phase1_artifacts lives), and .claude/manifest.json (host, mode, remote URL, deployment, poc_mode, enforcement level, plus the pinned framework commit and a currency inventory). Others include settings.json, build-progress.json, tool-usage.json, tool-preferences.json and intake-progress.json.
  • Initializes git, seeds .claude/bypass-audit.json with its first enforcement_level_set row, and finishes by running scripts/verify-install.sh --auto-fix.

What you do

  • Run the intake wizard and answer plain-language questions.
  • Describe project name, what it does, who uses it, platform (web/desktop/mobile/etc), language and success criteria, across the wizard's fourteen sections.
  • Four independent settings govern everything downstream. Only one of them is set here — the other three are chosen at ./init.sh time and the wizard merely reads them:
    • POC mode — set by the wizard: Production Build, Sponsored POC (org knows, non-technical approvals deferred) or Private POC. Phase 4 is hard-blocked in either POC mode until scripts/upgrade-project.sh --to-production.
    • Deployment: personal or organizational (init.sh).
    • Track: Light / Standard / Full — depth of Phase 3 rigor (init.sh).
    • Enforcement level: strict / light / no (init.sh). Strict is the default and is forced for every organizational project; only deployment: personal makes it choosable at all.
  • Review the generated PROJECT_INTAKE.md before moving on.
2

Project Intake

Tell the framework exactly what you're building and why.

bash scripts/intake-wizard.sh
Produces: PROJECT_INTAKE.md — the AI's product brief. Also persists data_classification + ZDR attestation into .claude/process-state.json under phase1_artifacts, which is exactly where the Phase 1 → 2 gate reads them.

What the framework does

  • Walks you through a structured Q&A tailored to your chosen platform.
  • Offers context-aware suggestions (e.g. auth options for web, notarization for macOS desktop).
  • Auto-fills the resolved tool matrix so the AI knows exactly which tools apply.
  • Captures data classification (public / internal / confidential / pii / financial / health / regulated) and ZDR attestation — enforced later at the Phase 1 → 2 gate.
  • Writes a complete intake document — no free-form guessing required later.

What you do

  • cd into the project init.sh created (the sibling folder, not the framework clone).
  • Run bash scripts/resume.sh — the single state-aware first-message generator — and copy what it prints between its two banner lines.
  • Start Claude Code and paste that as your very first message.
  • Read the AI's summary. Correct any misunderstanding before it starts work.
3

Give the AI Its Context

The agent reads its instructions before it does anything.

bash scripts/resume.sh
Produces: an AI that understands your project, its phase, and its constraints.

What the framework does

  • There is no hand-maintained prompt to paste from the README any more. scripts/resume.sh reads .claude/phase-state.json and picks one of four branches: the intake prompt, PROJECT_INTAKE.md § 13 verbatim, the phase-4 delta greeting, or the classic resume prompt. (The script lives in generated projects only.)
  • The § 13 initialization prompt attaches three documents: the Project Intake (the primary constraint), the Builder's Guide at docs/reference/builders-guide.md (the process reference), and the Platform Module. The other resume branches additionally tell the agent to read CLAUDE.md for project context.
  • Summarizes the goal, constraints, current phase, and available tools.
  • Asks you clarifying questions — its rules require it to flag a blank or conflicting intake field before proceeding past the step that needs it.

What you do (organizational only)

  • Record six blocking pre-conditions as dated rows in APPROVAL_LOG.md before Phase 0 can advance.
  • Personal projects and Private POCs skip this row entirely; Sponsored POCs need rows 1 & 4 up front and may defer the rest.
0

Pre-Phase 0 · Organizational Pre-Conditions

Six governance rows before Day 1 for organizational deployments. See governance-framework.md § V (Approval Authority / POC Modes) and § XIV → "Pre-Conditions (Before Day 1)".

check-phase-gate.sh (Pre-Phase 0)

What the framework checks

  • Six named rows, each with an ISO-dated approval. Numbering matters — upgrade-project.sh parses these row numbers:
    1. AI deployment path — IT Security approval.
    2. Insurance coverage confirmed — Insurance Broker.
    3. Liability entity designated — Legal / CIO.
    4. Project sponsor assigned — Executive Sponsor.
    5. Backup maintainer designated — Technical Lead.
    6. ITSM project registered — ITSM / PMO.
    Source: templates/generated/approval-log-org.tmpl, § Pre-Phase 0: Organizational Pre-Conditions — the <!-- BL-170-APPEND-DESIGN --> row-list paragraph.
  • Each row is checked by name, and a missing dated row prints [WARN] but increments the gate's issue counter — so it blocks.
  • This whole block is skipped whenever poc_mode is set. Sponsored POC owes rows 1 & 4 up front and defers 2/3/5/6 — but that is enforced later, by scripts/upgrade-project.sh --to-production, not by the Phase 0 → 1 gate.
  • Private POC: all six deferred. Personal: the template pre-fills all six as N/A — personal project.
  • Enforcement level is forced strict for every organizational project.

What you do

  • Answer the AI's discovery questions about goals and users.
  • Review the draft Product Manifesto.
  • Approve it in APPROVAL_LOG.md (or request revisions).
4

Phase 0 · Product Discovery

Turn the idea into a written product agreement.

Produces: Product Manifesto (goals, users, MVP scope, non-goals).

What the framework does

  • AI walks the seven Phase 0 sub-steps: 0.1 Functional Feature Set (the FRD), 0.2 User Personas & Interaction Flow (Skeptical Product Manager persona), 0.3 Data Input/Output & State Logic (the data contract), 0.4 Product Manifesto & MVP Cutline, 0.5 Revenue Model & Unit Economics (Std+), 0.6 Orchestrator Competency Matrix, 0.7 Trademark & Legal Pre-Check (Std+).
  • Generates supporting artifacts under docs/phase-0/: frd.md, user-journey.md, data-contract.md.
  • 0.6 is not advisory — for each domain marked "No", the corresponding automated tool MUST be installed and active in CI before Phase 2 begins.
  • Organizational deployments: sponsor reviews the Compliance Screening Matrix — ten rows covering SOX-adjacent financial reporting, PCI, multi-state/international personal data, EU users, OFAC sanctioned jurisdictions, records retention, EU-AI-Act end-user AI features, HIPAA, GLBA and SEC cyber disclosure. See governance-framework.md § VIII.11. (The intake wizard asks a related but different eight-item list — they are not the same set.)
  • Cannot proceed to Phase 1 until the phase gate is approved. (STRIDE threat model is Phase 1.3, not here.)

Your approval unlocks the next phase

  • Personal deployments: self-review recorded in APPROVAL_LOG.md with name and date.
  • Organizational deployments: Project Sponsor is the sole named approver for business justification + compliance screening. The Sponsor (not you) must author the git commit that adds their signature.
✓

Phase Gate 0 → 1

Framework refuses to advance without written sign-off. On success, a snapshot is copied to docs/snapshots/phase-0-to-1_YYYY-MM-DD/.

scripts/check-phase-gate.sh

What the framework checks

  • Reads APPROVAL_LOG.md and (organizational) runs git blame --line-porcelain on the Approver row itself — the git-commit author of that specific line must not equal the approver's name (anti-self-approval FAIL). Personal deployments skip this check.
  • Confirms PRODUCT_MANIFESTO.md has all 8 numbered sections filled with content, and NO Status: Open lines remain. A missing section and an unresolved Open Question are both [FAIL]; a placeholder-only section prints [WARN] — but it increments the issue counter too, so all three block.
  • Compares the dated Phase 0 → 1 entry against .claude/phase-state.json::gates.phase_0_to_1 — and writes it if the APPROVAL_LOG evidence is there and the JSON slot is empty, atomically and under a lock, alongside a companion phase_0_to_1_by key. The write is idempotent (an existing date is preserved) and deliberately still fires in warn mode. Function _cpg_record_gate_date; marker # BL-071-WRITE.
  • On PASS, check-phase-gate.sh creates a point-in-time snapshot at docs/snapshots/phase-0-to-1_YYYY-MM-DD/.

What you do

  • Review the three architecture options the AI is required to propose, with tradeoffs.
  • Pick the architecture. Read the test plan.
  • Approve at the Phase 1 → 2 gate.
5

Phase 1 · Architecture & Planning

Design the system on paper before writing any code.

Produces: the Project Bible — 16 numbered sections covering architecture, ADRs, threat model, data model and the test strategy. (The data contract is a Phase 0 artifact at docs/phase-0/data-contract.md, not a Bible section.)

What the framework does

  • AI walks the Phase 1 sub-steps: 1.1 Business Strategy Gateway (Std+ Go/No-Go), 1.1.5 Market Signal Validation (Std+), 1.2 Architecture & Stack Selection (3 candidates, 10 first-class decisions, Competency Matrix as required input), 1.3 Threat Model & Stress Test (STRIDE, Penetration Tester persona), 1.4 Data Model, 1.4.5 Data Migration Plan (only if replacing an existing system), 1.5 UI & UX Scaffolding (four required states — Empty / Loading / Error / Success), 1.6 The Project Bible (16 sections), 1.7 Data Classification & ZDR Attestation.
  • Writes Architecture Decision Records (ADRs) from templates/generated/adr.tmpl, with Options Evaluated and Rejected Alternatives sections — why each big choice was made, and what was turned down.
  • Configures branch protection against the real git-host API (GitHub / GitLab / Bitbucket) via scripts/lib/host.sh — host_configure_protection, called from init.sh and scripts/check-gate.sh. The phase gate later calls only host_verify_protection; it verifies, it does not configure. Free-tier limitations use an attestation escape hatch (github_free_tier, gitlab_free_tier_approvals).
  • Produces the test strategy in Bible § 12, with entry/exit criteria for Phase 3 and per-category pass/fail bars.

Your approval unlocks Phase 2

  • Personal: self-review recorded in APPROVAL_LOG.md.
  • Organizational: Senior Technical Authority approves architecture, security posture, and data classification.
✓

Phase Gate 1 → 2

Includes the mandatory Zero Data Retention gate (Invariant #16). Snapshot: docs/snapshots/phase-1-to-2_YYYY-MM-DD/.

scripts/check-phase-gate.sh

What the framework checks

  • Dated "Phase 1 → Phase 2" entry in APPROVAL_LOG.md; organizational adds a per-line git-blame check on the STA row.
  • PROJECT_BIBLE.md exists with ≥ 14 numbered sections (the template ships 16) and no YYYY-MM-DD placeholder dates remaining. Both arms print [WARN] and both block.
  • Mandatory ZDR gate (Invariant #16): .claude/process-state.json::phase1_artifacts.data_classification must be one of public / internal / confidential / pii / financial / health / regulated. Anything above public requires zdr_attested=true OR a written zdr_attestation_reason. FAIL otherwise, and it fails closed — no jq or no state file resolves to unset, which is also a FAIL.
  • Branch protection backstop: a real API call verifies four things — force-push disabled, admin enforcement on, and (org) at least one required PR approver plus non-empty required status checks. Free-tier attestation limits are accepted only if recorded in .claude/process-state.json under phase2_init.attestations.branch_protection.reason. Carve-out worth knowing: in CI with no host token exported, the check reports "could not run" and does not block; run locally it blocks.
  • Personal → organizational upgrades: a genuinely non-blocking recurring WARN until the Retroactive Phase 1 → 2 STA Approval row is filled — this arm deliberately omits the issue increment. It is one of the few WARNs on this page that really is only a nudge.

What you do

  • Answer clarifying questions when the AI asks.
  • Review test assertions and code diffs for each feature.
  • Every ~2 features: run a UAT session and triage any bugs found.
  • Mark bugs Fix Now / Defer / Won't Fix / Post-MVP.
6

Phase 2 · Construction (Build Loop)

Build features one at a time, TDD-first, with security review baked in. Full sub-loop shown below.

Produces: working codebase + passing tests + docs + audit trail.

What the framework does

  • Runs the Feature Build Loop for every feature (detailed diagram below).
  • Enforces the Build Loop checklist on feat: commits: from Phase 2 onward, process-checklist.sh requires the first five of six steps (tests_written → documentation_updated) before allowing the commit. Other prefixes (chore:, fix:, refactor:) bypass this check — it is scope-limited, not universal. They do not bypass the TDD ordering gate, which fires on feat/fix/refactor alike.
  • TDD ordering is tier-keyed, not warning-only. A commit that ships implementation with no accompanying test is a HARD BLOCK on organizational / Sponsored-POC projects and a logged warning on personal / Private-POC ones — keyed on deployment + poc_mode, never the spoofable track. The only escape is SOLO_TDD_ATTESTED=1 with a reason, recorded to process-state.json::tdd_attestations[]; if that record cannot be written the commit is still refused.
  • Runs gitleaks + Semgrep (staged files) on every commit — both live in the generated .git/hooks/pre-commit, and both block on a hit. Agent-issued --no-verify is denied outright, and commits that get through out-of-band are captured by the SessionStart detector in .claude/bypass-audit.json.
  • Blocks gh pr create when a UAT session is in progress with < 9 of 9 steps completed, or when a Build Loop is active with 1–4 of its 5 required steps recorded.
  • Test-gate reminds you when features_since_last_test reaches the interval (default 2, set with --set-interval N); you invoke scripts/test-gate.sh --check-batch to trigger the UAT.
  • Blocks Phase 2 → 3 on any open SEV-1 OR any SEV-2 (open OR deferred — deferred SEV-2 must be resolved or the feature removed; no third option).
  • Organizational: biweekly Mid-Phase 2 Governance Checkpoint with the Senior Technical Authority — a 30-minute maximum status review of features delivered vs Bible scope, architectural deviations from the Phase 1 design, test-pass-rate trend, unresolved security findings, and the risk-register delta. The STA does not approve or block at this cadence; it is course-correction, not a gate. Escalation is a separate path with its own triggers (budget/timeline overrun > 20%, cross-business-unit scope, a security finding beyond the Orchestrator's competency, a data-classification dispute, an unresolvable license concern).

Your approval unlocks Phase 3

  • Personal: self-review in APPROVAL_LOG.md.
  • Organizational: Senior Technical Authority signs.
  • Reconcile scope against the Manifesto MVP Cutline. The mechanical check compares the Manifesto's Must-Have bullet count against .claude/build-progress.json::features_completed and flags a mismatch in either direction. The "additions require documented orchestrator approval" rule is prose guidance — nothing verifies an approval record.
✓

Phase Gate 2 → 3

Bug gate blocks; MVP-Cutline reconciliation required. Snapshot: docs/snapshots/phase-2-to-3_YYYY-MM-DD/.

check-phase-gate.sh → test-gate.sh --check-phase-gate

What the framework checks

  • Dated "Phase 2 → Phase 3" entry in APPROVAL_LOG.md.
  • FEATURES.md and CHANGELOG.md exist — the gate tests presence only, not content. (A separate advisory in test-gate.sh notices an empty FEATURES.md; CHANGELOG.md is never checked for content by any gate.) Both arms print [WARN] and both block.
  • Bug gate via test-gate.sh --check-phase-gate: SEV-1 open > 0 → BLOCKED; SEV-2 open > 0 → BLOCKED; SEV-2 Deferred > 0 → BLOCKED (must resolve or remove the feature). SEV-3 open prints WARN and blocks too — it makes test-gate.sh exit 2, and the caller increments its issue counter on exit 2. So does "no bug tracking source found."
  • Read the increment, not the label. In check-phase-gate.sh the [WARN]/[FAIL] text is cosmetic — the exit predicate is zero issues. Nearly every WARN on this page increments and therefore blocks; the exceptions are called out individually.

What you do

  • Walk the mechanically-enforced 9-step Phase 3 checklist (process-checklist.sh --start-phase3): integration testing, security hardening, chaos testing, accessibility audit, performance audit, contract testing, results archived, pre-launch preparation, legal review.
  • Run evaluation-prompts/Projects/run-reviews.sh <module> to produce the six adversarial reviewer reports. Security + Red Team are REQUIRED on Standard and Full — a missing one is a hard FAIL at the Phase 3 → 4 gate; Full additionally requires all six. Light is warn-only, with the bypass logged. Address all Critical / High findings.
  • Personal: self-review recorded. Organizational: gather written sign-offs from both Application Owner AND IT Security — see the Gate 3 → 4 row below.
  • Security-domain "No" or "Partially" on the Competency Matrix → mandatory Security Peer Review at Phase 3 before go-live, regardless of track (governance-framework.md § V › "Security Peer Review (Competency-Gated)").
7

Phase 3 · Validation & Security

Nine substeps + adversarial reviews + track-specific pen test + attorney legal review. Exit rule: zero Critical or High-severity findings.

Produces: docs/test-results/ archive, sbom.json, HANDOFF.md, docs/INCIDENT_RESPONSE.md, SECURITY.md, docs/eval-results/review-manifest.json, penetration test report (Std+).

What the framework does

  • 3.1 Integration Testing — Platform Module E2E suite over the full User Journey.
  • 3.2 Security Hardening — Semgrep (--config=p/owasp-top-ten --config=p/security-audit) + Snyk + gitleaks + license check + SBOM (CycloneDX/syft) + threat-model validation. Web: OWASP ZAP baseline (all tracks) / active (Full). You (or the agent) archive the artifacts to docs/test-results/[date]_[scan-type]_[pass|fail].[ext] — that naming convention is the guide's, not an automatic writer's. The one script that writes results itself is scripts/run-phase3-validation.sh, into docs/test-results/phase3, and since BL-070 all five of its registered scanners really run.
  • 3.3 Chaos & Edge-Case Testing — input abuse defenses, error recovery, concurrency protection, resource limits, global error boundaries.
  • 3.4 UX & Accessibility Audit — WCAG AA baseline; Lighthouse ≥ 90 for web; Full Track requires explicit screen-reader testing.
  • 3.5 Performance Audit — latency vs data contract, memory stability, minimum-supported-hardware validation.
  • 3.5.5 Contract Testing (Std+, for applications with interfaces other systems consume — APIs, IPC, file formats); 3.5.7 Load/Stress Testing (Full only, if applicable — Standard does not require it).
  • 3.5.9 Test Results Archive — docs/test-results/ is referenced from the Phase 3 → 4 APPROVAL_LOG entry and folded into HANDOFF.md.
  • 3.6 Pre-Launch Preparation (Std+) — Final UAT with formal acceptance sign-off (Sponsored POC / Production); MANDATORY attorney review of Privacy Policy AND Terms of Service recorded in APPROVAL_LOG (builders-guide.md §Phase 3.6); license audit passing; trademark search.
  • Six evaluation prompts are operator-invoked via run-reviews.sh. Personas: Senior Engineer (01), CIO (02), SVP IT Security (03), Corporate Legal (04), Technical User (05), Red Team (06). A missing docs/eval-results/review-manifest.json BLOCKS the Phase 3 → 4 gate — under track-aware enforcement it prints FAIL, and even the plain "manifest not found" arm increments the issue counter. A manifest with zero completed reviews blocks too; only a partial manifest on a light or grandfathered track takes the truly non-blocking arm. scripts/lint-review-manifest.sh validates the file's shape only and says so — an absent manifest is a gate concern, not a schema concern.

The heaviest gate — governance sign-offs required

  • Personal: self-review recorded in APPROVAL_LOG.md (single approver).
  • Organizational — dual approval: BOTH Application Owner Approval AND IT Security Approval subsections in APPROVAL_LOG.md must have populated Date rows.
    • Application Owner: accepts operational risk + go-live readiness.
    • IT Security: reviews scan results, penetration test, threat-model validation, risk acceptance.
    • Each subsection is verified independently by validate_approval_section_dated — header presence alone does not satisfy the gate.
    • Approvers must author their own commit (anti-self-approval via per-line git blame; org projects FAIL on self-approval).
  • Attorney/Legal review recorded for Privacy Policy + ToS if applicable (external users).
  • ITSM deployment change ticket referenced in the Phase 4 Completion row.
  • Sponsored POC / Production Full UAT: formal acceptance sign-off by product sponsor or designated tester.
  • See governance-framework.md §V Approval Authority row for Phase 3 → 4.
✓

Phase Gate 3 → 4

Two written signatures (org), pen test on Std+, artifact roster, hard-block for POC. Snapshot: docs/snapshots/phase-3-to-4_YYYY-MM-DD/ — the point-in-time audit record.

scripts/check-phase-gate.sh

What the framework checks

In scripts/check-phase-gate.sh: the region opened by # Phase 3→4 readiness region, plus the functions validate_approval_section_dated, _cpg_gate_has_evidence and create_gate_snapshot, and the marker families # BL-073-ESCALATE, # BL-104-MANIFEST-ARM, # BL-070-GATE-CHECK and # BL-115-DATE-CELL.

  • Dated "Phase 3 → Phase 4" entry — the date must sit in a | Date | row within the first 15 lines of that section, not merely somewhere nearby.
  • Organizational: BOTH Application Owner AND IT Security Date rows populated. A template's placeholder [Date] or YYYY-MM-DD does not count. Either missing → the gate fails (printed as [WARN], but it increments).
  • Required artifacts — every one of these blocks, whatever label it prints: HANDOFF.md, docs/INCIDENT_RESPONSE.md, sbom.json, non-empty docs/test-results/, SECURITY.md, and docs/eval-results/review-manifest.json. SECURITY.md is not advisory — the "WARN if missing" wording in the Builder's Guide is cosmetically true and materially false.
  • Phase 3 checklist cross-check: the gate blocks at 0/9 steps and at 1–8/9.
  • Penetration test: Standard track requires *pen-test* / *pentest* / *penetration* files in docs/test-results/, or an exemption recorded in APPROVAL_LOG.md — note the exemption grep does not verify it came from IT Security. Full track has NO exemption path. On Standard, having neither also blocks.
  • POC hard-block: if poc_mode is set in .claude/phase-state.json, Phase 4 is BLOCKED with ::error::. Points at scripts/upgrade-project.sh --to-production, which walks the six numbered Pre-Phase 0 rows (or requires --ack-preconditions=<N1,N2,…> — the value form is mandatory — recorded in .claude/bypass-audit.json).
  • Release pipeline TODO check: unconfigured TODOs in the release workflow block. Note the path is hardcoded to .github/workflows/release.yml, so on GitLab and Bitbucket projects — where init writes .gitlab-ci/release.yml and bitbucket-pipelines/release.yml — this check silently never fires.
  • Bug gate (via test-gate.sh --check-phase-gate) must pass. Its warning exit code blocks here as well as its failure code.
  • On PASS only, and only if no such directory exists yet: a snapshot at docs/snapshots/phase-3-to-4_YYYY-MM-DD/ containing PRODUCT_MANIFESTO / PROJECT_BIBLE / FEATURES / CHANGELOG / BUGS / USER_GUIDE / HANDOFF / RELEASE_NOTES / APPROVAL_LOG / sbom.json, plus docs/INCIDENT_RESPONSE.md and a test-results-listing.txt (a listing, not the files). See builders-guide.md § Phase 3 → Phase 4 Gate › "Gate-Checked vs. Snapshot-Only Artifacts".
  • Enforcement decisions are appended to .claude/bypass-audit.json — the durable audit ledger. Routine clean passes are no longer among them: a clean terminal commit writes an untracked .claude/last-gate-pass.txt receipt instead, and the ledger's terminal_commit_passed type survives as schema-valid legacy.

What you do

  • POC → Production upgrade first: Phase 4 is hard-blocked for poc_mode projects at BOTH check-phase-gate.sh AND process-checklist.sh --start-phase4. Run scripts/upgrade-project.sh --to-production BEFORE Phase 4 can start.
  • Walk the 6-step Phase 4 checklist: production build, rollback tested, go-live verified, monitoring configured, handoff written, handoff tested.
  • Kick off the release (signing keys, store credentials, deploy) using your chosen strategy: cut-over (Light, internal tools), blue/green (Std+ web), rolling/canary (Std+ with >1,000 users — route 5–10% of traffic first), feature flags (high-risk features on any track).
  • Update RELEASE_NOTES.md and hand off to users.
  • Organizational: file the ITSM deployment change ticket (ID recorded in the APPROVAL_LOG Phase 4 Completion row); the backup maintainer validates HANDOFF.md — two tasks, from that document alone: set up a development environment from zero, and triage a simulated production issue.
8

Phase 4 · Release & Maintenance

Ship the MVP with a tested rollback and verified monitoring. Then maintain on a two-cadence schedule — and everything after this arrives through the Delta Track.

Produces: the release (signed where the platform requires it — desktop and mobile release pipelines sign; the web ones do not), RELEASE_NOTES.md, HANDOFF.md, docs/INCIDENT_RESPONSE.md (SEV-1..SEV-4 severity matrix + notification chains), monitoring configuration, Phase 4 Completion row in APPROVAL_LOG.md. CHANGELOG.md is not new here — it is a Phase 2+ artifact this step updates.

What the framework does

  • Runs the release pipeline for your platform — build, package, distribute, and sign on desktop/mobile. The path is host-conditional: .github/workflows/release.yml on GitHub, .gitlab-ci/release.yml on GitLab, bitbucket-pipelines/release.yml on Bitbucket.
  • MANDATORY rollback test BEFORE go-live (Step 4.1.5): deploy candidate → execute documented rollback → verify data integrity + revert. "A rollback procedure that has never been tested is not a rollback procedure — it is a hope."
  • MANDATORY monitoring verification (Step 4.3): trigger a test error, confirm the alert was received. "Configured is not verified."
  • PLATFORM MODULE MANDATORY go-live checklist (Step 4.2): SSL/security headers (web), code signing/auto-updater (desktop), app-store metadata & certificates (mobile). Failure may result in deployment rejection.
  • Updates CHANGELOG + RELEASE_NOTES with what shipped.
  • Turns on the maintenance cadence. There are two, not four: a routine review every 14 days (signal: the last commit touching CHANGELOG.md, and the last touching sbom.json) and a deep security scan every 95 days with the dependency audit folded into it (signal: the newest dated scan artefact in docs/test-results/). Both windows are project-owned policy, not constants, read through the delta-policy seam. Measured on demand by scripts/check-maintenance.sh, nagged at session start by scripts/session-cadence-check.sh, and enforced at the tag by scripts/cut-release.sh. The separate 95-day dependency row and 185-day biannual row were merged into one 95-day cadence, and 185→95 and 35→14 were deliberate tightenings — see the Delta Track.
  • Records the release + all post-launch changes in the APPROVAL_LOG "Approval History" table; the point-in-time docs/snapshots/phase-3-to-4_YYYY-MM-DD/ stays immutable — the writer returns early rather than overwrite an existing snapshot.
  • The journey does not end here. Every change after the v1.0.0 tag goes through the Delta Track below. Note that nothing in the enforcement path points you there: check-phase-gate.sh knows nothing about deltas, and neither process-checklist.sh's completion message nor resume.sh's phase-4 greeting names scripts/delta.sh. Your project's CLAUDE.md and the Builder's Guide § Step 4.6 are where that pointer lives.

Zoom in: The Feature Build Loop (inside Phase 2)

This is the sub-loop that runs for every single feature. It's the heartbeat of Phase 2 — a disciplined cycle that guarantees each feature ships with current library knowledge, a passing test, a security review, and a red-team review before it's marked complete. If any review flags an issue, the loop restarts at the fix step; nothing is approved on the first try if it isn't ready.

STEP 1 · convention

Context7 Docs Review

AI queries Context7 for current documentation on any libraries in play, preventing "I remember the API from training data" errors. This is a convention, not a Build Loop step — the Builder's Guide's loop opens at "write the test first". What is real is a non-blocking commit-time reminder: a usage tracker counts commits since the last Context7 call and the gate appends a warning, never a block.

STEP 2

Write the Test First

AI writes the test that describes what "working" means for this feature. Runs it — confirms it FAILS (Red). This proves the test actually tests something.

STEP 3

Write the Code

AI writes the minimum implementation needed to make the test pass (Green). No over-building.

STEP 4

Refactor

Clean up the implementation now that it works: better naming, remove duplication, tighten boundaries. Tests stay green throughout.

STEP 5

Commit-Time Gates

The generated pre-commit hook runs gitleaks (blocks on hit) and Semgrep on staged files (blocks on hit). The TDD file-ordering check runs in the commit-msg hook, not pre-commit — git only writes the message file after pre-commit has run — and it is tier-keyed: a hard block on organizational / Sponsored-POC projects, a logged warning on personal / Private-POC ones. Not warning-only.

STEP 6

Security Audit

Senior Security Engineer persona reviews the change: injection, authz, secrets, data isolation, N+1, structured logging. Findings live in docs/security-audits/<feature-slug>-security-audit.md, and the gate parses that file's verdict line — an audit reading "CRITICAL — VULNERABLE" does not pass. process-state.json's build_loop.steps_completed is a plain array of step names; it records only that the step happened.

STEP 7

Documentation Updated

Parallel doc updates: CHANGELOG.md, FEATURES.md, interface docs, ADR (if applicable), Bible update. Enforced as a mandatory Build Loop step.

STEP 8

Iterate If Needed

If steps 5–7 raised issues: back to Step 3 to fix, then re-run 4–7. Loop continues until reviews are clean. (Context7, Refactor, Red Team and Iterate are AI conventions — not framework-enforced Build Loop steps. Red Team is enforced, but at the Phase 3 → 4 gate, not per feature.)

STEP 9

Feature Recorded

Feature is added to FEATURES.md; build progress is recorded in .claude/build-progress.json; test-gate.sh --record-feature appends the feature and bumps the UAT counter. Marked complete in process-state.json.

Enforced vs documented: process-checklist.sh mechanically enforces six Build Loop steps: tests_written → tests_verified_failing → implemented → security_audit → documentation_updated → feature_recorded. The Context7 lookup, Refactor, Red Team Review and Iterate steps above are AI conventions, not gate-blocking on their own. From Phase 2 onward the feat:-commit gate blocks a commit until the first five of those six are complete (feature_recorded is explicitly not required at commit time); other prefixes bypass this check. They do not bypass the TDD ordering gate, which fires on feat, fix and refactor alike.
Every ~2 features (configurable): the loop pauses for a UAT session driven by scripts/test-gate.sh --check-batch. Parallel AI agents (automated testing, malicious user, cross-platform) test the app alongside you. Bugs get triaged into SEV-1 (must fix before release) through SEV-4 (nice to have) and assigned a disposition (Fix Now / Defer / Won't Fix / Post-MVP). Fix-Now bugs re-enter the Build Loop. The framework will refuse to advance Phase 2 → 3 while any SEV-1 is open OR any SEV-2 is open OR deferred (SEV-2 must be resolved or the feature removed; no third option).

After v1.0: the Delta Track

Phases 0 through 4 take a product from an idea to a tagged v1.0.0. Then the map ends and the product starts living: users ask for things, bugs arrive from real usage, a dependency advisory lands at three in the morning. The delta track is the loop for that. One unit of post-1.0 change is a delta. You say what you need in plain words, answer one question about what kind of change it is, and the track works out how much ceremony it owes, what has to be true before it can close, and what version it ships in.

scripts/delta.sh, scripts/cut-release.sh, scripts/check-maintenance.sh, scripts/session-cadence-check.sh and the four scripts/lib/delta-*.sh libraries are installed into your generated project by init.sh — run them from there. The two that write refuse outright if you run them inside the framework clone, including for --help. See docs/delta-track.md.

The track cannot start early

Phase 4 completion is the entry condition

A delta can only be opened when .claude/phase-state.json says current_phase is exactly 4. The invariant is a delta is open ⇒ the project is at phase 4, and scripts/delta.sh --open is its load-bearing enforcement point. Refusal is exit 3: "This project is not finished yet, so there is nothing to maintain."

Marker # DELTA-OPEN-ERA-GUARD. Equality, not >=.

Why the gate exists

Post-release maintenance ceremony is cheaper than building the product properly. Without this refusal, a project that found Phase 1 hard could discover that opening "deltas" is an easier way to write code — and the cheaper path always wins. The delta track is a loop inside phase 4, not a sixth phase, and current_phase never moves again.

--status works at any phase and simply tells you where you are.

One question, four classes

ClassYour situationWhat it buys you
feature "I want the product to do something new" Full ceremony — a brief, an adversarial review of that brief before you build, the Build Loop, a close review, a changelog entry
fix "Something is broken; it can wait for the normal loop" A reproduction test written RED first, a lighter close
hotfix "Something is broken now, in production" Speed — the standing safety checks and nothing heavier — paid for with a write-up that blocks the next release until it is filed
security-patch "Someone could exploit this" Fix ceremony plus a forced dependency scan, an SBOM refresh, and a flagged release note

Two attribute toggles add gates on top of the class list: risk: core adds brief_review, and level: evolution adds brief. A third toggle (touch_trigger → threat_model_refresh) ships in the policy schema and is inert — delta-classify.sh deliberately does not apply it (“a §8.1 re-fire trigger keyed on what gets touched during the work, not an attribute confirmed at open”), so filling in risk_surfaces does not make a threat-model-refresh gate appear. All of it is retunable in .claude/delta-policy.json, which ships with risk_surfaces empty — until you fill it in, every delta reads feature-local, and the tool says so on every open rather than hiding it.

Confirm, don't quiz

You answer one thing. Class, severity, risk and level are each proposed with their reasoning and their provenance shown — a proposal whose provenance is hidden is a quiz with extra steps. Non-interactively, --confirm accepts the four lines as they stand; with no terminal and no --confirm the run refuses rather than guessing.

The class proposal is a wording heuristic and it is wrong sometimes — read the four lines before you confirm them, and override with --class, --risk, --level or --severity. Raising an attribute is free; lowering one records a reason.

One delta at a time — structurally

The state file holds a single active_delta slot rather than an array, so "one at a time" is a property of the schema and not a rule someone has to remember. A second open is refused by name, exit 4.

Most gates are your word; two are checked

--complete-gate <name> records a gate and says so plainly: "This is your word for it — the record now says you did it, and nothing here re-checks it." The two the tool checks for itself are the tick-boxes in your brief and how big the change actually turned out to be, both at close.

The brief — and the one section a program reads

## Done-observable is the close review

A brief has five sections — What, Why, Done-observable, Must-not-change, Touched surfaces. Four are for humans. Done-observable is parsed, and it is the whole review at the end. You write it at the start, before you are invested in how you built the thing.

Criteria are list items with a bracketed single character. - [x] is done; anything else between the brackets counts as not done and is named in the refusal — an undefined marker is a criterion nobody has decided about.

It fails closed

No brief file, two files claiming the same id, no Done-observable heading, or a heading with no checkboxes under it are each a refusal to close (exit 8). An empty rubric would let the work close on nothing at all. Two Done-observable headings are both read and their criteria pooled — there is no "first one wins".

The close-time ratchet

Re-measured from what you actually changed

At open the diff is usually empty, so risk and level are forecasts. At close they are re-derived from the real diff. A re-derivation that lands in a higher bracket raises the attribute, and the raise is announced, not silent: "It only ever goes up — a smaller change later never talks it back down."

A raise that crosses a toggle gains a gate, and the close refuses on it (exit 10). Without the ratchet, a delta opened small and grown into an auth rewrite would close on the small checklist.

Two honest limits

level is lines changed, and lines are a poor proxy — a 12-line auth change is riskier than a 900-line locale file. That is exactly why risk is a separate axis derived from paths, and why you can raise either freely.

And risk is only as good as risk_surfaces, which ships empty. A framework-guessed default would be wrong for most projects and, worse, would look authoritative.

The hotfix lane and its debt

It defers the review; it does not skip it

A hotfix ships on the standing floor plus an audit row. That borrows the checking a normal change goes through, and the loan is collateralised: the retro row is written at OPEN, not at close, with a due date (default 3 days), and it outlives the delta. Close the hotfix and the row is still there.

A hotfix carries no separate close_review because the retro is that review, arriving late — giving it both would let a hotfix satisfy the review at ship time and make the retro optional, which is the loan going unrepaid.

An open retro blocks the next release

cut-release.sh refuses with exit 4 while any hotfix still owes its write-up, naming each one and its due date. File it with scripts/delta.sh --retro DELTA-NNN --record "…", taking either a path to a file you wrote or the short version in quotes. The write-up is write-once.

The honest limit: the release refusal is the only thing that ever collects. A project that simply stops cutting releases leaves the debt uncollected, with the session-start nag as the only other pressure. That is a real limit of the mechanism, not a gap in it.

The maintenance cadence — two clocks, both policy

CadenceSignal it readsDefault windowPolicy key
Routine review last commit touching CHANGELOG.md, and last touching sbom.json 14 days cadence.routine_review_days
Deep security scan
(dependency audit folded in)
newest dated file in docs/test-results/ matching *snyk*, *dep*, *audit*, *semgrep* or *sast* 95 days cadence.deep_security_days

Markers # CADENCE-DEFAULT-ROUTINE and # CADENCE-DEFAULT-DEEP; both are read through the delta-policy seam (# CADENCE-POLICY-READ), so they are project-owned policy, not constants. The previously separate 95-day dependency row and 185-day biannual row are now one cadence at 95, and both windows were deliberately tightened (185→95 and 35→14).

Three answers, and the third is the point

scripts/check-maintenance.sh exits 0 (every applicable cadence measured and current), 1 (one or more overdue), or 2 (one or more could not be measured, and none is overdue).

A release cut refuses on 1 AND on 2. Unmeasurable is not a pass — a cadence nobody could read must not be silently satisfiable at a tag. 2 is deliberately the zero-overdue code, so a real overdue is never hidden behind an unreadable date.

A surface you do not have is not a failure

No sbom.json reports not applicable and moves no counter. The tool measures cadences you keep; it does not audit whether you keep them.

scripts/session-cadence-check.sh is a SessionStart nag: silent when nothing is wrong, and it exits 0 either way — a nag that could fail a session start would be a worse problem than a stale cadence.

What a green cadence does not prove

Two of these signals are dates parsed out of filenames. A file named with today's date and containing nothing satisfies the cadence completely; so does a freshly-dated empty directory. Worse, *dep* matches a deployment-notes-2026-08-10.md. The windows make the schedule stricter; they do not make the evidence stronger.

Put a real scan artefact in docs/test-results/ because you want the scan, not because you want the gate to pass.

Cutting a release

bash scripts/cut-release.sh refuses three times before it writes anything at all, in this order — cheapest and clearest first. No write of any kind happens before all three pass: a partially-cut release (changelog promoted, tag absent) is a worse state than a refused one, because it is a repository whose changelog claims a version no tag names.

The three refusals

1 · An open delta (exit 3) — a release names what is finished, and open work is neither in it nor out of it.
2 · An unfiled hotfix retro (exit 4).
3 · An overdue or unmeasurable cadence (exit 5) — the expensive one, which is why it speaks last.

Semver is decided by the tool — no override

Any closed row carrying a breaking marker ⇒ major (plus a full run-phase3-validation.sh re-run before the tag); else any feature ⇒ minor; else patch; nothing closed ⇒ refuse.

There is no override flag, and the script rejects the version-override spellings someone will reach for first. An operator who disagrees has to change what they shipped or move the tag by hand outside the tool. The class→bump map is retunable; the precedence is machinery, because a project that could reorder it could make a feature release a patch.

The tag format is constrained, not chosen

The cut emits exactly vMAJOR.MINOR.PATCH — no -rc1, no -beta, no two-component tag — and checks its own output against that regex before using it. The reason is a measured asymmetry in the shipped release lanes: GitHub and Bitbucket match v*, but GitLab matches /^v\d+\.\d+\.\d+$/. A v1.2.0-rc1 would build on two hosts and silently do nothing on the third.

Marker # CUTREL-TAG-FORMAT.

Read the banner and re-tag

The tool tags before you commit the changelog promotion, so the tag as created points one commit too early. The run prints a loud banner: git tag -f vX.Y.Z after the release commit is not optional. Nothing has been pushed at that point, so moving it is free — and a pipeline that builds a release whose changelog does not contain this version goes green while publishing the wrong thing.

The cut closes the ledger rows it shipped

BUGS.md goes Open → Fixed with the version appended to the existing Fix Reference cell; a FEATURES.md block's **Status:** becomes Complete (shipped in vX.Y.Z). A FEATURES block that does not carry a **Phase Built:** line naming the delta is not matched at all — the safe direction, but real for a FEATURES.md that predates the delta track.

Exit 12 means "the release is real, the paperwork is not." The changelog was promoted, shipped_in was recorded and the tag exists — so it is not failed for a ledger problem — but one or more rows could not be closed and every one of them is named. The next cut will not offer them again; close them by hand from the list the cut printed.

Known and recorded — so the page does not overstate

Always Running in the Background

These aren't steps — they're guardrails that run automatically no matter which phase you're in. You never have to remember to invoke them; the framework does it for you and refuses to proceed if something is off.

Phase Gate Enforcement

Every phase-to-phase transition requires a written approval in APPROVAL_LOG.md plus completed gate criteria. Enforced by check-phase-gate.sh. On PASS, an immutable point-in-time snapshot is written to docs/snapshots/phase-N-to-M_YYYY-MM-DD/, with per-gate contents. Note the gate does not run your test suite — the delegation it makes is to the bug gate, and only from phase 3 onward.

Enforcement Level (strict / light / no)

Recorded in .claude/manifest.json::enforcement_level. Strict is the default and is forced for organizational Sponsored POC + Production; it installs .git/hooks/framework-gate.sh which blocks user-terminal commits that violate the classifier. Light and No relax coverage. Every transition is recorded as an enforcement_level_set row in the audit ledger.

Bypass Audit Ledger

.claude/bypass-audit.json is the append-only, git-tracked audit trail. The schema defines nine row types, all with live writers: claude_bypass_proposal, terminal_commit_blocked, terminal_commit_passed (legacy — routine clean commits no longer emit it), out_of_band_commit, enforcement_level_set, escalation, detector_error, sast_suppression, and adoption_event (new with brownfield adoption). SessionStart runs detect-out-of-band-commits.sh against the last-checked-commit baseline. Guarantee: "you can route around the block, you cannot route around the audit." See docs/audit-log-lifecycle.md.

Pending-Approval Sentinel

.claude/pending-approval.json signals a structured A/B/C decision to the operator. While present, the pre-commit gate blocks git commit and gh pr create — the agent cannot rationalize a unilateral commit while you are still deliberating.

Session Hooks

Every time you start the AI, six SessionStart hooks run: version check, test-gate check, freshness check, intake check, maintenance-cadence nag, and the out-of-band commit detector. If the Development Guardrails are out of date or the test-gate is red, you are told before any work begins. A seventh hook fires on session end (the Qdrant reminder).

The MCP-usage gate is not a SessionStart hook. It runs on Write and Edit, so it blocks file modifications rather than commits.

Live Docs (Context7)

When Context7 is configured as an MCP server, the framework requires at least one lookup per session before allowing a Write or Edit — the gate is bound to those tools, not to commits, and its own message says "before writing". One call per session satisfies it, not one per library. Separately, a non-blocking commit-time warning appears if Context7 has not been consulted in the last couple of commits.

Persistent Memory (Qdrant)

When Qdrant is configured as an MCP server, the gate requires at least one qdrant-find call per session — retrieve prior context before starting work. A qdrant-store call does not satisfy it: the tracker records both flags but the gate reads only the find one. Decisions, review findings and context notes are stored in a local semantic memory the AI can search across sessions — so it remembers why something was done, not just what.

Audit Trail

Every phase gate, every UAT session, every bug disposition, every release — all recorded in APPROVAL_LOG.md, docs/snapshots/, docs/test-results/, sbom.json, and .claude/bypass-audit.json. Seven canonical jq recipes in docs/audit-log-lifecycle.md support cold-pickup successor handoff (the W7 use case) — the newest reads what a brownfield adoption's collision archive took.

Organizational Governance (opt-in)

If you selected "organizational" deployment: IT Security (Pre-Phase 0), Project Sponsor (Phase 0 → 1), Senior Technical Authority (Phase 1 → 2 and 2 → 3 — on personal projects 2 → 3 is self-approved), Application Owner + IT Security (Phase 3 → 4), Attorney (Privacy Policy + ToS, inside Step 3.6), ITSM ticket linkage (Phase 4 Completion row). Each sign-off is verified with per-line git blame; anti-self-approval is a FAIL, and so is every "cannot verify" arm. The Pre-Phase 0 roster (six named rows) must be dated before Day 1. POC modes let you defer parts of that roster; upgrade-project.sh --to-production is the only way to unlock Phase 4 from a POC.

Gate Denial Path

When an approver denies a gate: written findings required, rework limited to cited deficiencies, maximum 2 rework cycles before escalation to the Project Sponsor. Every denial and re-submission is recorded in APPROVAL_LOG.md. See governance-framework.md §V Gate Denial.

Plain-English Glossary

TDD (Test-Driven Development)
Write the test first (it fails), then write just enough code to make it pass, then clean up. Guarantees the code does what the test says it does.
SAST
Static Application Security Testing — automated tools that read your code (without running it) and look for known unsafe patterns.
DAST
Dynamic Application Security Testing — attacks a running copy of your app to find real vulnerabilities from the outside.
UAT (User Acceptance Testing)
Sessions where a human — plus AI agents in this framework — actually use the app and try to break it or confirm it does what users need.
Phase Gate
A checkpoint between phases. The framework refuses to advance until specific artifacts exist, specific tests pass, and (for organizational Phase 3 → 4) BOTH Application Owner and IT Security have written signed approvals in the log.
MVP
Minimum Viable Product — the smallest useful version worth releasing. The framework's target for a first release.
Sponsored POC
Organizational-only POC mode: the organization knows and has approved. Requires AI-deployment-path approval + named sponsor (rows 1 & 4) up front; defers rows 2, 3, 5 and 6 — insurance, liability entity, backup maintainer and ITSM. Phase 4 hard-blocked until upgrade-project.sh --to-production. Note: several guides add "exit criteria" to that deferred list, but it is not one of the six APPROVAL_LOG rows the tooling parses — it is tracked elsewhere, and the governance framework says it is required up front rather than deferred.
Private POC
Personal-only POC mode: all six Pre-Phase 0 pre-conditions deferred. Same technical rigor as Production Build; NO real user data, NO external users, NO production deployment until upgraded.
Track (Light / Standard / Full)
Depth of Phase 3 rigor. Light skips the Business Strategy Gateway, Market Signal Validation, Revenue Model, Trademark & Legal pre-check, contract testing and Std+ pre-launch preparation. Standard adds those, and requires Security + Red Team reviews and a penetration test (with an IT Security exemption available). Full requires all six evaluation reviews, screen-reader accessibility testing, a penetration test with no exemption path, and is the only track that requires load/stress testing.
Enforcement Level (strict / light / no)
Field in .claude/manifest.json. Strict installs a filesystem-gate hook that blocks user-terminal commits violating the classifier; light logs but allows; no does not enforce. Forced strict for organizational Sponsored POC + Production.
ZDR (Zero Data Retention)
Mandatory Phase 1 → 2 gate (Invariant #16). Projects with data classification of internal or higher must attest ZDR (or record a written exception). Enforced by check-phase-gate.sh as a FAIL. Public projects are exempt.
APPROVAL_LOG.md
Append-only audit trail of every phase-gate approval. Tamper-evident via git history; anti-self-approval enforced via per-line git blame. Includes an Approval History table for post-launch changes.
Phase Gate Snapshot
Point-in-time immutable copy of key documents at each phase transition. Auto-created by check-phase-gate.sh at docs/snapshots/phase-N-to-M_YYYY-MM-DD/, only when the gate passes and only if that directory does not already exist. Contents are per-gate, widening as the project grows: 0→1 takes Manifesto + APPROVAL_LOG + PROJECT_INTAKE + docs/phase-0/; 1→2 takes Bible + Manifesto + APPROVAL_LOG; 2→3 takes Bible + FEATURES/CHANGELOG/BUGS + APPROVAL_LOG (the Manifesto drops out here, and returns at 3→4); 3→4 is the full set (Manifesto, Bible, FEATURES, CHANGELOG, BUGS, USER_GUIDE, HANDOFF, RELEASE_NOTES, APPROVAL_LOG, sbom, INCIDENT_RESPONSE, plus a listing of docs/test-results/).
Bypass Audit Ledger
.claude/bypass-audit.json — append-only, git-tracked, atomic-write JSON ledger recording every enforcement decision, bypass attempt, and out-of-band commit. The framework's guarantee: "you can route around the block, you cannot route around the audit."
Product Manifesto
The one-page product agreement produced at the end of Phase 0. What we're building, for whom, and what's out of scope.
Project Bible
The architecture + planning document produced at the end of Phase 1. Decisions, diagrams, threat model, and test plan.
ADR (Architecture Decision Record)
A short note explaining why a specific architectural choice was made (and what alternatives were rejected). Written when the decision is made, not months later.
Threat Model
A structured list of "what could an attacker do?" scenarios, plus what mitigation exists for each. Verified in Phase 3.
Red Team Review
An adversarial review that assumes the worst and tries to find failure modes: edge cases, hostile inputs, misuse. It is a Phase 3 evaluation prompt (reviewer 06), enforced at the Phase 3 → 4 gate on Standard and Full via the review manifest — not a Build Loop step. The per-feature review that is enforced is the security audit.
Context7
An MCP tool that fetches current library documentation on demand. Prevents the AI from using outdated API knowledge.
MCP (Model Context Protocol)
A standard way for AI agents to talk to external tools and services (documentation lookups, memory stores, code search, etc).
Development Guardrails for Claude Code
The git-hook-based guardrail layer (sometimes called CDF / Claude Dev Framework) that gets installed alongside your project. Clones from kraulerson/claude-dev-framework. Provides pre-commit hooks, SessionStart hooks, and the framework-gate that (in strict mode) refuses to accept commits which break the rules.
Anti-Self-Approval Check
For organizational deployments only, check-phase-gate.sh runs git blame --line-porcelain on the specific Approver row and FAILs if the committer of that line matches the approver's name. Personal deployments skip this check.
SEV-1 / SEV-2 / SEV-3 / SEV-4
Bug severity levels. SEV-1 = data loss, security breach, crash on a core flow, complete feature failure; SEV-2 = feature broken but a workaround exists; SEV-3 = minor UX or cosmetic; SEV-4 = enhancement or polish. Phase 2 can't finish while any SEV-1 or SEV-2 is open — or deferred, in SEV-2's case.
Brownfield Adoption
The second entrance: bringing a codebase that already exists under the framework, via scripts/adopt-project.sh rather than init.sh. It asks one question — who is this project for?, which sets the enforcement tier — lands the project at phase 0 like every other, writes state fail-safe and commits exactly the files it wrote. Half built — the assessment, the CI carve-out and the Adoption Record do not exist; the certification pass is retired.
Scout
The read-only survey that comes before adoption (scripts/scout.sh). It writes nothing into the tree it looks at, needs no jq, and reports seven sections including a full-history secrets scan whose findings never carry the secret value. A missing scanner is reported as a missing scanner, never as a clean result.
Adoption Stamp
The adoption block in .claude/manifest.json recording how a project entered the framework. Written once, never re-stamped. Because an upstream repair path can regenerate the manifest and silently un-adopt the project, check-phase-gate.sh compares the working copy against the copy committed at HEAD and fails the gate when the stamp is lost.
Test-Debt Ledger
.claude/test-debt.json — the untested-file set measured once at adoption, with two forward rules: the set may not grow, and a ledgered file you touch must gain a test in the same commit. Tier-floored (silent / warn / block). "Has a test" is a filename question, not coverage. Nothing calls it at commit time yet.
Collision Archive
.claude/adoption-archive/<timestamp>-<pid>/ — copies of your settings and git hooks taken before the framework's writers run, with a MANIFEST, a restore line per entry, and a gitleaks scan performed before staging so adoption cannot commit a credential out of an untracked hook. Nothing is deleted; --re-add puts a file back and records the choice.
Delta
One unit of post-1.0 change. Opened with scripts/delta.sh --open, classified as feature / fix / hotfix / security-patch, and carrying a gate list derived from that class plus its risk and size attributes. One at a time, enforced by the state schema.
Delta Track
The maintenance loop that runs inside phase 4, after v1.0.0. It cannot start before Phase 4 completion — --open requires current_phase to be exactly 4 — because post-release ceremony is cheaper than building properly, and the cheaper path always wins.
Done-observable
The one section of a delta brief that a program parses. You write it before you build; its checkboxes are the close review. It fails closed — a missing brief, a missing heading, or a heading with no checkboxes each refuse the close.
Hotfix Retro
The write-up a hotfix owes for shipping on the safety floor alone. The row is written at open, not at close, with a due date (default 3 days), and it outlives the delta. An unfiled retro blocks the next release cut — which is the only thing that ever collects it.
Maintenance Cadence
Two clocks measured by scripts/check-maintenance.sh: a routine review (default 14 days) and a deep security scan with the dependency audit folded in (default 95 days). Both are project-owned policy. A release cut refuses on overdue and on unmeasurable alike — a cadence nobody could read is not a pass.
Release Cut
scripts/cut-release.sh. Refuses three times before writing anything (open delta, unfiled hotfix retro, cadence), then decides the semver bump itself with no override flag, promotes the changelog, closes the ledger rows it shipped, and tags. Exit 12 means the release is real but one or more ledger rows could not be closed.