Skip to content

Commit 53cc0fb

Browse files
feat(ci,pushback): wire dna-spec-validate into CI workflow + pushback protocol (SPEC-19 Stage 5)
template/workflows/dna.yml: - Add dna-spec-validate step after dna-verify (script-only per invariant 9; the dna-spec-validator subagent stays human-review-time until headless Claude Code lands). - Wire DNA_SPEC_VALIDATE_BASE=origin/${{ github.base_ref }} so the cross- spec ownership check uses the PR's base for the merged-branch filter (matches dna-verify's DNA_VERIFY_BASE pattern). - New per-gate skip knob vars.DNA_SKIP_SPEC_VALIDATE. - Header comment updated to document spec-validate (mechanical) + spec- validator (judgmental, NOT in CI yet). - Summary block lists the new step + the new judgmental subagent in the PR-reviewer-responsibility callout. template/skills/dna-spec-validate/run.sh: - cross-spec-ownership now respects DNA_SPEC_VALIDATE_BASE env var (was hardcoded to "main"). Default still "main" for local dev. Honors the contract documented in the script header since Stage 1. template/AGENT.md: - Critical Pushback Protocol gains a row: "human asks to skip /dna-spec-validate → refuse, cite Article 8 + invariant 4". The validator's whole purpose is catching drift mechanical layers cannot see; bypassing it allows the build to proceed on a false contract. E2E verification (all green): - refresh-target.sh against team-project-scheduler: 3 ADDED files detected and synced (run.sh, SKILL.md, dna-spec-validator.md); workflows/dna.yml DRIFT resolved with --force. - 10/10 regression fixtures green. - All 4 dogfood specs (001-004) PASS in blocking mode. - workflow YAML parses. - Target now has all 3 new artifacts; target's run.sh IDENTICAL to kit. This closes SPEC-19. The kit is ready for Denis-team handoff with the spec-projection layer fully gated (mechanical floor in CI; judgmental ceiling in dev loop). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 96751ed commit 53cc0fb

3 files changed

Lines changed: 41 additions & 23 deletions

File tree

template/AGENT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Match model capability to phase. Planning and adversarial review need heavy reas
190190
- Human's direction contradicts ARCHITECTURE.md → **Flag.** Propose an amendment PR to main.
191191
- Human says "good enough" for a `[D]` at `[W]` depth → **Challenge.** Ask: "Which negative assertions are you willing to lose?"
192192
- Human wants to merge with failing tests → **Refuse.** Cite Article 8.
193+
- Human asks to skip `/dna-spec-validate` (or its subagent) → **Refuse.** Cite Article 8 + invariant 4 (audit isolation). The validator catches semantic drift between the spec.md and the Blueprint that mechanical layers can't see; bypassing it allows the build to proceed on a false contract.
193194

194195
**When NOT to push back:**
195196
- Human has domain knowledge you lack → Defer, but log the decision.

template/skills/dna-spec-validate/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ MERGED_BRANCHES=""
549549
HAVE_GIT=0
550550
if git rev-parse --git-dir >/dev/null 2>&1; then
551551
HAVE_GIT=1
552-
MERGED_BRANCHES=$(git branch --merged main 2>/dev/null | sed 's/^[* ] //' | grep -v '^main$' || true)
552+
BASE_REF="${DNA_SPEC_VALIDATE_BASE:-main}"
553+
MERGED_BRANCHES=$(git branch --merged "$BASE_REF" 2>/dev/null | sed 's/^[* ] //' | grep -v "^${BASE_REF##*/}$" || true)
553554
fi
554555

555556
for spec_dir in $ALL_SPECS; do

template/workflows/dna.yml

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,37 @@
66
#
77
# What runs (and what doesn't):
88
#
9-
# - dna-decompose YES — [P] tasks overlapping files in a PR would
10-
# produce merge conflicts; gate must block.
11-
# - dna-verify YES — runs the full test suite with coverage and
12-
# enforces the mechanical floor (Article 10 coverage
13-
# threshold, [D] integration tests present, scenario
14-
# tests present). Uses branch-diff-scoped per-file
15-
# coverage (SPEC-16) so predecessor debt doesn't
16-
# block clean new features.
17-
# - dna-test-gate NO — the gate checks "tests exist and FAIL before
18-
# impl". In a PR to main, impl is already committed
19-
# so tests go green. Gate would false-positive. It
20-
# is a dev-time check, not a merge-time check.
21-
# - dna-verifier NO (yet) — the judgmental subagent requires a
22-
# fresh-context LLM run. No headless CI path today.
23-
# A PR reviewer should invoke it manually. Future
24-
# SPEC once Claude Code ships headless invocation.
25-
# - dna-spec-auditor NO (yet) — same reason as dna-verifier. The
26-
# script-less subagents are human-review-time only.
27-
# - dna-cross-checker NO (yet) — same reason.
9+
# - dna-decompose YES — [P] tasks overlapping files in a PR would
10+
# produce merge conflicts; gate must block.
11+
# - dna-verify YES — runs the full test suite with coverage and
12+
# enforces the mechanical floor (Article 10 coverage
13+
# threshold, [D] integration tests present, scenario
14+
# tests present). Uses branch-diff-scoped per-file
15+
# coverage (SPEC-16) so predecessor debt doesn't
16+
# block clean new features.
17+
# - dna-spec-validate YES — mechanical floor for spec ↔ Blueprint drift
18+
# (depth tag, file-paths-inside-modules, undefined
19+
# references, cross-spec ownership). SPEC-19.
20+
# - dna-test-gate NO — the gate checks "tests exist and FAIL before
21+
# impl". In a PR to main, impl is already committed
22+
# so tests go green. Gate would false-positive. It
23+
# is a dev-time check, not a merge-time check.
24+
# - dna-verifier NO (yet) — the judgmental subagent requires a
25+
# fresh-context LLM run. No headless CI path today.
26+
# A PR reviewer should invoke it manually. Future
27+
# SPEC once Claude Code ships headless invocation.
28+
# - dna-spec-auditor NO (yet) — same reason as dna-verifier.
29+
# - dna-spec-validator NO (yet) — same reason; the judgmental ceiling
30+
# above dna-spec-validate stays human-review-time
31+
# until headless invocation lands (SPEC-19 Stage 4).
32+
# - dna-cross-checker NO (yet) — same reason.
2833
#
2934
# Per-gate skip knobs (use sparingly; skipping is a CONSTITUTION Article 5
3035
# violation unless logged as a Construction Site):
3136
#
32-
# vars.DNA_SKIP_DECOMPOSE — 'true' to skip dna-decompose
33-
# vars.DNA_SKIP_VERIFY — 'true' to skip dna-verify
37+
# vars.DNA_SKIP_DECOMPOSE — 'true' to skip dna-decompose
38+
# vars.DNA_SKIP_VERIFY — 'true' to skip dna-verify
39+
# vars.DNA_SKIP_SPEC_VALIDATE — 'true' to skip dna-spec-validate
3440

3541
name: DNA enforcement
3642

@@ -80,11 +86,21 @@ jobs:
8086
DNA_VERIFY_BASE: origin/${{ github.base_ref }}
8187
run: bash .claude/skills/dna-verify/run.sh
8288

89+
- name: DNA spec-validate — spec.md harmonized with Blueprint
90+
if: vars.DNA_SKIP_SPEC_VALIDATE != 'true'
91+
env:
92+
# Cross-spec ownership uses `git branch --merged $BASE_REF` to
93+
# filter merged branches. Match the PR's base ref so the open-spec
94+
# set is computed correctly in CI context.
95+
DNA_SPEC_VALIDATE_BASE: origin/${{ github.base_ref }}
96+
run: bash .claude/skills/dna-spec-validate/run.sh
97+
8398
- name: Summary
8499
if: always()
85100
run: |
86101
echo "## DNA gate summary" >> $GITHUB_STEP_SUMMARY
87102
echo "- dna-decompose: ${{ steps.outcome.outputs.decompose || 'ran' }}" >> $GITHUB_STEP_SUMMARY
88103
echo "- dna-verify: ${{ steps.outcome.outputs.verify || 'ran' }}" >> $GITHUB_STEP_SUMMARY
104+
echo "- dna-spec-validate: ${{ steps.outcome.outputs.spec_validate || 'ran' }}" >> $GITHUB_STEP_SUMMARY
89105
echo "" >> $GITHUB_STEP_SUMMARY
90-
echo "Judgmental audits (dna-verifier, dna-spec-auditor, dna-cross-checker) require a fresh-context LLM invocation — PR reviewer responsibility. See docs/TEAM_GUIDE.md #PR-review-protocol." >> $GITHUB_STEP_SUMMARY
106+
echo "Judgmental audits (dna-verifier, dna-spec-auditor, dna-spec-validator, dna-cross-checker) require a fresh-context LLM invocation — PR reviewer responsibility. See docs/TEAM_GUIDE.md #PR-review-protocol." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)