Skip to content

M15: enforcing what the documents assert - #19

Merged
youhide merged 1 commit into
mainfrom
feat/m15-enforce
Aug 11, 2026
Merged

M15: enforcing what the documents assert#19
youhide merged 1 commit into
mainfrom
feat/m15-enforce

Conversation

@youhide

@youhide youhide commented Aug 11, 2026

Copy link
Copy Markdown
Owner

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 unsafe block
appearing in the supervisor or the unit parser.

oxinit now carries #![deny(unsafe_code)] with sys::raw as the single
#[allow], and every crate that should contain none carries
#![forbid(unsafe_code)], which nothing downstream can relax.

Checked rather than assumed — an unsafe block added to reap.rs:

error: usage of an `unsafe` block
error: could not compile `oxinit`

and the same in oxinit-unit.

The two test fixtures keep theirs. Reconstructing an inherited descriptor
is from_raw_fd, which is unsafe by construction, and they are
installed only in a test image.

The MSRV was a promise nothing kept

rust-version = "1.95" is a claim about people on older toolchains, and
CI ran whatever stable was that week — so a dependency bump raising the
real 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 audit on every push, blocking — 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 actually wrong

tests/ appears in the workspace layout in both CLAUDE.md and
ARCHITECTURE.md and has never existed. The integration tests are the
xtask suites; the directory that does exist and was not listed is
units/.

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/.
@youhide
youhide merged commit dd9dfd5 into main Aug 11, 2026
7 checks passed
@youhide
youhide deleted the feat/m15-enforce branch August 11, 2026 19:12
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