Skip to content

[TASK-012] Multi-file gen: resolve use/import across specs for coherent output #64

Description

@gHashTag

Cross-file import resolution

Currently each spec generates independently. For real compilation:

  • use base::types should resolve to the types module
  • Generated Zig @import paths should be correct relative paths
  • Generated Verilog `include should work
  • Generated C #include should work

Add t27c compile-project --output build/ that generates ALL specs into a coherent project structure with working imports.

phi^2 + 1/phi^2 = 3 | TRINITY

Activity

  1. gHashTag commented on Apr 4, 2026

    @gHashTag
    OwnerAuthor

    🚀 Starting work on t27c compile-project command.

    Branch: feat/compile-project
    Plan:

    1. Explore existing compile infrastructure
    2. Implement module → path mapping
    3. Generate coherent project structure with resolved imports
    4. Generate build.zig
    5. Test end-to-end
    6. PR targeting master
  2. added a commit that references this issue on Apr 4, 2026
    8c8cbce
  3. gHashTag commented on Apr 4, 2026

    @gHashTag
    OwnerAuthor

    Completed — PR #68 merged.

    What was added

    t27c compile-project --output <dir> [--backend zig|c|verilog]

    Three-pass compilation:

    1. Scan — builds module→path map from all .t27 files
    2. Resolve — converts use X::Y to correct relative @import paths
    3. Write — outputs structured project + build.zig

    Results

    • 43 files compiled, 0 errors
    • Cross-namespace imports resolved (e.g. use base::types in ar/asp_solver.t27 → @import("../base/types.zig"))
    • Same-namespace imports stay local (e.g. @import("ternary_logic.zig"))
    • build.zig declares all 43 modules as a static library

    Output structure

    build/
      ar/asp_solver.zig, composition.zig, ...
      base/types.zig, ops.zig
      math/constants.zig, sacred_physics.zig
      numeric/gf16.zig, gf4.zig, ...
      nn/hslm.zig, attention.zig
      ...
      build.zig
    
  4. added a commit that references this issue on Jun 1, 2026
    06c0441
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phi-loopPHI LOOP development cycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions