Skip to content

spec: hardware preflight, so a route refuses a machine it would brick - #46

Merged
TusanHomichi merged 6 commits into
mainfrom
claude/project-thread-7dilna
Oct 13, 2026
Merged

TusanHomichi merged 6 commits into
mainfrom
claude/project-thread-7dilna

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

Requested by Peter · project thread

What this adds

Spec change, not a route. Before: a route that passed on CI boxes would start walking any machine. A Core 2 box would get to hop 3 of CentOS 5 → Alma 10, boot EL9, and die on Fatal glibc error: CPU does not support x86-64-v2. A box whose disk sits on a controller the new kernel dropped would come up with no root.

After: wend preflight ROUTE checks the machine against every release the route boots it into. It names the furthest release the machine can land on, exits 1 if that isn't the end, and touches nothing. On a VM it says how to raise the CPU model. wend facts gathers the same data on one machine so it can be judged somewhere else (--facts FILE).

How it works:

  • SPEC "Hardware preflight" (new section) and a required [hardware] adapter table. boot lists the firmware modes that have been proven. It is ["bios"] everywhere, because the VM tier only boots guests by BIOS. Each release a route boots into gets cpu, ram_mib (optional), disk_mib and drivers.
  • Driver tables live in adapters/drivers/<family>/<release>.txt, 19 of them, each pinned by sha256 in its adapter. tools/hwdata.py builds each one from the release's own kernel package. The download is checked against the index, and the alias=pci: lines are read from every storage and network module's .modinfo. Vendor deprecation lists aren't used because they're wrong for rebuilds: AlmaLinux 9's kernel still drives the PERC 6 (SAS1078) and the SAS2008 HBAs that RHEL dropped in 8. The tables also found that RHEL 7 dropped sym53c8xx, the QEMU LSI disk the VM tier gives etch.
  • CPU features come from CPUID, not /proc/cpuinfo, because 2.6.18 doesn't name avx2. The check takes the XSAVE bit, not OSXSAVE, because the new kernel turns XSAVE on.
  • Checker rules are in tools/check.py and client/src/check.rs. client/parity.py has 15 new adapter cases and reports both checkers identical. tools/test_check.py has 4 new refusals.

Numbers and sources:

  • CPU levels: EL9 is x86-64-v2 and EL10 is v3, per the RHEL 9/10 release notes. AlmaLinux 10's separate x86_64_v2 build is mentioned in hardware.alma10.note. No route uses that build yet, so a v2 machine lands on alma9.
  • RAM: EL figures come from Red Hat's limits article. Debian figures come from the installation guide's "no desktop" minimum. Ubuntu has a figure only for 24.04 and later (1 GiB cloud). 16.04 to 22.04 publish none, so their ram_mib is absent.
  • Disk: disk_mib is an estimate (2 GiB, or 4 GiB for alma9/10), and the adapter comments say so.
  • Not checked yet, listed in the spec: /boot size, out-of-tree drivers (ELRepo kmods, DKMS), and kernel flavour.

Model

anthropic:claude-opus-5-5. The code and spec were written by hand. The tables are generated by tools/hwdata.py.

Evidence

  • python3 -B wend check: 54 fixes, 3 routes, 6 boxes, 25 runs: ok
  • python3 -B tools/test_check.py: exit 0, with every new hardware case refused
  • cargo fmt --check, cargo clippy --all-targets -D warnings and cargo test: 21 passed. Six of those are new preflight tests against the real atlas: a 2008 PowerEdge 2950 lands on centos7, qemu64 gets the VM hint, the LSI disk stops EL at centos6 but walks Debian to trixie, and UEFI, i686 and low RAM are refused.
  • client/parity.py: 132 checker cases (57 refused) ... identical
  • No fix, route or box changed, so plan replays nothing. The schema job judges with base tools and adapters, as for any spec PR.

Self-review (AGENTS.md step 5)

  • It touches tools/, adapters/ and SPEC.md on purpose. This is a spec change, and the gate treats it as one.
  • Commits are signed off.

🤖 Generated with Claude Code

https://claude.ai/code/session_016DvvXoaaXH9jh74yrx4Nbb


Generated by Claude Code

…brick

Before the first hop, `wend preflight ROUTE` checks the machine can land on every release the route boots it
into: the CPU's x86-64 level (from CPUID), firmware, memory, free disk, and whether each release's kernel drives
the disk controllers and network cards in use. It names the furthest release the machine can land on, says how
to raise a VM's CPU model, and touches nothing.

Adapters get a required [hardware] table. Each booted release pins a driver table built by tools/hwdata.py from
the release's own kernel package (19 tables). The checker rules are in tools/check.py and the client, and
client/parity.py holds them to the same verdicts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016DvvXoaaXH9jh74yrx4Nbb
Signed-off-by: Peter Permenter <[email protected]>
@TusanHomichi TusanHomichi self-assigned this Oct 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T03:09:35.994180Z 912aaf9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc9db7186e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/main.rs Resolved
@github-actions github-actions Bot added the needs-claude-review Waiting on the Claude review layer label Oct 13, 2026
TusanHomichi and others added 2 commits October 13, 2026 02:48
…eneric IDE aliases don't count (review)

- Fibre Channel (0x0c04) and I2O (0x0e) controllers hold disks and InfiniBand (0x0c06) carries the network:
  a SAN-booted EL7 box with an Emulex card EL9 dropped now stops at centos7 instead of passing.
- A facts file must carry every field `wend facts` writes; a missing one is refused, never judged ok (Codex).
- ata_generic's, ide_pci_generic's and pata_acpi's class-wide IDE aliases count only for a device they drive now.
- MemTotal gets 10% slack: a 2 GiB VM shows ~1987 MiB.
- hwdata keeps built-in drivers by name (modules.builtin.modinfo has no device tables) and only lists
  built-in aliases of drivers under the storage and network directories.
- check.py: a non-table hardware or a non-list ladder is an error, not a traceback.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016DvvXoaaXH9jh74yrx4Nbb
Signed-off-by: Peter Permenter <[email protected]>
… by ID; facts name the module (review)

- Linux 6.12+ (resolute, alma10) records built-in drivers' device tables; matching ata_piix by name there let
  an ID the kernel dropped through. By-name now applies only when the table holds no pattern for that module.
- Facts record the device's module (driver/module) as well as its driver: lenny's ide_pci_generic registers as
  PCI_IDE, megaraid_mbox as megaraid.
- A hand-written uppercase class is lowercased before it's judged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016DvvXoaaXH9jh74yrx4Nbb
Signed-off-by: Peter Permenter <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d965a0fd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/hardware.rs Resolved
TusanHomichi and others added 2 commits October 13, 2026 03:01
…`wend facts` writes (Codex)

A class like 0xGGGGGG passed the shape check and was then skipped as an unrelated device; now it, and any
modalias not in the kernel's pci:v..d..sv..sd..bc..sc..i.. form, makes the facts file refused.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016DvvXoaaXH9jh74yrx4Nbb
Signed-off-by: Peter Permenter <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 912aaf96b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/src/hardware.rs Resolved
@TusanHomichi
TusanHomichi merged commit cf3f4e9 into main Oct 13, 2026
12 checks passed
@TusanHomichi
TusanHomichi deleted the claude/project-thread-7dilna branch October 13, 2026 03:26
TusanHomichi added a commit that referenced this pull request Oct 13, 2026
…rt and refuses it

trusty-web, trusty-db and trusty-web-updated passed trusty -> resolute on OVMF
without Secure Boot (tools/vm.py --uefi), rebooting onto UEFI at every hop with
network and checks kept. adapters/ubuntu.toml's [hardware].boot is now
["bios", "uefi"]; Debian and EL stay BIOS (etch and CentOS 5 can't install or
boot on x86-64 UEFI; the CentOS 7 route waits on #75).

Facts (schema wend.hardware/3) report boot as bios, uefi, or uefi-secureboot
when the firmware's SecureBoot variable says on or can't be read (efivarfs or
the older sysfs vars): a Secure Boot chain is its own claim, so no adapter
names it and preflight refuses it on every route. Both checkers accept the
three values. On UEFI, vm.py records each hop's boot chain (efibootmgr -v and
the hash of every .efi on the system partition).

Refs #13, #46

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Peter Permenter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-claude-review Waiting on the Claude review layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant