Files
hakorune/docs/private/roadmap/phases/phase-20.10/PLAN.md

44 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Phase 20.10 — Migration Plan (ScriptFirst 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: ONoptout via `HAKO_SCRIPT_RUNNER=0|off|false`)。
- Preinvoke emits stable short linesstdout: `invoke` / `invoke: FAIL`
- UsingResolver probes: `HAKO_USING_RESOLVER_FRONT|COMPARE|SHADOW`(挙動不変)。
2) Extern/Effects SSOTspec + 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 CABI (policy flip under gate)
- Ensure all scriptvisible 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 smokesinvoke/trace/workspace-only; quick + integration-core
6) Rollback & Safety
- All new pieces are optin 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.
- RefVM continues as a reference for semantics; production runs are Rust VM/LLVM.