Skip to content

machines: hardware inventory record — schema, template, collector, first record (amd) (#1094) - #2

Merged
dezren39 merged 1 commit into
mainfrom
queue/3002-1094-inventory-record
Oct 29, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/3002-1094-inventory-record

Conversation

@dezren39

@dezren39 dezren39 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Implements developing-today/code#1094 — the hardware inventory record (schema + template) for the basement-cluster program.

What

New top-level machines/ tree (placement rationale in machines/README.md: devices/ and components/ are per-device research dossiers and the root VERIFICATION-*.md files verify individual devices — a whole-machine inventory record is a different shape and gets its own tree):

  • machines/inventory-record.schema.json — JSON Schema (2020-12) covering every field #1094 names: CPU, motherboard, RAM (slots/size/ECC + per-module detail), every drive (model, serial, capacity, SMART summary, firmware), NICs (model, speed, ports), GPU, BMC/KVM address, BIOS/BMC versions.
  • machines/inventory-record-template.md — the human template: field checklist with sources, the JSON skeleton, and the one hard rule (never invent a value; unreadable ⇒ null + an unknowns entry with the reason).
  • machines/collect-inventory.py — the collector: stdlib-only, run on the machine being inventoried; reads DMI sysfs, lscpu, /proc/meminfo, lsblk, ip link, lspci, and privileged sources via sudo -n only (never prompts). Writes <hostname>.json + <hostname>.md.
  • machines/amd.json / machines/amd.md — the filled example, produced by running the collector end-to-end on the laptop amd (Framework Laptop 13, Ryzen 7 7840U, Samsung 990 PRO 4TB — real read values).

Honest unknowns in the example

The unprivileged run could not read: DMI machine serial (sysfs permission), memory slots/ECC/module detail and drive firmware/SMART (dmidecode/smartctl need root, no passwordless sudo), Wi-Fi link speed (not in sysfs), BMC (the machine has none). Each is null with its reason in the record's unknowns array; re-running the collector under sudo fills the privileged ones in the same pass.

Verification

  • Collector run end-to-end on amd — produced both example files (first run caught and fixed an lscpu -J traversal bug; CPU section fully populated on the re-run).
  • Example validates against the committed schema:
    npx --yes ajv-cli validate --spec=draft2020 -s machines/inventory-record.schema.json -d machines/amd.json → machines/amd.json valid

Out of scope per #1094: records for the basement core machines themselves (#1096/#1099, physical/KVM access) — they will land in this tree.

Refs developing-today/code#1094 (queue task 3002).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…rst record (amd)

Implements developing-today/code#1094: a machines/ tree holding the
inventory record JSON Schema (2020-12), the field template, a stdlib-only
collector that fills a record end-to-end on the machine itself, and the
first filled record (laptop amd, Framework Laptop 13) produced by running
that collector. Unreadable fields are null with a named reason in the
record unknowns array — no invented values.

Validation: npx --yes ajv-cli validate --spec=draft2020   -s machines/inventory-record.schema.json -d machines/amd.json
-> machines/amd.json valid
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T15:52:31.701278Z 14111f7 PR opened
ℹ️ 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.

@dezren39
dezren39 merged commit 79917df into main Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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