Skip to content

feat(gate)!: ship the verification-v2 contract - #21

Merged
beomeodev merged 2 commits into
masterfrom
feat/verification-v2
Jul 30, 2026
Merged

beomeodev merged 2 commits into
masterfrom
feat/verification-v2

Conversation

@beomeodev

Copy link
Copy Markdown
Owner

Why

The 2026-07-18..07-27 gate changes slowed the per-Feature cycle 2.5x in consuming repos (median 109 -> 276 min; /ms.review completions 5.3/day -> 1.3/day). The joint root-cause audit (this PR, docs/audits/2026-07-30-verification-slowdown-analysis.md, independently cross-reviewed by Codex) found:

  • the audit-tier system inverted: 0 x T1 in 136 real classifications, and 97% of 86 real specs classified T3 from prose keyword scanning alone — the single largest trigger being the workflow's own mandated phrase "CI passes green"
  • coverage set-equality tables and coupled receipt/continuity state produced 39 station blocks on form, not substance, in one repo
  • the round cap was prose only: aggregate --round 28 returned a clean PASS (reproduced on a fixture; observed in the wild)

Patching was rejected as patchwork risk; a blanket rollback would discard unrelated integrity fixes. This PR ships the contained redesign instead.

What

Design (merged from two independent designs written against the same brief; owner decisions D1–D6 recorded): docs/design/verification-v2.md.

Kept unchanged: L1 deterministic structure before any dispatch, two fresh independent L2 reviewers, mechanical worst-of L3 over station-fixed inputs, freshness binding, PRD-only product authority, append-only ledger with verbatim caught.

Replaced:

  • T1/T2/T3 -> two risk profiles (ordinary/high-risk) computed in-gate from the declared 8-signal ### Verification signals table + deterministic changed-file facts. No prose scanning, no cross-phase floor, no separate classifier process (retires classify_audit_tier.py + audit-tier-policy.json).
  • Coverage set-equality -> Checked / Not checked honesty sections, reviewer-graded.
  • Prose round caps -> executable budget: 2 automatic rounds; --round 3+ refused before reading reports without a typed authorize-round ledger decision.
  • Canonical-path overwrite + archives + packets -> round-numbered reports (*.rN.md).
  • warn-ack files -> typed decision events (specter-gate.sh decide), closed human-stop list; ordinary WARN records and advances.
  • New format-retry lane: a malformed report costs one same-agent retry, never a station round.

Cost model target: a clean ordinary Feature runs 6 dispatches, 3 rounds, 0 human stops; genuinely high-risk work deliberately stays near v1 cost.

Validation

  • New seeded-defect suite tests/specter/test_specter_gate_v2.py (47 cases): over-budget refusal incl. r28, false prose triggers (CI, retry, source of truth) staying ordinary, diff-fact escalation (migration/DDL/gate-machinery), digest staleness, degrade placeholders, ack roundtrip, ported v1 regressions (octal feature numbers, split-slate maps).
  • Full suite: 161 passed.
  • Net -4,347 lines.

Migration

Legacy .specify/audit-tiers/ / .specify/continuity/ state is read-only evidence, never reinterpreted. In-flight Features re-check once under v2 at their current station. Legacy signals tables run high-risk until replaced (fail-safe). /ms.sync broadcast is a separate follow-up after a real-repo shakedown cycle.

🤖 Generated with Claude Code

beomeodev and others added 2 commits July 30, 2026 15:23
…design

Add the 2026-07-30 root-cause analysis of the 2.5x per-Feature cycle
slowdown (measured 109 -> 276 min medians across consuming repos), its
independent Codex cross-review reconciliation, and the corpus evidence
that 97% of 86 real specs classified T3 from prose keyword scanning
alone - with the workflow's own mandated "CI passes green" phrase as the
single largest trigger.

Add the merged verification-v2 design (authoritative), produced from two
independent designs (Claude / Codex) written against the same brief, with
the owner decision log D1-D6: two risk profiles from declared signals and
deterministic diff facts, an executable 2-round budget, honesty sections
instead of coverage set-equality, round-numbered reports, typed
human-decision ledger events, and a closed human-stop list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replace the audit-tier cost model with the verification-v2 contract
(docs/design/verification-v2.md). The three-layer skeleton is unchanged:
deterministic L1 before any dispatch, two fresh independent L2 reviewers,
mechanical worst-of L3 over station-fixed inputs, freshness binding,
PRD-only product authority, append-only ledger.

Gate (specter-gate.sh v4.0.0):
- risk profile (ordinary|high-risk) computed in-gate from the declared
  8-signal "### Verification signals" table and deterministic changed-file
  facts (migration dirs, auth/secret paths, CI/workflow files, gate
  machinery, DDL/destructive statements in added diff lines) - never
  prose scanning, never a cross-phase floor
- executable round budget: aggregate refuses --round 3+ before reading
  any report unless a typed authorize-round decision event is recorded
- new subcommands: digest (input identity), validate-report (format-retry
  lane: a malformed report costs one same-agent retry, never a round),
  decide (typed human-decision ledger events; named-class acks surface as
  required_acks on the review receipt)
- round-numbered report inputs (*.rN.md), single station receipt at
  .specify/verification-v2/<station>-<scope>.json
- deleted: manifest/continuity subcommands, coverage set-equality and
  lineage validation, immutable round archives, tier receipt handshake

Retired: classify_audit_tier.py, audit-tier-policy.json (and their sync
manifest entries), the T1/T2/T3 tiers, the 5 reclassification boundaries,
warn-ack files, REVERSAL/COVERAGE_BREACH machinery, the D-ID entailment
gate test (owner decision D3 - D-IDs are references; scope-justifying
D-IDs are ordinary blocking findings).

Commands/skills: ms.verify, ms.analyze, ms.review, ms.pre-verify rewired
to the v2 report schema and budget; classifier steps removed from
ms.checklist, ms.specify, ms.clarify, ms.plan, ms.implement, ms.specter,
ms.featuremap (now authors the 8-signal table), ms.init, ms.sync;
specter-agent-protocols SKILL sections 3-8 rewritten.

Tests: new seeded-defect suite tests/specter/test_specter_gate_v2.py
(47 cases: over-budget refusal incl. round 28, false prose triggers
staying ordinary, diff-fact escalation, digest staleness, degrade
placeholders, ack roundtrip); four obsolete v1 suites retired. Full
suite: 161 passed. Net -4,347 lines.

Migration: legacy .specify/audit-tiers/ and .specify/continuity/ state is
read-only evidence, never reinterpreted; in-flight Features re-check once
under v2 at their current station; legacy signals tables run high-risk
until replaced (fail-safe).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@beomeodev
beomeodev force-pushed the feat/verification-v2 branch from 5c18434 to f2bb7dc Compare July 30, 2026 06:25
@beomeodev
beomeodev merged commit 222f846 into master Jul 30, 2026
1 check failed
@beomeodev
beomeodev deleted the feat/verification-v2 branch July 30, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant