rungate 0.4.0 → 0.5.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.
Files changed (65) hide show
  1. package/config/behavioral-sc-map.json +170 -0
  2. package/config/brief-policies.json +28 -0
  3. package/config/ceremony-profiles.json +207 -0
  4. package/config/check-registry.json +114 -0
  5. package/config/matcher-registry.json +142 -0
  6. package/config/prove-evidence.schema.json +65 -0
  7. package/config/spec-policies.json +36 -0
  8. package/config/universal-rules.yaml +15 -0
  9. package/config/workflow-schema.json +279 -0
  10. package/lib/ac-quality.ts +119 -0
  11. package/lib/cli-commands.ts +7 -1
  12. package/lib/config-loader.ts +129 -5
  13. package/lib/conformity.ts +1122 -31
  14. package/lib/context-docs.ts +182 -0
  15. package/lib/create-brief.ts +22 -17
  16. package/lib/create-sc.ts +35 -8
  17. package/lib/doc-scan-targets.ts +435 -0
  18. package/lib/gate-check-audit.ts +9 -9
  19. package/lib/github.ts +195 -0
  20. package/lib/js-top-level-code.ts +27 -2
  21. package/lib/organize.ts +129 -40
  22. package/lib/package-closure.ts +387 -0
  23. package/lib/project-aliases.ts +100 -0
  24. package/lib/release-preflight.ts +352 -48
  25. package/lib/rungate-schema.ts +23 -1
  26. package/lib/sc-cover.ts +92 -1
  27. package/lib/sc-ids.ts +151 -0
  28. package/lib/scaffold/defaults.ts +40 -0
  29. package/lib/scaffold/managed-workflow.ts +125 -27
  30. package/lib/scaffold/owned-files.ts +6 -0
  31. package/lib/scaffold/profiles.ts +94 -0
  32. package/lib/scaffold/rehearsal.ts +355 -0
  33. package/lib/scaffold/steps.ts +787 -105
  34. package/lib/scaffold/write-steps.ts +208 -0
  35. package/lib/scratch-cleanup.ts +198 -0
  36. package/lib/scratch-roots.ts +94 -0
  37. package/lib/source-anchor.ts +144 -0
  38. package/lib/success-doc.ts +779 -0
  39. package/lib/suite-run-reading.ts +194 -0
  40. package/lib/test-census.ts +199 -0
  41. package/lib/trajectory.ts +377 -0
  42. package/lib/validators/spec-validators.ts +52 -35
  43. package/lib/workflow-security.ts +152 -7
  44. package/lib/workflow-test-harness.ts +349 -0
  45. package/lib/worktree-cleanup.ts +123 -7
  46. package/lib/worktree-repo.ts +165 -0
  47. package/package.json +10 -1
  48. package/scripts/audit-specs.ts +134 -37
  49. package/scripts/audit-transcript.ts +259 -0
  50. package/scripts/create-sc.ts +15 -1
  51. package/scripts/create-success.ts +162 -0
  52. package/scripts/detect-sc-drift.ts +200 -0
  53. package/scripts/extract-constraints.ts +16 -36
  54. package/scripts/scaffold-project.ts +51 -137
  55. package/scripts/split-spec.ts +315 -0
  56. package/scripts/sync-sc-status.ts +751 -0
  57. package/specs/SPEC-TEMPLATE.md +200 -0
  58. package/templates/SUCCESS-TEMPLATE.md +72 -0
  59. package/templates/agent-briefs/_shared.md +9 -0
  60. package/templates/agent-briefs/aditi.md +46 -0
  61. package/templates/agent-briefs/discovery.md +37 -0
  62. package/templates/agent-briefs/marcus.md +39 -0
  63. package/templates/agent-briefs/quinn.md +67 -0
  64. package/templates/agent-briefs/rook.md +40 -0
  65. package/templates/agent-briefs/serena.md +39 -0
@@ -0,0 +1,170 @@
1
+ {
2
+ "SC-258": {
3
+ "criterionId": "SHARED-01",
4
+ "description": "Universal rules loaded from config/universal-rules.yaml"
5
+ },
6
+ "SC-259": {
7
+ "criterionId": "SHARED-01",
8
+ "description": "AGENTS.md template loaded from prompts/agents-md-template.md"
9
+ },
10
+ "SC-262": {
11
+ "criterionId": "SHARED-01",
12
+ "description": "Universal rules count under 16 — sigmoid collapse threshold"
13
+ },
14
+ "SC-270": {
15
+ "criterionId": "DA-03",
16
+ "description": "Large specs with multiple intents split into single-intent files"
17
+ },
18
+ "SC-280": {
19
+ "criterionId": "DA-03",
20
+ "description": "Split files sharing a common parent group under one routing entry"
21
+ },
22
+ "SC-295": {
23
+ "criterionId": "M-04",
24
+ "description": "~35 structural SCs enriched with bracket-list values — auto-tested by matchPattern"
25
+ },
26
+ "SC-305": {
27
+ "criterionId": "SHARED-03",
28
+ "description": "Hook registrations contain RUNGATE_HOOKS_DIR variable"
29
+ },
30
+ "SC-318": {
31
+ "criterionId": "SHARED-04",
32
+ "description": "Cold-start agent finds PROJECT-STATE.md within first 3 tool calls"
33
+ },
34
+ "SC-331": {
35
+ "criterionId": "Q-01",
36
+ "description": "matchPattern() returns non-null for all static SCs in testable strict specs"
37
+ },
38
+ "SC-343": {
39
+ "criterionId": "Q-01",
40
+ "description": "Phase-1.5 tests remain as conformity engine unit tests"
41
+ },
42
+ "SC-345": {
43
+ "criterionId": "M-04",
44
+ "description": "Every SC in testable specs classified as static or behavioral"
45
+ },
46
+ "SC-346": {
47
+ "criterionId": "M-04",
48
+ "description": "Behavioral SCs have verification tag and route to SESSION-AUDIT-SPEC"
49
+ },
50
+ "SC-347": {
51
+ "criterionId": "Q-01",
52
+ "description": "Hook-wiring SCs rewritten as static checks where artifact exists"
53
+ },
54
+ "SC-351": {
55
+ "criterionId": "SHARED-01",
56
+ "description": "Each generated brief has all 8 required sections"
57
+ },
58
+ "SC-357": {
59
+ "criterionId": "M-05",
60
+ "description": "Template variables filled from project scan match actual project values"
61
+ },
62
+ "SC-359": {
63
+ "criterionId": "M-05",
64
+ "description": "Scanner detects tech stack, specs, consumers, source directories"
65
+ },
66
+ "SC-365": {
67
+ "criterionId": "M-05",
68
+ "description": "Scanner is importable by other scripts without pulling in generation logic"
69
+ },
70
+ "SC-366": {
71
+ "criterionId": "M-03",
72
+ "description": "Each generator is independently testable with mock ProjectScan data"
73
+ },
74
+ "SC-370": {
75
+ "criterionId": "M-04",
76
+ "description": "Every hook file traces to at least one SC in a testable spec"
77
+ },
78
+ "SC-371": {
79
+ "criterionId": "SHARED-03",
80
+ "description": "No hook file exceeds 150 lines"
81
+ },
82
+ "SC-372": {
83
+ "criterionId": "Q-01",
84
+ "description": "Hook logic in lib/ has unit tests independent of hook trigger mechanism"
85
+ },
86
+ "SC-373": {
87
+ "criterionId": "Q-02",
88
+ "description": "Every gate source file has a typed input/output interface exported"
89
+ },
90
+ "SC-374": {
91
+ "criterionId": "M-04",
92
+ "description": "Pass/fail criteria for each gate documented as SCs in this spec"
93
+ },
94
+ "SC-375": {
95
+ "criterionId": "M-04",
96
+ "description": "Gate chain order documented — which gates feed into which"
97
+ },
98
+ "SC-377": {
99
+ "criterionId": "Q-01",
100
+ "description": "Gate contracts testable by conformity engine"
101
+ },
102
+ "SC-378": {
103
+ "criterionId": "Q-02",
104
+ "description": "No gate passes implicit state — all data flows through typed interfaces"
105
+ },
106
+ "SC-381": {
107
+ "criterionId": "M-05",
108
+ "description": "SPEC-TEMPLATE pattern reference auto-generated from matcher config"
109
+ },
110
+ "SC-384": {
111
+ "criterionId": "M-05",
112
+ "description": "Consumers can extend matcher config with custom matchers for their domain"
113
+ },
114
+ "SC-385": {
115
+ "criterionId": "SHARED-01",
116
+ "description": "Agent-to-prompt keyword routing defined in config, not hardcoded in scaffold"
117
+ },
118
+ "SC-386": {
119
+ "criterionId": "SHARED-01",
120
+ "description": "Consumers can override keyword routing in their rungate.json"
121
+ },
122
+ "SC-390": {
123
+ "criterionId": "SHARED-01",
124
+ "description": "Consumer can add project-specific rules via config"
125
+ },
126
+ "SC-391": {
127
+ "criterionId": "SHARED-03",
128
+ "description": "Hook registrations in settings.json contain hookFor and command fields"
129
+ },
130
+ "SC-392": {
131
+ "criterionId": "SHARED-01",
132
+ "description": "Hook activation controlled by config enabled field"
133
+ },
134
+ "SC-395": {
135
+ "criterionId": "Q-01",
136
+ "description": "Consumers running create-spec get SC validation identical to RunGate's own"
137
+ },
138
+ "SC-398": {
139
+ "criterionId": "Q-01",
140
+ "description": "All RunGate specs at compliance: strict — zero unmatched SCs"
141
+ },
142
+ "SC-400": {
143
+ "criterionId": "M-01",
144
+ "description": "test-brief CLI spawns agent, audits transcript, reports compliance score"
145
+ },
146
+ "SC-402": {
147
+ "criterionId": "M-02",
148
+ "description": "Transcript compliance checker cross-references directives against tool calls"
149
+ },
150
+ "SC-408": {
151
+ "criterionId": "SHARED-01",
152
+ "description": "Standard tasks defined per role in config"
153
+ },
154
+ "SC-418": {
155
+ "criterionId": "M-01",
156
+ "description": "Transcript grading includes per-rule FOLLOWED/IGNORED verdict with evidence"
157
+ },
158
+ "SC-420": {
159
+ "criterionId": "M-01",
160
+ "description": "Dashboard output shows per-rule compliance rate as percentage"
161
+ },
162
+ "SC-A1": {
163
+ "criterionId": "Q-01",
164
+ "description": "No LLM/AI model calls in lib/doc-hygiene.ts or lib/spec-registry.ts"
165
+ },
166
+ "SC-A2": {
167
+ "criterionId": "Q-01",
168
+ "description": "No FAIL-level content checks without 10+ cycle precision data"
169
+ }
170
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Content validation policies per agent type. AgentBriefGuard reads this at runtime.",
3
+ "policies": {
4
+ "marcus": {
5
+ "requiredPatterns": [
6
+ {"name": "Goal", "pattern": "(?i)(goal|objective|what to implement)", "description": "Issue goal statement"},
7
+ {"name": "ACs", "pattern": "(?i)(acceptance criter|\\bAC-|\\bSC-|success criter)", "description": "Acceptance or success criteria"},
8
+ {"name": "Files", "pattern": "(?i)(files to|files changed|file.*read|file.*modify)", "description": "Specific files to read/modify"},
9
+ {"name": "Scope", "pattern": "(?i)(scope.*not|do not touch|out of scope|scope bound)", "description": "Scope boundaries"},
10
+ {"name": "Verify", "pattern": "(?i)(verify|verification|verify command|test command)", "description": "Verification commands"}
11
+ ],
12
+ "enforcement": "WARN"
13
+ },
14
+ "quinn": {
15
+ "requiredPatterns": [
16
+ {"name": "Environment", "pattern": "(?i)(port|localhost|url|environment|7776|5173)", "description": "Test environment details"},
17
+ {"name": "What to test", "pattern": "(?i)(test|verify|check|validate)", "description": "Test scope"}
18
+ ],
19
+ "enforcement": "WARN"
20
+ },
21
+ "rook": {
22
+ "requiredPatterns": [
23
+ {"name": "Files", "pattern": "(?i)(files|changed|scan|review)", "description": "Files to scan"}
24
+ ],
25
+ "enforcement": "WARN"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,207 @@
1
+ {
2
+ "$schema": "./ceremony-profiles-schema.json",
3
+ "description": "Ceremony tiers — evaluator depth determines which checks run. Gate-runner reads this file.",
4
+ "tierSelection": {
5
+ "description": "Mechanical tier selection — harness selects, not DA",
6
+ "rules": [
7
+ {
8
+ "tier": "LIGHT",
9
+ "when": "size in [XS] AND unknowns == 0 AND files <= 3 AND no cascade-glob match"
10
+ },
11
+ {
12
+ "tier": "STANDARD",
13
+ "when": "size in [S, M] OR (size == XS AND any rule above fails)"
14
+ },
15
+ {
16
+ "tier": "THOROUGH",
17
+ "when": "size in [L] OR unfamiliar domain OR cross-repo"
18
+ }
19
+ ]
20
+ },
21
+ "tiers": {
22
+ "LIGHT": {
23
+ "description": "Self-verify. DA checks own work. Computational sensors only.",
24
+ "evaluator": "self",
25
+ "gates": [
26
+ "ship"
27
+ ],
28
+ "skipScopeGate": true,
29
+ "agents": {
30
+ "marcus": "optional",
31
+ "quinn": false,
32
+ "rook": false
33
+ },
34
+ "githubComments": 2,
35
+ "stopMarkers": 0,
36
+ "maxIterations": 3,
37
+ "checks": {
38
+ "scope": [
39
+ "acs-exist",
40
+ "acs-have-type",
41
+ "acs-have-threshold",
42
+ "source-spec-cited"
43
+ ],
44
+ "verify": [
45
+ "all-acs-have-evidence",
46
+ "all-acs-pass",
47
+ "tests-pass",
48
+ "tsc-pass",
49
+ "code-committed"
50
+ ],
51
+ "ship": [
52
+ "all-gates-pass",
53
+ "branch-merged",
54
+ "code-pushed"
55
+ ]
56
+ }
57
+ },
58
+ "STANDARD": {
59
+ "description": "Separated verifier. Quinn validates independently.",
60
+ "evaluator": "separated",
61
+ "gates": [
62
+ "scope",
63
+ "verify",
64
+ "ship"
65
+ ],
66
+ "skipScopeGate": false,
67
+ "agents": {
68
+ "marcus": true,
69
+ "quinn": true,
70
+ "rook": false
71
+ },
72
+ "githubComments": 3,
73
+ "stopMarkers": 1,
74
+ "maxIterations": 5,
75
+ "checks": {
76
+ "scope": [
77
+ "acs-exist",
78
+ "acs-have-type",
79
+ "acs-have-threshold",
80
+ "acs-have-evidence-method",
81
+ "source-spec-cited",
82
+ "spec-elements-in-acs",
83
+ "sizing-declared",
84
+ "issue-goal-captured",
85
+ "acs-no-skillmd-enforcement",
86
+ "acs-no-behavioral-language",
87
+ "ac-issue-alignment"
88
+ ],
89
+ "verify": [
90
+ "all-acs-have-evidence",
91
+ "all-acs-pass",
92
+ "evidence-type-valid",
93
+ "evidence-type-ratio",
94
+ "evidence-portable",
95
+ "tests-pass",
96
+ "tsc-pass",
97
+ "code-committed",
98
+ "quinn-on-ui-change",
99
+ "local-api-validated",
100
+ "local-ui-validated",
101
+ "local-before-prod",
102
+ "container-has-fix",
103
+ "spec-drift",
104
+ "decision-id-valid",
105
+ "spec-decision-compliance",
106
+ "brief-ac-alignment"
107
+ ],
108
+ "ship": [
109
+ "all-gates-pass",
110
+ "branch-merged",
111
+ "code-pushed",
112
+ "prod-rebuild-pass",
113
+ "prod-smoke-pass",
114
+ "prod-quinn-pass",
115
+ "prod-quinn-spot"
116
+ ]
117
+ },
118
+ "batchMode": {
119
+ "description": "When batchMode is active, use reduced check set. Activated by ship skill for 3+ dependent issues.",
120
+ "skipScopeGate": true,
121
+ "checks": {
122
+ "scope": [
123
+ "acs-measurable",
124
+ "acs-no-skillmd-enforcement",
125
+ "acs-no-behavioral-language"
126
+ ],
127
+ "verify": [
128
+ "code-committed",
129
+ "tests-pass",
130
+ "tsc-pass",
131
+ "local-before-prod",
132
+ "container-has-fix"
133
+ ],
134
+ "ship": [
135
+ "branch-merged",
136
+ "code-pushed",
137
+ "prod-smoke-pass"
138
+ ]
139
+ }
140
+ }
141
+ },
142
+ "THOROUGH": {
143
+ "description": "Adversarial multi-agent. Quinn + Rook + challenge agent.",
144
+ "evaluator": "adversarial",
145
+ "gates": [
146
+ "scope",
147
+ "verify",
148
+ "ship"
149
+ ],
150
+ "skipScopeGate": false,
151
+ "agents": {
152
+ "marcus": true,
153
+ "quinn": true,
154
+ "rook": true
155
+ },
156
+ "githubComments": 5,
157
+ "stopMarkers": 3,
158
+ "maxIterations": 8,
159
+ "checks": {
160
+ "scope": [
161
+ "acs-exist",
162
+ "acs-have-type",
163
+ "acs-have-threshold",
164
+ "acs-have-evidence-method",
165
+ "source-spec-cited",
166
+ "spec-elements-in-acs",
167
+ "sizing-declared",
168
+ "issue-goal-captured",
169
+ "acs-no-skillmd-enforcement",
170
+ "acs-no-behavioral-language",
171
+ "ac-issue-alignment"
172
+ ],
173
+ "verify": [
174
+ "all-acs-have-evidence",
175
+ "all-acs-pass",
176
+ "evidence-type-valid",
177
+ "evidence-type-ratio",
178
+ "evidence-portable",
179
+ "evidence-method-executed",
180
+ "threshold-crosscheck",
181
+ "tests-pass",
182
+ "tsc-pass",
183
+ "code-committed",
184
+ "quinn-on-ui-change",
185
+ "local-api-validated",
186
+ "local-ui-validated",
187
+ "local-before-prod",
188
+ "container-has-fix",
189
+ "dead-exports",
190
+ "spec-drift",
191
+ "decision-id-valid",
192
+ "spec-decision-compliance",
193
+ "brief-ac-alignment"
194
+ ],
195
+ "ship": [
196
+ "all-gates-pass",
197
+ "branch-merged",
198
+ "code-pushed",
199
+ "prod-rebuild-pass",
200
+ "prod-smoke-pass",
201
+ "prod-quinn-pass",
202
+ "prod-quinn-spot"
203
+ ]
204
+ }
205
+ }
206
+ }
207
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "$comment": "#339. Where every gate check named by config/ceremony-profiles.json is implemented. Enforced both directions by test/check-registry.test.ts — a profile cannot name a check with no entry, and an entry cannot point at an implementation that is not there. Edit this when you add a check, not after someone asks where it lives.",
3
+ "gateDescribes": [
4
+ "scope checks",
5
+ "verify checks",
6
+ "B1/B2 agent results",
7
+ "spec traceability",
8
+ "ship checks",
9
+ "prompt immutability",
10
+ "prove checks"
11
+ ],
12
+ "checks": {
13
+ "acs-exist": { "impl": "gates/workflow.test.ts" },
14
+ "acs-have-evidence-method": { "impl": "gates/workflow.test.ts" },
15
+ "acs-no-skillmd-enforcement": { "impl": "gates/workflow.test.ts" },
16
+ "ac-issue-alignment": { "impl": "gates/workflow.test.ts" },
17
+ "source-spec-cited": { "impl": "gates/workflow.test.ts" },
18
+ "spec-elements-in-acs": { "impl": "gates/workflow.test.ts" },
19
+ "sizing-declared": { "impl": "gates/workflow.test.ts" },
20
+ "issue-goal-captured": { "impl": "gates/workflow.test.ts" },
21
+ "local-before-prod": { "impl": "gates/workflow.test.ts" },
22
+ "container-has-fix": { "impl": "gates/workflow.test.ts" },
23
+ "all-acs-have-evidence": { "impl": "gates/workflow.test.ts" },
24
+ "all-acs-pass": { "impl": "gates/workflow.test.ts" },
25
+ "evidence-type-valid": { "impl": "gates/workflow.test.ts" },
26
+ "evidence-type-ratio": { "impl": "gates/workflow.test.ts" },
27
+ "evidence-method-executed": { "impl": "gates/workflow.test.ts" },
28
+ "evidence-portable": { "impl": "gates/workflow.test.ts" },
29
+ "threshold-crosscheck": { "impl": "gates/workflow.test.ts" },
30
+ "tests-pass": { "impl": "gates/workflow.test.ts" },
31
+ "tsc-pass": { "impl": "gates/workflow.test.ts" },
32
+ "code-committed": { "impl": "gates/workflow.test.ts" },
33
+ "code-pushed": { "impl": "gates/workflow.test.ts" },
34
+ "local-api-validated": { "impl": "gates/workflow.test.ts" },
35
+ "local-ui-validated": { "impl": "gates/workflow.test.ts" },
36
+ "quinn-on-ui-change": { "impl": "gates/workflow.test.ts" },
37
+ "brief-ac-alignment": { "impl": "gates/workflow.test.ts" },
38
+ "spec-decision-compliance": { "impl": "gates/workflow.test.ts" },
39
+ "decision-id-valid": { "impl": "gates/workflow.test.ts" },
40
+ "all-gates-pass": { "impl": "gates/workflow.test.ts" },
41
+ "branch-merged": { "impl": "gates/workflow.test.ts" },
42
+ "prod-rebuild-pass": { "impl": "gates/workflow.test.ts" },
43
+ "prod-smoke-pass": { "impl": "gates/workflow.test.ts" },
44
+ "prod-quinn-pass": { "impl": "gates/workflow.test.ts" },
45
+ "prod-quinn-spot": { "impl": "gates/workflow.test.ts" },
46
+
47
+ "acs-have-type": {
48
+ "impl": "gates/schema.ts",
49
+ "symbol": "missing type (CODE or OUTCOME)",
50
+ "note": "#339 made this true. The field was `.optional()`, so an AC with no type passed the check named after requiring one. 0 of 456 ACs across 82 recorded runs lacked a type, so refining it starts a check being enforced rather than starting it failing."
51
+ },
52
+ "acs-have-threshold": {
53
+ "impl": "gates/schema.ts",
54
+ "symbol": "missing threshold",
55
+ "note": "A superRefine on ACSchema, not a test in workflow.test.ts. Three greps for `acs-have-threshold` found nothing; the rule is there under a different name, which is the whole reason this registry is data."
56
+ },
57
+ "acs-no-behavioral-language": {
58
+ "impl": "gates/schema.ts",
59
+ "symbol": "BEHAVIORAL_PATTERN",
60
+ "note": "Same superRefine. #339 listed this among nine checks with no locatable implementation; it has one, spelled nothing like its profile name."
61
+ },
62
+ "spec-drift": {
63
+ "impl": "lib/conformity.ts",
64
+ "symbol": "runSpecDrift",
65
+ "note": "Part of the conformity suite the scaffold generates, not the workflow gate."
66
+ },
67
+ "dead-exports": {
68
+ "impl": "lib/conformity.ts",
69
+ "symbol": "runFallowCheck",
70
+ "note": "FALLOW-2. Warn-only unless the suite is run in failing mode, and skippable via opts.skipUnusedExports — so the profile naming it overstates what a THOROUGH run measures. Recorded rather than silently accepted; tightening it is a separate change with its own blast radius."
71
+ }
72
+ },
73
+ "alwaysRun": {
74
+ "$comment": "Gate checks that run at every tier because nothing selects on the profile lists — see the spec. Listed so the reverse direction is enforceable: a check in a gate describe must be named by a profile OR appear here. Not an exemption list: each entry is asserted to exist, and the set is asserted to be exactly what is in the file.",
75
+ "acs-measurable": "scope checks",
76
+ "sourceSpecs-required": "scope checks",
77
+ "before-state-captured": "scope checks",
78
+ "discovery-evidence": "scope checks",
79
+ "governing-spec-exists": "scope checks",
80
+ "harness-port-validation": "scope checks",
81
+ "worktree-repo": "verify checks",
82
+ "no-fail-verdicts-in-done": "verify checks",
83
+ "outcome-acs-no-skip": "verify checks",
84
+ "outcome-evidence-behavioral": "verify checks",
85
+ "evidence-prevalidation": "verify checks",
86
+ "quinn-container-port": "verify checks",
87
+ "ac-spec-traceability": "verify checks",
88
+ "marcus-committed": "verify checks",
89
+ "prove-evidence-type": "verify checks",
90
+ "acHash-consistency-verify": "verify checks",
91
+ "contextual-skip-validation": "verify checks",
92
+ "b1-prompt-exists": "B1/B2 agent results",
93
+ "b2-prompt-exists": "B1/B2 agent results",
94
+ "b1-adversary-verify-structure": "B1/B2 agent results",
95
+ "b2-evidence-validator-structure": "B1/B2 agent results",
96
+ "quinn-tested-changed-files": "ship checks",
97
+ "verify-blockers-cleared": "ship checks",
98
+ "witness-chain": "ship checks",
99
+ "witness-ac-verdict": "ship checks",
100
+ "pre-registration": "ship checks",
101
+ "acHash-consistency-ship": "ship checks",
102
+ "prove-label-enforcement": "ship checks",
103
+ "prompt-immutability": "prompt immutability",
104
+ "prove-evidence-exists": "prove checks",
105
+ "prove-evidence-verdict": "prove checks"
106
+ },
107
+ "delisted": {
108
+ "$comment": "#339 SC-4: named by a profile, resolving to nothing, removed from the profiles in the same change. Kept here so re-adding one without an implementation is a visible edit rather than a quiet one.",
109
+ "consumer-chain-verified": "No implementation anywhere in lib/, gates/, scripts/, workflows/ or hooks/. Named by THOROUGH.verify. Nothing has ever measured it.",
110
+ "skill-qc-goal": "scripts/skill-qc-validator.sh exists and nothing invokes it — no caller in any source directory, workflow or hook. Named by STANDARD.scope and THOROUGH.scope.",
111
+ "skill-qc-ship": "Same uninvoked script. Named by STANDARD.verify and THOROUGH.verify.",
112
+ "evidence-target-valid": "Removed in #315 because it asserted nothing, and replaced in #338 by evidence-portable after the measurement showed its premise did not hold."
113
+ }
114
+ }
@@ -0,0 +1,142 @@
1
+ [
2
+ {
3
+ "name": "file-exists",
4
+ "syntax": "{file} exists [at root] [<= N lines]",
5
+ "regex": "^(\\S+)\\s+exists?\\b(?:\\s+at\\s+root)?",
6
+ "example": "AGENTS.md exists",
7
+ "notes": "Checks that a file exists at the project root. Optionally checks line count with <= N lines suffix."
8
+ },
9
+ {
10
+ "name": "dir-exists",
11
+ "syntax": "{dir}/ directory exists [with >= N {type}]",
12
+ "regex": "^(\\S+?)\\/?\\s+directory\\s+exists",
13
+ "example": "specs/ directory exists",
14
+ "notes": "Checks that a directory exists. Supports aliases (test/tests, reference/ref). Optional minimum file count."
15
+ },
16
+ {
17
+ "name": "all-specs-frontmatter",
18
+ "syntax": "all specs have frontmatter",
19
+ "regex": "^all\\s+specs\\s+have\\b.*frontmatter",
20
+ "example": "all specs have frontmatter",
21
+ "notes": "Validates that every spec in specs/ has YAML frontmatter with a testable field. Skips status: split files."
22
+ },
23
+ {
24
+ "name": "paths-resolve",
25
+ "syntax": "all paths referenced in {file} resolve",
26
+ "regex": "all\\s+paths\\s+referenced\\s+in\\s+(\\S+)\\s+resolve",
27
+ "example": "all paths referenced in AGENTS.md resolve",
28
+ "notes": "Scans markdown links in the target file and verifies each local path resolves. Skips http and anchor links."
29
+ },
30
+ {
31
+ "name": "root-clean",
32
+ "syntax": "root is clean [content: <= N] [code: <= N]",
33
+ "regex": "root\\s+is\\s+clean",
34
+ "example": "root is clean",
35
+ "notes": "Checks that the project root has a reasonable number of top-level items. Content projects default to 10, code projects to 30."
36
+ },
37
+ {
38
+ "name": "pointer-exists",
39
+ "syntax": "{file} exists with pointer to {target}",
40
+ "regex": "(\\S+)\\s+exists\\s+with\\s+pointer\\s+to\\s+(\\S+)",
41
+ "example": "CLAUDE.md exists with pointer to AGENTS.md",
42
+ "notes": "Checks that a file exists AND contains a reference to the target string."
43
+ },
44
+ {
45
+ "name": "canary",
46
+ "syntax": "canary",
47
+ "regex": "canary",
48
+ "example": "canary test exists",
49
+ "notes": "Checks that a conformity or canary test file exists in the test/ directory."
50
+ },
51
+ {
52
+ "name": "content-contains-compound",
53
+ "syntax": "{file} contains [{items}] and [{file2}] [not] contains [{items2}]",
54
+ "regex": "^(\\S+)\\s+contains?\\s+\\[([^\\]]+)\\]\\s+and\\s+(?:\\S*[./]\\S*\\s+)?(?:not\\s+contains?|does\\s+not\\s+contain|must\\s+NOT\\s+contain|has\\s+no|contains?)\\s+\\[",
55
+ "example": "gates/orchestrator.ts contains [github] and not contains [gh issue]",
56
+ "notes": "MUST precede content-contains. A compound statement is asserted clause by clause; without this entry content-contains binds first, asserts only the leading bracket list, and discards every later clause with no signal (#220). A second clause may name its own file and may be positive — two of the 21 compound SCs found in the corpus are positive clauses on a different file. Absence clauses on .ts/.js targets are evaluated with comments stripped, because an absence claim is about code."
57
+ },
58
+ {
59
+ "name": "content-contains",
60
+ "syntax": "{file} contains [{item1}, {item2}, ...]",
61
+ "regex": "^(\\S+)\\s+contains?\\s+\\[([^\\]]+)\\]",
62
+ "example": "AGENTS.md contains [Project Identity, Rules]",
63
+ "notes": "Checks that a file contains all listed items. Items are comma-separated inside brackets."
64
+ },
65
+ {
66
+ "name": "content-not-contains",
67
+ "syntax": "{file} [must NOT contain|not contains|does not contain|has no] [{item1}, {item2}, ...]",
68
+ "regex": "^(\\S+)\\s+(?:must\\s+NOT\\s+contain|does\\s+not\\s+contain|not\\s+contains?|has\\s+no)\\s+\\[([^\\]]+)\\]",
69
+ "example": "AGENTS.md must NOT contain [deprecated-section]",
70
+ "notes": "Checks that a file does NOT contain any of the listed items. #426 added the 'not contains' and 'does not contain' forms: the entry accepted only 'must NOT contain' and 'has no', while content-contains-compound's own example writes the second clause as 'and not contains [gh issue]'. So the single-clause form of the grammar this file documents was unmatchable, and SC-1469 — an absence claim about workflows/ship.js — generated no assertion AND was rewritten lossily by scaffold --fix on every run."
71
+ },
72
+ {
73
+ "name": "count-threshold",
74
+ "syntax": "{file} is under [{N}] lines|words",
75
+ "regex": "^(.+?)\\s+(?:is\\s+under|at\\s+most)\\s+\\[(\\d+)\\]\\s+(lines?|words?)",
76
+ "example": "AGENTS.md is under [200] lines",
77
+ "notes": "Checks that a file is under a threshold of lines or words. Supports both 'is under' and 'at most' syntax."
78
+ },
79
+ {
80
+ "name": "json-field-equals",
81
+ "syntax": "{file} {field} field equals [{value}]",
82
+ "regex": "^(\\S+)\\s+(\\S+)\\s+field\\s+equals\\s+\\[([^\\]]+)\\]",
83
+ "example": "package.json name field equals [rungate]",
84
+ "notes": "Checks that a JSON file's field has the expected value. Supports nested fields with dot notation (e.g., config.name)."
85
+ },
86
+ {
87
+ "name": "section-exists",
88
+ "syntax": "{file} has section [{SectionName}]",
89
+ "regex": "^(\\S+)\\s+has\\s+section\\s+\\[([^\\]]+)\\]",
90
+ "example": "AGENTS.md has section [Rules]",
91
+ "notes": "Checks that a markdown file has a heading matching the section name. Matches any heading level (# through ######)."
92
+ },
93
+ {
94
+ "name": "regex-match",
95
+ "syntax": "{file} matches /{pattern}/[flags]",
96
+ "regex": "^(\\S+)\\s+matches\\s+\\/(.+?)\\/([gimsuvy]*)$",
97
+ "example": "AGENTS.md matches /^# /m",
98
+ "notes": "Checks that a file's content matches the given regular expression. Supports standard regex flags."
99
+ },
100
+ {
101
+ "name": "source-contains",
102
+ "syntax": "harness {file} contains [{keywords}]",
103
+ "regex": "^(?:harness\\s+)?(\\S+)\\s+contains?\\s+\\[([^\\]]+)\\]",
104
+ "example": "harness lib/conformity.ts contains [matchPattern, runScaffoldConformity]",
105
+ "notes": "Checks that a harness source file (lib/, scripts/, hooks/, gates/) contains listed keywords. Requires 'harness' prefix or source path prefix."
106
+ },
107
+ {
108
+ "name": "json-has-field",
109
+ "syntax": "{file}.json has field {name}",
110
+ "regex": "^(\\S+?)(?:\\.json)?\\s+has\\s+field\\s+(\\S+)",
111
+ "example": "package.json has field scripts",
112
+ "notes": "Checks that a JSON file has the specified field defined. Supports nested fields with dot notation."
113
+ },
114
+ {
115
+ "name": "scaffold-produces",
116
+ "syntax": "scaffold output {file} exists",
117
+ "regex": "^scaffold\\s+output\\s+(\\S+)\\s+exists",
118
+ "example": "scaffold output AGENTS.md exists",
119
+ "notes": "Checks that a scaffold-generated file exists. Currently validates file presence; future versions will run scaffold and verify output."
120
+ },
121
+ {
122
+ "name": "frontmatter-field",
123
+ "syntax": "{file} frontmatter has {field} [= {value}]",
124
+ "regex": "^(\\S+)\\s+frontmatter\\s+has\\s+(\\S+)(?:\\s*=\\s*(.+?))?(?:\\s+—\\s.*)?$",
125
+ "example": "specs/CONFIG-DRIVEN-TESTING-SPEC.md frontmatter has testable = true",
126
+ "notes": "Checks YAML frontmatter in a file. Verifies field exists, optionally checks its value. Used for spec and agent file metadata. The value stops at an em-dash separator so an SC can carry its rationale without that prose becoming part of the compared value. A field whose value is a nested YAML block counts as present."
127
+ },
128
+ {
129
+ "name": "file-line-range",
130
+ "syntax": "{file} is between [{min}] and [{max}] lines",
131
+ "regex": "^(\\S+)\\s+is\\s+between\\s+\\[(\\d+)\\]\\s+and\\s+\\[(\\d+)\\]\\s+lines",
132
+ "example": "AGENTS.md is between [50] and [300] lines",
133
+ "notes": "Checks that a file's line count falls within a range (inclusive). Useful for ensuring files are neither too short nor too long."
134
+ },
135
+ {
136
+ "name": "command-output",
137
+ "syntax": "command-output `{command}` contains [{expected1}, {expected2}, ...]",
138
+ "regex": "^command-output\\s+`([^`]+)`\\s+contains\\s+\\[([^\\]]+)\\]",
139
+ "example": "command-output `bun test --help` contains [test, run]",
140
+ "notes": "Runs a shell command via spawnSync with a 10-second timeout and checks that stdout contains all listed strings. Returns FAIL (not crash) on non-zero exit."
141
+ }
142
+ ]