M15: enforcing what the documents assert - #19
Merged
Merged
Conversation
The pass that produced M6, M11, M13 and M14 was reading a document and checking the code against it. This is the same pass applied to the invariants rather than the behaviours. "A reviewer should be able to audit all unsafe in the project by reading one file." ARCHITECTURE has said that since before there was code, and it was true by everyone's discipline — nothing stopped a second unsafe block appearing in the supervisor or the unit parser. The oxinit crate now denies unsafe_code with sys::raw as the single #[allow], and every crate that should contain none carries forbid, which nothing downstream can relax. Checked by adding an unsafe block to reap.rs and watching the build fail, and again in oxinit-unit. The two fixtures keep theirs: reconstructing an inherited descriptor is from_raw_fd, and they ship only in a test image. rust-version = "1.95" is a promise to people on older toolchains, and CI ran whatever stable was that week — a dependency bump raising the real floor would have been found by whoever it broke. A job builds on the declared minimum now; verified locally against 1.95 first. "The dependency tree of PID 1 is part of its attack surface" is in CLAUDE.md and every dependency's commit message justifies it, and nothing watched them afterwards. cargo audit runs on every push, and blocks: an advisory against something inside PID 1 is not a warning to look at later. Thirty-five crates in the lockfile, none affected today. One thing was actually wrong rather than merely unguarded: `tests/` appeared in the workspace layout in both CLAUDE.md and ARCHITECTURE.md and has never existed. The integration tests are the xtask suites, and the directory that does exist and was not listed is units/.
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.
The pass that produced M6, M11, M13 and M14 was reading a document and
checking the code against it. This is the same pass applied to the
invariants rather than the behaviours — the things the documents state
as properties of the project, which nothing was checking.
"A reviewer should be able to audit all unsafe by reading one file"
ARCHITECTURE has said that since before there was code. It was true — and
true by everyone's discipline. Nothing stopped a second
unsafeblockappearing in the supervisor or the unit parser.
oxinitnow carries#![deny(unsafe_code)]withsys::rawas the single#[allow], and every crate that should contain none carries#![forbid(unsafe_code)], which nothing downstream can relax.Checked rather than assumed — an
unsafeblock added toreap.rs:and the same in
oxinit-unit.The two test fixtures keep theirs. Reconstructing an inherited descriptor
is
from_raw_fd, which isunsafeby construction, and they areinstalled only in a test image.
The MSRV was a promise nothing kept
rust-version = "1.95"is a claim about people on older toolchains, andCI ran whatever
stablewas that week — so a dependency bump raising thereal floor would have been discovered by whoever it broke. Verified
locally against 1.95 before adding the job; it builds.
The dependency tree
CLAUDE.md: "The dependency tree of PID 1 is part of its attack surface."
Every dependency's commit message justifies it, and nothing watched them
afterwards.
cargo auditon every push, blocking — an advisory againstsomething inside PID 1 is not a warning to look at later.
Thirty-five crates in the lockfile, none affected today.
One thing actually wrong
tests/appears in the workspace layout in both CLAUDE.md andARCHITECTURE.md and has never existed. The integration tests are the
xtasksuites; the directory that does exist and was not listed isunits/.