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,36 @@
|
|
|
1
|
+
name: account-plan
|
|
2
|
+
spec: docs/specs/account-plan-rhsc-spec.md
|
|
3
|
+
project: /Users/jhorn/Projects/DailyBriefDashboard
|
|
4
|
+
|
|
5
|
+
regenerate:
|
|
6
|
+
command: "curl -s -X POST http://localhost:7778/api/customers/{customer}/account-plan/generate-cy27"
|
|
7
|
+
poll:
|
|
8
|
+
command: "curl -s http://localhost:7778/api/customers/{customer}/account-plan/cy27"
|
|
9
|
+
check: "generatedAt"
|
|
10
|
+
interval: 15
|
|
11
|
+
timeout: 360
|
|
12
|
+
timeout: 360
|
|
13
|
+
|
|
14
|
+
validate:
|
|
15
|
+
command: "bun scripts/validate-account-plan.ts {customer}"
|
|
16
|
+
parse:
|
|
17
|
+
pass: "PASS"
|
|
18
|
+
warn: "WARN"
|
|
19
|
+
fail: "FAIL"
|
|
20
|
+
summary: "SUMMARY"
|
|
21
|
+
|
|
22
|
+
quality_checks:
|
|
23
|
+
- name: humanize
|
|
24
|
+
description: "Score narrative sections through Sapling MCP for AI detection"
|
|
25
|
+
tool: mcp__sapling__sapling_ai_detect
|
|
26
|
+
extract: "Customer View Q5 (Why Red Hat), Q6 (Risks), Account Intelligence Q1-Q3 narratives"
|
|
27
|
+
threshold: 0.5
|
|
28
|
+
per_item: true
|
|
29
|
+
|
|
30
|
+
exit_criteria:
|
|
31
|
+
validate_pass: ">= 25"
|
|
32
|
+
validate_fail: "0"
|
|
33
|
+
humanize_all_below: 0.5
|
|
34
|
+
|
|
35
|
+
variables:
|
|
36
|
+
customer: "a10-networks"
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
name: campaign
|
|
2
|
+
spec: docs/specs/consumers/campaign.md
|
|
3
|
+
project: /Users/jhorn/Projects/DailyBriefDashboard
|
|
4
|
+
|
|
5
|
+
regenerate:
|
|
6
|
+
local_dev:
|
|
7
|
+
command: "curl -s -X POST http://localhost:7778/api/customer/{customer}/campaigns/generate -H 'Content-Type: application/json' -d '{input_json}'"
|
|
8
|
+
copy: "cp data-dev/cache/campaigns/{customer}-*.json data/cache/campaigns/"
|
|
9
|
+
timeout: 300
|
|
10
|
+
container:
|
|
11
|
+
command: "curl -s -X POST http://localhost:7777/api/customer/{customer}/campaigns/generate -H 'Content-Type: application/json' -d '{input_json}'"
|
|
12
|
+
timeout: 300
|
|
13
|
+
|
|
14
|
+
validate:
|
|
15
|
+
command: "bun scripts/validate-campaign.ts {customer}"
|
|
16
|
+
parse:
|
|
17
|
+
pass: "PASS"
|
|
18
|
+
warn: "WARN"
|
|
19
|
+
fail: "FAIL"
|
|
20
|
+
summary: "SUMMARY"
|
|
21
|
+
|
|
22
|
+
quality_checks:
|
|
23
|
+
- name: sapling
|
|
24
|
+
description: "Score each email body through Sapling MCP for AI detection"
|
|
25
|
+
tool: mcp__sapling__sapling_ai_detect
|
|
26
|
+
extract: "Split campaign HTML on emoji 📧, extract email body from each block, strip HTML tags, preserve newlines"
|
|
27
|
+
threshold: 0.05
|
|
28
|
+
pass_rate: 0.75
|
|
29
|
+
per_item: true
|
|
30
|
+
note: "Sapling overall score is a binary document-level decision driven by opener style, not per-sentence. 75% of emails must pass (6/8). Sentence-level scores are 0% for all template-assembled text."
|
|
31
|
+
|
|
32
|
+
- name: no_orphaned_words
|
|
33
|
+
description: "No standalone product names or single words as sentences (< 20 chars)"
|
|
34
|
+
check: "grep"
|
|
35
|
+
pattern: "Standalone sentences under 20 chars that are just a product name with a period"
|
|
36
|
+
examples_fail: ["Terraform.", "Ansible.", "OpenShift.", "Kubernetes.", "A10 AI Gateway."]
|
|
37
|
+
threshold: 0
|
|
38
|
+
|
|
39
|
+
- name: no_truncated_openers
|
|
40
|
+
description: "Every opener (first sentence of each email) must be a complete sentence — no dangling prepositions, adjectives without nouns, or verbs without objects"
|
|
41
|
+
check: "manual"
|
|
42
|
+
examples_fail:
|
|
43
|
+
- "and consolidate."
|
|
44
|
+
- "through strategic."
|
|
45
|
+
- "makes this a timely."
|
|
46
|
+
- "that can address a."
|
|
47
|
+
- "contributing to."
|
|
48
|
+
threshold: 0
|
|
49
|
+
|
|
50
|
+
- name: no_prompt_metadata
|
|
51
|
+
description: "Zero prompt/template artifacts in email output"
|
|
52
|
+
check: "grep"
|
|
53
|
+
pattern: "Given Event:|Given:|Event:|Context:|Background:|Signal:|Observation:"
|
|
54
|
+
threshold: 0
|
|
55
|
+
|
|
56
|
+
- name: theme_bridge_coverage
|
|
57
|
+
description: "When emailSubject sets a campaign theme, all emails should use theme-relevant signal bridges — not generic fallbacks"
|
|
58
|
+
check: "manual"
|
|
59
|
+
generic_fallbacks:
|
|
60
|
+
- "self-managed automation keeps this on track."
|
|
61
|
+
- "This aligns with how organizations are using Red Hat infrastructure"
|
|
62
|
+
threshold: 0
|
|
63
|
+
note: "Every email should reference the campaign theme (e.g. SaaS tax) in its signal bridge"
|
|
64
|
+
|
|
65
|
+
- name: no_pronoun_leaks
|
|
66
|
+
description: "No third-person pronouns referring to the recipient — should be 'you/your', never 'he/she/him/her/they'"
|
|
67
|
+
check: "grep"
|
|
68
|
+
pattern: "\\bgives him\\b|\\bgives her\\b|\\bhe is\\b|\\bshe is\\b|\\bhis team\\b|\\bher team\\b"
|
|
69
|
+
threshold: 0
|
|
70
|
+
|
|
71
|
+
exit_criteria:
|
|
72
|
+
validate_pass: ">= 20"
|
|
73
|
+
validate_fail: "0"
|
|
74
|
+
sapling_pass_rate: 0.75
|
|
75
|
+
sapling_per_email: 0.05
|
|
76
|
+
no_orphaned_words: 0
|
|
77
|
+
no_truncated_openers: 0
|
|
78
|
+
no_prompt_metadata: 0
|
|
79
|
+
theme_bridge_coverage: 0
|
|
80
|
+
no_pronoun_leaks: 0
|
|
81
|
+
|
|
82
|
+
# Two-stage validation: local dev first, then container
|
|
83
|
+
stages:
|
|
84
|
+
- name: local_dev
|
|
85
|
+
endpoint: "http://localhost:7778"
|
|
86
|
+
description: "Validate on local dev server first"
|
|
87
|
+
- name: container
|
|
88
|
+
endpoint: "http://localhost:7777"
|
|
89
|
+
description: "Once local dev passes, rebuild container and validate there"
|
|
90
|
+
requires: local_dev
|
|
91
|
+
|
|
92
|
+
variables:
|
|
93
|
+
customer: "a10-networks"
|
|
94
|
+
input_json: '{"emailSubject": "SaaS Tax Impact on Enterprise Automation Strategy"}'
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Prove Evidence",
|
|
4
|
+
"description": "Output artifact from /prove skill",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["contractVersion", "issueNumber", "verdict", "commitSHA", "capturedAt", "criteriaResults"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contractVersion": { "type": "string" },
|
|
9
|
+
"issueNumber": { "type": "integer" },
|
|
10
|
+
"verdict": { "type": "string", "enum": ["PROVEN", "UNPROVEN", "INCONCLUSIVE"] },
|
|
11
|
+
"commitSHA": { "type": "string" },
|
|
12
|
+
"capturedAt": { "type": "string", "format": "date-time" },
|
|
13
|
+
"beforeEvidence": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"type": { "type": "string", "enum": ["text", "screenshot", "api", "none"] },
|
|
17
|
+
"path": { "type": ["string", "null"] },
|
|
18
|
+
"capturedAt": { "type": ["string", "null"] },
|
|
19
|
+
"description": { "type": "string" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"afterEvidence": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"type": { "type": "string", "enum": ["text", "screenshot", "api"] },
|
|
26
|
+
"path": { "type": "string" },
|
|
27
|
+
"capturedAt": { "type": "string", "format": "date-time" },
|
|
28
|
+
"environment": { "type": "string", "enum": ["local", "prod"] },
|
|
29
|
+
"description": { "type": "string" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"comparisonSummary": { "type": "string" },
|
|
33
|
+
"quinnVerdict": { "type": "string", "enum": ["PASS", "FAIL", "SKIP"] },
|
|
34
|
+
"reproduced": { "type": "boolean" },
|
|
35
|
+
"criteriaResults": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"minItems": 1,
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["scId", "verdict", "evidence"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"scId": { "type": "string" },
|
|
43
|
+
"verdict": { "type": "string", "enum": ["PASS", "FAIL", "SKIP"] },
|
|
44
|
+
"evidence": { "type": "string" },
|
|
45
|
+
"evidencePath": { "type": ["string", "null"] },
|
|
46
|
+
"exitCode": { "type": ["integer", "null"] }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"gaps": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["ac", "status"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"ac": { "type": "string" },
|
|
57
|
+
"status": { "type": "string" },
|
|
58
|
+
"detail": { "type": "string" },
|
|
59
|
+
"priority": { "type": ["string", "null"] },
|
|
60
|
+
"followUpIssue": { "type": ["string", "null"] }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Data-driven spec-alignment checks — Decision #3",
|
|
3
|
+
"forbiddenTargets": {
|
|
4
|
+
"patterns": ["SKILL\\.md"],
|
|
5
|
+
"scope": ["statement", "evidenceMethod.command"],
|
|
6
|
+
"message": "enforcement goes in scripts/hooks/gates, not SKILL.md (decision #4)"
|
|
7
|
+
},
|
|
8
|
+
"forbiddenLanguage": {
|
|
9
|
+
"patterns": ["DA should", "remember to", "must manually", "don.t forget", "should remember", "needs to remember"],
|
|
10
|
+
"scope": ["statement"],
|
|
11
|
+
"message": "use mechanical enforcement instead (decision #8)"
|
|
12
|
+
},
|
|
13
|
+
"implementationPatterns": {
|
|
14
|
+
"data-driven-enforcement": {
|
|
15
|
+
"decision": "#3",
|
|
16
|
+
"description": "Enforcement via JSON data, not inline code",
|
|
17
|
+
"antiPatterns": ["hardcoded.*(rule|check|gate)", "inline.*(validation|enforcement)"],
|
|
18
|
+
"scope": ["statement"],
|
|
19
|
+
"message": "enforcement should be data-driven — add patterns to JSON, not inline code (decision #3)"
|
|
20
|
+
},
|
|
21
|
+
"deep-modules-thin-consumers": {
|
|
22
|
+
"decision": "#7",
|
|
23
|
+
"description": "Shared logic in scripts/lib/, consumers call one function",
|
|
24
|
+
"antiPatterns": ["duplicate.*(logic|function|helper)", "copy.*(shared|lib|util)"],
|
|
25
|
+
"scope": ["statement"],
|
|
26
|
+
"message": "shared logic goes in scripts/lib/ — consumers import and call (decision #7)"
|
|
27
|
+
},
|
|
28
|
+
"warn-before-fail": {
|
|
29
|
+
"decision": "#9",
|
|
30
|
+
"description": "New checks start as WARN, promote to FAIL after precision data",
|
|
31
|
+
"antiPatterns": ["new.*(check|gate).*expect.*fail", "add.*expect.*throw.*new"],
|
|
32
|
+
"scope": ["statement", "evidenceMethod.command"],
|
|
33
|
+
"message": "new checks ship as WARN — promote to FAIL only with >80% precision over 10+ cycles (decision #9)"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "workflow-state",
|
|
4
|
+
"description": "Ship harness v2 — single state file per issue. All gates read/write this file. See gateContract for expected field values per gate check.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "issue", "repo", "slug", "phase"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": 2 },
|
|
9
|
+
"issue": { "type": "integer", "description": "GitHub issue number" },
|
|
10
|
+
"repo": { "type": "string", "description": "owner/repo" },
|
|
11
|
+
"issueRepo": { "type": "string", "description": "owner/repo for GitHub issues (if different from code repo)" },
|
|
12
|
+
"projectRoot": { "type": "string", "description": "Absolute path to the project root directory" },
|
|
13
|
+
"slug": { "type": "string", "description": "YYYYMMDD-HHMMSS_kebab-description" },
|
|
14
|
+
"phase": {
|
|
15
|
+
"enum": ["GOAL", "DISCOVERY", "SCOPE", "BUILD", "VERIFY", "SHIP", "DONE", "CIRCUIT_BREAK"],
|
|
16
|
+
"description": "Current phase in the single loop"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"issueGoal": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Verbatim Goal section from GitHub issue — never paraphrased by DA"
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"sourceSpecs": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["path", "citedInDiscovery"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"path": { "type": "string", "description": "File path or URL to the spec" },
|
|
31
|
+
"citedInDiscovery": { "type": "boolean", "description": "Was this spec actually read with file:line citations?" },
|
|
32
|
+
"specElements": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" },
|
|
35
|
+
"description": "Key structural elements from the spec (e.g. '6 horizontal layers', '11 consumers')"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"sizing": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"predicted": { "enum": ["XS", "S", "M", "L"] },
|
|
45
|
+
"ceremonyTier": { "enum": ["LIGHT", "STANDARD", "THOROUGH"] },
|
|
46
|
+
"actualFiles": { "type": "integer" },
|
|
47
|
+
"actualMinutes": { "type": "integer" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
"acs": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"required": ["id", "type", "statement"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"id": { "type": "string", "pattern": "^AC-[0-9]+$" },
|
|
58
|
+
"type": { "enum": ["CODE", "OUTCOME"] },
|
|
59
|
+
"statement": { "type": "string" },
|
|
60
|
+
"specElement": { "type": "string", "description": "Which spec element this AC traces to" },
|
|
61
|
+
"threshold": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"op": { "enum": ["==", ">=", "<=", ">", "<", "!=", "contains", "exists"] },
|
|
65
|
+
"value": {},
|
|
66
|
+
"unit": { "type": "string" }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"evidenceMethod": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"type": { "enum": ["GREP_CHECK", "FILE_EXISTS", "CURL_CHECK", "BUN_TEST", "SCREENSHOT", "PLAYWRIGHT", "COMMAND", "MANUAL"] },
|
|
73
|
+
"command": { "type": "string" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"evidence": {
|
|
77
|
+
"type": ["object", "null"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"type": { "enum": ["file-citation", "grep-output", "api-response", "screenshot", "test-output", "command-output", "manual-attestation"] },
|
|
80
|
+
"content": { "type": "string" },
|
|
81
|
+
"value": { "type": ["number", "null"], "description": "Structured numeric value for threshold comparison — avoids grep extraction ambiguity" },
|
|
82
|
+
"url": { "type": ["string", "null"] }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"contextFiles": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"properties": {
|
|
90
|
+
"path": { "type": "string", "description": "File path relative to project root" },
|
|
91
|
+
"lines": { "type": "string", "description": "Line range, e.g. '162-285'" },
|
|
92
|
+
"reason": { "type": "string", "description": "Why this file is relevant to the AC" }
|
|
93
|
+
},
|
|
94
|
+
"required": ["path"]
|
|
95
|
+
},
|
|
96
|
+
"description": "Source files relevant to this AC — used by brief-assembler to give Marcus context"
|
|
97
|
+
},
|
|
98
|
+
"verdict": { "enum": ["PENDING", "PASS", "FAIL"] }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"agents": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"default": {},
|
|
106
|
+
"properties": {
|
|
107
|
+
"marcus": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"spawned": { "type": "boolean" },
|
|
111
|
+
"verdict": { "enum": ["PASS", "FAIL", null] },
|
|
112
|
+
"branch": { "type": "string" },
|
|
113
|
+
"iterations": { "type": "integer" }
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"quinn": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"spawned": { "type": "boolean" },
|
|
120
|
+
"verdict": { "enum": ["PASS", "FAIL", null] },
|
|
121
|
+
"comparedToSpec": { "type": "boolean" },
|
|
122
|
+
"screenshots": { "type": "array", "items": { "type": "string" } }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"rook": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"spawned": { "type": "boolean" },
|
|
129
|
+
"verdict": { "enum": ["PASS", "FAIL", null] },
|
|
130
|
+
"findings": { "type": ["string", "null"], "description": "Rook security scan findings summary" }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
"environments": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"default": {},
|
|
139
|
+
"properties": {
|
|
140
|
+
"local": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"properties": {
|
|
143
|
+
"api": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
144
|
+
"apiSkipReason": { "type": "string", "description": "Justification for skipping local API validation" },
|
|
145
|
+
"ui": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
146
|
+
"uiSkipReason": { "type": "string", "description": "Justification for skipping local UI validation" },
|
|
147
|
+
"tests": { "enum": ["PASS", "FAIL", "SKIP", null] }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"prod": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"properties": {
|
|
153
|
+
"rebuild": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
154
|
+
"rebuildSkipReason": { "type": "string", "description": "Justification for skipping prod rebuild" },
|
|
155
|
+
"smoke": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
156
|
+
"smokeSkipReason": { "type": "string", "description": "Justification for skipping prod smoke test" },
|
|
157
|
+
"quinn": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
158
|
+
"quinnSkipReason": { "type": "string", "description": "Justification for skipping prod Quinn validation" },
|
|
159
|
+
"quinnSpot": { "enum": ["PASS", "FAIL", "SKIP", null] },
|
|
160
|
+
"quinnSpotSkipReason": { "type": "string", "description": "Justification for skipping prod Quinn spot check" }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
"gates": {
|
|
167
|
+
"type": "object",
|
|
168
|
+
"properties": {
|
|
169
|
+
"scope": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"result": { "enum": ["PASS", "FAIL", null] },
|
|
173
|
+
"attempt": { "type": "integer" },
|
|
174
|
+
"failures": { "type": "array", "items": { "type": "object" } },
|
|
175
|
+
"ts": { "type": "string" }
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"verify": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"properties": {
|
|
181
|
+
"result": { "enum": ["PASS", "FAIL", null] },
|
|
182
|
+
"attempt": { "type": "integer" },
|
|
183
|
+
"failures": { "type": "array", "items": { "type": "object" } },
|
|
184
|
+
"ts": { "type": "string" }
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"ship": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"properties": {
|
|
190
|
+
"result": { "enum": ["PASS", "FAIL", null] },
|
|
191
|
+
"attempt": { "type": "integer" },
|
|
192
|
+
"failures": { "type": "array", "items": { "type": "object" } },
|
|
193
|
+
"ts": { "type": "string" }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
"daDirectEdits": { "type": "integer", "default": 0, "description": "Count of DA direct Edit/Write calls on project source files (not PAI config)" },
|
|
200
|
+
"iterationCount": { "type": "integer", "default": 0 },
|
|
201
|
+
"startTs": { "type": "string", "format": "date-time" },
|
|
202
|
+
"updatedTs": { "type": "string", "format": "date-time" },
|
|
203
|
+
|
|
204
|
+
"phaseTimings": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"description": "Per-phase timing entries for bottleneck analysis. Each phase maps to an array of entries — convergence loop re-entries create new entries rather than overwriting.",
|
|
207
|
+
"additionalProperties": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"properties": {
|
|
212
|
+
"enteredTs": { "type": "string", "format": "date-time" },
|
|
213
|
+
"exitedTs": { "type": "string", "format": "date-time" },
|
|
214
|
+
"iteration": { "type": "integer", "description": "Iteration number (1-based, for convergence loop re-entries)" },
|
|
215
|
+
"source": { "type": "string", "enum": ["gate-runner", "DA"], "description": "What wrote this timing entry" }
|
|
216
|
+
},
|
|
217
|
+
"required": ["enteredTs", "source"]
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
"gateContract": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"description": "Documents expected field paths and valid values for each gate check. DA reference — prevents setting fields to prose instead of enum values.",
|
|
225
|
+
"properties": {
|
|
226
|
+
"environments": {
|
|
227
|
+
"type": "object",
|
|
228
|
+
"description": "Expected values for environment validation fields",
|
|
229
|
+
"properties": {
|
|
230
|
+
"local.api": { "type": "string", "enum": ["PASS", "SKIP"], "description": "Set to PASS after API validation, SKIP with apiSkipReason" },
|
|
231
|
+
"local.ui": { "type": "string", "enum": ["PASS", "SKIP"], "description": "Set to PASS after UI validation, SKIP requires uiSkipReason field" },
|
|
232
|
+
"local.uiSkipReason": { "type": "string", "description": "Required when local.ui is SKIP" },
|
|
233
|
+
"local.tests": { "type": "string", "enum": ["PASS", "SKIP", "FAIL"], "description": "Set by Marcus after running tests. tests-pass reads this first." },
|
|
234
|
+
"prod.rebuild": { "type": "string", "enum": ["PASS", "SKIP"], "description": "SKIP requires rebuildSkipReason" },
|
|
235
|
+
"prod.smoke": { "type": "string", "enum": ["PASS", "SKIP"], "description": "SKIP requires smokeSkipReason" },
|
|
236
|
+
"prod.quinn": { "type": "string", "enum": ["PASS", "SKIP"], "description": "SKIP requires quinnSkipReason" }
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"verdicts": {
|
|
240
|
+
"type": "object",
|
|
241
|
+
"description": "Valid verdict values for ACs and agents",
|
|
242
|
+
"properties": {
|
|
243
|
+
"ac.verdict": { "type": "string", "enum": ["PASS", "FAIL"], "description": "Each AC verdict must be exactly PASS or FAIL" },
|
|
244
|
+
"agent.verdict": { "type": "string", "enum": ["PASS", "FAIL", "SKIP"], "description": "Agent verdicts — SKIP requires skipReason" }
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"evidence": {
|
|
248
|
+
"type": "object",
|
|
249
|
+
"description": "Valid evidence types",
|
|
250
|
+
"properties": {
|
|
251
|
+
"type": { "type": "string", "enum": ["file-citation", "grep-output", "api-response", "screenshot", "test-output", "command-output", "manual-attestation"] }
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"baselines": {
|
|
255
|
+
"type": "object",
|
|
256
|
+
"description": "Baseline fields for repos with pre-existing issues",
|
|
257
|
+
"properties": {
|
|
258
|
+
"testBaseline": { "type": "integer", "description": "Pre-existing test failure count. tests-pass compares against this." },
|
|
259
|
+
"tscBaseline": { "type": "integer", "description": "Pre-existing TypeScript error count. tsc-pass compares against this." }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
"changelog": {
|
|
266
|
+
"type": "array",
|
|
267
|
+
"description": "Append-only event log — never delete entries",
|
|
268
|
+
"items": {
|
|
269
|
+
"type": "object",
|
|
270
|
+
"required": ["ts", "event"],
|
|
271
|
+
"properties": {
|
|
272
|
+
"ts": { "type": "string", "format": "date-time" },
|
|
273
|
+
"event": { "type": "string" },
|
|
274
|
+
"detail": { "type": "string" },
|
|
275
|
+
"phase": { "type": "string" },
|
|
276
|
+
"actor": { "enum": ["da", "marcus", "quinn", "rook", "gate-runner"] }
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc-type: reference
|
|
3
|
+
status: active
|
|
4
|
+
owner: jason
|
|
5
|
+
updated: 2026-09-14
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# workflow-state.json Schema Guide
|
|
9
|
+
|
|
10
|
+
Read this BEFORE writing ACs or workflow-state.json. The scope gate validates every field.
|
|
11
|
+
|
|
12
|
+
## AC Required Fields
|
|
13
|
+
|
|
14
|
+
Every AC must have all of these:
|
|
15
|
+
|
|
16
|
+
| Field | Type | Constraints |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `id` | string | `AC-1`, `AC-2`, `AC-A1` (A-prefix for anti-criteria) |
|
|
19
|
+
| `type` | enum | `CODE` or `OUTCOME` only |
|
|
20
|
+
| `statement` | string | Min 5 words. No garbage (see below) |
|
|
21
|
+
| `threshold` | object | `{ op, value, unit }` — see Threshold Rules |
|
|
22
|
+
| `evidenceMethod` | object | `{ type, command }` — see Evidence Types |
|
|
23
|
+
|
|
24
|
+
Optional: `specElement` (string), `contextFiles` (array), `verdict`, `evidence`.
|
|
25
|
+
|
|
26
|
+
## Threshold Rules
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
value: string | number ← NEVER boolean (true/false will fail Zod validation)
|
|
30
|
+
op: "==" | ">=" | "<=" | ">" | "<" | "!=" | "contains" | "exists"
|
|
31
|
+
unit: string (optional)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Common mistake:** `{ "op": "exists", "value": true }` — FAILS. Use `"value": "true"` (string).
|
|
35
|
+
|
|
36
|
+
**Weak threshold:** `{ "op": ">=", "value": 1 }` — FAILS. Threshold `>= 1` effectively always passes.
|
|
37
|
+
|
|
38
|
+
## Evidence Method Types
|
|
39
|
+
|
|
40
|
+
Valid `type` values (case-sensitive): `GREP_CHECK`, `FILE_EXISTS`, `CURL_CHECK`, `BUN_TEST`, `SCREENSHOT`, `PLAYWRIGHT`, `COMMAND`, `MANUAL`, `grep`, `command`, `api`, `screenshot`, `manual`
|
|
41
|
+
|
|
42
|
+
## Statement Constraints
|
|
43
|
+
|
|
44
|
+
**Garbage patterns (auto-rejected):**
|
|
45
|
+
- "file exists", "it works", "code is correct/good/done"
|
|
46
|
+
- "tests pass", "changes are made/applied/done", "no errors"
|
|
47
|
+
|
|
48
|
+
**Behavioral language (auto-rejected):**
|
|
49
|
+
- "DA should", "remember to", "make sure", "don't forget"
|
|
50
|
+
|
|
51
|
+
## Ceremony Tier Requirements
|
|
52
|
+
|
|
53
|
+
| Requirement | LIGHT (XS) | STANDARD (S/M) | THOROUGH (L) |
|
|
54
|
+
|---|---|---|---|
|
|
55
|
+
| `sourceSpecs[]` | not required | **REQUIRED** | **REQUIRED** |
|
|
56
|
+
| `governingSpec` | not required | **REQUIRED** | **REQUIRED** |
|
|
57
|
+
| `specElement` on ACs | not required | at least 1 AC per specElement | at least 1 AC per specElement |
|
|
58
|
+
| spec-prohibited checks | skipped | **ACTIVE** | **ACTIVE** |
|
|
59
|
+
| hardcoded value checks | skipped | **ACTIVE** | **ACTIVE** |
|
|
60
|
+
|
|
61
|
+
### sourceSpecs format
|
|
62
|
+
```json
|
|
63
|
+
{ "path": ".github/workflows/issue-triage.md", "citedInDiscovery": true,
|
|
64
|
+
"specElements": ["frontmatter schema pattern", "add-comment config"] }
|
|
65
|
+
```
|
|
66
|
+
Paths must be relative to projectRoot (not `~/`). The gate resolves: `join(projectRoot, path)`.
|
|
67
|
+
|
|
68
|
+
### governingSpec format
|
|
69
|
+
```json
|
|
70
|
+
{ "path": "/Users/jhorn/.claude/PAI/specs/CI-ENFORCEMENT-SPEC.md",
|
|
71
|
+
"detectedFrom": "ship-workflow-discovery" }
|
|
72
|
+
```
|
|
73
|
+
Path must be absolute (starts with `/`) or relative to projectRoot. `~` is NOT expanded.
|
|
74
|
+
|
|
75
|
+
## Changelog Actor Values
|
|
76
|
+
|
|
77
|
+
Valid `actor` enum (lowercase only): `da`, `marcus`, `quinn`, `rook`, `gate-runner`
|
|
78
|
+
|
|
79
|
+
## Common Scope Gate Failures
|
|
80
|
+
|
|
81
|
+
| Check name | What it validates | Fix |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `workflow-state.json validates` | Zod schema parse | Fix threshold value types, actor casing, enum values |
|
|
84
|
+
| `governing spec exists and is readable` | sourceSpecs[0].path resolves to a file | Use absolute path or path relative to projectRoot |
|
|
85
|
+
| `sourceSpecs-required` | STANDARD+ has sourceSpecs[] | Add sourceSpecs with referenced pattern files |
|
|
86
|
+
| `discovery-evidence` | sourceSpecs have `citedInDiscovery: true` | Set the flag on each sourceSpec |
|
|
87
|
+
| `spec-elements-in-acs` | ACs reference declared specElements | Add `specElement` field to ACs matching sourceSpec elements |
|
|
88
|
+
| `no 'DA should'` | No behavioral delegation in AC statements | Rewrite as measurable assertions |
|
|
89
|
+
| `no hardcoded paths` | No `/usr/`, `/opt/`, `/home/`, `/tmp/` in statements | Use relative descriptions, not absolute paths |
|
|
90
|
+
|
|
91
|
+
## Correct vs Incorrect AC
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
// CORRECT
|
|
95
|
+
{
|
|
96
|
+
"id": "AC-1", "type": "CODE",
|
|
97
|
+
"statement": "sc-verification.md exists with pull_request trigger in frontmatter",
|
|
98
|
+
"threshold": { "op": "contains", "value": "pull_request", "unit": "trigger" },
|
|
99
|
+
"evidenceMethod": { "type": "grep", "command": "grep 'pull_request' .github/workflows/sc-verification.md" },
|
|
100
|
+
"specElement": "gh-aw workflow frontmatter schema pattern"
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// INCORRECT — 4 problems
|
|
104
|
+
{
|
|
105
|
+
"id": "AC-1", "type": "CODE",
|
|
106
|
+
"statement": "file exists", // garbage pattern, < 5 words
|
|
107
|
+
"threshold": { "op": "exists", "value": true }, // boolean value, needs "true" string
|
|
108
|
+
"evidenceMethod": { "type": "check" }, // invalid type, use "command"
|
|
109
|
+
"specElement": "something" // doesn't match any sourceSpec specElement
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Writing workflow-state.json
|
|
114
|
+
|
|
115
|
+
Use **writeWorkflowState()** via `bun -e`, not the Write tool or Bash `cat >` / `echo >`:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
bun -e "import {writeWorkflowState} from './gates/orchestrator.ts'; import {readFileSync} from 'fs'; const s = JSON.parse(readFileSync('WORK_DIR/workflow-state.json','utf8')); /* apply fix */; writeWorkflowState('WORK_DIR/workflow-state.json', s);"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
This validates via Zod at write time with enum-specific error formatting. Invalid values produce immediate feedback (e.g., `acs.0.threshold.op: expected one of [==, >=, ...], got "equals"`) instead of opaque gate failures later.
|