23 lines
1.0 KiB
Markdown
23 lines
1.0 KiB
Markdown
|
|
# MirBuilderBox — Program(JSON v0) → MIR(JSON v0)
|
|||
|
|
|
|||
|
|
Responsibility
|
|||
|
|
- Convert Stage‑B Program(JSON v0) into MIR(JSON v0) for VM/LLVM lines.
|
|||
|
|
- Phase 20.34 starts with a delegate implementation to Runner and progressively internalizes ops.
|
|||
|
|
|
|||
|
|
Interface (stable)
|
|||
|
|
- `emit_from_program_json_v0(program_json: String, opts: Map|Null) -> String|Null`
|
|||
|
|
- Returns canonical MIR(JSON v0) on success; returns null and prints a tagged diagnostic on failure.
|
|||
|
|
|
|||
|
|
Tags (Fail‑Fast, stable)
|
|||
|
|
- `[mirbuilder/input/null]` — input is null
|
|||
|
|
- `[mirbuilder/input/invalid]` — header missing (version/kind)
|
|||
|
|
- `[mirbuilder/delegate]` — delegate path selected (Runner `--program-json-to-mir`)
|
|||
|
|
- `[mirbuilder/delegate/missing]` — delegate/provider not wired yet
|
|||
|
|
|
|||
|
|
Toggles (default OFF)
|
|||
|
|
- `HAKO_MIR_BUILDER_DELEGATE=1`: Use Runner `--program-json-to-mir` as a temporary provider
|
|||
|
|
|
|||
|
|
Notes
|
|||
|
|
- Box‑First policy: boundary/contract first, then implementation. Keep tags stable; no silent fallback.
|
|||
|
|
- Large payloads: implementation may stream/json-scan later; initial version is string‑based.
|