Skip to content

issues: audit batch 3 against a8ea09d20 - #985

Merged
Japabu merged 2 commits into
mainfrom
wt/toyos-audit3
Oct 21, 2026
Merged

Japabu merged 2 commits into
mainfrom
wt/toyos-audit3

Conversation

@Japabu

@Japabu Japabu commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Stale claims in open kind: defect records misdirect planning and review.
This is the owner's one-off audit (decision A), batch 3 of 4: 115 records.
Every concrete claim was checked against origin/main at
db0cf636d16d265ac400ab5f32658ed81f5cd632. After rebasing onto
a8ea09d209c514fdcffcdbe58f3c1826e6aa40e9 (#978's descriptor table and
#981), every record whose cited code had changed was read again there. The owner's uncommitted
requirements/ and claude-questions.md in the primary checkout were read as
well. Nothing in them bears on these records.

Result

class count what was done
already deleted on main 7 nothing: 13ed7b4f4 (usbd) removed them
owner-held 1 untouched: tearing-is-what-gop-cannot-give-back has uncommitted owner edits
fixed 5 deleted, exit verified
superseded 4 deleted, residual folded where one exists
partly stale 34 corrected, residual kept; 3 renamed because the old slug was refuted
still-valid 58 unchanged
uncertain 6 unchanged

Fixed (deleted):

  • the-ack-delay-abi-doc-names-one-cpu: the doc now says what the kernel does.
  • the-running-slots-volume-is-claimable: since 13ed7b4f4 the kernel serves
    no partition claim. The remaining exposure is the owner's rejected
    the-block-service-does-not-refuse-the-running-root.
  • the-sysroots-core-and-alloc-carry-the-compiler-profiles-debug-assertions:
    5f732156a landed the exit and re-ran the proof.
  • thread-exits-completion-post-is-the-second-one: fa1e3254d removed the
    second post.
  • the-socket2-forks-ownedfd-holds-a-table-key-not-a-handle: fd: one descriptor table numbers every raw fd, and a child's descriptors are its fd:<n> endowments #978's
    descriptor table, with socket2 at 2aa6b00, which the lock now pins, makes
    a socket's number a descriptor in that table. std's OwnedFd closes it
    there.

Superseded (deleted):

Renamed:

  • the-panel-seeds-... became the-gcd-maps-held-mmio-descriptors-are-logged-nowhere.
  • the-kernel-depends-on-toyos-fat32-... became three-comments-say-the-kernel-uses-toyos-fat32.
  • two-std-maps-... became std-net-maps-every-other-syscall-error-to-other.

None of the three had an inbound reference.

Uncertain, left unchanged:

  • the-bootstraps-own-build-cannot-start-rust-objcopy-on-an-apple-host
  • the-console-loses-typed-keystrokes-under-host-load
  • the-t14s-superspeed-stick-enumerates-at-high-speed-under-toyos
  • the-wifi-demos-commits-still-resolve-on-origin
  • two-processes-started-at-an-entry-point-nothing-had-mapped
  • virt-claim-lpi-boot-stalled-in-firmware-once-under-load

Inbound references to deleted records were fixed in four files outside the
batch. The commit message gives every correction, and the classification table
with file and line evidence for each record is linked below.

Overlap with batches 1 and 2

The branch was rebased onto ff6b4fdff, after #982 and #986 landed. One file
overlapped. a-wake-to-a-busy-cpu-waits-for-its-next-pass-and-no-idle-cpu-can-take-it
was edited here only to replace its reference to the deleted watch-window
record. Batch 1 deleted it in favour of
no-row-holds-a-wake-beside-seven-spinners-to-100-us, and nothing in that
record cites watch-window. So the deletion stands and this branch's edit is
dropped, and the note that the restored hold would spin out with its poster
queued behind it now survives only in this branch's commit message.
blocking-read-window-reds-beside-other-guests still records that
git revert dc62efca4 restores the hold. No other record either batch touched
is touched here. A tree-wide search after the rebase finds no reference to a
slug that any of the three batches deleted or renamed. The only dangling
issues/ citation is the one already on main, noted below.

Checks

  • Classification table: one row per record, with its class
    and its file, line or commit evidence.
  • cargo run -- --ci host at df829822f, exit 1. That commit is the
    pre-rebase branch: it predates the socket2 record's deletion, the
    std-net-maps-... and broadcast-pin corrections made after the rebase, and
    review round 1's three record fixes. All of those are Markdown in issues/
    too (log). Every step through "the licences of what
    ships" passed: the build system, the harness's own checks, the workspace's
    host members, toyos-crypto, the kernel's library and the licences. Clippy
    stopped with No space left on device when the shared host's disk filled,
    so it established nothing. For a Markdown-only change, CI's documentation
    scope runs the build system's tests and the licences, and both passed.
  • cargo test --lib (the build system's tests) at 92c77f575, rebased onto
    ff6b4fdff: exit 0, 366 passed
    (log).
  • Before deleting each record, a tree-wide git grep for its slug found
    every inbound reference, and those were fixed. Every issues/*.md path cited
    under issues/ resolves except one already on main:
    a-device-function-is-driven-from-its-arrival-to-its-end cites
    a-cargo-run-boot-claims-every-pcidev-slot, which does not exist. That file
    has uncommitted owner edits, so it was not touched.
  • No guest, metal or code change.

Risks

  • Classification is a reading of code at one revision. Still-valid records
    were spot-checked against their central claims, not every sentence.
  • The touchpad track's keyboard bullet, which described the deleted kernel
    driver, is corrected in this PR alongside its reference fix.

🤖 Generated with Claude Code

@Japabu

Japabu commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Review r1: #985 at d3bd464be (base a8ea09d20, which is current origin/main)

Assessment. This changes Markdown only: 50 files, +414/−882. The approach fits the audit's terms. Five records were deleted as fixed, four as superseded, three were renamed, 31 were corrected in place, and four inbound references outside the batch were updated. I checked every deletion and rename against origin/main, using the socket2 fork's 2aa6b00 checkout and the rust gitlink a56b4057. I read all 34 corrections and spot-checked twelve still-valid records and two of the six uncertain ones. The published classification table matches the scratch copy byte for byte. Four claims need fixing before this lands: three are false sentences the branch introduces and one is a false evidence statement in the PR description. Everything else I checked holds.

What I verified

  • Fixed deletions (5), all with their exit met:
    • the-ack-delay-abi-doc-names-one-cpu: the doc at sdk/abi/src/syscall.rs:799-806 states what tlb.rs's ARM_WINDOW_NANOS does.
    • the-running-slots-volume-is-claimable: Claimed (kernel/src/device.rs:48-53) has no partition arm and hold_source is gone. The record's own exit routed the residual to the block service's grants, which is the rejected the-block-service-does-not-refuse-the-running-root.
    • the-sysroots-core-and-alloc-…: build/sysroot.rs:1137 has debug-assertions-std = false, and 5f732156a's message records the no-panic proof being re-run.
    • thread-exits-completion-post-is-the-second-one: thread_exit (kernel/src/process.rs:1237-1263) posts once and publish_released is gone. This resolves the double post by the other route than the record's exit, and that is fine.
    • the-socket2-forks-ownedfd-holds-a-table-key-not-a-handle: at 2aa6b00, install puts each socket into the descriptor table as an fd::Object::opaque with a release callback (src/sys/toyos.rs:338-357). Every fd impl (:929-963) passes that descriptor, and std's OwnedFd drop calls toyos::fd::close (rust a56b4057 library/std/src/os/fd/owned.rs:242-243). The root Cargo.lock is the only pin (:3900).
  • Superseded deletions (4), each residual kept or moved:
    • The scancode record: ps2server's probe (system/ps2server/src/probe.rs:11-17) resets the keyboard with translation on and asks for no scancode set.
    • The memory-map record: folded into the-boot-map-reaches-4-gib-…, and the T14 margin reading is added to its exit.
    • The 3.8 ms claim: the window now falls under syscall-preemption-is-incidental's mask_windows exit.
    • watch-window: the restore commit was already recorded in blocking-read-window-reds-beside-other-guests.md:47-49.
  • Renames (3):
    • The old slugs have no references left anywhere in the tree. I also searched the owner's uncommitted requirements/ and issues/ in the primary checkout, reading only; the only hits are the four files this PR edits, in their main versions.
    • Each opened date is preserved.
    • The fat32 comments (lib/fat32/Cargo.toml:2, build/fatformat.rs:5, build/image.rs:578) and syscall_err's _ => Other (sdk/std/sys/net/connection.rs:59-64, called at :358,360,482,499) are as described.
  • Path check: I ran a script over every path cited in the 47 added or modified records against the head tree. It found three misses, none of them a defect. Two are guest paths, /system/bin/…, which the extraction cut short. userland/soundd/ is explicitly historical ("was … now system/soundserver/"). Separately, tests/testcases/ in a-shared-boot-…:66 does not exist; that line predates this PR. Every issues/*.md citation resolves except the one the PR already names.
  • Personal data and format: no identifiers in the added lines. Frontmatter and kinds follow issues/README.md. No owner-held file is touched.

Required

  1. issues/the-t14-mouse-may-be-another-defect.md:25-28,33-35: a false claim about usbd, and the exit depends on it.
    • The record says that "under usbd the first names the completion code, and the second leaves no completion". The exit then asks for "the completion code or silence that says which of the two cases".
    • At main, read_reports (system/usbd/xhci/src/hid.rs:158-162) names the code only when dev.restart fails. An error completion that restarts successfully produces no line. restart (system/usbd/xhci/src/usb.rs:927-937) speaks only when Recovery::begin refuses.
    • So an endpoint that errors and recovers forever is as silent as one that was never scheduled. The next T14 session could not tell the two cases apart, which is exactly what this record exists to do.
    • Fix: say what usbd actually reports, and make the exit name an observable that separates the cases. That means either a line or counter for recovered error completions, recorded as owed, or wording that admits usbd cannot separate them today.
  2. issues/the-t14-touchpad-is-i2c-hid-and-unbuilt.md:33: the branch writes a false count.
    • "Two T14 defects are open beside this one" is untrue: about 37 open records name the T14, and the-t14-mouse-may-be-another-defect and t14-desktop-froze-at-64s are in this very batch.
    • The old "Three" was already wrong, but this edit restates the count.
    • Fix: drop the number, for example "T14 defects open beside this one include".
  3. issues/the-compiler-workspace-resolves-the-published-toyos-abi.md:13-14: the pin cited is not the current one.
    • "the committed lock (the rust fork at 11e31a5277)" names an older commit. Main's gitlink is a56b4057. The lock line is unchanged between the two (Cargo.lock:5854-5857 at a56b4057), so the fact is true but cited at the wrong revision.
    • This is the stale-base kind of citation the brief asked about. Cite a56b4057, or just say "the pinned rust/Cargo.lock".
  4. PR description, Checks (orchestrator to correct): a false evidence statement.
    • It calls df829822f "the same change before the rebase". git range-diff shows it is not.
    • After the rebase the branch added the socket2 OwnedFd deletion, changed std-net-maps-…'s text, moved the SO_BROADCAST pin from 12abd8f to 2aa6b00, and rewrote the commit message.
    • For a Markdown-only change the conclusion still stands: cargo test --lib ran at d3bd464be, and the slug search covers the manifest issue = check in build/userlandhost.rs. But the sentence should say "an earlier version of this change".

Optional

  • toybox-is-one-row-for-every-applet.md:18-23: the union described omits the row's starts list (images/system.toml:240: shell, update, sshserver, swap, …). Every applet inherits that authority too, so it belongs in the account of the over-grant.
  • the-gcd-maps-held-mmio-descriptors-are-logged-nowhere.md:9-11: free_mmio prints every free MMIO range of at least GRANULE, including those "past the room the kernel is handed" (loader/src/gcd.rs:146-158), not only the ranges it hands over. "one line per free MMIO range of GRANULE or more" would be exact.
  • the-t14-touchpad-is-i2c-hid-and-unbuilt.md: the PR edits this file but leaves the sentence it found false ("reads the set and never writes it"). Fixing it now costs one line, but deferring it to its batch is defensible.
  • test-runner-holds-logread-…: the exit's "or" became "and", which turns a stale comment into part of the defect. That is reasonable given testcases.toml:45's "log gate"; I mention it only so the scope change is deliberate.

Notes for the orchestrator (not about the branch)

  • The handoff's unfiled discovery is wrong. toyos_elf::section::rela_sections does have a caller, loader/src/main.rs:296-297, which panics on the REL/RELR refusal. Do not file it.
  • The handoff reports that the implementer ran git submodule status once in its worktree, which CLAUDE.md forbids. It was read-only, and I saw no damage, but the shared fork's worktree configuration is for you to judge.

SEND BACK: required items 1–3 are one-line or one-paragraph edits to the records, and item 4 is a PR-description correction.

@Japabu
Japabu marked this pull request as ready for review October 21, 2026 19:32
@Japabu
Japabu enabled auto-merge October 21, 2026 19:33
@Japabu
Japabu added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2026
Japabu added a commit to ToyOSOrg/evidence that referenced this pull request Oct 21, 2026
…fdff

Exit 0, 366 passed. Machine paths are masked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Japabu and others added 2 commits October 21, 2026 22:11
Each open defect record of batch 3 was checked against origin/main at
db0cf63, and every record whose cited
code changed up to a8ea09d (#978's
descriptor table, #981) was read again there. Seven of the batch were already
deleted by 13ed7b4, and tearing-is-what-gop-cannot-give-back carries
uncommitted owner edits, so it is untouched.

Deleted as fixed, each exit met:
- the-ack-delay-abi-doc-names-one-cpu: debug_action::TLB_ACK_DELAY_ARM's
  doc names each other CPU in turn, the smallest wait answered and the
  two-second window, as kernel/src/arch/x86_64/tlb.rs does.
- the-running-slots-volume-is-claimable: 13ed7b4 deleted the kernel's
  USB storage path; the kernel serves no partition claim (Claimed holds a
  class, a PCI function, an ISA row or the ACPI row) and hold_source is
  gone. What remains, the block service not refusing the running ROOT, is
  issues/the-block-service-does-not-refuse-the-running-root.md, rejected.
- the-sysroots-core-and-alloc-carry-the-compiler-profiles-debug-assertions:
  5f73215 set debug-assertions-std = false on its own line in
  std_config and re-ran the link-time no-panic proof against the built
  sysroot.
- thread-exits-completion-post-is-the-second-one: fa1e325 deleted
  publish_released, so process::thread_exit's post is the only one.
- the-socket2-forks-ownedfd-holds-a-table-key-not-a-handle: #978 gave
  the process one descriptor table, and socket2 at 2aa6b00, which the
  lock now pins, installs each socket as a descriptor in it and releases
  the socket when the last descriptor goes; std's OwnedFd closes through
  toyos::fd::close. The number OwnedFd holds is the socket's descriptor.

Deleted as superseded:
- t14-keyboard-will-not-report-its-scancode-set: ps2server (#899)
  replaced the kernel driver; its probe resets the keyboard with
  translation on, asks no scancode set and has no firmware-bit fallback,
  and names undecoded runs. The T14 passed ps2server_arms at a42489c.
- the-memory-map-buffer-is-the-unreported-pointer: the framebuffer lies
  in the boot map's scanout regions now, and the margin is MAP_MARGIN, 64.
  The memory map's report and the T14 reading it needs are folded into
  the-boot-map-reaches-4-gib-and-firmware-decides-what-lands-in-it,
  whose exit already asked for the report.
- the-supervisors-claim-of-a-pci-function-the-t14-lacks-holds-preemption-
  off-for-3-8-ms: #926 removed the measured claim path, as the record
  itself said. The preemption-off windows it read are
  syscall-preemption-is-incidental's, whose 131 us mask_windows bound on
  the T14 covers the inventory read that replaced the claim.
- watch-window-spins-out-a-hold-its-poster-is-queued-behind: dc62efc
  deleted the hold with its actuator. The record's one inbound reference
  was in a-wake-to-a-busy-cpu-waits-for-its-next-pass-and-no-idle-cpu-can-
  take-it, which audit batch 1 (#982) deleted, so no reference remains.
  blocking-read-window-reds-beside-other-guests keeps the pointer that
  git revert dc62efc restores the hold. The hold's own defect, a 50 ms
  spin with the task that would post queued behind it on the same CPU,
  is recorded only here.

Renamed, the old slug refuted, no inbound reference:
- the-panel-seeds-the-loaders-own-file-so-the-gcd-map-is-logged-nowhere
  -> the-gcd-maps-held-mmio-descriptors-are-logged-nowhere: the console
  seeds from logkeeper's stream, not /log's files.
- the-kernel-depends-on-toyos-fat32-and-uses-none-of-it
  -> three-comments-say-the-kernel-uses-toyos-fat32: 13ed7b4 removed
  the dependency; three comments remain.
- two-std-maps-still-answer-other-for-a-dead-peer
  -> std-net-maps-every-other-syscall-error-to-other: TcpStream moved to
  toyos::net::stream; one map remains, on UdpSocket and the listener.

Corrected and kept, each residual defect stated: suite-rows (a guest
binary deleted), t14-desktop-froze-at-64s (the drop line's wording),
t14-lost-every-integrated-input (ps2server's counters and decoder test),
the-t14-mouse-may-be-another-defect (usbd's HID path, no T14 reading),
t14-rows (Bench::blocks), test-runner-holds-logread (metalcase alone),
the EC record (mediated access, WR_EC for AML), the compiler workspace's
toyos-abi lock, the compositor's unknown message, the deadline header's
call sites, the pipe lock (user_ptr pins runs; names and lines), the
boot map's report_reach list, the VFS's function name, the black box's
foreign-record test, the power-off seal (kernel xHCI gone), the copy-out
test, the reset word, both shell records, the shared-object cache's
exit, the SSH key exchange
(toyos-crypto has ML-KEM-768 and its NIST answers), the roster readers,
toyos-dns, toybox's row (power is a connector), the click fold, the
I219 hang, the lendable region, x2APIC's declaration, the volatile
composite site and the file-size ledger. The SO_BROADCAST record's pin
is 2aa6b00, where the setter is still a no-op.

Inbound references fixed in the-t14-touchpad-is-i2c-hid-and-unbuilt,
a-shared-boot-stopped-answering-and-no-capture-says-why and
the-diary-computes-no-lateness-and-records-no-slow-system-call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the-t14-mouse-may-be-another-defect: usbd names a HID endpoint's
  completion code only when the endpoint will not restart, so a failure a
  restart clears is as silent as an endpoint that never completes; the
  text says so, and the exit asks for a boot that tells the two apart.
- the-t14-touchpad-is-i2c-hid-and-unbuilt: no count of the T14 defects
  beside it, and its keyboard bullet says what ps2server does: it asks
  for no scancode set and resets the keyboard with translation on.
- the-compiler-workspace-resolves-the-published-toyos-abi: the lock is
  cited at the current rust pin, a56b4057, which names the same four
  fork commits and toyos-abi 0.1.0 from crates.io.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Japabu
Japabu added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit eeffc8b Oct 21, 2026
4 checks passed
@Japabu
Japabu deleted the wt/toyos-audit3 branch October 21, 2026 20:16
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