rungate 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/aditi.md +47 -0
- package/.claude/agents/marcus.md +50 -0
- package/.claude/agents/quinn.md +58 -0
- package/.claude/agents/rook.md +47 -0
- package/.claude/agents/serena.md +46 -0
- package/.claude/rungate.json +11 -0
- package/.fallowrc.json +28 -0
- package/.github/copilot-instructions.md +20 -0
- package/.rungate/conformity-findings.json +648 -0
- package/AGENTS.md +106 -0
- package/CODE-MAP.md +50 -0
- package/HARNESS.md +88 -0
- package/bun.lock +26 -0
- package/bunfig.toml +2 -0
- package/config/brief-policies.json +28 -0
- package/config/ceremony-profiles.json +212 -0
- package/config/consumer-cascade-map.json +24 -0
- package/config/doc-cascade-map.json +24 -0
- package/config/eval.json +84 -0
- package/config/profiles/account-plan.yaml +36 -0
- package/config/profiles/campaign.yaml +94 -0
- package/config/prove-evidence.schema.json +65 -0
- package/config/spec-policies.json +36 -0
- package/config/workflow-schema.json +281 -0
- package/gates/SCHEMA-GUIDE.md +121 -0
- package/gates/ac-quality.test.ts +106 -0
- package/gates/adversarial.test.ts +274 -0
- package/gates/brief-assembler.test.ts +429 -0
- package/gates/brief-assembler.ts +334 -0
- package/gates/bunfig.toml +2 -0
- package/gates/chain.test.ts +91 -0
- package/gates/e2e-smoke.test.ts +234 -0
- package/gates/error-classifier.test.ts +249 -0
- package/gates/error-classifier.ts +89 -0
- package/gates/orchestrator.test.ts +950 -0
- package/gates/orchestrator.ts +569 -0
- package/gates/preload.ts +77 -0
- package/gates/prompts/ac-adversary.md +20 -0
- package/gates/prompts/evidence-validator.md +22 -0
- package/gates/prompts/prove-reproducer.md +53 -0
- package/gates/prove.test.ts +164 -0
- package/gates/run-gate.ts +936 -0
- package/gates/schema-parity.test.ts +197 -0
- package/gates/schema.ts +362 -0
- package/gates/self-heal.test.ts +511 -0
- package/gates/self-heal.ts +121 -0
- package/gates/ship-orchestrator.test.ts +379 -0
- package/gates/ship-orchestrator.ts +363 -0
- package/gates/test-fixtures/broken-no-environments.json +60 -0
- package/gates/test-fixtures/valid-standard.json +54 -0
- package/gates/test-utils.ts +43 -0
- package/gates/witness.ts +220 -0
- package/gates/workflow.test.ts +1053 -0
- package/hooks/AgentBriefGuard.hook.ts +586 -0
- package/hooks/AgentVerdictCapture.hook.ts +134 -0
- package/hooks/AutoVerifyGate.hook.ts +76 -0
- package/hooks/GateEnforcement.hook.ts +273 -0
- package/hooks/IssueCloseGuard.hook.ts +116 -0
- package/hooks/MergeGuard.hook.ts +55 -0
- package/hooks/StaleTTLCleanup.hook.ts +133 -0
- package/hooks/VerifyPhaseLock.hook.ts +81 -0
- package/hooks/WorkflowStateGuard.hook.ts +37 -0
- package/hooks/lib/agentDetection.ts +70 -0
- package/hooks/lib/findWorkflow.ts +101 -0
- package/hooks/lib/parseStdin.ts +37 -0
- package/hooks/lib/paths.ts +111 -0
- package/hooks/lib/utils.ts +81 -0
- package/lib/conformity.ts +959 -0
- package/lib/paths.ts +23 -0
- package/lib/rungate-schema.ts +60 -0
- package/lib/signal-phrases.ts +7 -0
- package/package.json +20 -0
- package/prompts/ac-adversary.md +20 -0
- package/prompts/ac-format.md +34 -0
- package/prompts/aditi.md +29 -0
- package/prompts/blast-radius.md +29 -0
- package/prompts/coding-principles.md +34 -0
- package/prompts/container-rebuild.md +29 -0
- package/prompts/container-verify.md +28 -0
- package/prompts/discovery.md +27 -0
- package/prompts/environment.md +28 -0
- package/prompts/escalation-decision-tree.md +38 -0
- package/prompts/evidence-hierarchy.md +31 -0
- package/prompts/evidence-validator.md +22 -0
- package/prompts/marcus.md +29 -0
- package/prompts/prevention.md +26 -0
- package/prompts/prove-reproducer.md +43 -0
- package/prompts/quinn-decision-tree.md +31 -0
- package/prompts/quinn-ui-brief.md +106 -0
- package/prompts/quinn.md +29 -0
- package/prompts/rca.md +28 -0
- package/prompts/read-before-write.md +30 -0
- package/prompts/regression.md +26 -0
- package/prompts/rook.md +29 -0
- package/prompts/serena.md +28 -0
- package/prompts/testing-strategy.md +34 -0
- package/reference/migration-manifest.json +554 -0
- package/reference/prompts/agent-aditi.md +38 -0
- package/reference/prompts/agent-marcus.md +38 -0
- package/reference/prompts/agent-quinn.md +38 -0
- package/reference/prompts/agent-rook.md +37 -0
- package/reference/prompts/agent-serena.md +37 -0
- package/reference/prompts/council-skill.md +170 -0
- package/reference/prompts/goal-skill.md +235 -0
- package/reference/prompts/prove-skill.md +283 -0
- package/reference/prompts/quinn-standard.md +246 -0
- package/reference/prompts/ship-convergence.md +65 -0
- package/reference/prompts/ship-escalation.md +43 -0
- package/reference/prompts/ship-iteration.md +382 -0
- package/reference/prompts/ship-pending-patches.md +246 -0
- package/reference/prompts/ship-reference.md +250 -0
- package/reference/prompts/ship-skill.md +347 -0
- package/reference/prompts/ship-templates.md +215 -0
- package/reference/scripts/batch-status.sh +68 -0
- package/reference/scripts/chain-compat-check.sh +67 -0
- package/reference/scripts/context-audit.sh +314 -0
- package/reference/scripts/dead-export-check.sh +61 -0
- package/reference/scripts/generate-qc-tables.sh +92 -0
- package/reference/scripts/harness-init.sh +111 -0
- package/reference/scripts/pai-054-baseline-check.sh +40 -0
- package/reference/scripts/prove-smoke-test.sh +112 -0
- package/reference/scripts/setup-keychain-salt.sh +12 -0
- package/reference/scripts/skill-optimizer-friday.sh +88 -0
- package/reference/scripts/skill-qc-test.sh +351 -0
- package/reference/scripts/skill-synthesize-tonight.sh +66 -0
- package/reference/specs/HARNESS-EXTRACTION-SPEC.md +263 -0
- package/reference/specs/harness-v3-bash-deletion-plan.md +65 -0
- package/reference/specs/harness-v3-migration-plan.md +188 -0
- package/scripts/decision-reconcile.sh +74 -0
- package/scripts/decision-reconcile.ts +152 -0
- package/scripts/extract-constraints.ts +260 -0
- package/scripts/generate-code-map.ts +339 -0
- package/scripts/git-hooks/pre-commit +76 -0
- package/scripts/git-hooks/pre-push +271 -0
- package/scripts/harness-skill-check.sh +52 -0
- package/scripts/lib/gap-emit.sh +65 -0
- package/scripts/lib/jq-update.sh +30 -0
- package/scripts/lib/resolve-slug.sh +30 -0
- package/scripts/lib/verify-spec-compliance.sh +102 -0
- package/scripts/prove-backfill.sh +87 -0
- package/scripts/scaffold-project.ts +1488 -0
- package/scripts/scaffold-rungate-config.ts +91 -0
- package/scripts/self-containment-check.sh +109 -0
- package/scripts/skill-qc-validator.sh +402 -0
- package/scripts/slug-resolver.sh +14 -0
- package/scripts/sync-spec-tests.ts +236 -0
- package/specs/BOOTSTRAP-DATA-FLOW-SPEC.md +2493 -0
- package/specs/BOOTSTRAP-TEST-PLAN.md +571 -0
- package/specs/HARNESS-GATES.md +256 -0
- package/specs/HARNESS-SKILL-CHAIN.md +286 -0
- package/specs/HARNESS-SKILL-CONTRACT.md +93 -0
- package/specs/HARNESS-STANDARD.md +488 -0
- package/specs/SPEC-TEMPLATE.md +53 -0
- package/specs/bootstrap-data-flow.png +0 -0
- package/specs/harness-automation-matrix.md +314 -0
- package/specs/harness-automation-matrix.rules.json +64 -0
- package/test/anti.test.ts +80 -0
- package/test/contract-negative.test.ts +86 -0
- package/test/contract.test.ts +158 -0
- package/test/external-deps.test.ts +48 -0
- package/test/fixtures/golden-project/.env.example +3 -0
- package/test/fixtures/golden-project/Makefile +7 -0
- package/test/fixtures/golden-project/docs/adr/ADR-001-framework.md +23 -0
- package/test/fixtures/golden-project/docs/setup-guide.md +10 -0
- package/test/fixtures/golden-project/package.json +10 -0
- package/test/fixtures/golden-project/specs/api-spec.md +20 -0
- package/test/fixtures/golden-project/src/auth.ts +8 -0
- package/test/fixtures/golden-project/src/db.ts +11 -0
- package/test/fixtures/golden-project/src/index.ts +19 -0
- package/test/fixtures/golden-project/src/utils/format.ts +3 -0
- package/test/fixtures/golden-project/test/auth.test.ts +15 -0
- package/test/fixtures/golden-project/tsconfig.json +12 -0
- package/test/meta-sc-coverage.test.ts +159 -0
- package/test/phase-0.test.ts +846 -0
- package/test/phase-1.test.ts +617 -0
- package/test/phase-2.test.ts +620 -0
- package/test/phase-3.test.ts +99 -0
- package/test/scaffold-conformity.test.ts +8 -0
- package/test/schema-canary.test.ts +51 -0
- package/test/spec-compliance-auto.test.ts +64 -0
- package/test/spec-compliance.test.ts +295 -0
- package/test/spec-discovery.test.ts +68 -0
- package/test/spec-drift.test.ts +5 -0
- package/test/structure.test.ts +165 -0
- package/test/unit/agent-brief-guard-ship.test.ts +293 -0
- package/test/unit/extract-constraints.test.ts +145 -0
- package/test/unit/issue-close-guard.test.ts +204 -0
- package/test/unit/scaffold-project.test.ts +417 -0
- package/test/unit/skill-cooccurrence.test.ts +177 -0
- package/test/unit/skill-sequence-logger.test.ts +244 -0
- package/test/unit/workflow-state-guard.test.ts +95 -0
- package/workflows/batch-ship.js +295 -0
- package/workflows/council.js +481 -0
- package/workflows/prove.js +560 -0
- package/workflows/ship.js +789 -0
- package/workflows/verify.js +236 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { test, expect, describe } from "bun:test";
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
|
|
5
|
+
const HARNESS = join(import.meta.dir, "..");
|
|
6
|
+
const GATES = join(HARNESS, "gates");
|
|
7
|
+
|
|
8
|
+
describe("Phase 3: Parallel Work", () => {
|
|
9
|
+
|
|
10
|
+
// SC-45: Container lock checked mechanically
|
|
11
|
+
describe("SC-45: container lock check", () => {
|
|
12
|
+
test("orchestrator or Makefile checks for lock file", () => {
|
|
13
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
14
|
+
.map(f => join(HARNESS, f))
|
|
15
|
+
.filter(f => existsSync(f));
|
|
16
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
17
|
+
expect(content).toMatch(/lock|container.*lock|rebuild.*block/i);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// SC-46: Worktree isolation for parallel execution
|
|
22
|
+
describe("SC-46: worktree isolation", () => {
|
|
23
|
+
test("ship orchestrator supports worktree mode", () => {
|
|
24
|
+
const orchestrator = join(GATES, "ship-orchestrator.ts");
|
|
25
|
+
if (existsSync(orchestrator)) {
|
|
26
|
+
const content = readFileSync(orchestrator, "utf-8");
|
|
27
|
+
expect(content).toMatch(/worktree|parallel|isolation/i);
|
|
28
|
+
} else {
|
|
29
|
+
expect(existsSync(orchestrator)).toBe(true);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// SC-47: Container lock released after test completion
|
|
35
|
+
describe("SC-47: lock release on completion", () => {
|
|
36
|
+
test("orchestrator releases lock after tests", () => {
|
|
37
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
38
|
+
.map(f => join(HARNESS, f))
|
|
39
|
+
.filter(f => existsSync(f));
|
|
40
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
41
|
+
expect(content).toMatch(/unlock|release.*lock|remove.*lock|cleanup/i);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// SC-69: File-set overlap detection
|
|
46
|
+
describe("SC-69: file-set overlap detection", () => {
|
|
47
|
+
test("orchestrator detects overlapping file sets", () => {
|
|
48
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
49
|
+
.map(f => join(HARNESS, f))
|
|
50
|
+
.filter(f => existsSync(f));
|
|
51
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
52
|
+
expect(content).toMatch(/overlap|file.*set|conflict.*detect/i);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// SC-70: Port/namespace isolation beyond worktree
|
|
57
|
+
describe("SC-70: port/namespace isolation", () => {
|
|
58
|
+
test("orchestrator handles port isolation", () => {
|
|
59
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
60
|
+
.map(f => join(HARNESS, f))
|
|
61
|
+
.filter(f => existsSync(f));
|
|
62
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
63
|
+
expect(content).toMatch(/port.*isol|namespace|port.*offset|port.*alloc/i);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// SC-71: Cap concurrent agents at 5
|
|
68
|
+
describe("SC-71: agent concurrency cap", () => {
|
|
69
|
+
test("orchestrator limits concurrent agents", () => {
|
|
70
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
71
|
+
.map(f => join(HARNESS, f))
|
|
72
|
+
.filter(f => existsSync(f));
|
|
73
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
74
|
+
expect(content).toMatch(/concurrent|cap|max.*agent|limit.*parallel|5.*agent/i);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// SC-72: Sequential merge with CI verification
|
|
79
|
+
describe("SC-72: sequential merge protocol", () => {
|
|
80
|
+
test("orchestrator enforces sequential merge", () => {
|
|
81
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
82
|
+
.map(f => join(HARNESS, f))
|
|
83
|
+
.filter(f => existsSync(f));
|
|
84
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
85
|
+
expect(content).toMatch(/sequential.*merge|merge.*queue|ci.*verif/i);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// SC-136: Worktree branch naming
|
|
90
|
+
describe("SC-136: deterministic worktree branch names", () => {
|
|
91
|
+
test("orchestrator uses issue-{N}-{slug} naming", () => {
|
|
92
|
+
const files = ["gates/orchestrator.ts", "gates/ship-orchestrator.ts"]
|
|
93
|
+
.map(f => join(HARNESS, f))
|
|
94
|
+
.filter(f => existsSync(f));
|
|
95
|
+
const content = files.map(f => readFileSync(f, "utf-8")).join("\n");
|
|
96
|
+
expect(content).toMatch(/issue.*slug|branch.*name|worktree.*branch/i);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { runScaffoldConformity, runDocHygiene, runFallowCheck, runAgentFileValidation } from "../lib/conformity";
|
|
3
|
+
|
|
4
|
+
const ROOT = resolve(import.meta.dir, "..");
|
|
5
|
+
runScaffoldConformity(ROOT);
|
|
6
|
+
runDocHygiene(ROOT);
|
|
7
|
+
runFallowCheck(ROOT);
|
|
8
|
+
runAgentFileValidation(ROOT);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, test, expect } from "bun:test";
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import { join, resolve } from "path";
|
|
4
|
+
import {
|
|
5
|
+
parseProjectHarness,
|
|
6
|
+
safeParseProjectHarness,
|
|
7
|
+
} from "../lib/rungate-schema";
|
|
8
|
+
|
|
9
|
+
const HARNESS_ROOT = resolve(import.meta.dir, "..");
|
|
10
|
+
const HOME = process.env.HOME || "";
|
|
11
|
+
|
|
12
|
+
describe("schema-canary", () => {
|
|
13
|
+
test("DDB rungate.json validates (if available)", () => {
|
|
14
|
+
const ddbPath = join(HOME, "Projects/DailyBriefDashboard/.claude/rungate.json");
|
|
15
|
+
if (!existsSync(ddbPath)) return;
|
|
16
|
+
const raw = JSON.parse(readFileSync(ddbPath, "utf-8"));
|
|
17
|
+
const result = safeParseProjectHarness(raw);
|
|
18
|
+
if (!result.success) {
|
|
19
|
+
console.error("Validation errors:", result.error.issues);
|
|
20
|
+
}
|
|
21
|
+
expect(result.success).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("missing required field produces Zod error", () => {
|
|
25
|
+
const bad = { repo: "org/repo", issueRepo: "org/issues" };
|
|
26
|
+
const result = safeParseProjectHarness(bad);
|
|
27
|
+
expect(result.success).toBe(false);
|
|
28
|
+
const paths = result.error!.issues.map((i) => i.path.join("."));
|
|
29
|
+
expect(paths).toContain("project");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("schema has schemaVersion field with default", () => {
|
|
33
|
+
const minimal = { project: "test", repo: "org/repo", issueRepo: "org/issues" };
|
|
34
|
+
const result = parseProjectHarness(minimal);
|
|
35
|
+
expect(result.schemaVersion).toBe(1);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("dev section requires start, apiBase, uiBase when present", () => {
|
|
39
|
+
const withPartialDev = {
|
|
40
|
+
project: "test",
|
|
41
|
+
repo: "org/repo",
|
|
42
|
+
issueRepo: "org/issues",
|
|
43
|
+
dev: { start: "make dev" },
|
|
44
|
+
};
|
|
45
|
+
const result = safeParseProjectHarness(withPartialDev);
|
|
46
|
+
expect(result.success).toBe(false);
|
|
47
|
+
const paths = result.error!.issues.map((i) => i.path.join("."));
|
|
48
|
+
expect(paths).toContain("dev.apiBase");
|
|
49
|
+
expect(paths).toContain("dev.uiBase");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/sync-spec-tests.ts — do not edit manually
|
|
2
|
+
// Regenerate: bun scripts/sync-spec-tests.ts
|
|
3
|
+
// Source: PAI/specs/HARNESS-SKILL-CHAIN.md
|
|
4
|
+
// Generated: 2026-09-17
|
|
5
|
+
|
|
6
|
+
import { test, expect, describe } from "bun:test";
|
|
7
|
+
import { readFileSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
import { harnessRoot } from "../lib/paths";
|
|
10
|
+
|
|
11
|
+
const HR = harnessRoot();
|
|
12
|
+
const SHIP_JS = readFileSync(join(HR, "workflows/ship.js"), "utf-8");
|
|
13
|
+
const PROVE_JS = readFileSync(join(HR, "workflows/prove.js"), "utf-8");
|
|
14
|
+
|
|
15
|
+
describe("auto-spec: ship.js claims from HARNESS-SKILL-CHAIN.md", () => {
|
|
16
|
+
// Spec line 49: **Gate:** Issue exists with ACs. Before-state captured.
|
|
17
|
+
test("AUTO-GATE-1: Gate: Issue exists with ACs. Before-state captured.", () => {
|
|
18
|
+
expect(SHIP_JS.toLowerCase()).toContain("gate");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Spec line 82: 1. Marcus codes on local dev (make dev-all, :7778 API / :5173 UI)
|
|
22
|
+
test("AUTO-PORT-3: Port 7778 referenced in SHIP context", () => {
|
|
23
|
+
expect(SHIP_JS).toContain("7778");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Spec line 84: 3. Quinn validates on local dev (:5173 UI, :7778 API)
|
|
27
|
+
test("AUTO-PORT-4: Port 5173 referenced in SHIP context", () => {
|
|
28
|
+
expect(SHIP_JS).toContain("5173");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Spec line 84: 3. Quinn validates on local dev (:5173 UI, :7778 API)
|
|
32
|
+
test("AUTO-QUINN-5: Quinn validates in SHIP", () => {
|
|
33
|
+
expect(SHIP_JS.toLowerCase()).toContain("quinn");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Spec line 90: 5. `make test-rebuild` → rebuilds container image from current code, starts on :7776 with seed data
|
|
37
|
+
test("AUTO-MAKE-7: Spec requires make test-rebuild", () => {
|
|
38
|
+
expect(SHIP_JS.toLowerCase()).toContain("test-rebuild");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Spec line 90: 5. `make test-rebuild` → rebuilds container image from current code, starts on :7776 with seed data
|
|
42
|
+
test("AUTO-PORT-8: Port 7776 referenced in SHIP context", () => {
|
|
43
|
+
expect(SHIP_JS).toContain("7776");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Spec line 103: 13. **GATE: Ship gate PASS. PR ready for review.**
|
|
47
|
+
test("AUTO-GATE-12: Gate: 13. Ship gate PASS. PR ready for review.", () => {
|
|
48
|
+
expect(SHIP_JS.toLowerCase()).toContain("ship");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe("auto-spec: prove.js claims from HARNESS-SKILL-CHAIN.md", () => {
|
|
54
|
+
// Spec line 122: 2. **Rebuild image + spin up isolated prove container** (`make prove-up`, port 7776)
|
|
55
|
+
test("AUTO-MAKE-14: Spec requires make prove-up", () => {
|
|
56
|
+
expect(PROVE_JS.toLowerCase()).toContain("prove-up");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Spec line 127: 3. **Quinn validates on prove container** (port 7776, prod data)
|
|
60
|
+
test("AUTO-QUINN-15: Quinn validates in PROVE", () => {
|
|
61
|
+
expect(PROVE_JS.toLowerCase()).toContain("quinn");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
});
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { test, expect, describe } from "bun:test";
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { harnessRoot } from "../lib/paths";
|
|
5
|
+
|
|
6
|
+
const HR = harnessRoot();
|
|
7
|
+
const SHIP_JS = readFileSync(join(HR, "workflows/ship.js"), "utf-8");
|
|
8
|
+
const SPEC_MD = readFileSync(join(HR, "specs/HARNESS-SKILL-CHAIN.md"), "utf-8");
|
|
9
|
+
const SKILL_MD = readFileSync(join(HR, "reference/prompts/ship-skill.md"), "utf-8");
|
|
10
|
+
|
|
11
|
+
function sliceBetween(src: string, start: string, end: string): string {
|
|
12
|
+
const s = src.indexOf(start);
|
|
13
|
+
const e = end ? src.indexOf(end, s + 1) : src.length;
|
|
14
|
+
if (s < 0) throw new Error(`Start marker not found: "${start}"`);
|
|
15
|
+
if (e < 0) throw new Error(`End marker not found: "${end}"`);
|
|
16
|
+
return src.slice(s, e);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// ── Ceremony Tier Gating ───────────────────────────────────────
|
|
20
|
+
// Spec: HARNESS-SKILL-CHAIN.md Layer 1-2-3 + SKILL.md ceremony table
|
|
21
|
+
// LIGHT = skip Quinn/Rook. STANDARD = Quinn. THOROUGH = Quinn + Rook.
|
|
22
|
+
|
|
23
|
+
describe("ceremony-tier: Quinn gating matches spec", () => {
|
|
24
|
+
|
|
25
|
+
test("SC-1: Quinn local gates on ceremonyTier, not hasUIChanges", () => {
|
|
26
|
+
// Spec Layer 1: "Quinn validates on local dev"
|
|
27
|
+
// Ceremony table: STANDARD = Quinn, THOROUGH = Quinn + Rook
|
|
28
|
+
// Quinn local MUST NOT gate on file extensions — backend fixes with UI impact need Quinn too
|
|
29
|
+
const validateSection = sliceBetween(SHIP_JS, "PHASE 5: VALIDATE", "PHASE 6: COMMIT");
|
|
30
|
+
expect(validateSection).not.toContain("if (hasUIChanges)");
|
|
31
|
+
expect(validateSection).toContain("ceremonyTier !== 'LIGHT'");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("SC-2: Container Quinn gates on ceremonyTier, not hasUIChanges", () => {
|
|
35
|
+
// Spec Layer 2: "make test-up → Quinn validates on container"
|
|
36
|
+
// Must gate on ceremonyTier !== 'LIGHT', not file type checks
|
|
37
|
+
const verifySection = sliceBetween(SHIP_JS, "PHASE 7: VERIFY", "PHASE 8: SHIP");
|
|
38
|
+
expect(verifySection).toContain("ceremonyTier !== 'LIGHT'");
|
|
39
|
+
expect(verifySection).not.toContain("hasUIChanges");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("SC-3: Rook gates on ceremonyTier", () => {
|
|
43
|
+
// Ceremony table: THOROUGH = Quinn + Rook parallel
|
|
44
|
+
// Spec line 94 says "STANDARD+ tiers" — conflict with ceremony table
|
|
45
|
+
// Code follows ceremony table (THOROUGH only) — this test documents current behavior
|
|
46
|
+
const verifySection = sliceBetween(SHIP_JS, "PHASE 7: VERIFY", "PHASE 8: SHIP");
|
|
47
|
+
expect(verifySection).toMatch(/ceremonyTier.*===.*'THOROUGH'/);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("SC-4: LIGHT tier skips scope gate", () => {
|
|
51
|
+
// SKILL.md: "LIGHT tier: scope gate is skipped"
|
|
52
|
+
expect(SHIP_JS).toMatch(/skipScope\s*=\s*discovery\.ceremonyTier\s*===\s*'LIGHT'/);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test("SC-5: LIGHT tier gets simplified log when Quinn skipped", () => {
|
|
56
|
+
expect(SHIP_JS).toContain("Quinn local: SKIPPED (LIGHT tier)");
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ── Phase Ordering ─────────────────────────────────────────────
|
|
61
|
+
// Spec Layer 1→2→3: local dev → container → PR + ship gate
|
|
62
|
+
|
|
63
|
+
describe("phase-ordering: spec-mandated sequence preserved", () => {
|
|
64
|
+
|
|
65
|
+
test("PO-1: Validate (Quinn local) runs BEFORE Commit", () => {
|
|
66
|
+
// Spec: "GATE: Quinn local PASS before container build"
|
|
67
|
+
// Commit must not happen until Quinn local passes
|
|
68
|
+
const validateIdx = SHIP_JS.indexOf("PHASE 5: VALIDATE");
|
|
69
|
+
const commitIdx = SHIP_JS.indexOf("PHASE 6: COMMIT");
|
|
70
|
+
expect(validateIdx).toBeGreaterThan(0);
|
|
71
|
+
expect(commitIdx).toBeGreaterThan(validateIdx);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("PO-2: Commit runs BEFORE Verify (container)", () => {
|
|
75
|
+
const commitIdx = SHIP_JS.indexOf("PHASE 6: COMMIT");
|
|
76
|
+
const verifyIdx = SHIP_JS.indexOf("PHASE 7: VERIFY");
|
|
77
|
+
expect(commitIdx).toBeGreaterThan(0);
|
|
78
|
+
expect(verifyIdx).toBeGreaterThan(commitIdx);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("PO-3: Container Quinn runs BEFORE PR creation", () => {
|
|
82
|
+
// Spec: "GATE: Quinn container PASS before PR is opened"
|
|
83
|
+
const containerQuinnIdx = SHIP_JS.indexOf("quinn-container");
|
|
84
|
+
const createPrIdx = SHIP_JS.indexOf("create-pr");
|
|
85
|
+
expect(containerQuinnIdx).toBeGreaterThan(0);
|
|
86
|
+
expect(createPrIdx).toBeGreaterThan(containerQuinnIdx);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("PO-4: PR creation runs BEFORE ship gate", () => {
|
|
90
|
+
const createPrIdx = SHIP_JS.indexOf("create-pr");
|
|
91
|
+
const shipGateIdx = SHIP_JS.indexOf("Running ship gate");
|
|
92
|
+
expect(createPrIdx).toBeGreaterThan(0);
|
|
93
|
+
expect(shipGateIdx).toBeGreaterThan(createPrIdx);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("PO-5: Ship gate runs BEFORE Prove", () => {
|
|
97
|
+
const shipGateIdx = SHIP_JS.indexOf("Running ship gate");
|
|
98
|
+
const proveIdx = SHIP_JS.indexOf("PHASE 9: PROVE");
|
|
99
|
+
expect(shipGateIdx).toBeGreaterThan(0);
|
|
100
|
+
expect(proveIdx).toBeGreaterThan(shipGateIdx);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test("PO-6: Implement runs BEFORE Validate", () => {
|
|
104
|
+
const implIdx = SHIP_JS.indexOf("PHASE 4: IMPLEMENT");
|
|
105
|
+
const validateIdx = SHIP_JS.indexOf("PHASE 5: VALIDATE");
|
|
106
|
+
expect(implIdx).toBeGreaterThan(0);
|
|
107
|
+
expect(validateIdx).toBeGreaterThan(implIdx);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// ── Prove Integration ──────────────────────────────────────────
|
|
112
|
+
// Spec Step 4: PROVE is post-merge, runs prove.js workflow (not gate test)
|
|
113
|
+
|
|
114
|
+
describe("prove-integration: prove.js workflow, not gate test", () => {
|
|
115
|
+
|
|
116
|
+
test("PI-1: Main path uses workflow() for prove, not runGateWithHeal", () => {
|
|
117
|
+
const proveSection = sliceBetween(SHIP_JS, "PHASE 9: PROVE", "Telemetry");
|
|
118
|
+
expect(proveSection).toContain("workflow(");
|
|
119
|
+
expect(proveSection).toContain("prove.js");
|
|
120
|
+
expect(proveSection).not.toContain("runGateWithHeal('prove')");
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test("PI-2: ALREADY_SHIPPED path uses workflow() for prove", () => {
|
|
124
|
+
const alreadySection = sliceBetween(SHIP_JS, "ALREADY_SHIPPED", "Prior work:");
|
|
125
|
+
expect(alreadySection).toContain("workflow(");
|
|
126
|
+
expect(alreadySection).toContain("prove.js");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("PI-3: Prove passes issue + project args to child workflow", () => {
|
|
130
|
+
const proveSection = sliceBetween(SHIP_JS, "PHASE 9: PROVE", "Telemetry");
|
|
131
|
+
expect(proveSection).toContain("issue: ISSUE");
|
|
132
|
+
expect(proveSection).toContain("projectRoot: PROJECT_ROOT");
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// ── Evidence Requirements ──────────────────────────────────────
|
|
137
|
+
// SKILL.md: environment evidence recorded, AC anchoring, evidence type ratio
|
|
138
|
+
|
|
139
|
+
describe("evidence-requirements: mechanical evidence checks", () => {
|
|
140
|
+
|
|
141
|
+
test("ER-1: Environment evidence recorded after commit", () => {
|
|
142
|
+
const commitSection = sliceBetween(SHIP_JS, "PHASE 6: COMMIT", "PHASE 7: VERIFY");
|
|
143
|
+
expect(commitSection).toContain("environments.local.api");
|
|
144
|
+
expect(commitSection).toContain("environments.local.ui");
|
|
145
|
+
expect(commitSection).toContain("environments.local.tests");
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test("ER-1b: Environment values enforced via schema enum (not agent prose)", () => {
|
|
149
|
+
// Schema: EnvironmentLocalSchema uses z.enum(["PASS", "FAIL", "SKIP"])
|
|
150
|
+
// ship.js must use structured output schema with enum constraint for env checks
|
|
151
|
+
const commitSection = sliceBetween(SHIP_JS, "PHASE 6: COMMIT", "PHASE 7: VERIFY");
|
|
152
|
+
expect(commitSection).toContain("enum: ['PASS', 'FAIL', 'SKIP']");
|
|
153
|
+
expect(commitSection).toContain("ENV_CHECK_SCHEMA");
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test("ER-1c: Container image rebuild before Quinn container (not just restart)", () => {
|
|
157
|
+
// Spec Layer 2: container must have the fix code — need image rebuild, not just restart
|
|
158
|
+
// make test-rebuild = build + test-down + seed + run (rebuilds image)
|
|
159
|
+
// make test-up = test-down + seed + run (reuses existing image — stale!)
|
|
160
|
+
const verifySection = sliceBetween(SHIP_JS, "PHASE 7: VERIFY", "PHASE 8: SHIP");
|
|
161
|
+
expect(verifySection).toContain("make test-rebuild");
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test("ER-2: AC anchoring instruction in discovery prompt", () => {
|
|
165
|
+
const discoveryPrompt = sliceBetween(SHIP_JS, "You are performing DISCOVERY", "DISCOVERY_SCHEMA");
|
|
166
|
+
expect(discoveryPrompt).toContain("1:1");
|
|
167
|
+
expect(discoveryPrompt).toContain("Success Criteria");
|
|
168
|
+
expect(discoveryPrompt).toContain("AC ANCHORING");
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test("ER-3: Evidence type ratio instruction in discovery prompt", () => {
|
|
172
|
+
const discoveryPrompt = sliceBetween(SHIP_JS, "You are performing DISCOVERY", "DISCOVERY_SCHEMA");
|
|
173
|
+
expect(discoveryPrompt).toContain("50%");
|
|
174
|
+
expect(discoveryPrompt).toContain("non-grep");
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test("ER-4: Prior work check instruction in discovery prompt", () => {
|
|
178
|
+
const discoveryPrompt = sliceBetween(SHIP_JS, "You are performing DISCOVERY", "DISCOVERY_SCHEMA");
|
|
179
|
+
expect(discoveryPrompt).toContain("PRIOR WORK CHECK");
|
|
180
|
+
expect(discoveryPrompt).toContain("MET");
|
|
181
|
+
expect(discoveryPrompt).toContain("UNMET");
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// ── Gate Paths ─────────────────────────────────────────────────
|
|
186
|
+
// Gates consolidated to ~/.claude/gates/ (PR #499)
|
|
187
|
+
|
|
188
|
+
describe("gate-paths: gates run from consolidated location", () => {
|
|
189
|
+
|
|
190
|
+
test("GP-1: runGateWithHeal gate command uses HARNESS_ROOT-based gate paths", () => {
|
|
191
|
+
const gateRunner = sliceBetween(SHIP_JS, "async function runGateWithHeal", "PHASE 1: GOAL");
|
|
192
|
+
expect(gateRunner).toContain("gates/run-gate.ts");
|
|
193
|
+
expect(gateRunner).toContain("gates/error-classifier.ts");
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test("GP-2: No PROJECT_ROOT reference in gate paths", () => {
|
|
197
|
+
// All gate invocations should use HOME-relative paths
|
|
198
|
+
const gateRuns = SHIP_JS.match(/bun run .*gates\/run-gate\.ts/g) || [];
|
|
199
|
+
expect(gateRuns.length).toBeGreaterThan(0);
|
|
200
|
+
for (const run of gateRuns) {
|
|
201
|
+
expect(run).not.toContain("PROJECT_ROOT");
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// ── Workflow Structure ─────────────────────────────────────────
|
|
207
|
+
// ship.js must have all 9 phases from meta block
|
|
208
|
+
|
|
209
|
+
describe("workflow-structure: all phases present", () => {
|
|
210
|
+
|
|
211
|
+
test("WS-1: All 9 phases declared in meta block", () => {
|
|
212
|
+
const metaBlock = sliceBetween(SHIP_JS, "export const meta", "// ── Structured");
|
|
213
|
+
const expectedPhases = ["Goal", "Discovery", "Scope", "Implement", "Validate", "Commit", "Verify", "Ship", "Prove"];
|
|
214
|
+
for (const p of expectedPhases) {
|
|
215
|
+
expect(metaBlock).toContain(`title: '${p}'`);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
test("WS-2: All phases have phase() calls in body", () => {
|
|
220
|
+
const phaseCalls = SHIP_JS.match(/phase\('(\w+)'\)/g) || [];
|
|
221
|
+
const called = phaseCalls.map(p => p.match(/phase\('(\w+)'\)/)![1]);
|
|
222
|
+
expect(called).toContain("Goal");
|
|
223
|
+
expect(called).toContain("Discovery");
|
|
224
|
+
expect(called).toContain("Scope");
|
|
225
|
+
expect(called).toContain("Implement");
|
|
226
|
+
expect(called).toContain("Validate");
|
|
227
|
+
expect(called).toContain("Commit");
|
|
228
|
+
expect(called).toContain("Verify");
|
|
229
|
+
expect(called).toContain("Ship");
|
|
230
|
+
expect(called).toContain("Prove");
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// ── Prove Integration ──────────────────────────────────────────
|
|
235
|
+
// Spec Step 4: PROVE uses make prove-up with prod data, Quinn on :7776
|
|
236
|
+
|
|
237
|
+
describe("prove-workflow: prove.js matches spec", () => {
|
|
238
|
+
const PROVE_JS = readFileSync(join(HR, "workflows/prove.js"), "utf-8");
|
|
239
|
+
|
|
240
|
+
test("PW-1: Prove starts container with make prove-up before Quinn", () => {
|
|
241
|
+
// Spec: "make prove-up (rebuild image + rsync prod data + start on :7776)"
|
|
242
|
+
expect(PROVE_JS).toContain("make prove-up");
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test("PW-2: Quinn told to test on port 7776 (prove container), not dev server", () => {
|
|
246
|
+
expect(PROVE_JS).toContain("localhost:7776");
|
|
247
|
+
expect(PROVE_JS).toContain("NOT dev server");
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
test("PW-3: Prove container cleaned up with make prove-down", () => {
|
|
251
|
+
expect(PROVE_JS).toContain("make prove-down");
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
test("PW-4: Quinn instructed to use customers with real contacts", () => {
|
|
255
|
+
// Prove uses prod data — Quinn must test with real customers, not empty test accounts
|
|
256
|
+
expect(PROVE_JS).toMatch(/customer.*contact|prod.*data|real.*customer/i);
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// ── Spec Sync Check ────────────────────────────────────────────
|
|
261
|
+
// Verify the spec itself contains the claims we're testing against
|
|
262
|
+
|
|
263
|
+
describe("spec-sync: HARNESS-SKILL-CHAIN.md contains required claims", () => {
|
|
264
|
+
|
|
265
|
+
test("SS-1: Spec documents 3-layer verification", () => {
|
|
266
|
+
expect(SPEC_MD).toContain("Layer 1");
|
|
267
|
+
expect(SPEC_MD).toContain("Layer 2");
|
|
268
|
+
expect(SPEC_MD).toContain("Layer 3");
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
test("SS-2: Spec documents Quinn container before PR", () => {
|
|
272
|
+
expect(SPEC_MD).toContain("Quinn container PASS before PR");
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test("SS-3: Spec documents make test-rebuild for Layer 2", () => {
|
|
276
|
+
expect(SPEC_MD).toContain("make test-rebuild");
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
test("SS-4: Spec documents make prove-up for Layer 3 (post-merge)", () => {
|
|
280
|
+
expect(SPEC_MD).toContain("make prove-up");
|
|
281
|
+
expect(SPEC_MD).toContain("post-merge");
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
test("SS-5: Spec documents Rook security scan", () => {
|
|
285
|
+
expect(SPEC_MD).toContain("Rook security scan");
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
test("SS-6: SKILL.MD ceremony table exists", () => {
|
|
289
|
+
expect(SKILL_MD).toContain("LIGHT");
|
|
290
|
+
expect(SKILL_MD).toContain("STANDARD");
|
|
291
|
+
expect(SKILL_MD).toContain("THOROUGH");
|
|
292
|
+
expect(SKILL_MD).toContain("Quinn");
|
|
293
|
+
expect(SKILL_MD).toContain("Rook");
|
|
294
|
+
});
|
|
295
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { test, expect, describe } from "bun:test";
|
|
2
|
+
import { readFileSync, readdirSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
|
|
5
|
+
import { harnessRoot } from "../lib/paths";
|
|
6
|
+
import { parseFrontmatter } from "../lib/conformity";
|
|
7
|
+
|
|
8
|
+
const HARNESS_ROOT = harnessRoot();
|
|
9
|
+
const SPECS_DIR = join(HARNESS_ROOT, "specs");
|
|
10
|
+
|
|
11
|
+
const specFiles = readdirSync(SPECS_DIR).filter(f => f.endsWith(".md"));
|
|
12
|
+
|
|
13
|
+
describe("spec-discovery: frontmatter enforcement", () => {
|
|
14
|
+
|
|
15
|
+
test("SD-1: Every .md in PAI/Specs/ has testable field (true or false)", () => {
|
|
16
|
+
const missing: string[] = [];
|
|
17
|
+
for (const f of specFiles) {
|
|
18
|
+
const content = readFileSync(join(SPECS_DIR, f), "utf-8");
|
|
19
|
+
const fm = parseFrontmatter(content);
|
|
20
|
+
if (!fm || !("testable" in fm)) {
|
|
21
|
+
missing.push(f);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
expect(missing).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("SD-2: Every spec with testable:true produced at least 1 claim", () => {
|
|
28
|
+
const testableSpecs: string[] = [];
|
|
29
|
+
for (const f of specFiles) {
|
|
30
|
+
const content = readFileSync(join(SPECS_DIR, f), "utf-8");
|
|
31
|
+
const fm = parseFrontmatter(content);
|
|
32
|
+
if (fm?.testable === "true") {
|
|
33
|
+
testableSpecs.push(f);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
expect(testableSpecs.length).toBeGreaterThan(0);
|
|
37
|
+
|
|
38
|
+
const noClaims: string[] = [];
|
|
39
|
+
for (const f of testableSpecs) {
|
|
40
|
+
const content = readFileSync(join(SPECS_DIR, f), "utf-8");
|
|
41
|
+
const hasMake = /`make\s+[\w-]+`/.test(content);
|
|
42
|
+
const hasGate = /\*\*GATE:|Gate:\*\*/.test(content);
|
|
43
|
+
const hasPort = /:\d{4}\b/.test(content);
|
|
44
|
+
const hasQuinn = /Quinn\s+(validates|captures|tests|navigates|compares|verifies)/i.test(content);
|
|
45
|
+
if (!hasMake && !hasGate && !hasPort && !hasQuinn) {
|
|
46
|
+
noClaims.push(f);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (noClaims.length > 0) {
|
|
50
|
+
console.warn(`Specs with testable:true but no extractable claims: ${noClaims.join(", ")}`);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("SD-3: Total claim count across all testable specs is non-zero", () => {
|
|
55
|
+
let totalClaims = 0;
|
|
56
|
+
for (const f of specFiles) {
|
|
57
|
+
const content = readFileSync(join(SPECS_DIR, f), "utf-8");
|
|
58
|
+
const fm = parseFrontmatter(content);
|
|
59
|
+
if (fm?.testable !== "true") continue;
|
|
60
|
+
const makes = (content.match(/`make\s+[\w-]+`/g) || []).length;
|
|
61
|
+
const gates = (content.match(/\*\*GATE:|Gate:\*\*/g) || []).length;
|
|
62
|
+
const ports = (content.match(/:(7776|7777|7778|5173)\b/g) || []).length;
|
|
63
|
+
const quinns = (content.match(/Quinn\s+(validates|captures|tests|navigates|compares|verifies)/gi) || []).length;
|
|
64
|
+
totalClaims += makes + gates + ports + quinns;
|
|
65
|
+
}
|
|
66
|
+
expect(totalClaims).toBeGreaterThan(0);
|
|
67
|
+
});
|
|
68
|
+
});
|