Milestone 365: xtask in modules, taken while the board is thin - #1001
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
`xtask/src/main.rs` was 11,124 lines with no module structure, one of the three files every lane edits to wire a test, and past the size at which a file gets read. Milestone 365. This commit is the move and nothing else: every line leaves main.rs and arrives verbatim in a module file, along the seams the file already had, which are the commands. No line is rewritten, no function is renamed, and nothing is reordered except `initrd_aarch64`, which joins the two archive packers it is a sibling of instead of sitting between the UEFI image and the disks. **It does not build on its own, by construction**, and that is the point of keeping it separate: a reviewer can read this diff as "these lines went there" without a visibility change or an import line in the way. The next commit is the fixups the compiler then demands, and nothing else. The module doc comments are the section banners the file already carried, lifted from `//` to `//!` where there was one, and written where there was not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
What the compiler asked for after the move, and nothing more: a `use`
line per name a module now reaches across a boundary for, `pub(crate)` on
exactly the items reached (the set is computed from those `use` lines, so
an item used only inside its own module stayed private), `stick.rs`'s
`use super::{..}` repointed at the modules its imports moved to, and the
`std::path` import the archive tests need in their own scope.
Nothing else changed. Every subcommand keeps its name, flags, environment
variables, output text and exit code; `cargo xtask` with an unknown
command prints the same usage byte for byte, and the 21 host tests are the
same 21, moved to the module each one tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
`script/lint`'s host-pass check read `xtask/src/main.rs` by name for the bare-metal exclusion list, which now lives in the module that runs the host pass. It reads every `xtask/src/*.rs` instead, which is what the check always meant: the list exists somewhere in xtask. Three intra-doc links and one `NIFE_GPU_MON` in a doc comment broke the same way, because a `[`run`]` that resolved inside one file does not resolve across two, and a section banner lifted to `//!` is documentation where `//` was not. Qualified, and backticked. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
The module layout, the four places where something other than "one module per command" won, the evidence that behaviour did not change, and the three things the split broke (all of them build errors, which is the failure mode milestone 130's refused `kernel_main` split is the precedent for). BUGS records that the nineteen module names are provisional and that `shell_check.rs` is still 1,866 lines. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
Eighteen places name a function in `xtask/src/main.rs` as the place to go read something: `boot_claim`, `SHELL_CHECK_SCRIPT`, `ABORTS_ACCEPTED`, `DOC_BUNDLES`, `bench_x86`, the scanout decoders, the host-load sampler, the excluded-crate list. Each now names the module that holds it. Done one at a time against the symbol, not by a sweep: this tree has a scar from a blind `sed` that rewrote the record of a name's refusal. Seven references are deliberately left alone, because they describe the past rather than direct a reader: a captured tool transcript in notes/documentation-audit.md, a struck-through closed row, the SMB prober that no longer exists in xtask, and two observations about which file the commit ranking used to put on top. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
What `script/lint`'s roadmap check asks of a BUILT block: the date the index's Built column is generated from, a Follow-on saying what happened to the work this named, and no gate line, since nothing gates work that is finished. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
calef
marked this pull request as ready for review
September 19, 2026 23:34
Collaborator
Author
|
merge-drain: STALLED. #1001 has conflicts a person must resolve (Milestone 365: xtask in modules, taken while the board is thin) |
…part The conflict this milestone's block predicted, resolved the way it says to: not line by line, but by moving each upstream hunk into the module the code now lives in. `--board` and the deferred `--until` went to `board.rs`, `stage_words` beside `parse_stage` there, the sweep's watch policy and `XENON` profile to `soak.rs`, and `boot_check_leg`'s empty prologue to `boot_check.rs`. Checked the same way the split was: every non-blank line of `main.rs` as `origin/main` has it appears in the merged modules, bar the five this branch deliberately edited (three intra-doc links and one backticked `NIFE_GPU_MON`). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lane: milestone/365-xtask-in-modules, written by an agent; calef's account is the author GitHub shows.
Milestone 365.
xtask/src/main.rswas 11,124 lines with no module structure, and one of the three merge hotspots every lane wires its test into. It is now 19 modules plus a 294-line dispatcher, split along the seams the file already had, which are the commands. Base638b6bfee83b2f17e5cef97178332fa92537ef39.The layout, and what lost
The largest file is now
shell_check.rsat 1,866 lines; the smallest ishost.rsat 130. The four places where something other than "one module per command" won:scanout.rs,inbound.rsandmeasure.rsare instruments several commands use, each named for what it does. Acommon.rswould have been a second hotspot wearing a new name.host.rsis the residue, deliberately small:cargo,run,capture,llvm_tool,workspace_root,bin_elf,flag_value. Named for what it holds rather than for the fact of being shared, which is what keeps it from growing into acommon.board-consoleand run under QEMU, never touching a board, so they aresoak.rs.tests.rs, which would have been a fourth hotspot.initrd_aarch64is the only thing that moved out of file order, to sit with the two packers it is a sibling of.The evidence that behaviour did not change
uselines and thepub(crate)prefixes the split forced, appears in the new files: zero missing, and the only additions are the module doc comments and themod testswrappers.script/fastpath-footprintis byte-identical on all three ISAs, before and after, down to the per-symbol totals.cargo xtask <unknown>prints the same usage text byte for byte, which is the one output naming every subcommand and flag.Milestone 130's refused
kernel_mainsplit is why that list exists rather than a claim it was unneeded.xtaskis a host binary compiled in one configuration with nocfg-gated early park, so the compiler really does verify this split completely.Three things it broke, all build errors
script/lint's host-pass check readxtask/src/main.rsby name for the bare-metal exclusion list (it reads everyxtask/src/*.rsnow); three intra-doc links stopped resolving across files; and a banner lifted from//to//!became documentation that clippy'sdoc_markdownthen had an opinion about.Eighteen citations in
notes/andscript/that direct a reader at a symbol were repointed at its module, one at a time against the symbol rather than by a sweep. Seven that describe the past were left alone.Gates, all from this worktree
script/lintscript/names(refusals unchanged)cargo test -p xtask(21 passed)script/test(aarch64, riscv64, x86_64/OVMF)script/shell-check(all three architectures)script/shell-check --graphicalscript/shell-check --graphical-serialscript/boot-checkscript/bench --checkscript/icountscript/fastpath-footprint(byte-identical)This lane took the machine-global
nife-devlink, as every gating lane does.Commits
The split is its own commit and does not build on its own, by construction: a reviewer can read it as "these lines went there" with no visibility change or import line in the way. The next commit is the fixups the compiler then demanded.
🤖 Generated with Claude Code
https://claude.ai/code/session_01STu3VeDYnEHem3iKCbzBF2