notes

Hardening the repository itself

Milestone 44 splits cleanly in two. The files are in the tree (SECURITY.md, deny.toml, script/supply-chain, script/vendor-verify, the CI job); the rest is repository settings, which live in GitHub's web UI and cannot be committed. This note is the exact procedure for those, written to be followed rather than interpreted. The reasoning behind each is DECISIONS §36.

Everything below needs admin on nifeos/nife.

1. Private vulnerability reporting

What it does. Adds a "Report a vulnerability" button to the repository's Security tab, which opens a draft advisory visible only to the reporter and the maintainers, with a private fork for the fix. Without it, the only way to report a bug in a project whose whole subject is confinement is a public issue, which is the opposite of what you want.

Free on public repositories. SECURITY.md already tells reporters to use it, so this is the one item where the committed file is currently ahead of the setting.

Steps. Settings → Advanced Security (older UI: "Code security and analysis") → find Private vulnerability reporting → Enable.

Or, in one command:

gh api -X PUT repos/nifeos/nife/private-vulnerability-reporting

Verify: open https://github.com/nifeos/nife/security/advisories and confirm the "Report a vulnerability" button is present.

2. The ruleset on main

This is the item with real consequences, and the argument for it is in §36. The short version: on 2026-07-30 gh pr merge --auto was used and silently did nothing, because GitHub only queues auto-merge when something is actually blocking the merge, and with no required checks nothing was. The merge landed unchecked and looked exactly like one that had waited. "Merge when green" is currently a habit, not a property of the repository.

Apply this only after the milestone-44 branch has merged, because one of the required checks below does not exist yet, and a required check that never reports blocks every merge forever. That is the single most likely way to get this wrong.

Steps. Settings → Rules → Rulesets → New ruleset → New branch ruleset.

Field Value
Ruleset name main
Enforcement status Active
Bypass list empty
Target branches Include default branch

Leave the bypass list empty, deliberately. This is the difference between a ruleset and classic branch protection: with classic protection, admins bypassed by default unless you ticked "do not allow bypassing", and it was easy to leave the exemption in place. A ruleset exempts nobody unless you add them. On a solo repository an exemption for the one person who pushes is an exemption for every push, and the gate exists because --auto fails open and invisibly, not because the maintainer is untrustworthy.

Rules to enable

Do NOT enable

The required checks, by exact name

These are the job names GitHub sees, taken from a real run rather than from the workflow file:

build + test (host + QEMU)
rustfmt
clippy
verify (Kani proofs)
bench (icount regression tripwire)
coverage (host crates)
supply chain (advisories, licenses, vendored integrity)

All seven come from .github/workflows/ci.yml, which means the names are in the repository and a rename is a diff someone reviews. That is the property that makes them safe to require.

CodeQL is deliberately not on the list, and the reason is operational rather than a judgment about scanning. Default setup produces four checks (CodeQL, plus Analyze (rust), Analyze (c-cpp), Analyze (actions)) whose names are chosen by GitHub, change when GitHub adds or drops a detected language, and are not visible in any file here. A required check that stops reporting blocks every merge until an admin edits the ruleset, and CodeQL's Rust support is still in preview. Its findings are still dispositioned; that is DECISIONS §35's policy, and it does not need a merge gate to work. Add CodeQL to the required list later if it proves stable, and expect to revisit it whenever the detected-language set changes.

Verify: open a throwaway PR with a trivial change. It should show seven required checks, a merge button disabled until they pass, and gh pr merge --auto should now actually queue rather than merging immediately. That last one is the whole point, so it is worth confirming rather than assuming.

One thing to fix first, or at least to know about

build + test (host + QEMU) is currently flaky on the CI runner, and requiring it will surface that as blocked merges. Commit 91564e9 on main failed twice on 2026-07-30 in two different places, both timing-shaped and both green on a developer machine:

A four-vCPU shared runner emulating a four-core guest under TCG is a much slower and much noisier machine than the laptop these deadlines were calibrated on. This is a real bug in the tests' timing assumptions rather than an argument against the ruleset: a gate you have to re-run is annoying, and a gate that was never there is how main stayed red for two days. Fix it, then require the check.

3. Code scanning: advanced setup

Code scanning runs on advanced setup, by calef's order of 2026-10-08, for actions, c-cpp, python and rust, with vendor/** excluded; notes/code-scanning.md holds the decided record, the toggle and every alert's disposition. §36 (the repository is part of the TCB) records the reasoning. The number to read next to every Rust "0 alerts": on 2026-07-30 the Rust extractor reported 176 of 176 files scanned, 60 of them extracted with errors. It ran against the host target with default features, for a kernel that does not build for the host at all.

To re-check the coverage number after a future run:

gh run list --repo nifeos/nife --workflow CodeQL --limit 1 --json databaseId --jq '.[0].databaseId' \
  | xargs -I{} gh run view {} --repo nifeos/nife --log \
  | grep -E "scanned .* out of|extracted with"

4. What is deliberately still missing

Owed: strip 720 build artifacts from history (2026-08-02)

Not done, and queued deliberately behind the in-flight branches. Recorded here because it has already been noted once in a commit message and lost.

On 2026-08-02 a git add -A during the milestone 63 merge (1952f8df) committed 23,222 build artifacts across three nested workspaces: fs-server/target/ (14,405), tools/redoxfs-host/target/ (8,814) and user-std/target/ (680). The first count recorded here said 680, because that was the directory the first symptom pointed at and nobody counted the rest until the hardened checker named a second one. The tree is 470 files. The artifacts were 98% of the repository. They are untracked now and .gitignore is fixed (/target was anchored, so three nested workspace target/ directories were never ignored; it is target/ now, matching at any depth). They remain in history.

.git on disk 518 MB
packed 486 MiB
artifact objects in history many thousands; the tracked set alone was 23,222 files
largest single object a 59 MB libcore rlib; four are 58 to 59 MB

Every clone pays that, including every CI job, which is why a run reported "Updating files: 76% (18522/24370)".

The plan, and the wrinkle

git filter-repo over the user-std/target/ paths, then force-push. For a solo repository with no other clones this is about as safe as history rewriting gets.

The wrinkle is self-inflicted: the main ruleset applied the same day blocks force pushes (non_fast_forward, empty bypass list). So the sequence is: wait until nothing is in flight, remove that one rule, rewrite, force-push, put the rule back, and verify it is back by attempting a force push and being refused. A protection disabled for a moment is a protection that stays disabled when the moment is interrupted.

Anything unmerged at that time has to be re-cut afterwards, which is the reason for waiting rather than a reason not to do it.