agent: builder model: opus max_turns: 120 budget_usd: 25 —
Project::drive and drive_to of project.rs into project_drive.nika (Part #125)Score: self-hosting lane, plan row P5c of docs/selfhosting-plan.md (prerequisites P5a, P5b, P5d built; #920 built 8eb22790, so process::run streams). S=2, C~3-5 M (comparable: P5d). K3b is blocked on #1077 and #1078 (bug lane b17, b18) and did not land: a host method write_if_changed(path, text) forwards to the Rust one in comptime_run.rs (unchanged); say so in Body:. K3b’s re-run later turns it into the Nikaia call.
Cut: crates/nikaia/src/project.rs:2116-2590
Convert: –profile check-free –prefix project_drive_
Shape: schematic host-calls (R295’s host parameter, as project_members.nika and P5d’s project_check.nika)
Facts: Where things live, Traps already met, Moving Rust into Nikaia, Commands
The driver converts this before you start. Ranges re-grepped at 4520d400 (33ed1119 and its neighbours shifted them by 4); if git log -- crates/nikaia/src/project.rs shows a later change (K3b may touch build_for_cpu’s call), re-grep /// Build the project, or build and run it. and the end of pub fn drive_to and cut again.
drive_to’s steps and every decision between them: the entry refusal, explain when asked, the members in dependency order (project_members_dependencies_first, already Nikaia), the own-sources filter of each member, the refusals of libraries, writing the gen/*.rs files and the switches file ("{build}\n{backend}\n{flags}\n{NIKAIA_COMPILER}\n"), the toolchain checks’ refusal texts, the choice between the run_fast path, run_directly and cargo run, the env list handed to cargo (WRAPPER_MARKER, GEN_DIR_VAR, PROGRAM_TAG_VAR only when CARGO_TARGET_DIR is unset, LINK_VAR, NO_CACHE_VAR, SHOWN_AS_VAR, READS_VAR), the c-library outputs (header, Python and Node bindings, the copy of what libraries_in finds), and the warning of record_resolved_dependencies. Texts byte for byte.env::var("CARGO_TARGET_DIR") empty counts as unset (Nikaia’s env::var gives String?; ?? "" then == ""). Name it in Body:.libraries_in, executable_in, Project::report; they are host methods, serde_json and a whole Program): drive and drive_to keep their signatures and forward through block_on (nikaia test calls drive_to for the binary); Members, Lowered, Cargo, Workspace, the WARNED/SHOWN_AS statics and lower_reading behind the host; libraries::declared/named_both_ways/link_flags (libraries.rs) behind one host method.pub trait ProjectDriveHost (one Rust struct holding &Project, the arguments and the Rust values made on the way, in RefCells; units and members are named by i64 index; a host method that throws lowers to Box<dyn Error>, builder-facts Host traits; a body-less method’s text parameter is ref String):
entry() -> fs::Path?, members() -> Vec[ProjectMembersMember], tests_build() -> bool, gen_dir/switches_path/own_dir/build_dir() -> fs::Path, choices() -> String, compiler() -> String, target_triple() -> String, host_triple() -> String, is_library() -> bool, nothing_exported() -> bool, settings_env() -> Vec[(String, String)], cpu_rustflags() -> Stringexplain_if_asked() throws, lower_member(at: i64, no_cache: bool) -> ProjectDriveLowered throws with ProjectDriveLowered { rust: String, sources: Vec[fs::Path], notes: Vec[String], header: String?, python: String?, node: String? }, check_libraries(at: i64, own: ref Vec[fs::Path]) -> Vec[String] throws (refusal texts, empty when none), write_ledgers(at: i64, locked: bool) throws (both ledgers, and the proofs unless tests_build), eprint(text: ref String)toolchain_is_new_enough() -> String? (the refusal text or null), toolchain_can_build_for(triple: ref String) -> bool, write_workspace() -> fs::Path throws, runs_without_cargo() -> bool, compile_fast() -> fs::Path? throws, make_cargo(env: ref Vec[(String, String)], rustflags: ref String) throws, cargo_messages(args: ref Vec[String]) -> String throws, settle() throws, report(messages: ref String) -> bool throws (P5d’s Project::report), cargo_run(args: ref Vec[String]) -> i32 throws, run_directly(binary: ref fs::Path) -> i32 throwslibraries_in(messages: ref String) -> Vec[fs::Path], executable_in(messages: ref String) -> fs::Path?, own_copy(built: ref fs::Path) -> fs::Path throws, record_resolved_dependencies() -> String? (the warning text or null)
You may add one-line read-only getters where a value the Rust reads is missing; name each in Body:. A host method that would take a decision is no getter: it is Nikaia.pub enum ProjectDriveRefusal { Host, Refused(String) } as ProjectMembersRefusal (project_members.nika): Host re-raises the anyhow error the host keeps, Refused(text) becomes anyhow!(text) in the forward.target/fast/nikaia from HEAD before the first lower-std (a stale binary rewrote project_members.rs, b15 1d88667d). After lower-std, git status --short crates/nikaia-std/src/tools/lowered/ must show only project_drive.rs and lowered.rs as yours; any other lowered file differing from HEAD is Found: with its diff’s first lines, and stops the brief. Name the host methods so no other tools/*.nika uses the name as a variable (members is one: call it drive_members).crates/rs2nika/**, comptime_run.rs, grammar_run.rs, docs/briefs/* but your report, the uncommitted files git status shows at start.project_drive.nika, the host impl and the forwards in project.rs; lower-std and its fixpoint. Tests: cargo test -p nikaia --test it -- project build run_ library c_library python node explain ledger (anchored grep -E '^test result:|FAILED|panicked'), cargo test -p nikaia --lib project::, and nikaia test tests/compiler on two project_* tests. Commit project: drive and drive_to move into Nikaia (P5c), Part: #125; plan rows P5c (built, what stays Rust) and P5e (record_resolved_dependencies is a host method of P5c now) updated, self-hosting share in the body. Stop about 15 turns before max_turns, commit what is finished and report partial.Run 1 finished the move on branch wip/p5c-project-drive (cc40334f) and stopped on #1088: a tuple’s String? part at a return match end got no Some. Pre-flight: the probe in #1088 prints 2x on HEAD’s binary, or stop. Then take the branch’s files onto develop (by name, not a merge). Do not hand-wrap lowered/project_drive.rs. Run lower-std, the build and the tests, update plan rows P5c/P5e and the self_hosting.py row, score rs2nika against the branch’s project_drive.nika, and commit. Keep the design run 1 chose: ProjectDriveRefusal::Failed(String), toolchain_can_build_for -> bool with its text in project_drive_no_std_for, the host getters shown_as, allowlist, root_tag, package_name, bind, and Rust dependencies_first removed. Name them in Body:.
docs/builder-facts.md first. develop in the main checkout; git status at start: other agents’ uncommitted files are not yours, never touch or stage them.git add <files> only (scripts/commit.nika -- REPORT does it); commit locally after each step and never push: the driver runs the complete suite and pushes (.claude/agents/builder.md, Cheap checks only; owner, 2026-10-31).cargo build --profile fast -p nikaia, lower-std and its fixpoint when a tools/*.nika changed, cargo fmt, cargo clippy --all-targets -- -D warnings, scripts/pre-push-check.sh, the tests the brief names and the ones your change touches. No gate.nika.CHANGELOG.md, badges; no new NK code. New tests in Nikaia only; never the full suite. No foreground sleep, no polling; scripts in files.std or the toolchain lacks stops the work: no code around it unless an ADR or Part I-III refuses it (name it). Else Result: blocked, Found: gap + probe, Needs: architect decision (CLAUDE.md, A missing form stops the work).NIKAIA_CACHE_LIMIT=2G; at most two clones with target/ in the machine; delete your own clone’s target/ and target/release/nikaia-scratch at the end; report GB freed.Result: partial with what you ruled out, the probe, and the suspected file and function (.claude/agents/builder.md).target/fast/nikaia run scripts/commit.nika -- REPORT, which writes Pushed: local <sha> into it. A report without a Pushed: line, or with a placeholder left in (TC, DISK), is not done and cuts the batch (k3a1 2026-10-29: Result: done, nothing committed)./home/user/Nikaia/docs/briefs/p5c-project-drive.md.report.md)Fields of docs/architect.md, Briefs and reports: Result: done|noop|partial|blocked (the bare word alone on that line: Result: done, never a summary after it, which cuts the batch, b869a 2026-10-27; Owner: is a question for the owner or none, never a role), Files, Commit, Body (optional, one paragraph for the commit message), Fixes, Pushed, Tests, Gate (green|red), Deviation, Found, Needs, Changelog, Owner, Disk freed, and for a move Rs2nika: (the kept N of M lines of rs2nika --score, then the three costliest hand edits; none for a task that moves no Rust, none (redesign) for a brief with Shape: redesign and no Convert: line). none where nothing, and then the bare word: Deviation: none (a note) cuts the batch (batch.nika compares exactly); a note goes into the commit message. Found: is only for a defect outside your change (it cuts the batch); a process event such as another session resetting or rewriting your files is no Found:, it goes under Needs: (m3a 2026-10-28); a converter draft that came out wrong is no Found:, it is one of the costliest edits under Rs2nika:, which the converter lane reads (e12-4b 2026-10-27); how you solved your own step goes into the commit message. Deviation: is only a step of the brief built otherwise than written or not built (a choice the brief left to you, such as keep what X needs and say so, is no deviation: it goes into the commit message; nor is building two steps in one commit when every step is built, e12-3a 2026-10-27, nor a step another commit on develop already built, shown by your test failing with that commit’s change reverted, b889 2026-10-27: name the commit in Body:, nor a test’s expected .stdout/.stderr taken from what the program really prints where the brief’s sketch of it was short or wrong, b934 2026-10-29: say so in Body:, nor a lowering that follows the ADR governing it where the brief’s expected lowering contradicts that ADR, b933 2026-10-29: name the ADR in Body:, nor a lowering other than the brief’s where rustc cannot take the brief’s, b1029 2026-10-31: say why in Body:, nor re-keying an allow-list entry (KNOWN) whose hash changed for the same program and the same reason, b-fixforward-sweep2 2026-10-28: say so in Body:, nor an existing test’s expected .stdout/.stderr updated because your change rightly changes the message it prints, b1012b 2026-10-31: name the test in Body:); how you verified (e.g. a test not run against the unfixed compiler) goes under Tests:. A noop says why under Tests: (what was probed), not under Deviation:. Final answer, one line: done <sha>, report <path> (or BLOCKED: ... / PUSH REJECTED ...).
Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq