Skip to content

feat(pipeline): Generator v2 — deep .tri parser + correct Zig emission #70

Description

@gHashTag

Problem

Current generator (vibee gen) fails on 85% of specs. Root causes from REGENERATION_REPORT:

Bug 1: YAML List-Format Fields Not Parsed (9/16 failures)

Parser only understands:
```yaml
fields:
name: String # WORKS
```
But many specs use:
```yaml
fields:

  • name: x # BROKEN → emits "-: name: x"
    type: Float
    ```

Bug 2: Incomplete Type Mapping (7/16 failures)

`mapType()` in spec_compiler.zig:421-474 missing:

  • Int64 → i64, UInt64 → u64, UInt32 → u32
  • float → f64 (case-sensitive), string → []const u8
  • list<T> (lowercase) → []const T
  • List (bare, no generic) → error

Bug 3: Reserved Words + Comment Leaks (3/16 failures)

  • YAML `#` comments pass through to generated Zig
  • `.error` enum variant not escaped to `@"error"`
  • Duplicate function emission (stub + implementation)

Fix Locations

  • `trinity-nexus/lang/src/vibee_parser.zig` — parseFields(), parseConstants()
  • `trinity-nexus/lang/src/spec_compiler.zig:421-474` — mapType()
  • `trinity-nexus/lang/src/codegen/emitter.zig:1140-1146` — field emission

Acceptance Criteria

  • YAML list-format fields parsed correctly
  • Case-insensitive type mapping with Int64/UInt64/UInt32 aliases
  • Comments stripped from all emitted values
  • Reserved words escaped in enum variants
  • 8/10 test specs compile after fixes

Activity

  1. gHashTag commented on Mar 10, 2026

    @gHashTag
    OwnerAuthor

    🔧 Agent: Ralph | ⏱️ 2026-03-10T16:50:00+07
    📋 Task: Generator v2 — deep .tri parser + correct Zig emission
    🔄 Status: 🔵 IN PROGRESS (86% → 90%)

    Progress:

    • Compile rate: 15% → 86% → 90% (45/50 sample)
    • Full batch: 310/359 specs (86%)
    • 10+ codegen bugs fixed (YAML parse, type mapping, reserved words)
    • vibee build fixed (appendSlice Zig 0.15 compat)

    Remaining (P0-P3):

    • P0: List T space syntax (6 specs)
    • P1: Allocator/Self imports + dedup (8 specs)
    • P2: Undeclared identifiers (7 specs)
    • P3: Other syntax (4 specs)
    • Total: ~25 gen-fixable → 93% target

    New additions today:

    • Pipeline Link 24: perplexity_scholar (research on failure)
    • Pipeline Link 25: spec_lint (validate before gen)
    • tri_swarm.zig: Swarm Coordinator CLI (decompose/status/assign/escalate)
    • Faculty Board in /tri diagnostic

    📐 V = φ·(90/100)² = 1.310 → target φ=1.618

  2. moved this to In progress in TRINITYon Mar 10, 2026
  3. moved this from In progress to Done in TRINITYon Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions