Result: done
Files: crates/nikaia-std/src/tools/grammar_run.nika crates/nikaia-std/src/tools/lowered/grammar_run.rs crates/nikaia-std/src/tools/lowered.rs crates/nikaia-std/src/tools/lowered/project_members.rs crates/nikaia/src/grammar_run.rs docs/selfhosting-plan.md scripts/self_hosting.py
Commit: grammar run: the parser’s build and run move into Nikaia (GR, again after 0fbe3d6b)
Body: compile_and_run, cargo and write_if_changed move to tools/grammar_run.nika as grammar_run_compile_and_run and grammar_run_write_if_changed, over process::run, hash::sha256_hex, env::var and fs with fs::Root::Anywhere. The host trait GrammarRunHost has driver, manifest, shared_target and where_tools_start. A host method that throws lowers to Box<dyn Error>, so the Rust host keeps the driver’s own Wall in a RefCell and Workshop::run returns it after the call; the Nikaia side rethrows NowhereToBuild there, and that value is never seen. Workshop::run keeps its Mutex guard and calls the lowered function through block_on, which works inside a comptime evaluation. The file gets an impl Error for CheckWall (needed to throw it), which also gives Wall a Display. Known and kept: the unchanged-file check reuses sysroot_holds (sysroot_cache.nika), because String? == String is refused (NK1102); messages stay byte for byte, but {error} is now an io::IoError’s text and not Rust’s io::Error’s; process::run throws on output that is not UTF-8, where Rust read it lossily. Stays Rust: Ask, Workshop and its Mutex/OnceLock, run_comptime, driver, dumper, shapes, decode, and shared_target and manifest as host methods (they move with O1). b15 cleared the stale-binary drift the revert blamed; what is left in lowered/project_members.rs (its fs::Path-keyed maps and sets go from TrustedMap/TrustedSet to keyed HashMap/HashSet) is right by ADR-010 D9: process::run’s output is the first untrusted source in the tools package, and the fs::Path keys come through ProjectMembersHost trait methods, which D9 point 5 makes a barrier. lowered/grammar_run.rs is re-lowered: process::run now takes three more defaulted arguments (stdin, stdout, stderr).
Part: #125
Tests: it grammar_at_build_time dsl_grammar build_time comptime 115 passed (language::the_build_time_package_passes_its_own_tests failed once in the batch because another agent rebuilt target/fast/nikaia during the run; it passed alone, and nikaia test --both-settings --project tests/build-time passed on my copy of the binary); nikaia test --both-settings --project tests/compiler 499 passed, 0 failed (no name filter exists, so the whole project ran, which covers grammar/comptime/sysroot/lowered); lower-std fixpoint; cargo check nikaia-std –features compiler; clippy 1.97 –all-targets and 1.99.1 -p nikaia clean; fmt; pre-push-check
Gate: green
Deviation: none
Found: none
Needs: none
Changelog: none
Owner: none
Disk freed: 0 GB; target/nikaia-project-tests 3.5G, disk 5.5G free; new cache entries over 100 MB: run-bundle/3f8b93b88f7f213d 480 MB, build-time-parsers/768d2772d43bb4cc 1030 MB
Rs2nika: none
Pushed: local 6ccfc63720de554db27aaed7616007d7e341f801