Repository navigation
Every crate with one consumer moves under it, and the track closes - #703
Conversation
Step 4 of issues/build/code-used-by-one-program-lives-in-that-program.md. The count reads `cargo metadata --no-deps` over every manifest `git ls-files '*Cargo.toml'` lists; a shipped program is its own consumer. - kernel/dma, kernel/gicv3, kernel/pci, kernel/ps2: the kernel's alone. They stay members of the host workspace, as kernel/loom and kernel/sim are. - toyos-blockring/transport: toyos-blockring's alone. - toyos-net-shard/testnet and toyos-net-shard/tcp: the shard and the testnet are each other's only consumer, the shard naming the testnet only as a dev-dependency. The step now says how such a pair counts (the orchestrator's reading, not an owner ruling): the dev-dependency moves under the other, and the pair counts as one crate, which makes the pair toyos-net-tcp's one consumer too. - userland/compositor/desktop, userland/netstack/mdns, userland/soundserver/mixer: each one program's alone. They leave the host workspace for the userland one, with `[lib] doctest = false` as the survey asks of a userland library (none has a doc-test). src/userlandhost.rs's survey now gates a nested crate's tests instead of listing them as escapes, so `--ci host` runs the three userland crates' tests with `cargo test --target <host>`. src/clippy.rs gains a shape that lints the three against the host, since the host workspace's shapes no longer reach them; the other userland crates are not linted, as before. Every package keeps its name, so no `use` changes, and no lockfile but the root's changes: it drops the three that left its workspace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
…oses
Its last step, step 4, landed in the previous commit, and its exit is
met. No directory the file names as moved or merged exists: step 4 names
none, and steps 1, 2, 3 and 5 left with their own pull requests. Step 4's
count, `cargo metadata --no-deps` over every manifest
`git ls-files '*Cargo.toml'` lists, run at that commit, finds 14
packages with one consumer:
- 10 sit under their consumer: kernel/{dma,gicv3,pci,ps2},
toyos-blockring/transport, toyos-net-shard/testnet,
userland/{compositor/desktop,netstack/mdns,soundserver/mixer}, and
tests/toyos-rust-tests/tls-multi-crate/dep.
- toyos-net-shard is the testnet's, the pair the step counts as one.
- diskserver, inspect and terminal are programs the images ship, each
its own consumer.
The rule it carried has its home already: `.claude/agents/reviewer.md`'s
Fit line states the layout, as the track itself said. No file cites the
slug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
|
Mutation patches for #703, each applied with Clippy reaches the userland nested crates ( diff --git a/userland/compositor/desktop/src/budget.rs b/userland/compositor/desktop/src/budget.rs
index 592846086..d9f30afbd 100644
--- a/userland/compositor/desktop/src/budget.rs
+++ b/userland/compositor/desktop/src/budget.rs
@@ -124,3 +124,12 @@ mod tests {
assert_eq!(create_verdict((0, 0), Rect::new(0, 0, 4, 4), 0, 10), Verdict::Allow);
}
}
+
+#[cfg(test)]
+mod planted {
+ #[test]
+ fn planted() {
+ let v: &[u8] = &[];
+ assert!(v.len() == 0);
+ }
+}Negative control: the base survey branch back ( diff --git a/src/userlandhost.rs b/src/userlandhost.rs
index 9d74d61c5..43866c0c9 100644
--- a/src/userlandhost.rs
+++ b/src/userlandhost.rs
@@ -101,7 +101,11 @@ pub fn survey(userland: &Path) -> Result<Survey, String> {
continue;
}
let inside = rel(owner, file);
- if !(inside.starts_with("src/") || inside.starts_with("tests/")) {
+ if crate_name.contains('/') {
+ escapes.insert(format!(
+ "{at}: a test in the nested crate {crate_name}, which the gate does not discover"
+ ));
+ } else if !(inside.starts_with("src/") || inside.starts_with("tests/")) {
escapes.insert(format!(
"{at}: a test outside {crate_name}'s src/ and tests/, which cargo test does not run"
)); |
|
Review round 1, head Net: 116 files, +110 −158. Of that, I re-ran the count myself: On the brief's question, whether the pair sentence makes the BLOCKER
NOTE
REMOVE
SEND BACK |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
…rom the survey src/clippy.rs listed toyos-desktop, toyos-mdns and toyos-mixer by hand, a second declaration beside userland/Cargo.toml's members and the survey: a fourth crate moved under a program would have been tested but never linted. The runs are now derived when clippy runs, one `--manifest-path userland/<dir>/Cargo.toml --all-targets` for each nested crate src/userlandhost.rs's survey gates, as ci.rs derives the tests. The moved crates' manifest headers that restated their descriptions go, and so do the soundserver header lines that were corrected rather than deleted. issues/build/userland-programs-are-never-linted.md says what is linted now, and the file-size issue's history names the paths its commits wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
|
Review round 1 control, re-run at diff --git a/userland/compositor/desktop/src/budget.rs b/userland/compositor/desktop/src/budget.rs
--- a/userland/compositor/desktop/src/budget.rs
+++ b/userland/compositor/desktop/src/budget.rs
@@ -124,3 +124,12 @@ mod tests {
assert_eq!(create_verdict((0, 0), Rect::new(0, 0, 4, 4), 0, 10), Verdict::Allow);
}
}
+
+#[cfg(test)]
+mod planted {
+ #[test]
+ fn planted() {
+ let v: &[u8] = &[];
+ assert!(v.len() == 0);
+ }
+} |
|
Review round 2, head Round 1:
Net: 118 files, +137 −195. In BLOCKER NOTE REMOVE LAND |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
…under one observability umbrella (#704) Notes only: no source, test or manifest changes. This branch writes the owner's rulings of 2026-10-03 into the issues whose tracks they change, each quoted in his words; what was derived from them is attributed to the orchestrator or cut. ## What changed, per decision - **The umbrella track, new: `issues/diagnostics/toyos-explains-itself.md`** (kind: track, 85 lines). Three parts: - **The owner's rulings**, quoted: the diary reader shipping ("its obvious that we want to be able to understand kernel metrics from within toyos ... should be shipped with toyos"), "Keep crash records", "Only with permission" (his option text verbatim: power and per-device interrupts are the revealing counters, and ordinary programs and the toolbox go without "until each program can be granted rights on its own"), "General counters", "Always on", and symbols "adopt". - **Decided by the orchestrator, not ruled.** Each line says where it came from. Its strategy and the roast of it were adopted by the orchestrator. A line marked *told* was told to the owner with his veto open; the rest were not put to him. The lines: on-demand counters with the roast's bound (*told*); one sampler per CPU (*told*); and the request vector. The roast's Ring 3 self-IPI is cut as untold design no exit reads. Design a reader would not pay to re-derive (readers in every image, the decoder crate, the four places) is cut, since a track carries no design. - **A pillar table** that points at each pillar's track, the orchestrator's build order, and an exit. The exit reads "Only with permission": a program without the counters right is refused a counter read, and one holding it but not `trace` is refused the power and per-device interrupt counters. The track holds the counters and sizes pillars itself, because no other track does. - **Folding.** Each of these gains one line naming the umbrella: - the logging track; - `redesign-the-log-subsystem.md` (its sinks and layout half); - the inspect track; - both accounting tracks; - the T14 firmware-SMI issue. Where a fold line carries a plan (logging, inspect), it says the plan is the orchestrator's and not ruled. No track was closed or merged. - **Symbols, Move 3 of `the-kernel-still-parses-what-userland-writes.md`.** It quotes "adopt". The kernel keeping `toyos-elf` is cited to the owner's separate crate ruling ("if it makes sense we wrote our own elf parser ... we do it") as the orchestrator's reading of it. The move now names the work left: - the kernel stops naming a program's addresses; - `read_backtrace_table`'s per-spawn table and each task's copy are deleted; - a userland service names a reported file and offset; - `rustc-demangle`'s standing is decided. It gains an exit that reads each of these. - **The trace track** (`nothing-in-the-machine-can-read-the-trace-ring.md`). "Ruled" became "Proposal accepted (owner, 'Build it as proposed')", and "The lines he drew" became "The proposal's other lines, accepted with it". The line "The reader tool is not in the shipped image", which was never his, is deleted. His quote about shipping the reader replaces it. Step 3 gains slow system calls under "Always on", and its exit reads one back with its number and its program. - **MOR.** `the-loader-never-sets-the-firmwares-memory-overwrite-request.md` is now `kind: rejected`, `status: none`: setting the request is declined by "Keep crash records". The parity track names that line as a place ToyOS stays below Linux. A new defect, `a-memory-overwrite-request-ubuntu-left-set-stays-set-under-toyos.md`, records the T14 reading under Ubuntu, with its command: `MemoryOverwriteRequestControl` 0x01 and its lock 0x00. Its exit: the loader clears a set request where the firmware defines it, and on the T14 a boot that finds it set logs it. `the-update-rig-the-guest-cut-deleted-is-still-cited.md` drops the MOR file's two lines. - **Latency bar** (`toyos-beats-linuxs-latency-on-the-t14.md`). "131 µs" is ruled. The exit holds the timer interrupt's lateness under 131 µs with every CPU spawning a program that exits at once, the load under which Linux read 131 µs (idle it read 99 µs). The woken thread is held under Linux's loaded longest on the same seven CPUs, 503 µs, so the ruling is not stretched to a figure he did not give for it. - **Linux's counter readings before the wipe.** The before-the-wipe issue gains three outputs whole (with trailing blanks stripped), each with its exact command and a decoded summary: turbostat idle, turbostat loaded (eight `yes`), and `perf stat` msr idle. They carry no machine or network identifier. Taking that Linux as the counters' oracle is attributed to the orchestrator. The T14 row in the umbrella's exit is what reads them. - **ACPI.** The track carries "General counters", "Back to legacy mode", "Extracts only" and "full clean room write with the spec". Running uACPI and ACPICA as black-box oracles is moved out of the ruled block and attributed to the orchestrator. Stage 1's exit reads `MSR_SMI_COUNT` through the general counters, not by a check of its own, so "General counters" is read by an exit; it gains a T14 row that kills the server and reads `SCI_EN` clear. - **Views.** `every-program-sees-only-the-files-it-was-given.md` gains "Restrict", "Adopt" and "Per session"; stage 3's "private `/tmp`" became the session's own. `where-everything-lives.md` amends its `/tmp` line and rule. - **Stale crate names.** These paths are re-pointed: - `toyos-sched/src/` → `kernel/pure/sched/` - `toyos-sched/loom` → `kernel/loom` - `toyos-sched/sim` → `kernel/sim` - `toyos_sched::`/`toyos_proclife::` → `kernel::sched::`/`kernel::proclife::` - `toyos-proclife`/`toyos-pcid` → `kernel/pure/…` Transcripts of past runs stay as written, because each is true of when it ran: - `739af0c2`'s sweeps; - the steal-probe loom run; - the two-watch model's evidence; - a CI panic log; - an `aaddf38a^:` path and a branch name; - `parallel-tests-red-under-other-suites.md`'s `toyos-sched-sim` sighting. In `spawn-thread-disagrees-about-a-reaped-parent.md`, the test that file cited was deleted in `fa1e3254d`, and the file now says so. Whether the model that replaced it reaches the state is marked unread. ## Gates - `cargo run -- --ci host` at `accd59656`: EXIT=0, "72 step(s), all green" (log `/Users/jan/.claude/jobs/2280e09e/tmp/scratchpad/orch/rulings-r4/host.log`). - No guest test is reached: the diff touches only `issues/`. ## Unsure - **The woken thread's bar.** It is held to Linux's loaded longest, 503 µs, to match the load of his 131 µs. The idle figure was 571 µs. - **Crate names #703 moved.** `origin/main` still cites `toyos-desktop`, `toyos-ps2`, `toyos-mixer`, `toyos-net-tcp` and others in `issues/`, which #703 moved. That is outside this branch's brief. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8
Step 4 of
issues/build/code-used-by-one-program-lives-in-that-program.md, the track's last step. Every crate with exactly one consumer moves under that consumer, and the track closes.The count
The count follows the step's own definition. It reads
cargo metadata --offline --no-depsover every manifestgit ls-files '*Cargo.toml'lists (97 manifests, 96 packages;userland/Cargo.tomlis a virtual workspace). Every path dependency of any kind counts. A shipped program is its own consumer.My count at the base,
42e5fca73, matches the scout's list exactly: the same 14 packages have one consumer. There is one difference in the result, which comes from the pair rule below:toyos-net-tcpmoves too, which the scout's list did not include.What moved, and why
Every package keeps its name. That means no
useline changes, andkernel/Cargo.lockanduserland/Cargo.lockdo not change. The rootCargo.lockdrops the three packages that left the host workspace (−18).toyos-dma,toyos-gicv3,toyos-pci,toyos-ps2toyos-*kernel/{dma,gicv3,pci,ps2}toyos-transporttoyos-transporttoyos-blockring/transporttoyos-blockringtoyos-net-testnettoyos-net-testnettoyos-net-shard/testnettoyos-net-shard(dev)toyos-net-tcptoyos-net-tcptoyos-net-shard/tcptoyos-desktoptoyos-desktopuserland/compositor/desktoptoyos-mdnstoyos-mdnsuserland/netstack/mdnstoyos-mixertoyos-mixeruserland/soundserver/mixerkernel/loomandkernel/simalready are. They are tested and linted exactly as before.toyos-net-testnetandtoyos-net-shardare each other's only consumer, so the step as written could not be met. I added one sentence to the step. It is the orchestrator's reading, not an owner ruling: "Of two crates that are each other's only consumer, the one the other names only as a dev-dependency moves under it, and the count treats the pair as one crate." So the testnet moves under the shard. Under the same sentence,toyos-net-tcp's two consumers, the shard and the testnet, count as one, so the TCP crate moves under the shard as well.userland/belongs to the workspaceuserland/Cargo.tomlroots, so they leave the host workspace and are listed in the userland workspace'smembers.[lib] doctest = false, which the survey asks of every userland library because thetoyostoolchain builds no rustdoc. None of the three has a doc-test (-- --listat base shows 0 for each), so no test is lost.toyos-mixer's "No dependencies, deliberately" paragraph: what was left restated thedescriptionor the modules.src/userlandhost.rs's survey gates a nested crate's tests instead of listing them as escapes, as the step says.--ci hostnow runscargo test --manifest-path userland/<program>/<crate>/Cargo.toml --target <host>for each nested crate that holds a test.gated/subamong the gated crates, where it used to expect an escape.userland/".src/clippy.rslints every nested crate the survey gates. The host workspace's shapes no longer reach the three userland crates, and the step's check says--clippylints them. The runs are not listed:clippy::runtakesuserlandhost::survey's gated crates whose directory holds a/and runscargo clippy --manifest-path userland/<dir>/Cargo.toml --all-targets -- $ADOPTED -D warningsfor each, against the host, the wayci.rsderives the tests. A crate moved under a program later is linted once it holds a test, with nothing to add by hand.cargo clippy -D warningson each gated program fails:calc,diskserver,fileserver,logkeeper,netstackandpkgeach exited 101 on real findings, andsoundserverandsshserverexited 101 when the manifest load failed mid-move.issues/build/userland-programs-are-never-linted.mdnow says which crates are linted and that no program is.userland/CLAUDE.mdand six issue files.userland/soundserver/src/main.rs's header lines that citedtoyos-mixer/andtoyos-desktop/are deleted. Three kinds stay as they were:issues/build/the-host-job-runs-the-toolchain-the-runner-ships.mdquotestoyos-desktop/src/input.rsandtoyos-mixer/src/channel.rsinside a pasted clippy log. That is output, so it stays verbatim, following toyos-fat32-check moves to toyos-fat32/check, beside the one subject it judges #691.issues/design-debt/what-is-owed-on-file-size.md's history keeps the paths763712band the mixer's split wrote,toyos-desktop/andtoyos-mixer/, and says they have moved since.rgover the fork clones beside the monorepo,rust/libraryandrust/compiler/rustc_targetfinds none of the ten names.~/.cargo/git/checkouts/finds them only in a cargo checkout of this repository at6115718, as in toyos-fat32-check moves to toyos-fat32/check, beside the one subject it judges #691.The track closes
The second commit deletes the track file, because its exit is met.
a08850a80. Of its 14 packages with one consumer:toyos-net-tcp, which now has two, andtls-dep, already undertls-multi-crate;toyos-net-shardis one half of the pair, whose only consumer is the other half;diskserver,inspectandterminalare programssystem.tomlships, so each is its own consumer.git grepfinds no citation of the slug or its title..claude/agents/reviewer.md's Fit line, as the track itself said.Gates
The branch merges
origin/mainat42bda5268(#696). That run includes #696'sthe_kernel_resolves_no_libc_for_either_target, which runscargo tree --lockedonkernel/Cargo.toml, whose four path dependencies this branch moves. It passes.cargo run -- --ci hostdec6bef21Host: 72 step(s), all greenfolders4-r2/ci-host.logcargo run -- --build-onlydec6bef21Build finished.folders4-r2/build-only.logcargo test, the whole guest suitedec6bef2126 passed, 26 totalfolders4-r2/guest.logcargo run -- --clippydec6bef2122 invocations cleanfolders4-r2/clippy-clean.logThe logs are in the brief's log directory, under
orch/. The host run has three more steps than before:userland/compositor/desktop,userland/netstack/mdnsanduserland/soundserver/mixer.I ran the guest suite whole because the kernel, compositor, netstack and soundserver were all rebuilt from moved paths. The source is unchanged, but the bytes are not: panic locations carry the file's path.
The step's check, part 1:
--ci hostruns every test each package lists today. I listed each package's tests at base withcargo test -p <package> -- --list. At head I used the same command for the root members, and for the three userland crates the gate's own command,cargo test --manifest-path … --target aarch64-apple-darwin -- --list. Every run exited 0. Each package lists the same names at both heads, once a doc-test's path prefix is mapped to its new directory.toyos-desktoptoyos-mdnstoyos-mixertoyos-transporttoyos-net-tcptoyos-net-testnettoyos-dmatoyos-gicv3toyos-pcitoyos-ps2In
ci-host.log, the three userland steps read95 passed,12 passedand55 passed.The step's check, part 2:
--clippylints them. The root members stay under the existing workspace shapes. For the three userland crates, I ran a checked mutation atdec6bef21, posted as a comment on this pull request (folders4-r2/mutation.log):v.len() == 0on a&[u8], added touserland/compositor/desktop/src/budget.rs.cargo test --manifest-path userland/compositor/desktop/Cargo.toml --target aarch64-apple-darwin --no-runexited 0.cargo run -- --clippyexited 1. It reportedclippy::len_zeroatcompositor/desktop/src/budget.rs:133:17under the derived runcargo clippy --manifest-path userland/compositor/desktop/Cargo.toml --all-targets, and1 of 22 invocation(s) found warnings.git apply -Rexited 0, and the tree was clean.The survey gate has a negative control, run at
e169ca7a4and posted as a comment. I put back the base's nested-crate escape branch as a checked patch:cargo build --libexited 0.cargo test --lib userlandhostexited 101.every_userland_test_is_in_the_gatefailed, naming every test file undercompositor/desktop,netstack/mdnsandsoundserver/mixer, and the fixture test failed too.git apply -Rexited 0.Growth
git diff --shortstat origin/main...dec6bef21: 118 files, +137 −195. Every non-manifest file moves as a 100% rename. Each moved manifest changes only its paths, and the three userland manifests also lose their headers and gain[lib]. Git reads the desktop and mdns manifests as a delete and an add.src/): +62 −45.clippy.rs+52 −28: the derived runs, andrunreporting how many ran.userlandhost.rs+9 −16, the survey and its docs.ci.rs+1 −1.Unsure
toyos-transport's andtoyos-net-tcp's doc-tests now read under their new directories.git grep 'rs - ('finds nothing in the tree that keys on those names.🤖 Generated with Claude Code
https://claude.ai/code/session_01WcU2Dsw6mDYtwYfzVHPzM8