me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Verify that each release feed covers both runtime roots

diviocity committed 4 days ago · 314f90d3fd5181ca546641f273283f3c7fc45346 View patch
Unverified signature 2 files changed +87 -0
tests/FEED.md +9 -0

@@ -211,6 +211,15 @@ The full amd64 candidate inputs passed the release driver's input checker for Vi

211211

212212The matching arm64 inputs passed with a 69-package installed desktop and 152 signed offline packages. The prepared initramfs SHA-256 is `e0e73713401c4706ff3d316b545010993c7cd291c5d9b5ef03d67ae0a700185a`. See `foundation/ports-candidate-inputs-01/arm64`, receipt SHA-256 `2f407d9b90413f0648bb44a0a443a8a22bb9a1555cfd1652d93d40a37a7c12fd`.

213213

214+Run the closure check against the matching source plan and the already audited clients. It checks every seed version and archive digest against the verified source coverage and compares both installed version sets with the planned runtime dependencies.

215+

216+```sh

217+python3 tests/release-runtime-closure.py "$plan" "$coverage" "$repo/packages.tsv" \

218+ "$desktop_client" "$desktop_x11_client" "$report"

219+```

220+

221+Both cold installs match their respective 70-package or 69-package desktop closure and the 138-package desktop and X11 closure. Each signed offline feed carries the complete runtime closure and 14 extra packages. The six other verified outputs are `busybox-bootstrap`, `elfutils`, `encodings`, `pkgconf`, `spirv-tools` and `util-macros`. The five with Alpine counterparts had no file matches in the published image or sidecar inventory. The worker rejected a missing X11 metapackage, a changed seed digest and a desktop-only client supplied for the X11 root. See `foundation/release-runtime-closure-01`, receipt SHA-256 `b82a76b60a01c45712d34823d033ebba793d5cd7ddad96540a7cba9ce99e8c18`.

222+

214223The worker stores each prepared input directory in `inputs.sqfs`. It compared every file byte for byte with the original on a read-only mount and rechecked `inputs/SHA256SUMS` before freeing the raw copies. To replay without a mount, verify `compact-filesystem.sha256`, unpack the image with `unsquashfs -d "$output" inputs.sqfs`, and verify `SHA256SUMS` in the extracted directory. The compact storage receipt SHA-256 values are `66f093bc6d841c3d2593b02307fa7039551b249cedc1d5d314ae5c3486b624e0` for amd64 and `043fee4d6dea91c3c277dc62ee28cfe95c4c8ce5aa4431fe7a03587efef3bc61` for arm64.

215224

216225Both full release ISOs passed the streamed comparison against their respective prepared initramfs files, including the image identifiers. The candidate manifest lists SHA-256 `57f8d17a7bcbd675113b121e9f2234954b6c8c0cef7de226e702e22423882515` for `vinix-amd64.iso` and `c918af6fa4006eddd44ba6eaf69f66f79b4b7351c22c9c95f2b95cbf0df4d3f4` for `vinix-arm64.iso`. See `foundation/ports-candidate-embedded-inputs-01`, receipt SHA-256 `9dc3c348677731c6fea75093f39453b3961d4d08c008363a48458c925d34b75f`.

tests/release-runtime-closure.py new file +78 -0

@@ -0,0 +1,78 @@

1+"""Compare a signed release feed and its cold clients with the source plan."""

2+

3+import argparse

4+import csv

5+from importlib import import_module

6+from pathlib import Path

7+import sys

8+

9+

10+sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))

11+release_feed = import_module("release-feed")

12+package_fields = import_module("stage-image").package_fields

13+

14+

15+def index(rows, name_field):

16+ named = {}

17+ for row in rows:

18+ name = row[name_field]

19+ if name in named:

20+ raise ValueError(f"duplicate package record: {name}")

21+ named[name] = row

22+ return named

23+

24+

25+def check_client(path, expected):

26+ actual = index((package_fields(file.read_text()) for file in (path / "db/local").glob("*/desc")),

27+ "NAME")

28+ missing = sorted(expected.keys() - actual.keys())

29+ extra = sorted(actual.keys() - expected.keys())

30+ changed = sorted(name for name in expected.keys() & actual.keys()

31+ if expected[name]["version"] != actual[name]["VERSION"])

32+ if missing or extra or changed:

33+ raise ValueError(f"{path}: missing {missing}, extra {extra}, changed versions {changed}")

34+

35+

36+def check(args):

37+ packages = index(release_feed.records(args.coverage), "package")

38+ planned = index(release_feed.records(args.plan / "order.tsv"), "package")

39+ if packages.keys() != planned.keys() or not packages:

40+ raise ValueError("archive coverage does not match the source plan")

41+ for name, row in packages.items():

42+ if row["status"] != "verified" or row["version"] != planned[name]["version"]:

43+ raise ValueError(f"source plan has no verified archive for {name} {planned[name]['version']}")

44+

45+ desktop_root = "vinix-release-desktop"

46+ x11_root = "vinix-release-x11"

47+ desktop = release_feed.runtime_packages(args.plan, args.coverage, [desktop_root])

48+ graphics = release_feed.runtime_packages(args.plan, args.coverage, [desktop_root, x11_root])

49+ feed = index(release_feed.records(args.feed), "name")

50+ missing = sorted(graphics.keys() - feed.keys())

51+ if missing:

52+ raise ValueError(f"signed seed omits runtime packages: {missing}")

53+ for name, row in feed.items():

54+ source = packages.get(name)

55+ if not source or (row["version"], row["archive"], row["sha256"]) != (

56+ source["version"], Path(source["archive"]).name, source["archive_sha256"]):

57+ raise ValueError(f"signed seed archive differs from verified coverage: {name}")

58+ check_client(args.desktop, desktop)

59+ check_client(args.graphics, graphics)

60+

61+ with args.output.open("x", newline="") as stream:

62+ writer = csv.writer(stream, delimiter="\t", lineterminator="\n")

63+ writer.writerow(("package", "version", "desktop", "desktop_x11", "signed_seed", "archive_sha256"))

64+ for name, row in sorted(packages.items()):

65+ writer.writerow((name, row["version"], int(name in desktop), int(name in graphics),

66+ int(name in feed), row["archive_sha256"]))

67+ print(f"{len(packages)} verified outputs, {len(feed)} signed seed packages, "

68+ f"{len(desktop)} desktop packages, {len(graphics)} desktop and X11 packages")

69+

70+

71+if __name__ == "__main__":

72+ parser = argparse.ArgumentParser(description=__doc__)

73+ for arg in ("plan", "coverage", "feed", "desktop", "graphics", "output"):

74+ parser.add_argument(arg, type=Path)

75+ try:

76+ check(parser.parse_args())

77+ except (OSError, ValueError, KeyError) as error:

78+ parser.exit(1, f"{error}\n")