A案実装: debug_verify_phi_inputs呼び出し前にCFG predecessorを更新
修正箇所(7箇所):
- src/mir/builder/phi.rs:50, 73, 132, 143
- src/mir/builder/ops.rs:273, 328, 351
根本原因:
- Branch/Jump命令でsuccessorは即座に更新
- predecessorはupdate_cfg()で遅延再構築
- PHI検証が先に実行されてpredecessor未更新でpanic
解決策:
- 各debug_verify_phi_inputs呼び出し前に
if let Some(func) = self.current_function.as_mut() {
func.update_cfg();
}
を挿入してCFGを同期
影響: if/else文、論理演算子(&&/||)のPHI生成が正常動作
Runner Facade (Script‑First) — Phase 20.10
Responsibility
- Provide a thin, opt‑in runner facade in Hakorune (script) to orchestrate entry selection and pre/post hooks.
- Delegates actual execution to existing backends (Rust VM / LLVM). No behavior change by default.
Gate
- Enable with
HAKO_SCRIPT_RUNNER=1(default OFF). In 20.10 this runner is not wired by default; wiring will be added behind the gate.
Contracts (draft)
- Entry:
Runner.run(entry: string, args: array<string>) -> i64 - Pre‑hooks: validate entry, shape args, emit diagnostics (short tokens) on failure.
- Post‑hooks: normalize result (e.g., quiet result mode), optional metrics/logging.
Notes
- Keep this layer pure and free of platform I/O. Defer I/O to C‑ABI utilities (
hako_*). - Fail‑Fast: invalid entry/args → emit short diagnostics and return non‑zero.
- Box‑First: add adapters for boundary objects (args, env) instead of sprinkling conditions.
Short Diagnostics & Observability
- Pre‑invoke emits stable one‑liners for smokes:
- Success:
[script-runner] invoke(stdout) - Failure (dev injection or panic):
[script-runner] invoke: FAIL(stdout)
- Success:
- The runner wiring prints a gate trace to stderr:
[script-runner] gate=on (facade).
Dev‑only toggle (TTL: Phase 20.10 bring‑up)
HAKO_SCRIPT_RUNNER_FORCE_FAIL=1forces the pre‑invoke to emit[script-runner] invoke: FAILwithout executing the facade program.- Scope: tests/smokes only. Remove after runner wiring stabilizes (documented here as a temporary aid).