Skip to content

Hygiene: delete the dead-citation and arch upward-import gates, keep the tracker cleanup - #537

Merged
Japabu merged 15 commits into
mainfrom
wt/toyos-hygiene
Sep 27, 2026
Merged

Japabu merged 15 commits into
mainfrom
wt/toyos-hygiene

Conversation

@Japabu

@Japabu Japabu commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Owner ruling: this repository carries too much code that only polices. Two
gates this work had built are not landed; what lands is the tracker cleanup,
the CLAUDE.md pointer edits, the crate descriptions with the gate that keeps
them, one git ls-files helper, and the kernel's arch layer holding no
re-export of a name that lives above it.

Not landed

  • The dead-citation gate (src/citations.rs: a scanner over every issue
    file and CLAUDE.md for repository paths git does not track). Nothing in the
    tree refers to it.
  • The arch upward-import gate (ARCH_REACHES_UP and its scan in
    src/sourcegate.rs), with the path-resolving generalisation of
    arch_module_lines it needed (spelled_paths, Code, Spelled, a
    char-literal branch in code_only). src/sourcegate.rs is main's but for
    the tracked_files calls below, and no redlist row, workflow or test names
    either gate.

Kept

  • The arch-rules scan (ARCH_RULES: assembly, core::arch and
    target_arch only in each architecture's own module), unchanged from main.
  • Tracker cleanup. Every dead path citation in issues/ and the
    CLAUDE.md files re-pointed where the file went, written as
    <rev>^:<path> where it was deleted, or prefixed with the fork repository
    it lives in. Duplicates merged: the two sun_len tap-socket files into
    issues/build/a-lane-s-tap-socket-path-outgrows-sun-len-on-the-dev-host.md,
    the two blocking_read_window files into
    issues/build/blocking-read-window-reds-beside-other-guests.md, and
    issues/boot-media/log-flush-retry-two-older-failure-modes-with-no-home.md
    into issues/filesystem/log-flush-retry-deadman-arm.md, carrying main's
    "disabled with a src/redlist.rs row" wording into its exit condition.
    issues/build/issue-files-cite-paths-that-moved.md is closed. Frontmatter:
    toyos-dns-decodes-what-a-published-crate-decodes.md is a defect, and two
    tracks lose an undeclared decided: field. tests/metal-profile.toml names
    time::DEAF_CPU where it named the deleted arch::tlb::ACK_TIMEOUT.
  • CLAUDE.md edits (owner-approved): the repository-layout listing becomes
    a pointer at the root workspace table and src/hostws.rs; tests/CLAUDE.md's
    host-suite list becomes a pointer at src/ci.rs's host; the std fork's paths
    carry rust/; the capabilities and dependencies clarifications.
  • Every host-workspace package has a description (48, toyos-net-wire
    included), and hostws::every_package_the_workspace_names_has_a_description
    reds on one without.
  • One git ls-files: sysroot::tracked_files replaces the wrappers in
    licence.rs, assets.rs, sourcegate.rs and sdkversion.rs, refusing a
    name that is not UTF-8 instead of rewriting it.
  • The arch layer re-exports nothing from above it: arch::tlb no longer
    re-exports invalidation::Origin, nor arch::paging mm::policy's
    CachePolicy, MmioPolicy, Prot and WindowProt; every caller names them
    at home. The TLB shootdown's ack wait is time::DEAF_CPU, which xHCI's
    CALL_AFTER_BREAK is asserted under at compile time.

Net lines against main (c551894)

git diff --numstat origin/main HEAD: 165 files, +460 −511, net −51.

  • Kernel (production): +57 −58.
  • Build system, production (sysroot.rs +28 −9, licence.rs +2 −18,
    assets.rs +2 −16): +32 −43.
  • Build system, test-only (hostws.rs +52 −1, sourcegate.rs +7 −37,
    sdkversion.rs +2 −2): +61 −40.
  • Cargo.toml descriptions +48; *.md +261 −368; tests/metal-profile.toml
    +2 −2.

Gates

  • cargo test --lib: EXIT=0, 381 passed, 0 failed, 1 ignored.
  • cargo run -- --clippy: EXIT=0, 10 invocations clean.
  • cargo test --workspace --exclude toyos-build: EXIT=0, no failure.
  • cargo run -- --ci host: EXIT=0, 48 steps green.
  • cargo run -- --build-only: EXIT=0.

Negative controls

  • The description gate: toyos-net-wire/Cargo.toml without its
    description → cargo test --lib hostws EXIT=101,
    every_package_the_workspace_names_has_a_description red on
    "toyos-net-wire/Cargo.toml has no description".
  • The deleted re-exports: TlsBlock::publish naming
    crate::mm::paging::Prot → cargo run -- --clippy EXIT=1,
    error[E0603]: enum import Prot is private on both architectures.

Guest tests, run by the orchestrator

The kernel changes are path renames that compile or do not; no guest test was
run on this branch. The Fast tier: cargo test, expected green or reds that
cargo run -- --known-red <test> names.

Unsure

  • The arch layer still names the scheduler, the log and drivers above it; with
    the upward-import gate not landed and its issue not filed, nothing counts
    that.

🤖 Generated with Claude Code

Japabu and others added 7 commits September 27, 2026 13:10
…ate holds it

`src/citations.rs` reads every tracked `issues/**/*.md` and `CLAUDE.md` for
tokens that begin with a directory git tracks at the root, and reds on one git
does not track, naming the citing file, its line and the missing path. What
another namespace spells is not read: patterns, `path:line:column` panic
locations quoted from captures, build output under `target/`, the std fork
under `rust/`, and `.cargo/config.toml`, the name cargo reads everywhere. The
module header says how to cite what is not in this tree: a foreign
repository's path with the repository's name in front, a deleted path as
`<rev>^:<path>`, a path not yet written relative to its crate.

At 16d2e64 it found 138 dead citations of 62 distinct paths in 63 files (62
issue files and src/CLAUDE.md). Each is fixed:

- moved paths re-pointed where the file went (the ARM stage-0 moves under
  `kernel/src/arch/x86_64/`, the syscall layer to `kernel/src/syscall/`,
  `kernel/src/inbox.rs` to `inbox/mod.rs`, `toyos-abi/src/io_uring.rs` to
  `inbox.rs`);
- deleted paths written as the revision that last held them (the syscall
  monolith `4a98107f^:kernel/src/arch/syscall.rs`, the three workflows and
  `src/durations.rs` at `35383398^`, closed issue files), every one checked
  with `git cat-file -e`;
- fork paths prefixed with their repository (`mio/`, `memmap2/`,
  `softbuffer/`, `tinycc/`, and `rust/` for the std fork in src/CLAUDE.md).

`issues/build/issue-files-cite-paths-that-moved.md` is closed by this: every
whole-repository path in `issues/` resolves, and the gate is the owner's
answer to its question (a move that strands one is refused).

Tracker hygiene in the same change:

- merged `a-lane-s-tap-socket-path-is-past-sun-len-on-the-dev-host.md`
  (tooling) into `a-lane-s-tap-socket-path-outgrows-sun-len-on-the-dev-host.md`,
  now `kind: tooling` because it is the harness, with all three sightings;
- merged the two `blocking_read_window` findings, whose slugs carried their
  measurements, into `blocking-read-window-reds-beside-other-guests.md`;
- merged `boot-media/log-flush-retry-two-older-failure-modes-with-no-home.md`
  into `filesystem/log-flush-retry-deadman-arm.md`: one test, and the deadman
  assertion is the same red in both;
- `toyos-dns-decodes-what-a-published-crate-decodes.md` had the illegal
  `kind: design-debt` and is a `defect`; two tracks carried an undeclared
  `decided:` field whose date their bodies already state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
Reverted by the next commit. Planted to show the gate reds on a path this
tree does not hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
`src/sourcegate.rs` gains an eleventh scan beside the arch rules. A file under
`kernel/src/arch/` may name, by `crate::`, `$crate::`, a `crate::{…}` group or
a `super::` chain out of its module, only the architecture and the kernel
root's re-exports of it (`crate::hw` is `arch::hw`, read off main.rs). A glob
of the root or a rename of it is refused whole. Everything it names beyond
that today is `ARCH_REACHES_UP`: 49 files, 203 (file, item) entries over 38
distinct root items. The gate reds on a name a file adds and on a listed name
its file no longer spells, so the list only shrinks. It is recorded debt,
filed as `issues/kernel/the-arch-layer-names-the-kernel-above-it.md`, owned by
the arch-contract work (a statically dispatched contract trait and a
`platform/` layer for the PC's devices), exit: the list is empty.

The review counted 35 non-arch modules with a text search over comments too;
the gate reads code only and counts root items, so it also sees the three root
re-exports arch names (`PHYS_OFFSET`, `DirectMap`, `MemoryMapEntry`) and the
items `alert` and `kernel_main`, and does not count `crate::hw`.

One entry is fixed rather than listed: `arch/x86_64/tlb.rs` asserted its
shootdown tripwire above `crate::drivers::xhci::CALL_AFTER_BREAK`, so the ISA
layer knew how long a USB disk call spins. The timeout is now
`time::DEAF_CPU`, a generic tripwire with its own reason (no CPU that is not
wedged goes five seconds without taking an interrupt), and the xHCI driver
asserts its own bound under it. It lives in `time` and not in either arch's
`tlb`, because both architectures compile the xHCI driver and AArch64's
shootdown waits on no acknowledgement to export a timeout for.
`CALL_AFTER_BREAK` loses its `pub(crate)`: nothing outside the driver reads
it now. `cargo run -- --clippy`: all ten shapes clean, the kernel on both
architectures in all three feature arms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
Reverted by the next commit. A real upward import that builds, planted to
show the gate reds on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
This reverts c523ccb. The planted `crate::process` in
`kernel/src/arch/x86_64/tlb.rs` built (`cargo check --target
x86_64-unknown-none` in kernel/, exit 0) and redded
`the_arch_layer_names_nothing_above_it` (exit 101) naming
`kernel/src/arch/x86_64/tlb.rs:279` and `crate::process`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
…ge describes itself

The owner-approved CLAUDE.md edits, placed as ruled:

- the rule, appended to "There are no spec documents.": a CLAUDE.md never
  holds a list that a manifest, a directory or a gate already answers; it
  points at that source instead;
- root "Repository layout" is one sentence pointing at the root Cargo.toml's
  `[workspace]` members/exclude (held to the tree by `src/hostws.rs`) and each
  package's `description`. The list it replaces omitted 23 of the root crates.
  No orienting fact of it was kept: the build system's package name and the
  workspace gate are the Cargo.toml's, `rust/` is the Dependencies section's,
  the QEMU harness is Build & test's, `issues/` is the table at the top, and
  `system.toml` is src/CLAUDE.md's and the Capabilities paragraph's;
- tests/CLAUDE.md's host-suite list, which named 23 crates of a workspace
  that holds more, is a pointer: the workspace members, the SDK and every
  userland crate `src/userlandhost.rs` finds a test in, all run by
  `src/ci.rs`'s `host`. Its claim that any userland crate is host-testable
  with the host triple went with it; userlandhost's header says most cannot
  make a host build;
- the Capabilities paragraph stated per-program file views as present fact,
  and `sys_open` resolves every path against one machine-wide tree
  (`kernel/src/syscall/fs.rs`), so it now says that is not yet true of files;
- the Dependencies section's first sentence says the development machine can
  be any host OS and architecture.

44 workspace members and the root, `bootloader` and `kernel` packages had no
`description`; each now has one line taken from its own module header, or
from the deleted list where that was still accurate (the no_std/forbid claims
re-checked against each lib.rs). `hostws`'s new gate reds on a package the
`[workspace]` table names without one; a checked mutation deleting
toyos-dns's description redded it (exit 101) and was restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
@Japabu
Japabu marked this pull request as ready for review September 27, 2026 11:25
@Japabu

Japabu commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

Review of #537 at 9f0665a against origin/main 16d2e64.

Before review: CI on the PR is abi-split SUCCESS. host is SKIPPED on pull requests by design (ci.yml) and runs only in the merge queue. The branch adds eight host tests; the PR body gives cargo test --lib EXIT=0 with 404 passed, against 396 at the base. The change targets no hardware.

BLOCKER

  • src/citations.rs:78 — roots() takes the roots it reads from what git tracks now. Delete or rename a whole root directory and every citation into it stops being read, rather than going red. Patch: git rm -r --cached -q toyos-cc. The files stay on disk, so cargo still builds. citations::tests::every_path_the_tracker_and_the_claude_files_cite_exists stays green while issues/ still cites toyos-cc/src/codegen/resolve.rs and toyos-cc/tests/emission.rs. git rm --cached -q toyos-cc/tests/emission.rs on its own does turn it red. The test must go red on the first patch too — the header says a move or a delete goes red, and the open toolchain branch deletes exactly this root.
  • src/sourcegate.rs:1820 — item != "arch" accepts any path through crate::arch::…. So an upward name that arch re-exports (pub use crate::invalidation::Origin in both tlb.rs files, pub use crate::mm::policy::… in both paging.rs files) reaches every arch file without a row. This already happens: kernel/src/arch/x86_64/paging.rs:354 names crate::arch::tlb::Origin, which is crate::invalidation::Origin, and its row (sourcegate.rs:1646) has no invalidation. Patch: add use crate::arch::paging::Prot; const _: Option<Prot> = None; to kernel/src/arch/x86_64/rtc.rs. the_arch_layer_names_nothing_above_it stays green on it; it must go red.
  • kernel/src/arch/x86_64/tlb.rs:64 — the xHCI assertion now binds time::DEAF_CPU, not the wait that uses it. Patch: -const ACK_TIMEOUT: Tripwire = crate::time::DEAF_CPU; +const ACK_TIMEOUT: Tripwire = Tripwire::absurd(crate::time::Duration::from_secs(1), "m");. That builds on x86_64 at this head, leaving a 4.75 s xHCI spin with IF clear against a 1 s ack panic. The same shortening of ACK_TIMEOUT fails the build at origin/main. Fix it either way: name crate::time::DEAF_CPU at wait_for's two uses (tlb.rs:143, :147) and delete the alias, or assert ACK_TIMEOUT.nanos() >= DEAF_CPU.nanos() in tlb.rs. The x86_64 kernel check must go red on the patch. The fix edits the shootdown wait, so post tlb_shootdown_waits, run alone at the new head, with its exit code and log. This is high-risk code, and the check the branch moved is weaker than the one it replaced.
  • src/citations.rs:55 — tracked() is a fifth git ls-files -z wrapper. The others are licence.rs:1155 ls_files, assets.rs:218 tracked, sourcegate.rs:1237 and the two inline copies at sourcegate.rs:2832 and :2899. Make one of them pub(crate) and derive the directories from its result. It is a sibling of what the tree already has.
  • src/sourcegate.rs:1672 — crate_items_named copies arch_module_lines (sourcegate.rs:1297): the same word, line_of, skip_space and ident closures and the same {…} element walker. The copy skips a group's self as k element, which the original refuses as a rename. Make one path scanner that takes its root (core/std, or crate/$crate/super chains) as a parameter. It is a sibling.

NOTE

  • CLAUDE.md edits against the approval. The four root edits and the tests/CLAUDE.md pointer match the brief's items. I hold no verbatim approved text, so the rule's closing clause "; it points at that source instead" (CLAUDE.md:21-22) is checked against the brief's paraphrase only. Two edits fall outside the approved list:
    • src/CLAUDE.md:22 changes library/ and src/bootstrap/ to rust/library/ and rust/src/bootstrap/.
    • tests/CLAUDE.md:29 drops the host-triple/calc clause.
      The PR body files the first under "placed exactly as ruled". Neither edit is wrong in fact; the orchestrator rules on both.
  • src/citations.rs:31 — the <rev>^:<path> form is trusted, never resolved. All 21 in issues/ resolve today (git cat-file -e over each, run for this review). A mistyped rev or path would still pass forever, and CI's host checkout is depth 1, so resolving them needs history. The header should name this as a second hole beside crate-relative paths.
  • src/citations.rs:90,100 — also unread: a whole-repository path wrapped in ** (the * makes it a pattern), a path in single quotes, and a whole-repository path:line:col. The false positives (#L anchors, kernel/userland in prose) are loud and acceptable. URLs, fork paths prefixed with a repository name, rust/, and code without a root prefix are correctly not read. I scanned the same files independently with a regex: nothing is dead except the panic locations the gate skips on purpose.
  • src/sourcegate.rs:1748 — super after :: is never read, so self::super::super::super::drivers gets past the gate. An inline mod x {} (six arch files have one) shifts the depth, so a super chain inside it is counted at the wrong depth. A '"' char literal hides the rest of its line from code_only. Either say so in the doc or read these.
  • src/sourcegate.rs:1811 — a row naming an existing file outside arch/ passes silently, because the check asks whether the file exists, not whether it is under ARCH_TREE.
  • src/sourcegate.rs:1606 — the list is per (file, root item). A file with a sched row can add any new crate::sched::… path without being seen. The list only shrinks by item, not by reach, and a new row added with its reach is green: "only shrinks" is a convention that review enforces, not the gate.
  • issues/kernel/the-arch-layer-names-the-kernel-above-it.md:36 — the owner, "the arch-contract work", is no file in issues/. Name a file that exists.
  • kernel/src/drivers/xhci/mod.rs:326 — the assertion is correct on both architectures. On AArch64 it binds a tripwire that nothing waits on, so there it guards nothing. On x86_64 the timeout is 5 s before and after. ACK_TIMEOUT is read only through .nanos(), so the new reason string reaches no output, and there is no runtime change at this head. No guest test reaches the 5 s arm: tlb_shootdown_waits stages 20 ms delays.
  • Deleted issues/build/issue-files-cite-paths-that-moved.md — its exit condition holds at this head: no whole-repository path in issues/ is dead. Its durable rule is at citations.rs:7-8. Commit c4fc16e's "the owner's answer" is truthful on the owner-approved plan. Its "(a move that strands one is refused)" is not yet true of a move at root level (first BLOCKER). It cannot be amended, so the fix round's commit says so.
  • 98b3545's default revert message does not matter. The -F rule guards against -m backtick substitution, which a default revert message cannot trigger, and the revert names the hash it reverts. The red it measured is recorded only in the PR body, which becomes the merge commit. 41ae518 also swept in the uncommitted arch-gate draft; the revert removed it, and the planted dead path is still a valid control for this gate.
  • Duplicates: all three merges are lossless. Every sighting, number, rev, command and exit clause of the deleted files is in the file that survives. git grep finds no citation of any deleted slug anywhere in the tree, src/redlist.rs included.
  • Net lines (git diff --shortstat): 128 files, +976 −368.
    • Production: kernel/src +20 −14, net +6. The alias fix in the third BLOCKER removes 4 of these. The 47 description lines replace the deleted list.
    • Test-only (#[cfg(test)]) gate code in src/: +621 −1. The fourth and fifth BLOCKERs shrink it.
    • Prose: issues/ +281 −316, CLAUDE.md files +7 −37.

REMOVE

  • src/CLAUDE.md:36 — "Documentation carries no gates" — false once src/citations.rs lands. The orchestrator has authorised deleting it; the fix round deletes it.
  • kernel/src/arch/x86_64/tlb.rs:62-63 — "Every spin that masks them holds itself under this at its own site" — one site (xhci/mod.rs:326) does, and nothing holds the others to it.
  • bcachefs/Cargo.toml:3 — "and the interim ToyOS format the kernel still links" — goes false when the kernel's storage code is deleted.
  • issues/kernel/the-arch-layer-names-the-kernel-above-it.md:12-13 — "enumerates every such name" — false (paging.rs:354).
  • PR body, first bullet under "Unsure" — "the toolchain branch deletes toyos-cc … will red on this gate" — false: deleting the whole root makes its citations unread. This body becomes the merge commit.

SEND BACK

…ls-files, one path scanner

The citation gate read only roots git tracks now, so deleting a whole root
directory silenced every citation into it. A token shaped like a file
(`name/.../file.ext` or `name/.../`, lowercase) whose first component is
no tracked root, no directory below one and no named foreign one is now a
citation of a root that is gone, and reds. The foreign names are the
fourteen the tracker quotes today: QEMU's, the std fork's, forked crates,
a game repository, host capture directories. The bare `name/` form is not
read, because the tracker uses it in prose for directories that do not
exist yet. c4fc16e's "(a move that strands one is refused)" was not true
of a whole root until this commit.

The arch gate accepted any `crate::arch::...` path, so a name arch
re-exports from above (`invalidation::Origin`, the `mm::policy` four)
reached every arch file without a row. The gate now reads what arch
re-exports from above and counts a path that passes through one, via
`crate::arch`, a root alias or a `super` chain, as naming its origin.
x86_64/paging.rs's `crate::arch::tlb::Origin` gets its `invalidation`
entry. A `super` after `self::` starts a chain, an inline `mod x {}`
deepens the chain a `super` needs, a char literal (`'"'`) no longer hides
the rest of its line from `code_only`, and a row naming a file outside
arch/ reds. The list shrinks by item only; the header says review holds
the rest.

The two path scanners are one, `spelled_paths`, which takes its roots
(`core`/`std`, or `crate` plus a module depth for `super` chains) and
expands use groups. Both gates read it. Glob and rename are still refused
whole, and a group's `self as k` is now a rename for the crate gate too.

tlb.rs asserts that ACK_TIMEOUT is no shorter than time::DEAF_CPU, so the
shootdown wait itself is bound to the tripwire the xHCI IF-clear spin sits
under, not just the constant.

The five `git ls-files` wrappers become one, sysroot::tracked_files, used
by licence.rs, assets.rs, sourcegate.rs at all three sites, and
citations.rs.

Removed, as the review asked: src/CLAUDE.md's "Documentation carries no
gates" (the orchestrator authorised the edit), the tlb.rs sentence that
said every masking spin held itself under the wait, bcachefs's
"interim ToyOS format" clause, and the arch issue's "enumerates every such
name" with the "only shrinks" clause beside it. The arch issue is now owed
by the ARM track, issues/kernel/toyos-runs-on-arm64.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
@Japabu

Japabu commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

Review of #537, round 2, at 5f527da against origin/main 16d2e64. Changes reviewed since 9f0665a.

Before review: CI on the PR is abi-split pass at 5f527da (run 36317954159). host is skipped on pull requests by design. The PR body gives cargo test --lib EXIT=0 (404 passed, 1 ignored) and tlb_shootdown_waits alone EXIT=0, and both logs exist.

Round-1 BLOCKERs

  • B1, gone root: OPEN. The toyos-cc patch now reds (EXIT=101), but the class it stood for does not. A deleted root is read only when a citation of it is "path-shaped" (citations.rs:112-114): the first character must be a lowercase letter, and the token must end in /…/ or a lowercase extension. So:
    • git rm -r --cached -q toyos-desktop leaves cargo test --lib citations:: green. userland/CLAUDE.md:3 and issues/design-debt/what-is-owed-on-file-size.md:17 cite the bare toyos-desktop/. The root's only other citation is a path:line:col, which the scan skips.
    • git rm -r --cached -q .claude leaves it green too, although CLAUDE.md:16, :90 and :100 cite .claude/agents/reviewer.md: a first component that starts with . is not lowercase.
    • toyos-fat32-check, toyos-proclife and toyos-symbols are in the same state: every citation of each is the bare name/.
      Both patches must go EXIT=101 naming those lines.
  • B2, re-exports: OPEN. The round-1 patch now reds. A one-token variant does not: arch_reach (sourcegate.rs:1750-1754) matches a re-exported name only when it is spelled in the path, and a glob never spells it. Patch for kernel/src/arch/x86_64/rtc.rs: use crate::arch::paging::*; const _: Option<Prot> = None;. the_arch_layer_names_nothing_above_it stays green, and it must red naming rtc.rs and crate::mm.
  • B3, ack wait: CLOSED. wait_for reads ACK_TIMEOUT.nanos() at tlb.rs:145 and :149, and that is the value asserted at :66. The PR body gives these measurements: the 1 s patch is EXIT=101 at tlb.rs:66, and tlb_shootdown_waits alone at 5f527da is EXIT=0 (qemu-tlb.log line 106 PASS, line 117 ok).
  • B4, one ls-files: CLOSED for the five named sites. A sixth is missed; see NOTE.
  • B5, one scanner: CLOSED. spelled_paths is the only scanner. A group's self as k is refused for the crate root; every_spelling_of_a_crate_root_item_is_read asserts it at sourcegate.rs:1945.

BLOCKER

  • src/citations.rs:107-115 — B1 is still open (patches above). Either read the bare name/ form and a first component that starts with . when the root is gone, or read every citation of a gone root whatever its shape. The prose that writes nonexistent directories as fs/ would then be rewritten. The header's claim at :17 "a root this tree no longer holds is still read" is false until one of these lands.
  • src/citations.rs:59-62 — no gate keeps FOREIGN honest, and one entry is already dead at the head that adds it. Patch: delete "smoltcp-0.12.0", from :61. citations:: stays EXIT=0, because the name's only use (issues/isolation/netd-socket-ids-are-ambient.md:24) is a path:line:col the scan already skips. Add a red for a FOREIGN name that no token needs, as this branch does for a stale ARCH_REACHES_UP row. Every future fork citation grows this list, so it rots unless something reds.
  • src/sourcegate.rs:1765-1790 — B2 is still open. Beside the glob patch above, two more spellings evade the same test:
    • A second hop written relative to its module: pub use paging::Prot as ArchProt; in x86_64/mod.rs, plus const _: Option<crate::arch::ArchProt> = None; in rtc.rs. arch_reexports reads only crate-rooted statements, so the second hop is never recorded.
    • A type alias: pub type Hop = crate::invalidation::Origin; in x86_64/tlb.rs, plus const _: Option<crate::arch::tlb::Hop> = None; in rtc.rs. This file's own renames_command counts a type alias as a rename.
      All three patches must red the_arch_layer_names_nothing_above_it naming rtc.rs. Refuse each by name, or delete the five upward re-exports, which leaves nothing to resolve.

NOTE

  • src/sdkversion.rs:345 — tracked_lockfiles is a sixth hand-rolled git ls-files -z. Move it onto sysroot::tracked_files with the pathspec *Cargo.lock.
  • src/sysroot.rs:610 — tracked_files decodes with from_utf8_lossy. At 9f0665a, sourcegate.rs's two listings and citations.rs failed loudly on a name that is not UTF-8. Now the name is rewritten, and every_committed_binary_file_is_declared then continues past a file it cannot open. Refuse such a name by name.
  • src/licence.rs:1251,1269 — judge returns Result, but a failing git ls-files now panics instead of returning Err. The function mixes two ways of failing.
  • kernel/src/arch/x86_64/tlb.rs:63-66 — the alias plus an assertion that the alias is at least what it aliases is the larger of round 1's two fixes. Delete both and name crate::time::DEAF_CPU at :145 and :149. That is 3 lines fewer, and the value can no longer diverge at all.
  • cargo run -- --clippy was not run at 5f527da, and this round changes src/ and kernel/. Post it before the merge queue's host job finds it.
  • Net lines (git diff --shortstat origin/main...HEAD): 131 files, +1208 −546.
    • Production kernel: +21 −13, net +8 (+6 at round 1). The NOTE above removes 3.
    • Production build system (assets, licence, sysroot): +11 −34, net −23.
    • description lines in Cargo.toml: +47.
    • Test-only gate code (citations.rs, sourcegate.rs, hostws.rs, the lib.rs declaration): +843 −145, net +698.
    • Prose: issues/ +279 −316, CLAUDE.md files +7 −38.

REMOVE

  • kernel/src/arch/x86_64/tlb.rs:65 — "A spin with interrupts masked is held under DEAF_CPU at its own site" — the round-1 REMOVE, reworded and back. One site (xhci/mod.rs:326) holds itself there; vtd/queue.rs:45's spin does not.
  • kernel/src/time.rs:221-223 — "A spin that holds interrupts masked is bounded under it at its own site, and never the other way." — the same false universal.
  • PR body — "That was not true of a whole root until 5f527da." — false for the roots named under B1. This body becomes the merge commit.

SEND BACK

Japabu and others added 2 commits September 27, 2026 14:30
…oot read

The arch layer re-exported five names from above it (`invalidation::Origin`
in both tlb.rs files, `mm::policy`'s four in both paging.rs files), and the
gate resolved paths through them by name, which a glob, a relative second hop
and a type alias each walked past. They are deleted instead: every caller names
`crate::invalidation::Origin` and `crate::mm::policy::*` at home, and arch
imports them privately. With nothing handed up there is nothing to resolve, so
`arch_reexports` and the resolution in `arch_reach` go. What the gate refuses
outright in its place: a `pub use` under arch/ that reaches above the layer,
any `pub type` there (an alias is the one re-export rustc lets carry a
privately imported name out, so x86_64's `Root` becomes `pub use Cr3 as
Root`), and a glob of `crate::arch`.

The citation gate reads a gone root in every shape: a bare `name/` and a first
component that starts with `.`. The prose that wrote directories that exist
nowhere as paths (`fs/`, `completion/`, `gates/`, `lib/`, `stamps/`, `forks/`,
`compiler/`) is rewritten. `FOREIGN` reds on an entry no citation needs;
`smoltcp-0.12.0` was one and is gone, and `.git`, `.build-locks` and
`compiler`, which src/CLAUDE.md writes, join it.

`sysroot::tracked_files` returns `Result` and refuses a name that is not UTF-8,
so `licence::judge` fails only by `Err`; `sdkversion`'s lockfile listing uses
it. tlb.rs names `time::DEAF_CPU` itself, its alias and assertion deleted, and
the two false sentences about masked spins are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
…ruling, #537 has too much zookeeping

Two gates go whole, by owner ruling on #537: `src/citations.rs` (the tracker/
`CLAUDE.md` path-citation check, its `FOREIGN` list and its two tests) and, in
`src/sourcegate.rs`, the eleventh scan — `ARCH_REACHES_UP`, `arch_reach`,
`arch_hands_up`, `arch_reach_complaints`, `module_depth`, `arch_aliases`,
`ARCH_TREE`, `KERNEL_ROOT` and their three tests. `issues/kernel/the-arch-layer-
names-the-kernel-above-it.md` goes with it: nothing else cites it, so its
exit condition dies with the gate rather than living on as an issue about a
gate that no longer exists.

`spelled_paths` loses the `depth: Option<usize>` parameter and the super-chain/
inline-module-scope machinery it carried only for `arch_reach`'s benefit — the
one remaining caller, `arch_module_lines`, always passed `None`. `Code::public`
goes too: nothing but the deleted `arch_hands_up` called it.

Kept, per the ruling: the pure arch-rules scan (`ARCH_RULES`, asm/`target_arch`/
arch-path confinement — `every_architecture_rule_holds` still passes), the
one-off tracker cleanup, the CLAUDE.md edits, the 47 crate descriptions and
`src/hostws.rs`'s gate, the kernel's five upward re-exports and `DEAF_CPU`, and
the `sysroot::tracked_files` consolidation.

cargo test --lib: 398 passed, 0 failed, 1 ignored, exit 0.
cargo test --workspace --exclude toyos-build: every crate green, exit 0.
cargo run -- --clippy: 10 invocations clean, exit 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iqcj4jDKpaiDX8B7CMvmK
@Japabu Japabu changed the title Hygiene: CLAUDE.md points at its sources, the tracker's citations resolve, and arch/ names nothing new above it Hygiene: delete the dead-citation and arch upward-import gates, keep the tracker cleanup Sep 27, 2026
Japabu and others added 2 commits September 27, 2026 22:24
Conflicts, each resolved by accounting for both sides' hunks:

- issues/boot-media/log-flush-retry-two-older-failure-modes-with-no-home.md
  (modify/delete): deleted, because this branch merged its body into
  issues/filesystem/log-flush-retry-deadman-arm.md. Main's one modification,
  "a redlist row carries it with a measured rate" becoming "it is disabled with
  a src/redlist.rs row and this file", is applied to the same sentence of the
  merged file's exit condition. No citation of the deleted name remains, by
  path or bare slug.
- issues/build/the-tooling-is-a-review-prompt-and-three-workflows.md: main's
  sentence (landing.yml's abi-split no longer listed), with this branch's
  deleted-path spelling a5b25a7^:src/mergehealth.rs.
- kernel/src/loader/mod.rs, kernel/src/loader/tls.rs, kernel/src/object/shm.rs:
  main's code (Segment::flags(), the TlsBlock publish path, align_2m_checked),
  with every Prot and CachePolicy named at home in crate::mm::policy, since
  this branch deleted arch::paging's re-export of them. map_block, whose
  one-line rename was this branch's hunk in tls.rs, is gone on main; its
  successor TlsBlock::publish takes the same rename.
- src/sdkversion.rs: main's rewrite. This branch's hunk changed
  tracked_lockfiles, which main deleted; main's new lockfile test lists
  lockfiles through sysroot::tracked_files like every other caller.

Outside the conflicts: tests/metal-profile.toml cited arch::tlb::ACK_TIMEOUT
twice, a constant this branch deleted for time::DEAF_CPU; both name
time::DEAF_CPU now. No row's ceiling_from starts with it, so
metalprofile's NAMED check is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spelled_paths, Code and Spelled generalised arch_module_lines over any root
with segments and aliases so the arch upward-import gate could resolve
`crate::` and `super::` paths; code_only's char-literal branch was there for
the same scan over kernel sources. With that gate deleted, the one caller is
arch_module_lines over `core` and `std`, which main's version already reads,
so src/sourcegate.rs is main's but for the sysroot::tracked_files calls.

toyos-net-wire joined the host workspace on main without a [package]
description, which hostws's description gate refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Japabu
Japabu enabled auto-merge September 27, 2026 21:05
@Japabu
Japabu added this pull request to the merge queue Sep 27, 2026
Japabu added a commit that referenced this pull request Sep 27, 2026
…oss under host contention

lan_mdns_answer: QEMU's chardev refused the tap sockets' path once a macOS
$TMPDIR plus this harness's own lane path had already spent every byte of
Darwin's 104-byte sockaddr_un.sun_path, leaving nothing for a filename
(orchestrator's Fast-tier run on PR #537's head 06b926b, a diff that touches
neither). tests/common/segment.rs now names its sockets under /tmp directly,
via the new toyos_build::socketpath, whose length never depends on $TMPDIR;
open() unlinks both once connected, since /tmp is not this run's lane.

i8042_mouse: a third sighting of the identical shape already tracked in
issues/build/parallel-tests-red-under-other-suites.md's own entry for this
test (872/876 packets, never more than the pacing's 12-of-16-byte bound
outstanding) — inside the bound the first fix installed, so not that
mechanism. Extended that entry with today's evidence and filed
issues/hardware/i8042-mouse-loses-a-packet-under-host-contention.md for the
redlist row, naming the plausible mechanism this tree's own qemu.rs already
documents for the keyboard path: QEMU's PS/2 queue silently drops what a
guest a starved host has not scheduled has not drained, which MOUSE_LEAD does
not guard against the way the keyboard's own pacing against the guest's echo
does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 27, 2026
@Japabu
Japabu added this pull request to the merge queue Sep 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 27, 2026
…ine description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Japabu
Japabu enabled auto-merge September 27, 2026 22:24
@Japabu
Japabu added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit 71c1f1e Sep 27, 2026
1 check passed
Japabu added a commit that referenced this pull request Sep 28, 2026
Conflicts, each resolved by accounting for both sides' hunks:

- toyos-cc/Cargo.toml (modify/delete): main gave it a description (#537);
  this branch deletes toyos-cc, so the deletion stands.
- CLAUDE.md: main replaced the repository-layout listing with a pointer to
  the workspace lists (#537); this branch had only removed the toyos-cc row
  from that listing, so main's pointer stands. This branch's removal of the
  toyos-cc bullet under Dependencies merged cleanly and stays.
- tests/CLAUDE.md: main replaced the host-suite enumeration with a pointer
  to the workspace and `src/ci.rs`; this branch had only removed toyos-cc
  from it, so main's line stands.
- tests/common/compile.rs: main removed the build slot from the libc
  archive's build (#561); this branch replaced that function with
  `c_sysroot`, which took the same slot, so this branch's rewrite stands
  without the `build_slot` call, which main deleted.
- issues/build/the-primary-rebuilds-its-compiler-on-compiler-alone.md:
  main prefixed the fork's paths with `rust/`; this branch dropped "or the
  LLVM submodule", since the LLVM commit is now part of the key. Both kept.
- issues/build/the-third-party-corpus-is-in-no-machine-read-ledger.md:
  this branch's counts (315 tracked, 312 under `tinycc/`, `pp_tcc/` gone)
  with main's `tinycc/tests/tests2` spelling of TinyCC's path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6rME2DoqwjcYFStYHHY4j
Japabu added a commit that referenced this pull request Sep 28, 2026
Brings in #537, #553 (every kernel panic halts, usbd and poison deleted,
the no-kernel-threads track), #559 and #561. The kernel now spawns one
thread outside the actuator build, klogd: this branch deleted iod and
main deleted usbd, and neither side's replacement is a kthread.

Conflicts, each resolved against both sides' hunks:

- kernel/src/drivers/nvme.rs, kernel/src/iod.rs (modify/delete): deleted.
  Main's changes to them were the `mm::policy::MmioPolicy` import rename
  and dropping `OnPanic::Recover` from iod's spawn, adaptations to code
  this branch removes; neither carries behaviour to move elsewhere.
- kernel/src/sched/kthread.rs: main's row table without panic policy.
  MAX_KERNEL_TASKS is 1 (klogd), and 2 + MAX_LOG_SHARDS in the actuator
  build (klogd, lognest, one logstorm per shard, which can run in one boot).
- kernel/src/main.rs: neither `usbd::start()` nor `iod::start()`; main's
  panic handler without recovery, this branch's storage phase.
- kernel/src/quiesce.rs: main's header, which names no kernel thread.
- kernel-loom/src/lib.rs: neither `poison` (main) nor `durability` (here).
- tests/toyos.rs: `heap_ceiling_bounds` (main's rename) without
  `cache_eviction` (deleted here); `blocked_dump` and `klogd_hosted` ask
  for klogd alone; `klogd_panic_halts` is main's, whose usbd arm and
  recover row are gone with usbd and poison.
- issues/build/a-lane-s-tap-socket-path-outgrows-sun-len-on-the-dev-host.md:
  main's body and `kind: tooling`, this branch's two-shapes measurement;
  `status: open`, since no disabled row names `lan_mdns_answer` on either
  side and `--known-red` answers NO, so the quarantine paragraph goes.

Beyond the conflicts: toyos-inventory gets the `description` main's
hostws gate now requires of every workspace package, and the
no-kernel-threads track loses K5, which this branch meets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6rME2DoqwjcYFStYHHY4j
@Japabu
Japabu deleted the wt/toyos-hygiene branch September 28, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant