Phase 2: hosted profile (P2-8a)

- src/interp/host.zig: real console, files (scope checked before any
  host call, positional reads/writes, append from file size) and TCP
  through std.Io; monotonic clock and host CSPRNG; host errors mapped
  to the closed io_error set; open handles released at the end of the
  instance
- interpreter dispatches intrinsics to the host or the deterministic
  world; never reports blocked in the hosted profile
- CLI: --profile hosted; the program owns stdout/stderr, the run record
  goes to --result-file, otherwise a human summary on stderr
- spec 11 §8.0: host error mapping table
- tests/hosted/smoke.py (file copy, scope denial, stdin->stdout, TCP
  echo on a free port) runs in CI
- works around Zig 0.17 net.Stream.read not compiling by using
  readWithControl
This commit is contained in:
dev committed 2026-10-04 14:46:40 +03:00
1 parent 008654999e
commit 36e91be84c
10 files changed
+530 -51

No files matched your search

+3 -2
View File
@@ -13,11 +13,12 @@ zig build # build ./zig-out/bin/aji
zig build test # unit tests (includes registry ↔ docs sync check)
zig build conformance # conformance suite, see tests/conformance/README.md
zig build run -- check f.air # verify a text AIR module
zig build run -- run f.air # verify and execute @main
zig build run -- run f.air # verify and execute @main (deterministic profile)
python3 tests/hosted/smoke.py # hosted profile against the real OS
zig fmt --check build.zig src tools
```
CI runs `zig fmt --check`, `zig build test` and `zig build conformance` on every push and pull request.
CI runs `zig fmt --check`, `zig build test`, `zig build conformance` and the hosted smoke tests on every push and pull request.
## Repository layout