44 lines
2.2 KiB
Markdown
44 lines
2.2 KiB
Markdown
# Phase 20.10 — Migration Plan (Script‑First Runner)
|
||
|
||
Phases
|
||
|
||
1) Runner Facade in Script (lang)
|
||
- Provide a thin Script Runner that orchestrates entry selection and delegates execution to current backends.
|
||
- Keep VM/LLVM selection in Rust; the script facade focuses on entry/args and pre/post hooks.
|
||
- Default: ON(opt‑out via `HAKO_SCRIPT_RUNNER=0|off|false`)。
|
||
- Pre‑invoke emits stable short lines(stdout): `invoke` / `invoke: FAIL`。
|
||
- UsingResolver probes: `HAKO_USING_RESOLVER_FRONT|COMPARE|SHADOW`(挙動不変)。
|
||
|
||
2) Extern/Effects SSOT(spec + generator; STRICT checks)
|
||
- `specs/externs.toml` を SSOT とし、dev ツールで Python/Rust に生成・同期。
|
||
- Drift チェックは STRICT(ズレは FAIL)。
|
||
- Effects の取り込みは env ゲート(`HAKO_EXTERN_EFFECTS_SSOT=1` → Io を反映)。
|
||
|
||
3) CLI/ENV Harmonize
|
||
- Add CLI flags (done in 20.9) and align HAKO_* first; ENV remains helper overrides.
|
||
- Document precedence: CLI > ENV > TOML. Provide quickref in docs/guides/env-variables.md.
|
||
|
||
4) Extern via C‑ABI (policy flip under gate)
|
||
- Ensure all script‑visible externs lower to `hako_*` (AOT) and forbid dotted C symbols in STRICT.
|
||
- Gate: CI_STRICT=1 for dotted symbol check.
|
||
|
||
5) Smokes & Parity
|
||
- Add representative integration-core parities (done: env.local.get exists/missing, console.warn/error).
|
||
- Add failure diagnostics (done: mir_emit_failed; have symbol_missing already).
|
||
- Add runner representative smokes(invoke/trace/workspace-only; quick + integration-core)。
|
||
|
||
6) Rollback & Safety
|
||
- All new pieces are opt‑in by flags. Removing gates reverts to current behavior.
|
||
|
||
7) Selfhost Launcher (AOT)
|
||
- Produce `lang/bin/hakorune` via `lang/build/build_runner.sh`(LLVM18 dev)。
|
||
- Quick smoke builds and runs the launcher (exit code=0)。
|
||
|
||
8) Final Goal(配布イメージ)
|
||
- `git/hakorune-selfhost/lang/bin/hakorune` を自己ホストバイナリとして常備。
|
||
- CI(将来)で `lang/build/build_runner.sh` を build-only に組み込み、canary 実行で健康診断。
|
||
|
||
Notes
|
||
- Python backend remains as-is. This phase focuses on boundaries, contracts, and runner facade.
|
||
- Ref‑VM continues as a reference for semantics; production runs are Rust VM/LLVM.
|