Skip to content

Commit 2f60292

Browse files
Antigravity Agentclaude
andcommitted
feat(batch): Batch Pipeline Runner spec + E2E validation (#77)
- specs/tri/batch_runner.tri: VIBEE spec for parallel batch runner - E2E: 378 specs → 323 pass (85%), 4 workers, ~9min - JSON reports at .trinity/batch/latest.json Closes #77 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b360bf7 commit 2f60292

3 files changed

Lines changed: 191 additions & 15 deletions

File tree

.trinity/batch/1773166040.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"agent":"batch_runner","action":"batch_run","timestamp":1773166040,"total":378,"filtered":378,"passed":323,"failed":23,"skipped":32,"rate":85,"workers":4,"duration_ns":535570946000}

.trinity/batch/latest.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
11
{
2-
"timestamp": 1773137317,
3-
"total_specs": 373,
4-
"filtered_specs": 373,
5-
"passed": 316,
6-
"failed": 27,
7-
"skipped": 30,
8-
"pass_rate": 84,
9-
"duration_ms": 580851,
2+
"timestamp": 1773166040,
3+
"total_specs": 378,
4+
"filtered_specs": 378,
5+
"passed": 323,
6+
"failed": 23,
7+
"skipped": 32,
8+
"pass_rate": 85,
9+
"duration_ms": 535570,
1010
"parallel_workers": 4,
1111
"failures": [
1212
{"spec": "specs/tri/codegen_math_safety.tri", "status": "ast_fail"},
1313
{"spec": "specs/tri/self_improving_formula_discovery.tri", "status": "ast_fail"},
1414
{"spec": "specs/tri/forge_bitstream.tri", "status": "ast_fail"},
1515
{"spec": "specs/tri/codegen_engine_formal_spec.tri", "status": "ast_fail"},
1616
{"spec": "specs/tri/stress_test.tri", "status": "ast_fail"},
17-
{"spec": "specs/tri/tqnn_quantum_primitives.tri", "status": "ast_fail"},
1817
{"spec": "specs/tri/holy_core_emitter_phase1.tri", "status": "ast_fail"},
1918
{"spec": "specs/tri/swarm_agents.tri", "status": "ast_fail"},
2019
{"spec": "specs/tri/autonomous_lifecycle.tri", "status": "ast_fail"},
20+
{"spec": "specs/tri/multilingual_codegen.tri", "status": "ast_fail"},
2121
{"spec": "specs/tri/cycle99_cli_integration.tri", "status": "ast_fail"},
2222
{"spec": "specs/tri/codegen_engine_final_upgrade.tri", "status": "ast_fail"},
23-
{"spec": "specs/tri/state/hardening_v2.tri", "status": "gen_fail"},
2423
{"spec": "specs/tri/trinity_fpga_core.tri", "status": "ast_fail"},
2524
{"spec": "specs/tri/coordinator_test.tri", "status": "ast_fail"},
2625
{"spec": "specs/tri/autonomous_universe.tri", "status": "ast_fail"},
2726
{"spec": "specs/tri/codegen_full_automation.tri", "status": "ast_fail"},
28-
{"spec": "specs/tri/cycle50/emitter_upgrade.tri", "status": "gen_fail"},
29-
{"spec": "specs/tri/cycle50/full_regen_test.tri", "status": "gen_fail"},
3027
{"spec": "specs/tri/igla_emitter_phase2.tri", "status": "ast_fail"},
3128
{"spec": "specs/tri/omega_phase.tri", "status": "ast_fail"},
32-
{"spec": "specs/tri/codegen_engine_full_upgrade.tri", "status": "gen_fail"},
3329
{"spec": "specs/tri/bootstrap/emitter_full.tri", "status": "ast_fail"},
34-
{"spec": "specs/tri/bootstrap/impl_block_demo.tri", "status": "ast_fail"},
3530
{"spec": "specs/tri/bootstrap/tests_gen_full.tri", "status": "ast_fail"},
3631
{"spec": "specs/tri/tri_igla_commands.tri", "status": "ast_fail"},
3732
{"spec": "specs/tri/forge_routing.tri", "status": "ast_fail"},
38-
{"spec": "specs/tri/treesitter/hnsw_core.tri", "status": "ast_fail"}
33+
{"spec": "specs/tri/treesitter/hnsw_core.tri", "status": "ast_fail"},
34+
{"spec": "specs/tri/neural_gamma.tri", "status": "ast_fail"}
3935
]
4036
}

specs/tri/batch_runner.tri

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# ═══════════════════════════════════════════════════════════════════════════════
2+
# VIBEE Specification — Batch Pipeline Runner
3+
# ═══════════════════════════════════════════════════════════════════════════════
4+
# φ² + 1/φ² = 3 = TRINITY
5+
# Issue #77: Parallel spec generation with std.Thread.Pool
6+
# ═══════════════════════════════════════════════════════════════════════════════
7+
8+
name: batch_runner
9+
version: "1.0.0"
10+
language: zig
11+
module: batch_runner
12+
13+
description: |
14+
Batch Pipeline Runner — scans specs/, filters by lint status,
15+
runs vibee gen + zig ast-check in parallel using std.Thread.Pool.
16+
Produces JSON report with pass/fail per spec and sacred V-formula.
17+
18+
# ═══════════════════════════════════════════════════════════════════════════════
19+
# TYPE SYSTEM
20+
# ═══════════════════════════════════════════════════════════════════════════════
21+
22+
types:
23+
CompileStatus:
24+
variants:
25+
- pass
26+
- ast_fail
27+
- compile_fail
28+
- gen_fail
29+
- lint_fail
30+
- timeout
31+
- skipped
32+
33+
FilterMode:
34+
variants:
35+
- all
36+
- lint_pass
37+
- lint_fail
38+
- changed_only
39+
40+
PipelineResult:
41+
fields:
42+
spec_path: String
43+
success: Bool
44+
status: CompileStatus
45+
duration_ns: Int
46+
error_msg: String
47+
48+
BatchConfig:
49+
fields:
50+
parallel: Int
51+
filter: FilterMode
52+
directory: String
53+
dry_run: Bool
54+
timeout_seconds: Int
55+
56+
BatchReport:
57+
fields:
58+
total_specs: Int
59+
filtered_specs: Int
60+
passed: Int
61+
failed: Int
62+
skipped: Int
63+
total_duration_ns: Int
64+
parallel_workers: Int
65+
failures: List(FailureEntry)
66+
67+
FailureEntry:
68+
fields:
69+
spec: String
70+
status: CompileStatus
71+
error_msg: String
72+
73+
ThreadSafeResults:
74+
fields:
75+
items: List(PipelineResult)
76+
lock_active: Bool
77+
78+
# ═══════════════════════════════════════════════════════════════════════════════
79+
# BEHAVIORS
80+
# ═══════════════════════════════════════════════════════════════════════════════
81+
82+
behaviors:
83+
scan_specs:
84+
description: "Walk directory recursively for .tri files, skip archive/"
85+
inputs:
86+
- directory: String
87+
output: List(String)
88+
steps:
89+
- Open directory with iterate flag
90+
- Walk entries, collect .tri files
91+
- Recurse into subdirectories (skip archive/)
92+
- Return full paths
93+
94+
filter_specs:
95+
description: "Apply filter mode to spec list"
96+
inputs:
97+
- specs: List(String)
98+
- mode: FilterMode
99+
output: List(String)
100+
steps:
101+
- If all, return all specs
102+
- If lint_pass, run vibee validate → keep passing
103+
- If lint_fail, run vibee validate → keep failing
104+
- If changed_only, git diff HEAD~1 → keep changed
105+
106+
run_single_pipeline:
107+
description: "Run lint → gen → ast-check for one spec"
108+
inputs:
109+
- spec_path: String
110+
- filter: FilterMode
111+
output: PipelineResult
112+
steps:
113+
- Run lint check (skip if already filtered)
114+
- Run vibee gen to /tmp/tri-batch/{stem}.zig
115+
- Detect verilog specs → skip ast-check
116+
- Run zig ast-check on generated file
117+
- Return PipelineResult with timing
118+
119+
run_batch:
120+
description: "Full batch: scan → filter → parallel run → report"
121+
inputs:
122+
- config: BatchConfig
123+
output: BatchReport
124+
steps:
125+
- Scan specs from config.directory
126+
- Filter by config.filter mode
127+
- If dry_run, print plan and return
128+
- Init std.Thread.Pool with config.parallel workers
129+
- Spawn workers via pool.spawnWg
130+
- Wait for all workers
131+
- Aggregate results (pass/fail/skip)
132+
- Print colored report with V-formula
133+
- Write protocol JSONL + latest.json
134+
135+
run_batch_command:
136+
description: "CLI entry: parse flags → run_batch"
137+
inputs:
138+
- args: List(String)
139+
output: Void
140+
steps:
141+
- Parse --parallel, --filter, --dry-run, --timeout, --report, --compare
142+
- Call run_batch with parsed config
143+
144+
# ═══════════════════════════════════════════════════════════════════════════════
145+
# CONSTRAINTS
146+
# ═══════════════════════════════════════════════════════════════════════════════
147+
148+
constraints:
149+
- Thread-safe result collection via mutex
150+
- Per-spec failures do NOT block other specs
151+
- Verilog specs skip ast-check (no zig output)
152+
- Output to /tmp/tri-batch/ to avoid polluting generated/
153+
- Maximum 20 failure details in report
154+
- Sacred formula V = phi * (rate/100)^2 in every report
155+
156+
# ═══════════════════════════════════════════════════════════════════════════════
157+
# TESTS
158+
# ═══════════════════════════════════════════════════════════════════════════════
159+
160+
tests:
161+
- name: "extractStem from path"
162+
input: {path: "specs/tri/foo.tri"}
163+
expected: {stem: "foo"}
164+
165+
- name: "parseFilterMode lint:pass"
166+
input: {mode_str: "lint:pass"}
167+
expected: {mode: "lint_pass"}
168+
169+
- name: "scanSpecs finds files"
170+
input: {directory: "specs/tri"}
171+
expected: {count_gt: 0}
172+
173+
- name: "ThreadSafeResults append"
174+
input: {result: {spec_path: "test.tri", success: true}}
175+
expected: {items_len: 1}
176+
177+
- name: "detectVerilog false for missing file"
178+
input: {path: "nonexistent.tri"}
179+
expected: {is_verilog: false}

0 commit comments

Comments
 (0)