Skip to content

M0 Stage 1: Project scaffold #2

Description

@tlkahn

Stage 1: Project scaffold

Establish the Zig package and the full module graph with compile-enforced dependency direction. Every later stage attaches to the modules declared here, so the import tables must match the dependency graph in CLAUDE.md exactly from the start.

Epic: #1

Depends on: nothing (first stage)

Phase 1.1: Zig package init

  • 1.1.1 Add build.zig.zon: package name mlxd, version 0.1.0, minimum_zig_version >= 0.16
  • 1.1.2 Add build.zig skeleton with standard target/optimize options and the mlxd executable definition
  • 1.1.3 Create the src/ directory tree per the planned layout: core/, mlx/, chat/, model/, engine/ (with specdecode/, constrain/), registry/, http/ (with handlers/), cli/ (with cmd/), plus tests/ and tests/fixtures/

Phase 1.2: Module graph with enforced dependency direction

  • 1.2.1 Add an empty root.zig for each module: core, mlxbridge, chat, model, engine, registry, http
  • 1.2.2 Declare all modules in build.zig via b.createModule(.{ .imports = ... }) with exact import tables: core and mlxbridge are leaves; chat imports core; model imports core, mlxbridge; engine imports core, mlxbridge, model (NOT chat); registry imports core; http imports core, chat, model, engine, registry
  • 1.2.3 Add cli/main.zig as the exe root importing all modules, with stub subcommand dispatch for serve | run | pull | list (each prints a placeholder and exits 0)
  • 1.2.4 Verify the enforcement property: an undeclared cross-module @import (e.g. engine importing chat) fails to compile; record the check as a comment in build.zig

Acceptance

  • zig build produces an mlxd binary whose four subcommands run and exit 0
  • The module import tables in build.zig match the dependency graph in CLAUDE.md exactly, and an undeclared cross-module import is a compile error

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestm0-skeletonM0 skeleton milestone work

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions