45. Triage the CodeQL code-scanning alerts, and decide what the tool is for
Built 2026-07-30. All nine alerts are fixed, and the policy is DECISIONS ยง35. The seven
actions/missing-workflow-permissions went first. Every CI job held a GITHUB_TOKEN with
permissions it never used. That is an odd default for a project whose thesis is that a component holds the
authority its job needs and nothing more.
The two rust/access-invalid-pointer alerts turned out to be two different findings wearing one label.
Nullness was structurally fixable and the type was failing to say so. Every pointer entering the
intrusive queues comes from a &mut Thread, so non-nullness is a fact of construction rather than a
caller's promise. Fifo, Endpoint and the Node trait moved to NonNull. Every conversion at
every call site is infallible (NonNull::from, never NonNull::new(..).unwrap()). Option<NonNull<T>>
is the same size as *mut T through the niche, so it costs nothing. Validity and aliasing remain
inexpressible, which is the design of an intrusive queue rather than a gap. That reasoning now
lives in the crate's own docs as the standing caveat.
Two things recorded because they were wrong or nearly so. I predicted twice that NonNull would improve
the code without satisfying CodeQL, reasoning that the rule was about validity generally. It
cleared both alerts, so the rule was more precise than I credited. And I first "proved" that with a query
against refs/heads/<branch>, which has zero analyses. It would have returned zero whatever the
code did. The real comparison is /language:rust: 2 results on refs/heads/main, 0 on
refs/pull/5/head, holding across four commits each side.
In brief. Nine alerts on first run. Seven (actions/missing-workflow-permissions) were fixed
immediately by giving every workflow an explicit least-privilege permissions: contents: read. That
is the right call for this repo specifically. A project whose thesis is that a component holds the
authority its job needs and nothing more has no business letting its CI token default to write
access it never uses. The two that remain are high severity and need judgment, not
configuration: rust/access-invalid-pointer in push_back and pop_front in
crates/intrusive_queue/src/lib.rs, the raw-pointer dereferences in the intrusive wait-queue. Both already
carry SAFETY comments citing the queue's caller contract, and intrusive is one of the 13
Kani-proved crates. So the question is precisely what CodeQL sees that Kani does not. Kani proves
the pure logic under chosen bounds, while the pointer validity here rests on a caller contract
enforced by convention rather than by the type system. Decide per alert whether it is a true
positive worth restructuring for, or a false positive to dismiss with a written reason. Then set the
standing policy for how alerts get triaged, since an alert list nobody dispositions decays into wallpaper
Why it matters. the alerts land exactly where this project's most-used unsafe abstraction lives, so the answer is worth having either way. Either the wait queue's contract can be made structural rather than documented, a real improvement to the code every blocked thread passes through. Or we write down why it cannot be and what upholds it instead. Also forces the meta-decision milestone 44 (GitHub repository hardening) left open, now that scanning is actually running. A scanner whose findings are never dispositioned is worse than none, because it manufactures the appearance of review
Follow-on
- Recorded. The caller's contract in
partsfoundry/intrusive_queue's README carries the standing caveat: pointer validity and aliasing in the intrusive queue remain inexpressible.NonNullmade nullness structural and cleared both alerts. What upholds the rest is the kernel's state machine rather than any type, which the crate says out loud rather than letting two green checkmarks imply safety.
Index row
the alerts land on this project's most-used unsafe abstraction