Skip to content

Commit 3321ac3

Browse files
committed
docs(ssot),fix(sbom): retarget every PACKAGES.md citation at mios.toml
Follow-on cleanup to commit 4f3ca0c, which moved the runtime SSOT to mios.toml [packages.<section>].pkgs and PACKAGES.md to the docs tree. The user-facing surface (system prompts, agent tool descriptions, API example payloads, README, CONTRIBUTING) still pointed at the legacy SSOT path; this commit lands every remaining citation update. Touched files: - tools/lib/generate-sbom.py: parse mios.toml via tomllib instead of scraping fenced ```packages-<cat>``` blocks; emit "From mios.toml [packages.<cat>].pkgs" provenance lines. MiOS-SBOM.csv regenerated: 399 rows (was 388), all rows now cite the TOML SSOT. - usr/lib/mios/tools/{chat-completions-api,responses-api}/packages_md_query.json: description now points at mios.toml; section enum updated to reflect the actual sub-table names. Tool name retained for tool-call compat (rename would propagate through tools.json + dispatcher). - usr/share/mios/ai/v1/tools.json: matching index entry retargeted. - etc/mios/system-prompts/{mios-engineer,mios-reviewer,mios-troubleshoot}.md: the three operator personas now declare mios.toml as the package SSOT; the reviewer's hard-check rule renames "PACKAGES.md SSOT" -> "mios.toml SSOT". - usr/share/mios/ai/system.md: canonical agent prompt's table row pointing at PACKAGES.md retargeted. - usr/share/mios/api/{chat,chat.local,responses,embeddings}.example.json: citation strings in the canonical API payloads retargeted (the embeddings example also gets a tighter rewrite). - README.md, CONTRIBUTING.md, mios.toml comment block: prose pointers retargeted; CONTRIBUTING #3 now tells contributors to edit [packages.<section>] (or use the configurator HTML), not PACKAGES.md. - var/lib/mios/evals/mios-knowledge.local-runner.py: default citation hint no longer references PACKAGES.md. - automation/manifest.json + tools/manifest.json: regenerated via tools/generate-ai-manifest.py so the AI surface sees the updated source bodies. Why: the user's "deprecate -> consolidate -> remove" arc finishes only when every consumer of the SSOT name has been retargeted. KB/training .jsonl and reference docs still carry stale snapshots, but those regenerate on the next KB/build cycle.
1 parent 4f3ca0c commit 3321ac3

19 files changed

Lines changed: 1002 additions & 824 deletions

CONTRIBUTING.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
## Project rules
44

5-
- **Single source of truth: `usr/share/mios/ai/INDEX.md` + `usr/share/mios/PACKAGES.md`.**
6-
Every package belongs in `PACKAGES.md`, every architectural rule in
7-
`usr/share/mios/ai/INDEX.md`. Other docs cite, never duplicate.
5+
- **Single source of truth: `usr/share/mios/ai/INDEX.md` + `usr/share/mios/mios.toml`.**
6+
Every package belongs in `mios.toml [packages.<section>].pkgs`,
7+
every architectural rule in `usr/share/mios/ai/INDEX.md`. Other docs
8+
cite, never duplicate. Human-readable package documentation lives at
9+
`usr/share/doc/mios/reference/PACKAGES.md` -- it is documentation, not
10+
the runtime SSOT.
811
- **USR-OVER-ETC, NO-MKDIR-IN-VAR, BOUND-IMAGES, BOOTC-CONTAINER-LINT,
912
UNIFIED-AI-REDIRECTS, UNPRIVILEGED-QUADLETS** -- see `usr/share/mios/ai/INDEX.md` §3.
1013
Violating any of the six is a build/audit fail.
@@ -95,7 +98,11 @@ cleanup.
9598

9699
1. Branch from `main`.
97100
2. Local validation: `just build` (Containerfile lint runs as final RUN).
98-
3. If you added or changed packages, edit `usr/share/mios/PACKAGES.md`.
101+
3. If you added or changed packages, edit `usr/share/mios/mios.toml`
102+
under the matching `[packages.<section>]` table (the configurator
103+
HTML at `usr/share/mios/configurator/index.html` is the WYSIWYG
104+
editor for the same file). Update `usr/share/doc/mios/reference/PACKAGES.md`
105+
in the same PR if the prose rationale changes.
99106
4. If user-facing, bump `VERSION`.
100107
5. Open a PR against `main`.
101108

MiOS-SBOM.csv

Lines changed: 374 additions & 348 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,14 @@ etc.) and the numeric prefix encodes execution order. Add a new step? Drop
139139
a new `45-myfeature.sh` next to its peers.
140140

141141
If you want to know what makes a package show up in the image, check
142-
[`usr/share/mios/PACKAGES.md`](usr/share/mios/PACKAGES.md) -- it's the single
143-
source of truth, parsed at build time. Want to know what kernel arguments
144-
ship? They're in [`usr/lib/bootc/kargs.d/`](usr/lib/bootc/kargs.d/).
142+
[`usr/share/mios/mios.toml`](usr/share/mios/mios.toml) under
143+
`[packages.<section>].pkgs` -- that's the runtime source of truth,
144+
parsed by `automation/lib/packages.sh` and edited via the configurator
145+
HTML at `/usr/share/mios/configurator/`. Human-readable companion
146+
documentation lives at
147+
[`usr/share/doc/mios/reference/PACKAGES.md`](usr/share/doc/mios/reference/PACKAGES.md).
148+
Want to know what kernel arguments ship? They're in
149+
[`usr/lib/bootc/kargs.d/`](usr/lib/bootc/kargs.d/).
145150

146151
---
147152

automation/manifest.json

Lines changed: 330 additions & 246 deletions
Large diffs are not rendered by default.

etc/mios/system-prompts/mios-engineer.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ stacks (hadolint, shellcheck SC2038, TOML validation).
2828
1. The repo root **is** the system root. `usr/`, `etc/`, `home/`, `srv/`,
2929
`v1/` mirror the deployed image 1:1. **There is no `system_files/`
3030
directory.** Never reference one.
31-
2. The single source of truth for packages is `usr/share/mios/PACKAGES.md`.
32-
Categories live in fenced ` ```packages-<category>` blocks parsed by
33-
`automation/lib/packages.sh:get_packages`. Never invent package names.
31+
2. The single source of truth for packages is `usr/share/mios/mios.toml`
32+
under `[packages.<section>].pkgs`. The TOML chain is resolved by
33+
`automation/lib/packages.sh:get_packages`. The companion human-readable
34+
reference is `usr/share/doc/mios/reference/PACKAGES.md` (documentation
35+
only). Never invent package names.
3436
3. Build orchestration: Linux uses `Justfile` (`just build | iso | raw |
3537
qcow2 | vhdx | wsl2 | sbom | rechunk | lint | preflight`). Windows uses
3638
`mios-build-local.ps1` (5-phase). Numbered phase scripts live at
@@ -65,8 +67,8 @@ stacks (hadolint, shellcheck SC2038, TOML validation).
6567
- Markdown only where semantically correct (inline code, code fences, lists, tables).
6668
- Wrap file paths, commands, package names, unit names, and image refs in backticks.
6769
- Cite the exact MiOS file or upstream doc when stating a fact (e.g. "per
68-
`usr/share/mios/ai/INDEX.md` §3", "per `usr/share/mios/PACKAGES.md`",
69-
"per bootc kargs docs").
70+
`usr/share/mios/ai/INDEX.md` §3", "per `usr/share/mios/mios.toml`
71+
`[packages.<section>]`", "per bootc kargs docs").
7072
- If a question is ambiguous between MiOS and upstream behavior, answer
7173
for MiOS first, then note the upstream baseline.
7274
- **Refuse to fabricate.** If unsure, say so and propose the smallest

etc/mios/system-prompts/mios-reviewer.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ established conventions.
99

1010
## Hard checks (PR must fail any of these)
1111

12-
1. **PACKAGES.md SSOT** — any package installed by a phase script must
13-
appear in a fenced ` ```packages-<category>` block in
14-
`usr/share/mios/PACKAGES.md`. CI cross-references this.
12+
1. **mios.toml SSOT** — any package installed by a phase script must
13+
appear in `[packages.<section>].pkgs` in `usr/share/mios/mios.toml`,
14+
resolved by `automation/lib/packages.sh:get_packages`. CI
15+
cross-references this. The companion `usr/share/doc/mios/reference/PACKAGES.md`
16+
is documentation only; the legacy fenced-block fallback was removed
17+
in v0.2.4.
1518
2. **Containerfile invariants** — final RUN remains `bootc container lint`;
1619
no `--squash-all`; kernel rule (`kernel`/`kernel-core` excluded) intact;
1720
`dnf install_weak_deps=False` (underscore form).

etc/mios/system-prompts/mios-troubleshoot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ When given a symptom, walk this checklist before proposing a fix:
2525
3. **Find the source-of-truth file** in the repo overlay (`usr/`, `etc/`,
2626
`home/`, `srv/`, `v1/`). Cite it in the response.
2727
4. **Propose a fix** that:
28-
- prefers image-layer changes (PACKAGES.md, kargs.d, `system_files/`-style overlay paths)
28+
- prefers image-layer changes (`mios.toml [packages.<section>]`, kargs.d, `system_files/`-style overlay paths)
2929
- over runtime mutations
3030
- reverts cleanly via `bootc rollback` if it's image-layer
3131
- or via override files in `/etc/` if it's admin-layer

tools/lib/generate-sbom.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/env python3
2-
# tools/lib/generate-sbom.py -- emit MiOS-SBOM.csv from PACKAGES.md +
3-
# Quadlet Image= refs + base image refs + .env.mios Flatpak defaults.
2+
# tools/lib/generate-sbom.py -- emit MiOS-SBOM.csv from mios.toml
3+
# [packages.<section>].pkgs + Quadlet Image= refs + base image refs +
4+
# .env.mios Flatpak defaults. As of v0.2.4 (2026-05-05) PACKAGES.md is
5+
# documentation only; mios.toml is the runtime SSOT.
46

57
import re
68
import csv
79
import sys
10+
import tomllib
811
from pathlib import Path
912

1013
ROOT = Path(__file__).resolve().parents[2]
@@ -109,26 +112,28 @@
109112
def main(out_path: Path):
110113
rows = []
111114

112-
# 1. PACKAGES.md
113-
pmd = (ROOT / "usr/share/mios/PACKAGES.md").read_text(encoding="utf-8")
114-
section_re = re.compile(r"^```packages-([a-z0-9-]+)\s*\n(.*?)^```\s*$", re.MULTILINE | re.DOTALL)
115-
for m in section_re.finditer(pmd):
116-
cat = m.group(1)
117-
body = m.group(2)
115+
# 1. mios.toml [packages.<section>].pkgs (runtime SSOT)
116+
toml_path = ROOT / "usr/share/mios/mios.toml"
117+
with toml_path.open("rb") as fh:
118+
toml = tomllib.load(fh)
119+
pkg_tables = toml.get("packages", {}) or {}
120+
for cat, table in sorted(pkg_tables.items()):
121+
if not isinstance(table, dict):
122+
continue
123+
pkgs = table.get("pkgs", []) or []
124+
if not pkgs:
125+
continue
118126
classification, purpose = CAT_META.get(cat, (f"rpm-{cat}", "(uncategorized)"))
119-
for ln in body.splitlines():
120-
ln = ln.strip()
121-
if not ln or ln.startswith("#"):
122-
continue
123-
ln = ln.split("#", 1)[0].strip()
124-
if not ln:
127+
for pkg in pkgs:
128+
pkg = (pkg or "").strip()
129+
if not pkg:
125130
continue
126131
rows.append({
127132
"section": f"packages-{cat}",
128-
"package": ln,
133+
"package": pkg,
129134
"classification": classification,
130135
"purpose": purpose,
131-
"notes": f"From usr/share/mios/PACKAGES.md packages-{cat} block",
136+
"notes": f"From usr/share/mios/mios.toml [packages.{cat}].pkgs",
132137
})
133138

134139
# 2. From-source

tools/manifest.json

Lines changed: 207 additions & 175 deletions
Large diffs are not rendered by default.

usr/lib/mios/tools/chat-completions-api/packages_md_query.json

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "function",
33
"function": {
44
"name": "packages_md_query",
5-
"description": "Query the MiOS PACKAGES.md SSOT (at usr/share/mios/PACKAGES.md). Returns whether a package is included, the fenced-block category that installs it, and the install helper that consumes the block. Categories live in fenced ```packages-<category>``` blocks parsed by automation/lib/packages.sh:get_packages.",
5+
"description": "Query the MiOS package SSOT (mios.toml [packages.<section>].pkgs at usr/share/mios/mios.toml). Returns whether a package is included, the section table that installs it, and the install helper that consumes the table. As of v0.2.4 the legacy PACKAGES.md fenced-block fallback is removed; mios.toml is the only runtime source. The companion human-readable doc is usr/share/doc/mios/reference/PACKAGES.md.",
66
"strict": true,
77
"parameters": {
88
"type": "object",
@@ -19,19 +19,28 @@
1919
],
2020
"enum": [
2121
"base",
22+
"ai",
23+
"boot",
24+
"ceph",
25+
"cockpit",
26+
"containers",
2227
"critical",
23-
"self-build",
24-
"desktop",
25-
"nvidia",
28+
"gnome",
29+
"gpu-nvidia",
30+
"gpu-mesa",
2631
"k3s",
27-
"ceph",
28-
"ai",
29-
"gpu",
32+
"kernel",
33+
"security",
34+
"self-build",
35+
"storage",
36+
"uki",
37+
"updater",
38+
"utils",
3039
"virt",
3140
"all",
3241
null
3342
],
34-
"description": "Optional category filter. 'all' searches every fenced block. Null defaults to 'all'."
43+
"description": "Optional [packages.<section>] filter. 'all' searches every section table. Null defaults to 'all'."
3544
}
3645
},
3746
"required": [

0 commit comments

Comments
 (0)