diff --git a/docs/os/HARDWARE_QUALIFICATION.md b/docs/os/HARDWARE_QUALIFICATION.md index 5b612e3d..23594f19 100644 --- a/docs/os/HARDWARE_QUALIFICATION.md +++ b/docs/os/HARDWARE_QUALIFICATION.md @@ -8,7 +8,7 @@ this GPU, motherboard firmware, audio, network radios or physical power loss. | Target | Current evidence | Gate | | --- | --- | --- | -| Disposable x64 UEFI/KVM VM, 2 CPUs, 4 GiB RAM, 32-GiB disk | Exact normal live/install/data/recovery/Linux proof, virtual DHCP/audio and manual PAM locking passed in 36823086807; separate ephemeral signed-update/interruption QA passed in the same source run | Future final artifact and actual signed release transition must be qualified separately | +| Disposable x64 UEFI/KVM VM, 2 CPUs, 4 GiB RAM, 32-GiB disk | Exact normal live/install/data/recovery/Linux proof, virtual DHCP/audio and manual PAM locking passed in integration run 36827706986; separate ephemeral signed-update/interruption QA passed in the same source run | Future final artifact and actual signed release transition must be qualified separately | | Supplied Skytech/Core Ultra 9/RTX 5070 machine | No boot or driver observations | Live boot, GPU/input/network/audio/firmware tests first | | Dedicated empty physical test disk | No selected disk or test | Exact installer identity/blankness/confirmation, no-media boot, persistence, update and recovery | diff --git a/docs/os/IMPLEMENTATION_STATUS.md b/docs/os/IMPLEMENTATION_STATUS.md index f337c726..3fc01582 100644 --- a/docs/os/IMPLEMENTATION_STATUS.md +++ b/docs/os/IMPLEMENTATION_STATUS.md @@ -18,7 +18,38 @@ proof that PhiOS is a completed OS. Preserve the repository AGENTS.md rules. | R9: Qualify hardware and one Linux governed workflow | UID-separated installed-only proof-note broker, canonical bound single-use lease, independent protected ledger and read-only hardware collector/protocol | 21 focused tests and actual sudo/PAM/UID 1001 proof, cancellation, denial, replay, expiry and historical-authority refusal after restart/recovery passed on the exact normal ISO in run 36812104386; supplied Skytech target remains physically unqualified | | R10: Sign and publish the exact qualified artifact | Actual native/Python/npm and bundled frontend inventory, supplier notices, CycloneDX SBOM and exact source/ISO/artifact provenance | 11 focused inventory/refusal tests, pinned CycloneDX schema validation and exact fixture-free live/install/state/recovery VM qualification passed in run 36812104386; final signed transition, hardware, source/license delivery, release identity and publication remain held | -## Latest desktop and aggregate qualification +## Latest integration and source-delivery continuation + +[Run 36827706986](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986) +passed all nine main-targeted integration jobs for prospective source +`a3572a9bac7051b70af2ef66e75bc021f4214b31`, the same tree as PR #280 head +`41f0c8b2f7b268d046bfd8aa1bef8d24c712c9d1`. Python CI passed 2,287 tests and +six existing optional skips, with lint/types and wheel/vector/ledger/PhiShell +also passing. Exact normal and separate signed QA image scopes passed. The +downloaded compact archive digests, 15 available checksum payloads each and +available provenance records were independently checked; large image/source/ +package/notice payloads retain producer hashes. The normal recovered desktop +and wrong-password hold were visually inspected. Exact identities and the +earlier failed integration are preserved in +`evidence/qualification-gate-a3572a9b.json` and its linked receipts. + +The R10 continuation adds `packaging/linux/source_delivery.py` and +SOURCE_DELIVERY.md. The offline tool binds a manifest to the exact normal +provenance/SBOM/source-review/notices, requires every component origin, checks +local source/build/notice hashes, and refuses pending or unsafe delivery packets. +It never selects license conclusions, authenticates a reviewer or grants release +authority. Its observed initial check of this candidate finds 501 pending +component reviews and no supplied material bytes; receipt: +`evidence/source-delivery-a3572a9b.json`. Actual terms/content review and +corresponding source delivery remain open. This continuation's new code/source +must pass its own CI; the historical passed image does not qualify changed bytes. +Local validation passed 82 focused source-delivery/inventory/Linux-foundation/ +CI-gate cases, including actual packet bytes/checksums, deterministic output, +changed material/candidate refusal, symlink/FIFO/traversal holds and incomplete +review refusal. Ruff and mypy passed for the added tool; GitHub remains the full +platform and exact-image qualification check for this continuation. + +## Preceding desktop and aggregate qualification [Run 36823086807](https://github.com/MichaelWave369/PhiOS/actions/runs/36823086807) passed all nine jobs for source `a7bcd9863eea12a87c1a9ef1fcbd26211542cd91`, diff --git a/docs/os/RELEASE_ARTIFACTS.md b/docs/os/RELEASE_ARTIFACTS.md index 93636bf1..04799810 100644 --- a/docs/os/RELEASE_ARTIFACTS.md +++ b/docs/os/RELEASE_ARTIFACTS.md @@ -52,6 +52,15 @@ The exact source material, delivery terms and required notices for each component must receive a maintainer review under its applicable license. Arch binary archive URLs alone are not recorded as delivered source code. +SOURCE_DELIVERY.md describes the separate offline manifest/check/bundle tool. +It requires exact normal candidate metadata and all component origins, records +explicit reviewer declarations, checks supplied local source/build/notice bytes +and seals a deterministic packet only after all records/material are present. +It refuses the QA image, mismatched versions/origins, symlink/traversal/special +files and binary Arch/wheel/ISO substitutions for source. Its reports preserve +the separate unauthenticated-review, content/license and release gates; completed +byte records do not independently establish compliance or publication authority. + ## Remaining publication gates 1. Preserve the passed exact normal-image live/install/state/recovery/fixed @@ -106,3 +115,14 @@ per archive were independently checked against hashes/provenance; the large ISO/package/source/notice archives were not redownloaded into the review host. See `evidence/qualification-gate-a7bcd986.json` and its two linked receipts. Source delivery, maintainer signing and physical support remain open. + +The main-targeted integration [run 36827706986](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986) +passed all nine jobs on source `a3572a9bac7051b70af2ef66e75bc021f4214b31`, +matching PR #280 head's tree. Its two compact archives were independently +matched to GitHub digests; 15 available checksum payloads each and their available +provenance records were checked. The exact normal and separate QA scopes passed; +the normal inventory has 501 components / 746 supplier notice files. The large +ISO/source/package/notice archives were not redownloaded on the review host. +`evidence/qualification-gate-a3572a9b.json` retains exact receipts and the earlier +failed integration; RELEASE_HANDOFF.md points to this normal candidate. New +continuation/final source bytes require separate qualification. diff --git a/docs/os/RELEASE_HANDOFF.md b/docs/os/RELEASE_HANDOFF.md index e273e65a..8750d4a3 100644 --- a/docs/os/RELEASE_HANDOFF.md +++ b/docs/os/RELEASE_HANDOFF.md @@ -13,15 +13,15 @@ this handoff; no private PhiKernel/TIEKAT implementation is needed to boot it. | Identity | Value | | --- | --- | -| Reviewed branch head | `9c98475274442595c59370113b9c1e0dee595ec9` | -| Tested prospective merge source | `a7bcd9863eea12a87c1a9ef1fcbd26211542cd91` | -| Identical source tree | `a85700b2c08e54a066a77a2f4a4db7494b7579ff` | -| Normal ISO SHA-256 | `3b26a7334b36254b4e686843e84924ee14cdb6ef2d6748fd771e09a02e5f79a2` | -| First-party source archive SHA-256 | `41ed0a19a811f7ac6c22edbb555adbc4b55d5421f8ea6b9e73481cd58116d8b7` | -| Normal image qualification | [36823086807](https://github.com/MichaelWave369/PhiOS/actions/runs/36823086807) | -| Download normal ISO and payloads | [11144157950](https://github.com/MichaelWave369/PhiOS/actions/runs/36823086807/artifacts/11144157950) | -| Compact evidence | [11144167873](https://github.com/MichaelWave369/PhiOS/actions/runs/36823086807/artifacts/11144167873) | -| Persisted receipt | [desktop-normal-a7bcd986.json](evidence/desktop-normal-a7bcd986.json) | +| Reviewed integration PR/head | [280](https://github.com/MichaelWave369/PhiOS/pull/280), `41f0c8b2f7b268d046bfd8aa1bef8d24c712c9d1` | +| Tested prospective merge source | `a3572a9bac7051b70af2ef66e75bc021f4214b31` | +| Identical source tree | `6d328cf55777a5fda0737f043e0f263208dfc3b4` | +| Normal ISO SHA-256 | `8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d` | +| First-party source archive SHA-256 | `090f6ee53f5db5dca1cbae17b80580de467b0daeec804082f4a629609bd736ec` | +| Normal image qualification | [36827706986](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986) | +| Download normal ISO and payloads | [11146755842](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986/artifacts/11146755842) | +| Compact evidence | [11146641362](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986/artifacts/11146641362) | +| Persisted receipt | [integration-normal-a3572a9b.json](evidence/integration-normal-a3572a9b.json) | These unsigned review downloads expire **2026-10-08**. A later build, branch update, final merge or tag has a separate identity. Download the normal payload, @@ -53,7 +53,27 @@ integration. The component PRs above remain focused review references. Requiring `release-gate` on the earlier component heads would leave them pending because they predate that controller. Keep every merge and release under maintainer review. -The latest aggregate gate passed all nine jobs in +The main-targeted integration's aggregate gate passed all nine jobs in +[run 36827706986](https://github.com/MichaelWave369/PhiOS/actions/runs/36827706986) +for source `a3572a9bac7051b70af2ef66e75bc021f4214b31`, with 2,287 Python tests +passed and six existing optional skips. The two compact archives were downloaded +and independently matched to GitHub's archive digests; 15 available checksum +payloads per archive and their available provenance records were checked. Normal +live/install/data/proof/recovery/desktop and the separate ephemeral signed QA +scope passed on their own exact ISO bytes. The normal inventory has 501 component +origins and 746 captured supplier notice files. Installed recovery and actual +wrong-password screen-lock screenshots were visually inspected. Large ISO, +package, source and notice archives were not redownloaded to the review host; +their hashes remain the producer's recorded identities. See +`evidence/qualification-gate-a3572a9b.json` and its two linked receipts. + +The preceding integration attempt 36825649652 held the aggregate gate after +signed Arch downloads timed out before a normal image existed; its screenshot +preservation also failed because PIL had not yet been installed. The successful +later code guards that step and keeps attempt-specific artifacts. The failed run +remains recorded; its passed QA image never qualified the missing normal image. + +The preceding desktop aggregate gate passed all nine jobs in [run 36823086807](https://github.com/MichaelWave369/PhiOS/actions/runs/36823086807) for source `a7bcd9863eea12a87c1a9ef1fcbd26211542cd91`, with 2,287 Python tests passed and six existing optional skips. `evidence/qualification-gate-a7bcd986.json` @@ -113,6 +133,12 @@ does not claim those settings were applied. with the required materials and notices. Have the release owner review the result. Supplier labels, an Arch binary archive link, captured license files and valid CycloneDX syntax alone do not complete this gate. + SOURCE_DELIVERY.md documents the offline `init` / `check` / `bundle` tool for + exact component coverage, declared reviews and retained local source/build/ + notice bytes. Its check of the integration metadata finds all 501 component + reviews pending. Packaging is held until reviews and exact material bytes + are supplied; complete delivery records do not authenticate a reviewer or + prove the content/legal review is correct. 5. **Freeze support scope and qualify final bytes before publication.** Record supported machines/features, known issues, maintenance/security update and recovery procedures, support contact/owner and the retained evidence. diff --git a/docs/os/SOURCE_DELIVERY.md b/docs/os/SOURCE_DELIVERY.md new file mode 100644 index 00000000..5e45f4a5 --- /dev/null +++ b/docs/os/SOURCE_DELIVERY.md @@ -0,0 +1,136 @@ +# Exact candidate source and notice delivery + +On a Linux maintenance host with Python 3.11 or newer, +`packaging/linux/source_delivery.py` prepares a separate, offline review and +delivery packet for one **normal** candidate. It uses the final SBOM component +identities, including distinct installed and bundled frontend origins. Supplier +license labels remain declarations. No license conclusion or disposition is +selected automatically, and nothing is downloaded, signed or published. + +The release owner must review the actual applicable terms, corresponding source, +build instructions/patches, required notices and delivery arrangement for each +component. The tool checks recorded coverage and local bytes. A reviewer name and +timestamp are recorded assertions, not authenticated decisions or proof that the +legal/content review is correct. See RELEASE_ARTIFACTS.md for the independent +release signing, hardware, final-transition and publication gates. + +## Bind the review to the candidate + +Start with the exact normal candidate payload from RELEASE_HANDOFF.md. In one +directory retain `provenance.json`, `sbom.cdx.json`, `source-review.json`, +`third-party-notices.json` and `SHA256SUMS` unchanged. These metadata files may +also come from its compact evidence archive, using the actual +`PhiOS/PhiOS/dist/fixture-free/` directory. The tool checks their hashes against +checksums/provenance, their common source identity, and complete SBOM coverage. +It refuses the separate QA image. + +```sh +python3 packaging/linux/source_delivery.py init \ + --candidate /path/to/exact-normal-candidate \ + --output /path/to/source-delivery-manifest.json +``` + +`init` creates a new file and refuses to overwrite an existing review. Every +component starts pending. The manifest binds the source commit/epoch, ISO +identity, first-party source and supplier notice archives, and exact metadata +hashes. A changed build needs a new manifest; do not transfer completed reviews +to changed component identities without fresh review. + +Checksums/provenance here do not authenticate their publisher. A compact archive +also does not contain the ISO/source/notice archive bytes. Verify the actual ISO +and authenticated final signature separately. The report always records +`iso_bytes_independently_verified: false` because this tool does not read the ISO. + +## Supply real material and record reviews + +Place the selected source, actual build/patch material and notices beneath one +explicit local materials directory. Use ordinary relative paths without spaces, +traversal, symlinks or special files. Input archives stay opaque and are never +extracted. Each catalog entry has these exact fields: + +```json +{ + "path": "sources/component-version.tar.gz", + "kind": "corresponding-source", + "sha256": "ACTUAL_FULL_LOWERCASE_SHA256", + "size": 12345, + "origin": "Actual source origin and exact revision/version", + "custody": "How these exact bytes were acquired and retained" +} +``` + +Replace every example value with the actual record. `kind` is +`corresponding-source`, `build-material` or `notice`. Use `sha256sum` and the +actual file byte count to record identity. The checker independently reads and +hashes each local file; a URL or claimed hash without supplied bytes is held. +An Arch binary `.pkg.tar.*`, wheel or ISO cannot satisfy a source/build record. +A source filename alone does not establish that its contents correspond to the +distributed binary; the reviewer must inspect the actual material. + +Supply the exact `phios-source.tar.gz` and `third-party-notices.tar.gz` named by +the bound provenance as corresponding-source and notice catalog entries. The +checker requires those exact archive hashes/sizes before packaging. The +first-party archive contains the checked-out code, packaging/build files and +patches; it does not replace third-party corresponding source. Do not include +private release keys or private PhiKernel/TIEKAT implementation material. + +For each component, preserve `component`, `name`, `version` and +`declared_licenses`. Fill its `review` with an explicit `source-required` or +`no-source-required` disposition, reviewer, timezone-bearing ISO timestamp, +applicable terms and rationale. Record source/build/notice paths as references +to the material catalog. `source-required` requires both corresponding-source +and build/patch records. `no-source-required` still requires actual reviewed +terms and a rationale; it is never inferred from MIT/GPL/custom supplier labels. +Notice references may be empty only when that reviewed rationale explains the +applicable delivery requirements. One retained material path can be shared by +several exact component origins. Unreferenced extra files are refused. + +## Check and seal the packet + +```sh +python3 packaging/linux/source_delivery.py check \ + --candidate /path/to/exact-normal-candidate \ + --manifest /path/to/source-delivery-manifest.json \ + --materials /path/to/materials + +python3 packaging/linux/source_delivery.py bundle \ + --candidate /path/to/exact-normal-candidate \ + --manifest /path/to/source-delivery-manifest.json \ + --materials /path/to/materials \ + --output /path/to/source-delivery.tar.gz +``` + +| Exit | Meaning | +| --- | --- | +| `0` | Init succeeded, or all delivery records/files are present, or a complete packet was sealed | +| `1` | Invalid identity/record, changed/missing bytes, unsafe path, or incomplete bundle request | +| `2` | Check was valid but component reviews or the exact source/notice archives remain pending | + +`check` emits a report with pending component identities, missing candidate +archives, verified local material counts and the canonical manifest hash. +`bundle` refuses incomplete records, seals and rechecks material bytes, and +retains the original candidate metadata, manifest, report, selected material +and a new internal checksum index in a deterministic gzip/tar archive. It +refuses output overwrite. Matching inputs produce matching packet bytes; this +does not imply reproducibility of the OS image itself. + +File material is bounded to 8 GiB each / 32 GiB total; metadata to 16 MiB. +Materials use non-following descriptor-relative opens. Changing material or +candidate bytes between checking and sealing holds the packet. + +`delivery_records_complete` means only that the specified declarations and +local byte records are complete. Reports always retain +`review_declarations_authenticated: false`, +`license_source_compliance_reviewed: false`, `release_ready: false` and +`publication_authority: false`. The release owner still evaluates the supplied +terms/content and delivery arrangement before publishing final distribution +bytes with their required accompanying materials. + +## Continuation observation + +The independently checked normal metadata from integration run **36827706986** +has 501 component origins and 746 supplier notice files. Initializing/checking +that exact candidate leaves all 501 reviews pending and requires the actual +first-party source and supplier notice archive bytes. This is the observed +starting point, not a completed source-delivery gate. The compact observation +receipt is `evidence/source-delivery-a3572a9b.json`. diff --git a/docs/os/evidence/integration-normal-a3572a9b.json b/docs/os/evidence/integration-normal-a3572a9b.json new file mode 100644 index 00000000..a918e9d2 --- /dev/null +++ b/docs/os/evidence/integration-normal-a3572a9b.json @@ -0,0 +1,433 @@ +{ + "artifact_expiry": "2026-10-08T07:12:29Z", + "bounds": { + "actual_maintainer_signed_transition_qualified": false, + "hardware_qualified": false, + "license_source_compliance_reviewed": false, + "physical_audio_qualified": false, + "publication_authority": false, + "release_ready": false, + "repository_protection_configured": false, + "specific_graphical_admin_operation_qualified": false, + "wifi_radio_qualified": false + }, + "compact_checksum_payloads_verified": [ + "builder-image.json", + "builder-packages.txt", + "fixture-inventory.json", + "image-packages.txt", + "javascript-bundled-packages.json", + "javascript-packages.json", + "native-packages.json", + "provenance.json", + "python-packages.json", + "release.json", + "sbom.cdx.json", + "source-archive-sha256.txt", + "source-commit.txt", + "source-review.json", + "third-party-notices.json" + ], + "compact_provenance_hashes_verified": true, + "evidence_archive_sha256": "a2a97c8c0f7ac62cd27531ee6a3ce451e2f7c4eaf95c3e2cb6782b139b25a6f9", + "evidence_artifact_id": 11146641362, + "evidence_files": { + "PhiOS/PhiOS/dist/fixture-free/SHA256SUMS": "3d6a5739ef070a3d4cf7fe6258c420c0c6e7f7c4fa9d815e208379fab75e98d5", + "PhiOS/PhiOS/dist/fixture-free/build.log": "c6e63e84ec963807df431c460236a195b6160b6e4a5f42d79f295d7e2e7fffe3", + "PhiOS/PhiOS/dist/fixture-free/builder-image.json": "e9cb284e6af2c5485f641b175ed1e9f68b15416e769730cc76a71099be6a4fd9", + "PhiOS/PhiOS/dist/fixture-free/builder-packages.txt": "374d8ffd2ec34f22d8ef7f28110927eef7d17586faba2954e1906a2c5229c35f", + "PhiOS/PhiOS/dist/fixture-free/fixture-inventory.json": "14ce1577031ab6cc9b29967bc57b054661ce36d3a5ec0ada86a0bba9ddc9627e", + "PhiOS/PhiOS/dist/fixture-free/image-packages.txt": "742b3c4ce23cb82cdc8eb10f95152fc1b39422bdf9dd4532b66693d2fa92b202", + "PhiOS/PhiOS/dist/fixture-free/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/fixture-free/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/fixture-free/mkarchiso.log": "048e9293889017b3cc4d3f710f64ae8bb319622f1549e3a5875c29be800a95e4", + "PhiOS/PhiOS/dist/fixture-free/native-packages.json": "1ed7518ef7ee89add067440ecf2c9d4149577fa7f97c878e1689ef94db844ff8", + "PhiOS/PhiOS/dist/fixture-free/provenance.json": "1f53ef2a290479a390f21ee782c3c671dd03fa1a639ac4267a6bc21430db6c4a", + "PhiOS/PhiOS/dist/fixture-free/python-packages.json": "48f3bcadd0328850b62db09eaad2b5fa9be45abc029e0e746e481a6094f8f209", + "PhiOS/PhiOS/dist/fixture-free/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/fixture-free/sbom.cdx.json": "8d60bf9d1fe67b242b915ab4f1f358eed33fd3040f08bb77f86cb5a44d62ae25", + "PhiOS/PhiOS/dist/fixture-free/source-archive-sha256.txt": "cb32523acbb7f6c3eec21c7f1f8e6c19f880ad8c07a9a3a8dff55ecb4460d0bb", + "PhiOS/PhiOS/dist/fixture-free/source-commit.txt": "1b1c1caadcc32693b522249661e485f296fdf9cb5e9c7a6a79f0f222ce9099c3", + "PhiOS/PhiOS/dist/fixture-free/source-review.json": "4334dc47c9907aa86b127d36b586d3db9c75dad72f5582318ab58c073f8b7d99", + "PhiOS/PhiOS/dist/fixture-free/third-party-notices.json": "840a10e3dac4ffac473e0f68ba6d078c85ddf1e4120518fa598d1876fe3cc71f", + "_temp/phios-normal-installed/failed-boot-qemu.log": "0eb1be2352df981151ec211f5894e954571a735d3c6338e914eba9a411ade492", + "_temp/phios-normal-installed/failed-boot-serial.log": "c93af9b88ba036e82c1be058ec184146e963032c1d1a9e6ac8ee2afbb7f0b34c", + "_temp/phios-normal-installed/installed-1-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-normal-installed/installed-1-serial.log": "7989ab895a9c88bd2b8ea6e2e91f6bbf2e194a99f8a237ad78a173c1d382a455", + "_temp/phios-normal-installed/installed-2-qemu.log": "0eb1be2352df981151ec211f5894e954571a735d3c6338e914eba9a411ade492", + "_temp/phios-normal-installed/installed-2-serial.log": "4ccc4cee6bd4dab28e0b3337ab85d6413e4ac63c938115649791fbfd934825de", + "_temp/phios-normal-installed/installed-3-qemu.log": "0eb1be2352df981151ec211f5894e954571a735d3c6338e914eba9a411ade492", + "_temp/phios-normal-installed/installed-3-serial.log": "4153d980cedc6ce0c567a30d60e3fd5becd628eed8c1980a807be1c3aefc5d87", + "_temp/phios-normal-installed/installed-evidence.json": "3c5a2b2359b2701980eb84abb7d030b56383a6ce613193686dc1af7fc3c78d79", + "_temp/phios-normal-installed/normal-install-live-qemu.log": "0eb1be2352df981151ec211f5894e954571a735d3c6338e914eba9a411ade492", + "_temp/phios-normal-installed/normal-install-live-serial.log": "55ad258695431ee47f2e03809365d2c2b6343bc97d834b6ba3d10c721b0630df", + "_temp/phios-normal-installed/normal-restore-live-qemu.log": "0eb1be2352df981151ec211f5894e954571a735d3c6338e914eba9a411ade492", + "_temp/phios-normal-installed/normal-restore-live-serial.log": "0633fadb95d22b7ea74f7e43e4e6b753b11c7304c79ad2c98fed40c83eea198c", + "_temp/phios-normal-installed/screen-failed-boot.png": "c9f55c3f4c24064fe8f2128551fedd058e6f4e45e55ca8d23ced49d15d28f4ab", + "_temp/phios-normal-installed/screen-installed-1-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-normal-installed/screen-installed-1.png": "dc6baa5ce94ac35afe9a275fc81a38c56bf01b4600c814e2645b61a8f315da8b", + "_temp/phios-normal-installed/screen-installed-2-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-normal-installed/screen-installed-2.png": "cf44dada7596faf3f16bd3fee2388dd19e5b6695de4e1088ce8db7d75ba74e1b", + "_temp/phios-normal-installed/screen-installed-3-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-normal-installed/screen-installed-3.png": "6e68e5a0c55175d835fc0823cad6c3874d8f978996d845a38295b569f39d0905", + "_temp/phios-normal-installed/screen-installed-locked.png": "c9b1b7f56900e1d02779f08643a468f474a22a0c4a4e7b6e9a8eeb766c6f87a3", + "_temp/phios-normal-installed/screen-installed-unlocked.png": "dc6baa5ce94ac35afe9a275fc81a38c56bf01b4600c814e2645b61a8f315da8b", + "_temp/phios-normal-installed/screen-installed-wrong-password.png": "5ccb466a16a200c652f30646c549ba909a258553fbb8714c085012c71dfcc860", + "_temp/phios-normal-installed/screen-normal-install-live.png": "811798c54539849d45bafb50e70792dcdcff22de253331e704607834a078433e", + "_temp/phios-normal-installed/screen-normal-restore-live.png": "df34dba77cbf150e7aa7cdde0a2e95e71fd0c6328179586a79d41e91ef972e44", + "_temp/phios-preview/preview-evidence.json": "fe50381e55ff4b427b84045da9df84b5f6790a26e43c62a2c0737bd1b9b61646", + "_temp/phios-preview/qemu.log": "aa4735d3c5f31d67343e9f833e1247533511340e12f9ace973fdef2ca873058e", + "_temp/phios-preview/screen-1-first.png": "1ac68c0bf23b107d4f03d35a234f8ee095583f51324b8d8b725134787999083a", + "_temp/phios-preview/screen-1-reauthenticated.png": "9a17b4d00d604fb1302782f842a94e4e94fc3310cf831b5af5ab63d0097dda87", + "_temp/phios-preview/screen-2-first.png": "16e4bc0ade3195c1440b9631d740b414ffcabf1bb2a0eddd0c5975e826103e11", + "_temp/phios-preview/screen-2-reauthenticated.png": "d4eba63cdd303b2ea232cac553069523d0e531c5e998fc99c65775ed99c21158", + "_temp/phios-preview/screen-live-1-locked.png": "1ac68c0bf23b107d4f03d35a234f8ee095583f51324b8d8b725134787999083a", + "_temp/phios-preview/screen-live-1-unlocked.png": "fc3acabaab4cfabcf73863e7790544a16924b3730f93308afaa15bb90577405d", + "_temp/phios-preview/screen-live-1-wrong-password.png": "5ccb466a16a200c652f30646c549ba909a258553fbb8714c085012c71dfcc860", + "_temp/phios-preview/screen-live-2-locked.png": "16e4bc0ade3195c1440b9631d740b414ffcabf1bb2a0eddd0c5975e826103e11", + "_temp/phios-preview/screen-live-2-unlocked.png": "1556dc6d0a9741f50c52fb1de87bae1098345a2849148d4fed849756b60385cf", + "_temp/phios-preview/screen-live-2-wrong-password.png": "5ccb466a16a200c652f30646c549ba909a258553fbb8714c085012c71dfcc860", + "_temp/phios-preview/screen.png": "d4eba63cdd303b2ea232cac553069523d0e531c5e998fc99c65775ed99c21158", + "_temp/phios-preview/serial.log": "78d98381c8e6ca92599f230fa5c8ca7f151f02daed787eaebeb9a19d95bdfd8e" + }, + "image_artifact_id": 11146755842, + "installed_evidence": { + "abrupt_virtual_restart_passed": true, + "accelerator": "kvm", + "boot_ids": [ + "b334d3544edf4bb5b87f834bebe23ef3", + "4bd82ee4df59407e8f7a45232c86a70d", + "9258c38a1e5e45a1b9ee2f32d92ff816" + ], + "ci_serial_console_injected": false, + "desktop_service_boots": [ + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + }, + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + }, + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + } + ], + "disk_bytes": 34359738368, + "disk_serial": "PHIOS_CI_BLANK", + "explicit_serial_console_password_login": true, + "fixture_free_installed_qualified": true, + "fixture_free_requested": true, + "hardware_qualified": false, + "installed": true, + "installed_screen_lock": { + "actual_super_l_shortcut": true, + "boot_id": "b334d3544edf4bb5b87f834bebe23ef3", + "correct_pam_password_unlocked": true, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "wrong_password_held": true + }, + "interrupted_signed_transaction_observed": false, + "interrupted_update_active_root_preserved": false, + "iso_sha256": "8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d", + "linux_governed_workflow": { + "actual_agent_uid": 1001, + "agent_broker_denied": true, + "agent_store_denied": true, + "approval_sha256": "d6db45cae5d11636b99e9923f4b8b89db820b13e3a930f63b310e2b2b51e5d4e", + "cancel_passed": true, + "expired_approval_sha256": "c078d34e17c7cb689034384afc77f4de8d5db526ec113d66257a7ce9dfcc0f6b", + "expiry_refused": true, + "hardware_qualified": false, + "receipt": { + "approval_sha256": "d6db45cae5d11636b99e9923f4b8b89db820b13e3a930f63b310e2b2b51e5d4e", + "authority_replayable": false, + "binding_sha256": "ece85f6f33a105b07c568f578b8435fbd69cecf63fe38c34880df2799f0458cd", + "boot_id": "b334d3544edf4bb5b87f834bebe23ef3", + "decision_sha256": "6280f4e3ec1ad64cafc2a3bb3efcc75a0dec92e647fb1e79a7387319b3b05e08", + "effect_performed": true, + "execution_authority": false, + "lease_sha256": "22caabfcd44b7f9d6c3d8eb459567cfb68f8cffcf9b9be7d740e76a78319b0e0", + "note_bytes": 57, + "note_sha256": "e2e3a3855d190c74791ad81fdc9a5dd8742363fcede860ef07439ce9e9058ba8", + "operator_uid": 1000, + "post_effect_verified": true, + "principal_uid": 1001, + "release_ready": false, + "schema_version": "phios.linux-proof-receipt.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31" + }, + "release_ready": false, + "replay_refused": true, + "schema_version": "phios.linux-proof-qualification.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "sudo_password_authentication": true + }, + "linux_governed_workflow_qualified": true, + "matched_root_efi_restored": true, + "no_iso_boot_passed": true, + "record_sha256": "c481900567db858427663a26909e82a9d30fe2e083c929cb68683a9823e87bb4", + "recovery_checkpoint_generation": "4cb5adbe09bc44a29bf36fd900fa45de", + "recovery_requested": true, + "release_ready": false, + "schema_version": "phios.installed-boot-evidence.v1", + "signed_package_application_qualified": false, + "signed_update_refusals_observed": false, + "signed_update_requested": false, + "simulated_boot_failure_observed": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "whole_os_recovery_passed": true + }, + "inventory_counts": { + "bundled_frontend_origins": 4, + "cyclonedx_components": 501, + "installed_npm": 12, + "native": 446, + "python": 39, + "supplier_notice_files": 746 + }, + "iso_sha256": "8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d", + "job_id": 110257062078, + "large_payloads_redownloaded_and_verified_locally": false, + "live_evidence": { + "accelerator": "kvm", + "boots": [ + { + "first": { + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "fixture_free": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "first", + "uid": 1000 + }, + "lifecycle": { + "all_session_units_inactive": true, + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "new_observer_pid": "989", + "old_observer_pid": "646", + "stopped_session_units": [ + "phios-session.target", + "phios-observer.service", + "phios-browser.service", + "phios-waybar.service", + "phios-curiosity-reader.service", + "phios-history-reader.service", + "phios-policykit.service", + "phios-audio.target", + "pipewire.service", + "pipewire-pulse.service", + "wireplumber.service", + "pipewire.socket", + "pipewire-pulse.socket" + ] + }, + "reauthenticated": { + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "fixture_free": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "reauthenticated", + "uid": 1000 + } + }, + { + "first": { + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "fixture_free": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "first", + "uid": 1000 + }, + "lifecycle": { + "all_session_units_inactive": true, + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "new_observer_pid": "1000", + "old_observer_pid": "655", + "stopped_session_units": [ + "phios-session.target", + "phios-observer.service", + "phios-browser.service", + "phios-waybar.service", + "phios-curiosity-reader.service", + "phios-history-reader.service", + "phios-policykit.service", + "phios-audio.target", + "pipewire.service", + "pipewire-pulse.service", + "wireplumber.service", + "pipewire.socket", + "pipewire-pulse.socket" + ] + }, + "reauthenticated": { + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "fixture_free": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "reauthenticated", + "uid": 1000 + } + } + ], + "desktop_service_boots": [ + { + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "restricted_dhcp_address": "192.0.2.15/24", + "restricted_dhcp_server": "192.0.2.2", + "restricted_ipv4_default_route": false, + "restricted_ipv4_dns_advertised": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "first", + "uid": 1000, + "user_audio_services": true, + "virtual_network_scope": "QEMU restricted user network 192.0.2.0/24; no forwarding", + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": true + }, + { + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "restricted_dhcp_address": "192.0.2.15/24", + "restricted_dhcp_server": "192.0.2.2", + "restricted_ipv4_default_route": false, + "restricted_ipv4_dns_advertised": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "reauthenticated", + "uid": 1000, + "user_audio_services": true, + "virtual_network_scope": "QEMU restricted user network 192.0.2.0/24; no forwarding", + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": true + }, + { + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "restricted_dhcp_address": "192.0.2.15/24", + "restricted_dhcp_server": "192.0.2.2", + "restricted_ipv4_default_route": false, + "restricted_ipv4_dns_advertised": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "first", + "uid": 1000, + "user_audio_services": true, + "virtual_network_scope": "QEMU restricted user network 192.0.2.0/24; no forwarding", + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": true + }, + { + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "restricted_dhcp_address": "192.0.2.15/24", + "restricted_dhcp_server": "192.0.2.2", + "restricted_ipv4_default_route": false, + "restricted_ipv4_dns_advertised": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "stage": "reauthenticated", + "uid": 1000, + "user_audio_services": true, + "virtual_network_scope": "QEMU restricted user network 192.0.2.0/24; no forwarding", + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": true + } + ], + "external_network_forwarding": false, + "fixture_free_qualified": true, + "hardware_qualified": false, + "host_audio_attached": false, + "iso_sha256": "8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d", + "public_volatile_credentials": true, + "release_ready": false, + "restricted_virtual_ethernet": true, + "schema_version": "phios.fixture-free-live-evidence.v1", + "screen_lock_boots": [ + { + "actual_super_l_shortcut": true, + "boot_id": "7c1362eb4d7b4373a58b5d69cca64b12", + "correct_pam_password_unlocked": true, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "wrong_password_held": true + }, + { + "actual_super_l_shortcut": true, + "boot_id": "4366da1dc2694898a648dfa59d0396a6", + "correct_pam_password_unlocked": true, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "wrong_password_held": true + } + ], + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "test_code_injected_into_image": false + }, + "payloads_absent_from_compact_archive": [ + "LICENSE_HISTORY.md", + "phios-1.0.0-1-any.pkg.tar.zst", + "phios-linux-0.1.0-alpha.1-x86_64.iso", + "phios-source.tar.gz", + "phishell-0.16.0-2-any.pkg.tar.zst", + "third-party-notices.tar.gz" + ], + "reviewed_branch_head": "41f0c8b2f7b268d046bfd8aa1bef8d24c712c9d1", + "run_attempt": 1, + "schema_version": "phios.integration-normal-qualification.v1", + "source_archive_sha256": "090f6ee53f5db5dca1cbae17b80580de467b0daeec804082f4a629609bd736ec", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "tested_source_tree": "6d328cf55777a5fda0737f043e0f263208dfc3b4", + "visually_reviewed_files": [ + "_temp/phios-normal-installed/screen-installed-3.png", + "_temp/phios-normal-installed/screen-installed-wrong-password.png" + ], + "workflow_run": 36827706986 +} diff --git a/docs/os/evidence/integration-signed-a3572a9b.json b/docs/os/evidence/integration-signed-a3572a9b.json new file mode 100644 index 00000000..f80f950a --- /dev/null +++ b/docs/os/evidence/integration-signed-a3572a9b.json @@ -0,0 +1,253 @@ +{ + "artifact_expiry": "2026-10-08T07:15:29Z", + "bounds": { + "actual_maintainer_signed_transition_qualified": false, + "hardware_qualified": false, + "license_source_compliance_reviewed": false, + "physical_audio_qualified": false, + "publication_authority": false, + "release_ready": false, + "repository_protection_configured": false, + "specific_graphical_admin_operation_qualified": false, + "wifi_radio_qualified": false + }, + "compact_checksum_payloads_verified": [ + "builder-image.json", + "builder-packages.txt", + "fixture-inventory.json", + "image-packages.txt", + "javascript-bundled-packages.json", + "javascript-packages.json", + "native-packages.json", + "provenance.json", + "python-packages.json", + "release.json", + "sbom.cdx.json", + "source-archive-sha256.txt", + "source-commit.txt", + "source-review.json", + "third-party-notices.json" + ], + "compact_provenance_hashes_verified": true, + "evidence_archive_sha256": "aa5f3bf02830121bfb913ff6545e73742d0c0d262075a52ec9e45491eb9d1ac0", + "evidence_artifact_id": 11146486655, + "evidence_files": { + "PhiOS/PhiOS/dist/linux/SHA256SUMS": "f2287109cee19d8d77d6141626a584342eeec9e6464fec9430516c59b826af24", + "PhiOS/PhiOS/dist/linux/build.log": "c919aba55e8315cd1065dffb016d93e97a602082487a392e452f974cba1061f8", + "PhiOS/PhiOS/dist/linux/builder-image.json": "b942eb2b1dca31f68a94c7762f68ad5f91002ec0ac2499fd06298da8ede91e08", + "PhiOS/PhiOS/dist/linux/builder-packages.txt": "374d8ffd2ec34f22d8ef7f28110927eef7d17586faba2954e1906a2c5229c35f", + "PhiOS/PhiOS/dist/linux/fixture-inventory.json": "2ebf26541ddaa6d1e239b1a3be944946f18e8d08e78837065d11eed7921d7a60", + "PhiOS/PhiOS/dist/linux/image-packages.txt": "aaa20387817ce8190c61b9408185f5e77809a25b730ca2902936f751d23613c1", + "PhiOS/PhiOS/dist/linux/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/linux/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/linux/mkarchiso.log": "188eeda8646b233feefc4284bb5b22f7642a7848bffcfd483ac77ce1b63a7ea3", + "PhiOS/PhiOS/dist/linux/native-packages.json": "af577d3ea1fec83337fc5317f8b1c3c81ab8e1601a34c40bb5ff1cd75afae37e", + "PhiOS/PhiOS/dist/linux/provenance.json": "e6341bd0ae917331b523cfe422b55c27ab15b7a86e99f3236b559456f1fa57ab", + "PhiOS/PhiOS/dist/linux/python-packages.json": "48f3bcadd0328850b62db09eaad2b5fa9be45abc029e0e746e481a6094f8f209", + "PhiOS/PhiOS/dist/linux/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/linux/sbom.cdx.json": "74f9d62b729208f1cd98a6059d68cc11cdc8d90e7d00196255ad31c5ec5a888a", + "PhiOS/PhiOS/dist/linux/source-archive-sha256.txt": "cb32523acbb7f6c3eec21c7f1f8e6c19f880ad8c07a9a3a8dff55ecb4460d0bb", + "PhiOS/PhiOS/dist/linux/source-commit.txt": "1b1c1caadcc32693b522249661e485f296fdf9cb5e9c7a6a79f0f222ce9099c3", + "PhiOS/PhiOS/dist/linux/source-review.json": "17f78e206d9c7529f0e7333571a553ed0c6dc57a50292179212c0d154dd45a9a", + "PhiOS/PhiOS/dist/linux/third-party-notices.json": "840a10e3dac4ffac473e0f68ba6d078c85ddf1e4120518fa598d1876fe3cc71f", + "_temp/phios-boot/boot-evidence.json": "a1161bd87fc692a3d6522112b131a34e28395350ab71a32037e4b7b7177a55d2", + "_temp/phios-boot/qemu.log": "997255a44dabc181606ebe2feccc02070a1fc5f3c085b22240be103bb325ac2a", + "_temp/phios-boot/screen-first.png": "2cf60eec1c9c227b0459680f07c43960528820e726de47017bcfd4c0b8e0007d", + "_temp/phios-boot/screen.png": "1f998d9632de3dbe88b73a768260820a099f45cc3a46e680b36cc04357ae613d", + "_temp/phios-boot/serial.log": "b76437fb843563a3b11ee29f203c9708b7e8f5238f48db376b5b45b178802171", + "_temp/phios-installed/failed-boot-qemu.log": "4305973510966846dd84cc07e76eae8110a03fd16307110d7de04d5756e4ddc2", + "_temp/phios-installed/failed-boot-serial.log": "58c41a6e8664e3e90b41180564793c18e8026cb2c0458e2d4efb908fc56f758b", + "_temp/phios-installed/install-live-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-installed/install-live-serial.log": "a4b2cbf87ed6d0df8e5b356890317ebebc1e4e0477457dc58645ef315e030b2c", + "_temp/phios-installed/installed-1-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-installed/installed-1-serial.log": "f44e40c912dcf444b9a00667722d5f94be09dec5c432aa694618ddda5be830b8", + "_temp/phios-installed/installed-2-qemu.log": "4305973510966846dd84cc07e76eae8110a03fd16307110d7de04d5756e4ddc2", + "_temp/phios-installed/installed-2-serial.log": "59dc2352ade23abb0a8b457d4fb0ce8f5d6a21dc904d0321321c64759e3ab96c", + "_temp/phios-installed/installed-3-qemu.log": "4305973510966846dd84cc07e76eae8110a03fd16307110d7de04d5756e4ddc2", + "_temp/phios-installed/installed-3-serial.log": "93a5638f5b73477d1e96563d1f60ee05533d7d81725ad2cdd0d45267d0fef442", + "_temp/phios-installed/installed-evidence.json": "d8d0eccbb119314d1ce8bf731e376f8cd4275bb939310ca5d88d5e98653129b9", + "_temp/phios-installed/interrupted-resume-live-qemu.log": "4305973510966846dd84cc07e76eae8110a03fd16307110d7de04d5756e4ddc2", + "_temp/phios-installed/interrupted-resume-live-serial.log": "8f8b9dfccf58d39e8e46543d0648a2a0172c3d8bad958a9f5ccc25c73bb7395e", + "_temp/phios-installed/recovery-live-qemu.log": "4305973510966846dd84cc07e76eae8110a03fd16307110d7de04d5756e4ddc2", + "_temp/phios-installed/recovery-live-serial.log": "08e6388241d3bb920d89c7ab03bd22c87dc78932926532e277b738020bf5464c", + "_temp/phios-installed/screen-failed-boot.png": "58db54492efb26ef4283b1085bb5bf343ce56dc4ec6fa63e51a28ffd1149d776", + "_temp/phios-installed/screen-install-live.png": "9881b1ee528d82449de4f4e69a7d925bcf175c0b75cb2c48f7e6f1aaa48dc7bc", + "_temp/phios-installed/screen-installed-1-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-installed/screen-installed-1.png": "782c474bfddbe1eb274780b4d65fdeee1c650f9381710976744a4279b94a9d14", + "_temp/phios-installed/screen-installed-2-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-installed/screen-installed-2.png": "8dd452a3c299cd1d1db60f22b1e4427664ee7bf981508141cf6d232e5c06108b", + "_temp/phios-installed/screen-installed-3-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-installed/screen-installed-3.png": "163b0b8f19d0678b674d53876358a8e9d8fe9fb10725567c77000da7514eb8b2", + "_temp/phios-installed/screen-installed-locked.png": "59177e6ea22128f4b436b1f0df7222f9aa18a3416631c8ebf732c6196ed2a1f6", + "_temp/phios-installed/screen-installed-unlocked.png": "782c474bfddbe1eb274780b4d65fdeee1c650f9381710976744a4279b94a9d14", + "_temp/phios-installed/screen-installed-wrong-password.png": "5ccb466a16a200c652f30646c549ba909a258553fbb8714c085012c71dfcc860", + "_temp/phios-installed/screen-interrupted-resume-live.png": "5bc1600262dc2a750a6f0836c0d967da75c03905bede6fe27c228ed5a6b9c6f4", + "_temp/phios-installed/screen-recovery-live.png": "112e3bec43f4a1c8a52dbb569ff10e0e51e2d01216ad0f8384d05dd9e456a8e1" + }, + "image_artifact_id": 11146401812, + "installed_evidence": { + "abrupt_virtual_restart_passed": true, + "accelerator": "kvm", + "boot_ids": [ + "fbca797e241d421c9eb5d35725786d28", + "18a359b20bb646e29e8a1deeb44dd0a0", + "470ed83db63d43499fff50eacb8177c6" + ], + "ci_serial_console_injected": true, + "desktop_service_boots": [ + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + }, + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + }, + { + "emulated_alsa_device_observed": true, + "host_audio_attached": false, + "nonroot_graphical_policykit_agent": true, + "physical_audio_qualified": false, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "user_audio_services": true, + "virtual_pcm_playback_completed": true, + "wifi_radio_qualified": false, + "wired_dhcp_observed": false + } + ], + "disk_bytes": 34359738368, + "disk_serial": "PHIOS_CI_BLANK", + "explicit_serial_console_password_login": false, + "fixture_free_installed_qualified": false, + "fixture_free_requested": false, + "hardware_qualified": false, + "installed": true, + "installed_screen_lock": { + "actual_super_l_shortcut": true, + "boot_id": "fbca797e241d421c9eb5d35725786d28", + "correct_pam_password_unlocked": true, + "release_ready": false, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "uid": 1000, + "wrong_password_held": true + }, + "interrupted_signed_transaction_observed": true, + "interrupted_update_active_root_preserved": true, + "iso_sha256": "92ca600ef8e84616b425bec61586c3bc89df30c82490896e44b2d182ee2b3960", + "linux_governed_workflow": { + "actual_agent_uid": 1001, + "agent_broker_denied": true, + "agent_store_denied": true, + "approval_sha256": "b612362eb50431bee2aab5b6a0ada450bdccb5d95fff7e8e2c8c86cb5d800943", + "cancel_passed": true, + "expired_approval_sha256": "29c8713b7ea231d5a6c944570d1aba09247303b12e22030cffac0a9a5ee2a8af", + "expiry_refused": true, + "hardware_qualified": false, + "receipt": { + "approval_sha256": "b612362eb50431bee2aab5b6a0ada450bdccb5d95fff7e8e2c8c86cb5d800943", + "authority_replayable": false, + "binding_sha256": "2b6bef962a0bf4916011d9f1b24fcb58144991586d7f77e7add76128e8681f7b", + "boot_id": "fbca797e241d421c9eb5d35725786d28", + "decision_sha256": "11aaf37955eea6527da64b3afb1ad686dad7937127d59c0518f42f6617878020", + "effect_performed": true, + "execution_authority": false, + "lease_sha256": "3eea5c3692f3de832011c4942cceed6de5878e028c49c8df2482d7510e28ca64", + "note_bytes": 57, + "note_sha256": "e2e3a3855d190c74791ad81fdc9a5dd8742363fcede860ef07439ce9e9058ba8", + "operator_uid": 1000, + "post_effect_verified": true, + "principal_uid": 1001, + "release_ready": false, + "schema_version": "phios.linux-proof-receipt.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31" + }, + "release_ready": false, + "replay_refused": true, + "schema_version": "phios.linux-proof-qualification.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "sudo_password_authentication": true + }, + "linux_governed_workflow_qualified": true, + "matched_root_efi_restored": true, + "no_iso_boot_passed": true, + "record_sha256": "c481900567db858427663a26909e82a9d30fe2e083c929cb68683a9823e87bb4", + "recovery_checkpoint_generation": "ef6587a480194a0fb436e985671c61fd", + "recovery_requested": true, + "release_ready": false, + "schema_version": "phios.installed-boot-evidence.v1", + "signed_package_application_qualified": true, + "signed_update_refusals_observed": true, + "signed_update_requested": true, + "signed_update_transaction": { + "ephemeral_test_key": true, + "generation": "ef6587a480194a0fb436e985671c61fd", + "sequence": 1, + "signer": "4754BF39017A1D69FA443DCA55660E67F9D2BFF9" + }, + "simulated_boot_failure_observed": true, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "whole_os_recovery_passed": true + }, + "inventory_counts": { + "bundled_frontend_origins": 4, + "cyclonedx_components": 502, + "installed_npm": 12, + "native": 447, + "python": 39, + "supplier_notice_files": 746 + }, + "iso_sha256": "92ca600ef8e84616b425bec61586c3bc89df30c82490896e44b2d182ee2b3960", + "job_id": 110257062077, + "large_payloads_redownloaded_and_verified_locally": false, + "live_evidence": { + "accelerator": "kvm", + "boot_ids": [ + "c7ea9e4147ef4356a3faf3789071352b", + "452664407a1e4b2294816f7d2fa71e1b" + ], + "boot_passed": true, + "hardware_qualified": false, + "iso_sha256": "92ca600ef8e84616b425bec61586c3bc89df30c82490896e44b2d182ee2b3960", + "reboot_passed": true, + "release_ready": false, + "schema_version": "phios.live-boot-evidence.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "timeout_seconds": 600 + }, + "payloads_absent_from_compact_archive": [ + "LICENSE_HISTORY.md", + "phios-1.0.0-1-any.pkg.tar.zst", + "phios-linux-0.1.0-alpha.1-x86_64.iso", + "phios-source.tar.gz", + "phishell-0.16.0-2-any.pkg.tar.zst", + "third-party-notices.tar.gz" + ], + "reviewed_branch_head": "41f0c8b2f7b268d046bfd8aa1bef8d24c712c9d1", + "run_attempt": 1, + "schema_version": "phios.integration-signed-qa-qualification.v1", + "source_archive_sha256": "090f6ee53f5db5dca1cbae17b80580de467b0daeec804082f4a629609bd736ec", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "tested_source_tree": "6d328cf55777a5fda0737f043e0f263208dfc3b4", + "visually_reviewed_files": [], + "workflow_run": 36827706986 +} diff --git a/docs/os/evidence/qualification-gate-a3572a9b.json b/docs/os/evidence/qualification-gate-a3572a9b.json new file mode 100644 index 00000000..4802e81c --- /dev/null +++ b/docs/os/evidence/qualification-gate-a3572a9b.json @@ -0,0 +1,137 @@ +{ + "actual_jobs": [ + { + "id": 110257015446, + "name": "changes", + "result": "success", + "status": "completed" + }, + { + "id": 110257061712, + "name": "phishell / build", + "result": "success", + "status": "completed" + }, + { + "id": 110257061718, + "name": "python-tests / test", + "result": "success", + "status": "completed" + }, + { + "id": 110257061774, + "name": "python-tests / ledger-reports", + "result": "success", + "status": "completed" + }, + { + "id": 110257061795, + "name": "python-tests / installed-artifact", + "result": "success", + "status": "completed" + }, + { + "id": 110257061949, + "name": "python-tests / memory-vector", + "result": "success", + "status": "completed" + }, + { + "id": 110257062077, + "name": "qa-image / live-image", + "result": "success", + "status": "completed" + }, + { + "id": 110257062078, + "name": "normal-image / fixture-free-candidate", + "result": "success", + "status": "completed" + }, + { + "id": 110261963874, + "name": "release-gate", + "result": "success", + "status": "completed" + } + ], + "actual_maintainer_signed_transition_qualified": false, + "artifact_metadata": [ + { + "digest": "sha256:53871f3c397d4b4110eaaeaf25dc6bf4a9414028a492ff217b6fab40dc56fa9d", + "expires_at": "2026-10-08T07:11:41Z", + "id": 11146755842, + "name": "phios-fixture-free-candidate-36827706986-attempt-1", + "size_in_bytes": 1806426957 + }, + { + "digest": "sha256:a2a97c8c0f7ac62cd27531ee6a3ce451e2f7c4eaf95c3e2cb6782b139b25a6f9", + "expires_at": "2026-10-08T07:12:29Z", + "id": 11146641362, + "name": "phios-fixture-free-evidence-36827706986-attempt-1", + "size_in_bytes": 7148074 + }, + { + "digest": "sha256:aa5f3bf02830121bfb913ff6545e73742d0c0d262075a52ec9e45491eb9d1ac0", + "expires_at": "2026-10-08T07:15:29Z", + "id": 11146486655, + "name": "phios-linux-evidence-36827706986-attempt-1", + "size_in_bytes": 4186916 + }, + { + "digest": "sha256:021549585dd32fd9f39ff36db1d907192946ea65829f7cbaa81344e19fe4aa81", + "expires_at": "2026-10-08T07:14:31Z", + "id": 11146401812, + "name": "phios-linux-development-36827706986-attempt-1", + "size_in_bytes": 1803559908 + } + ], + "hardware_qualified": false, + "license_source_compliance_reviewed": false, + "ordinary_ci_existing_skips": 6, + "ordinary_ci_passed": 2287, + "prior_failed_run": { + "aggregate_gate_held": true, + "failures": [ + "Signed pinned Arch package download timed out before a normal image existed.", + "Screenshot preservation imported PIL before the prerequisite package had been installed." + ], + "normal_job": 110250655210, + "passed_qa_did_not_qualify_normal_image": true, + "repair": "41f0c8b made artifact names attempt-specific, guarded screenshot conversion and emitted bounded exact-source review metadata; the later full run passed.", + "reviewed_branch_head": "57a55730b036a11d9e496701336999bf406bdaf5", + "workflow_run": 36825649652 + }, + "publication_authority": false, + "pull_request": 280, + "receipts": { + "integration-normal-a3572a9b.json": { + "evidence_archive_sha256": "a2a97c8c0f7ac62cd27531ee6a3ce451e2f7c4eaf95c3e2cb6782b139b25a6f9", + "evidence_artifact_id": 11146641362, + "iso_sha256": "8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d", + "sha256": "c84a9a6285c62c5b5c3836d8a7f427625e42df1dc485997c6a0147f05ae1a4d4" + }, + "integration-signed-a3572a9b.json": { + "evidence_archive_sha256": "aa5f3bf02830121bfb913ff6545e73742d0c0d262075a52ec9e45491eb9d1ac0", + "evidence_artifact_id": 11146486655, + "iso_sha256": "92ca600ef8e84616b425bec61586c3bc89df30c82490896e44b2d182ee2b3960", + "sha256": "0a0db16b67b783947e20e05df167adfa66cff0066a94afdc2d84e4a526e65ebe" + } + }, + "release_gate_job_id": 110261963874, + "release_ready": false, + "repository_protection_configured": false, + "required_jobs_skipped": false, + "required_scope": { + "normal_image": true, + "python": true, + "qa_image": true, + "ui": true + }, + "reviewed_branch_head": "41f0c8b2f7b268d046bfd8aa1bef8d24c712c9d1", + "run_attempt": 1, + "schema_version": "phios.ci-qualification-summary.v1", + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "tested_source_tree": "6d328cf55777a5fda0737f043e0f263208dfc3b4", + "workflow_run": 36827706986 +} diff --git a/docs/os/evidence/source-delivery-a3572a9b.json b/docs/os/evidence/source-delivery-a3572a9b.json new file mode 100644 index 00000000..c0c7d5bd --- /dev/null +++ b/docs/os/evidence/source-delivery-a3572a9b.json @@ -0,0 +1,62 @@ +{ + "candidate": { + "first_party_source_archive": { + "sha256": "090f6ee53f5db5dca1cbae17b80580de467b0daeec804082f4a629609bd736ec", + "size": 1758971 + }, + "iso": { + "filename": "phios-linux-0.1.0-alpha.1-x86_64.iso", + "sha256": "8199e2abad0e7699747876bd95e734e3168758b1bb59f20a232339eb61ef614d", + "size": 1802305536 + }, + "metadata": { + "SHA256SUMS": { + "sha256": "3d6a5739ef070a3d4cf7fe6258c420c0c6e7f7c4fa9d815e208379fab75e98d5", + "size": 1866 + }, + "provenance.json": { + "sha256": "1f53ef2a290479a390f21ee782c3c671dd03fa1a639ac4267a6bc21430db6c4a", + "size": 3582 + }, + "sbom.cdx.json": { + "sha256": "8d60bf9d1fe67b242b915ab4f1f358eed33fd3040f08bb77f86cb5a44d62ae25", + "size": 382659 + }, + "source-review.json": { + "sha256": "4334dc47c9907aa86b127d36b586d3db9c75dad72f5582318ab58c073f8b7d99", + "size": 223400 + }, + "third-party-notices.json": { + "sha256": "840a10e3dac4ffac473e0f68ba6d078c85ddf1e4120518fa598d1876fe3cc71f", + "size": 194883 + } + }, + "source_commit": "a3572a9bac7051b70af2ef66e75bc021f4214b31", + "source_date_epoch": 1790837928, + "supplier_notice_archive": { + "sha256": "608e76cc9b418e017dcba1d8fd3eb1a276ff2e5398ac3aafa5cff214af3d922d", + "size": 919270 + } + }, + "canonical_manifest_sha256": "2052e0fb717b978a3d5f62dbfd6b53c8db16c04998afa29e468c8e5872e6cda9", + "component_reviews_recorded": 0, + "components_total": 501, + "delivery_records_complete": false, + "evidence_artifact_id": 11146641362, + "iso_bytes_independently_verified": false, + "license_conclusions_automatically_selected": false, + "license_source_compliance_reviewed": false, + "manifest_initialized_from_exact_candidate": true, + "missing_candidate_archives": [ + "first_party_source_archive", + "supplier_notice_archive" + ], + "pending_component_count": 501, + "publication_authority": false, + "release_ready": false, + "review_declarations_authenticated": false, + "schema_version": "phios.source-delivery-check.v1", + "verified_material_bytes": 0, + "verified_material_files": 0, + "workflow_run": 36827706986 +} diff --git a/packaging/linux/source_delivery.py b/packaging/linux/source_delivery.py new file mode 100644 index 00000000..16488282 --- /dev/null +++ b/packaging/linux/source_delivery.py @@ -0,0 +1,346 @@ +"""Prepare and verify offline source delivery records; never authorize release.""" +from __future__ import annotations + +import argparse +import gzip +import hashlib +import json +import os +import re +import stat +import tarfile +import tempfile +from contextlib import contextmanager +from datetime import datetime +from pathlib import Path +from typing import Any, BinaryIO, Iterator + +JSON_LIMIT = 16 * 1024**2 +FILE_LIMIT = 8 * 1024**3 +TOTAL_LIMIT = 32 * 1024**3 +SHA256 = re.compile(r'[0-9a-f]{64}') +METADATA = ('provenance.json', 'sbom.cdx.json', 'source-review.json', 'third-party-notices.json') +KINDS = {'corresponding-source', 'build-material', 'notice'} +SCHEMA = 'phios.source-delivery-manifest.v1' + + +def relative_path(value: Any) -> str: + if (not isinstance(value, str) or len(value) > 512 or + not re.fullmatch(r'[A-Za-z0-9._+@=-]+(?:/[A-Za-z0-9._+@=-]+)*', value) or + any(p in ('.', '..') for p in value.split('/'))): + raise ValueError('safe relative file path required') + return value + + +@contextmanager +def regular(root: Path, relative: str, maximum: int) -> Iterator[BinaryIO]: + """Open beneath an explicit local root without following any child symlink.""" + parts = relative_path(relative).split('/') + directory = os.open(root, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW) + try: + for part in parts[:-1]: + child = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=directory) + os.close(directory) + directory = child + fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=directory) + try: + info = os.fstat(fd) + if not stat.S_ISREG(info.st_mode) or not 0 <= info.st_size <= maximum: + raise ValueError('bounded regular file required: ' + relative) + with os.fdopen(fd, 'rb', closefd=False) as stream: + yield stream + finally: + os.close(fd) + finally: + os.close(directory) + + +def read(root: Path, name: str) -> bytes: + with regular(root, name, JSON_LIMIT) as stream: + data = stream.read(JSON_LIMIT + 1) + if len(data) > JSON_LIMIT: + raise ValueError('metadata exceeds its bound') + return data + + +def unique(pairs: list[tuple[str, Any]]) -> dict[str, Any]: + result: dict[str, Any] = {} + for key, value in pairs: + if key in result: + raise ValueError('duplicate JSON key: ' + key) + result[key] = value + return result + + +def decode(data: bytes) -> Any: + def invalid(value: str) -> None: + raise ValueError('non-finite JSON value: ' + value) + return json.loads(data, object_pairs_hook=unique, parse_constant=invalid) + + +def wire(value: Any) -> bytes: + return (json.dumps(value, indent=2, sort_keys=True, allow_nan=False) + '\n').encode() + + +def record(value: Any) -> dict[str, Any]: + if (not isinstance(value, dict) or set(value) != {'sha256', 'size'} or + not isinstance(value['sha256'], str) or not SHA256.fullmatch(value['sha256']) or + type(value['size']) is not int or not 0 < value['size'] <= FILE_LIMIT): + raise ValueError('exact SHA-256 and positive bounded file size required') + return value + + +def hash_file(root: Path, name: str, destination: BinaryIO | None = None) -> dict[str, Any]: + hasher, size = hashlib.sha256(), 0 + with regular(root, name, FILE_LIMIT) as stream: + while data := stream.read(1024**2): + size += len(data) + if size > FILE_LIMIT: + raise ValueError('material exceeds its bound') + hasher.update(data) + if destination is not None: + destination.write(data) + return {'sha256': hasher.hexdigest(), 'size': size} + + +def candidate(root: Path) -> tuple[dict[str, Any], list[dict[str, Any]], dict[str, bytes]]: + payload = {name: read(root, name) for name in METADATA} + payload['SHA256SUMS'] = read(root, 'SHA256SUMS') + sums: dict[str, str] = {} + for line in payload['SHA256SUMS'].decode().splitlines(): + if not re.fullmatch(r'[0-9a-f]{64} [A-Za-z0-9._+@=-]+', line): + raise ValueError('invalid candidate checksum record') + digest, name = line.split(' ') + relative_path(name) + if name in sums: + raise ValueError('duplicate candidate checksum') + sums[name] = digest + for name in METADATA: + if sums.get(name) != hashlib.sha256(payload[name]).hexdigest(): + raise ValueError('candidate checksum mismatch: ' + name) + provenance = decode(payload['provenance.json']) + if (provenance.get('schema_version') != 'phios.os-build-provenance.v1' or + provenance.get('ci_fixture_build') is not False or + not isinstance(provenance.get('source_commit'), str) or + not re.fullmatch('[0-9a-f]{40}', provenance['source_commit']) or + type(provenance.get('source_date_epoch')) is not int or not 0 <= provenance['source_date_epoch'] < 2**32): + raise ValueError('exact normal candidate provenance required; QA images refused') + artifacts = provenance['artifacts'] + for name in METADATA[1:]: + if record(artifacts[name]) != {'sha256': hashlib.sha256(payload[name]).hexdigest(), 'size': len(payload[name])}: + raise ValueError('candidate metadata differs from provenance: ' + name) + iso = provenance['iso'] + relative_path(iso['filename']) + iso_record = record({k: iso[k] for k in ('sha256', 'size')}) + if record(artifacts[iso['filename']]) != iso_record or sums.get(iso['filename']) != iso_record['sha256']: + raise ValueError('ISO provenance/checksum identity mismatch') + source = record(artifacts['phios-source.tar.gz']) + notices = record(artifacts['third-party-notices.tar.gz']) + if any(sums.get(name) != artifacts[name]['sha256'] for name in ('phios-source.tar.gz', 'third-party-notices.tar.gz')): + raise ValueError('source/notice archive checksum identity mismatch') + review, bom = decode(payload['source-review.json']), decode(payload['sbom.cdx.json']) + if (review.get('schema_version') != 'phios.distribution-source-review.v1' or + review.get('source_commit') != provenance['source_commit'] or + review.get('first_party_source_archive') != source or + bom.get('bomFormat') != 'CycloneDX' or bom.get('specVersion') != '1.6'): + raise ValueError('source review differs from candidate identity') + properties = bom.get('metadata', {}).get('properties', []) + if [p.get('value') for p in properties if p.get('name') == 'phios:source-commit'] != [provenance['source_commit']]: + raise ValueError('SBOM source identity mismatch') + rows = review['required_review'] + components = bom['components'] + if not isinstance(rows, list) or not 1 <= len(rows) <= 20000 or not isinstance(components, list): + raise ValueError('bounded complete component inventory required') + indexed: dict[str, dict[str, Any]] = {} + for row in components: + ref = row['bom-ref'] + if not isinstance(ref, str) or not ref or ref in indexed: + raise ValueError('unique SBOM component identities required') + indexed[ref] = {'component': ref, 'name': row['name'], 'version': row['version'], 'declared_licenses': row.get('licenses', [])} + required = [{key: row[key] for key in ('component', 'name', 'version', 'declared_licenses')} for row in rows] + if len({row['component'] for row in required}) != len(required) or indexed != {row['component']: row for row in required}: + raise ValueError('source review does not cover exactly the SBOM components') + identity = {'source_commit': provenance['source_commit'], 'source_date_epoch': provenance['source_date_epoch'], + 'iso': iso, 'first_party_source_archive': source, 'supplier_notice_archive': notices, + 'metadata': {name: {'sha256': hashlib.sha256(data).hexdigest(), 'size': len(data)} for name, data in payload.items()}} + return identity, sorted(required, key=lambda row: row['component']), payload + + +def initialize(root: Path) -> dict[str, Any]: + identity, rows, _ = candidate(root) + return {'schema_version': SCHEMA, 'candidate': identity, 'materials': [], + 'components': [{**row, 'review': {'disposition': 'pending', 'reviewer': None, 'reviewed_at': None, + 'applicable_terms': None, 'rationale': None, 'source_paths': [], 'build_paths': [], 'notice_paths': []}} for row in rows], + 'release_ready': False, 'publication_authority': False, 'license_source_compliance_reviewed': False} + + +def text(value: Any, name: str) -> str: + if not isinstance(value, str) or not value.strip() or len(value) > 4096 or any(ord(c) < 32 for c in value): + raise ValueError('bounded review text required: ' + name) + return value + + +def verify(root: Path, manifest: dict[str, Any], materials_root: Path) -> dict[str, Any]: + expected = initialize(root) + if (set(manifest) != set(expected) or manifest['schema_version'] != SCHEMA or + manifest['candidate'] != expected['candidate'] or + any(manifest[k] is not False for k in ('release_ready', 'publication_authority', 'license_source_compliance_reviewed'))): + raise ValueError('manifest identity/scope differs from exact normal candidate') + materials: dict[str, dict[str, Any]] = {} + if not isinstance(manifest['materials'], list) or len(manifest['materials']) > 40000: + raise ValueError('bounded material catalog required') + total = 0 + for item in manifest['materials']: + if set(item) != {'path', 'kind', 'sha256', 'size', 'origin', 'custody'}: + raise ValueError('exact material record required') + name = relative_path(item['path']) + if name in materials or item['kind'] not in KINDS: + raise ValueError('duplicate material path or unsupported kind') + declared = record({k: item[k] for k in ('sha256', 'size')}) + total += declared['size'] + if total > TOTAL_LIMIT: + raise ValueError('total source material exceeds its bound') + for key in ('origin', 'custody'): + text(item[key], key) + if item['kind'] in ('corresponding-source', 'build-material') and ('.pkg.tar.' in name or name.endswith(('.iso', '.whl'))): + raise ValueError('binary package/image is not source or build material') + if hash_file(materials_root, name) != declared: + raise ValueError('delivered material hash/size mismatch: ' + name) + materials[name] = item + wanted = {row['component']: row for row in expected['components']} + rows = manifest['components'] + if not isinstance(rows, list) or len(rows) != len(wanted): + raise ValueError('complete component review coverage required') + seen: set[str] = set() + pending: list[str] = [] + references: set[str] = set() + for row in rows: + ref = row['component'] + if ref in seen or ref not in wanted or set(row) != set(wanted[ref]) or any(row[k] != wanted[ref][k] for k in row if k != 'review'): + raise ValueError('duplicate, missing or mismatched component review') + seen.add(ref) + review = row['review'] + if not isinstance(review, dict) or set(review) != set(wanted[ref]['review']): + raise ValueError('exact component review record required') + disposition = review['disposition'] + if disposition not in ('pending', 'source-required', 'no-source-required'): + raise ValueError('explicit source disposition required') + for key, kind in [('source_paths', 'corresponding-source'), ('build_paths', 'build-material'), ('notice_paths', 'notice')]: + paths = review[key] + if not isinstance(paths, list) or len(paths) > 256 or len(set(paths)) != len(paths): + raise ValueError('bounded unique material references required') + for name in paths: + relative_path(name) + if name not in materials or materials[name]['kind'] != kind: + raise ValueError('missing material or incorrect material kind') + references.add(name) + if disposition == 'pending': + pending.append(ref) + continue + for key in ('reviewer', 'reviewed_at', 'applicable_terms', 'rationale'): + text(review[key], key) + stamp = datetime.fromisoformat(review['reviewed_at'].replace('Z', '+00:00')) + if stamp.utcoffset() is None: + raise ValueError('review timestamp requires an explicit timezone') + if disposition == 'source-required' and (not review['source_paths'] or not review['build_paths']): + raise ValueError('required corresponding source and build/patch material missing') + absent_archives = [] + for key, kind in [('first_party_source_archive', 'corresponding-source'), ('supplier_notice_archive', 'notice')]: + bound = expected['candidate'][key] + matches = [name for name, item in materials.items() if item['kind'] == kind and + {k: item[k] for k in ('sha256', 'size')} == bound] + if not matches: + absent_archives.append(key) + references.update(matches) + if set(materials) - references: + raise ValueError('unreferenced material is not part of this delivery packet') + return {'schema_version': 'phios.source-delivery-check.v1', 'candidate': expected['candidate'], + 'canonical_manifest_sha256': hashlib.sha256(wire(manifest)).hexdigest(), + 'components_total': len(wanted), 'component_reviews_recorded': len(wanted) - len(pending), + 'pending_components': sorted(pending), 'missing_candidate_archives': absent_archives, + 'verified_material_files': len(materials), 'verified_material_bytes': total, + 'delivery_records_complete': not pending and not absent_archives, + 'review_declarations_authenticated': False, 'license_source_compliance_reviewed': False, + 'iso_bytes_independently_verified': False, 'release_ready': False, 'publication_authority': False} + + +def bundle(root: Path, manifest: dict[str, Any], materials_root: Path, output: Path) -> dict[str, Any]: + report = verify(root, manifest, materials_root) + if not report['delivery_records_complete']: + raise ValueError('source delivery remains incomplete; bundle held') + identity, _, candidate_files = candidate(root) + if identity != report['candidate']: + raise ValueError('candidate changed while sealing delivery packet') + # Seal bytes while rechecking every material. No input archive is extracted. + with tempfile.TemporaryDirectory(prefix='phios-source-delivery-', dir=output.parent) as directory: + stage = Path(directory) + files = {**{'candidate/' + k: v for k, v in candidate_files.items()}, + 'source-delivery-manifest.json': wire(manifest), 'source-delivery-check.json': wire(report)} + for name, data in files.items(): + target = stage / name + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(data) + for item in manifest['materials']: + target = stage / 'materials' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + with target.open('xb') as stream: + observed = hash_file(materials_root, item['path'], stream) + if observed != {k: item[k] for k in ('sha256', 'size')}: + raise ValueError('material changed while sealing delivery packet') + paths = sorted(path for path in stage.rglob('*') if path.is_file()) + (stage / 'SHA256SUMS').write_text(''.join(hash_file(stage, p.relative_to(stage).as_posix())['sha256'] + + ' ' + p.relative_to(stage).as_posix() + '\n' for p in paths)) + paths.append(stage / 'SHA256SUMS') + epoch = report['candidate']['source_date_epoch'] + with output.open('xb') as raw: + try: + with gzip.GzipFile(fileobj=raw, mode='wb', mtime=epoch, filename='') as compressed: + with tarfile.open(fileobj=compressed, mode='w|', format=tarfile.PAX_FORMAT) as archive: + for path in sorted(paths): + info = tarfile.TarInfo(path.relative_to(stage).as_posix()) + info.size, info.mode, info.mtime = path.stat().st_size, 0o644, epoch + with path.open('rb') as stream: + archive.addfile(info, stream) + except BaseException: + output.unlink() + raise + return {'schema_version': 'phios.source-delivery-bundle.v1', 'archive': hash_file(output.parent, output.name), + 'candidate': report['candidate'], 'delivery_records_complete': True, + 'review_declarations_authenticated': False, 'iso_bytes_independently_verified': False, + 'license_source_compliance_reviewed': False, 'release_ready': False, 'publication_authority': False} + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('command', choices=('init', 'check', 'bundle')) + parser.add_argument('--candidate', type=Path, required=True) + parser.add_argument('--manifest', type=Path) + parser.add_argument('--materials', type=Path) + parser.add_argument('--output', type=Path) + args = parser.parse_args() + try: + if args.command == 'init': + if args.output is None: + raise ValueError('init requires --output') + data = wire(initialize(args.candidate)) + with args.output.open('xb') as stream: + stream.write(data) + print(json.dumps({'manifest_written': str(args.output), 'release_ready': False})) + return 0 + if args.manifest is None or args.materials is None: + raise ValueError('check/bundle requires --manifest and --materials') + manifest = decode(read(args.manifest.parent, args.manifest.name)) + if args.command == 'bundle': + if args.output is None: + raise ValueError('bundle requires --output') + result = bundle(args.candidate, manifest, args.materials, args.output) + else: + result = verify(args.candidate, manifest, args.materials) + print(wire(result).decode(), end='') + return 0 if result['delivery_records_complete'] else 2 + except (OSError, ValueError, TypeError, KeyError, AttributeError) as exc: + parser.exit(1, 'Source delivery held: ' + str(exc) + '\n') + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/tests/test_os_source_delivery_v01.py b/tests/test_os_source_delivery_v01.py new file mode 100644 index 00000000..49a95342 --- /dev/null +++ b/tests/test_os_source_delivery_v01.py @@ -0,0 +1,287 @@ +from __future__ import annotations + +import hashlib +import importlib.util +import json +import subprocess +import sys +import tarfile +from pathlib import Path + +import pytest + +from test_os_release_inventory_v01 import fixture, inventory + +FILE = Path(__file__).resolve().parents[1] / 'packaging/linux/source_delivery.py' +spec = importlib.util.spec_from_file_location('phios_source_delivery', FILE) +assert spec is not None and spec.loader is not None +delivery = importlib.util.module_from_spec(spec) +spec.loader.exec_module(delivery) + + +def candidate(tmp: Path) -> Path: + root, output = tmp / 'image', tmp / 'candidate' + fixture(root, output) + inventory.record(root, output, 'a' * 40, ci_fixtures=False, epoch=1) + return output + + +def complete(output: Path, materials: Path) -> dict: + manifest = delivery.initialize(output) + materials.mkdir() + payloads = [('first-party.tar.gz', 'corresponding-source', (output / 'phios-source.tar.gz').read_bytes()), + ('supplier-notices.tar.gz', 'notice', (output / 'third-party-notices.tar.gz').read_bytes()), + ('build/README.txt', 'build-material', b'Disposable test source and build/patch instructions.\n')] + for name, kind, data in payloads: + path = materials / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(data) + manifest['materials'].append({'path': name, 'kind': kind, 'sha256': hashlib.sha256(data).hexdigest(), + 'size': len(data), 'origin': 'Disposable local fixture; no upstream claim', 'custody': 'Created by this test'}) + for row in manifest['components']: + row['review'] = {'disposition': 'source-required', 'reviewer': 'Fixture reviewer; not authenticated', + 'reviewed_at': '2026-10-01T00:00:00Z', 'applicable_terms': 'Disposable test declaration', + 'rationale': 'Tests record a human declaration, never infer compliance from it', + 'source_paths': ['first-party.tar.gz'], 'build_paths': ['build/README.txt'], + 'notice_paths': ['supplier-notices.tar.gz']} + return manifest + + +def rebind(output: Path, name: str, value: dict) -> None: + path = output / name + path.write_bytes(delivery.wire(value)) + if name != 'provenance.json': + provenance = json.loads((output / 'provenance.json').read_text()) + provenance['artifacts'][name] = {'sha256': hashlib.sha256(path.read_bytes()).hexdigest(), 'size': path.stat().st_size} + (output / 'provenance.json').write_bytes(delivery.wire(provenance)) + lines = (output / 'SHA256SUMS').read_text().splitlines() + for i, line in enumerate(lines): + digest, filename = line.split(' ') + if filename in (name, 'provenance.json'): + digest = hashlib.sha256((output / filename).read_bytes()).hexdigest() + lines[i] = digest + ' ' + filename + (output / 'SHA256SUMS').write_text('\n'.join(lines) + '\n') + + +def test_pending_inventory_is_complete_but_cannot_be_bundled(tmp_path: Path) -> None: + output = candidate(tmp_path) + manifest = delivery.initialize(output) + assert len(manifest['components']) == 5 + report = delivery.verify(output, manifest, tmp_path) + assert report['delivery_records_complete'] is False + assert report['components_total'] == len(report['pending_components']) == 5 + assert report['missing_candidate_archives'] == ['first_party_source_archive', 'supplier_notice_archive'] + archive = tmp_path / 'held.tar.gz' + with pytest.raises(ValueError, match='incomplete'): + delivery.bundle(output, manifest, tmp_path, archive) + assert not archive.exists() + + +def test_actual_material_bytes_pack_with_every_origin_and_no_release_claim(tmp_path: Path) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + archive = tmp_path / 'delivery.tar.gz' + receipt = delivery.bundle(output, manifest, materials, archive) + assert receipt['delivery_records_complete'] is True + for flag in ('release_ready', 'publication_authority', 'license_source_compliance_reviewed'): + assert receipt[flag] is False + with tarfile.open(archive, 'r:gz') as packet: + names = packet.getnames() + assert all(item.isfile() and item.uid == item.gid == 0 and item.mtime == 1 for item in packet.getmembers()) + assert len(names) == len(set(names)) + sums = packet.extractfile('SHA256SUMS').read().decode().splitlines() + for line in sums: + digest, name = line.split(' ') + assert hashlib.sha256(packet.extractfile(name).read()).hexdigest() == digest + report = json.load(packet.extractfile('source-delivery-check.json')) + assert report['component_reviews_recorded'] == 5 + assert report['review_declarations_authenticated'] is False + assert report['iso_bytes_independently_verified'] is False + assert report['license_source_compliance_reviewed'] is False + second = tmp_path / 'same.tar.gz' + delivery.bundle(output, manifest, materials, second) + assert second.read_bytes() == archive.read_bytes() + with pytest.raises(FileExistsError): + delivery.bundle(output, manifest, materials, archive) + + +@pytest.mark.parametrize('case', ['source', 'iso', 'provenance', 'component-omit', 'component-duplicate', + 'component-version', 'component-license', 'material-tamper', 'material-size', 'material-kind', + 'path-escape', 'material-duplicate', 'missing-build', 'missing-source', 'reviewer', 'rationale', + 'timezone', 'release-ready', 'publication', 'compliance', 'unreferenced', 'missing-reference']) +def test_mismatched_or_unsafe_delivery_is_held(tmp_path: Path, case: str) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + row, item = manifest['components'][0], manifest['materials'][0] + if case == 'source': + manifest['candidate']['source_commit'] = 'b' * 40 + elif case == 'iso': + manifest['candidate']['iso']['sha256'] = 'b' * 64 + elif case == 'provenance': + manifest['candidate']['metadata']['provenance.json']['sha256'] = 'b' * 64 + elif case == 'component-omit': + manifest['components'].pop() + elif case == 'component-duplicate': + manifest['components'][-1] = row + elif case == 'component-version': + row['version'] = 'wrong' + elif case == 'component-license': + row['declared_licenses'] = [] + elif case == 'material-tamper': + (materials / item['path']).write_bytes(b'tampered') + elif case == 'material-size': + item['size'] = True + elif case == 'material-kind': + item['kind'] = 'notice' + elif case == 'path-escape': + item['path'] = '../first-party.tar.gz' + elif case == 'material-duplicate': + manifest['materials'].append(item) + elif case == 'missing-build': + row['review']['build_paths'] = [] + elif case == 'missing-source': + row['review']['source_paths'] = [] + elif case in ('reviewer', 'rationale'): + row['review'][case] = ' ' + elif case == 'timezone': + row['review']['reviewed_at'] = '2026-10-01T00:00:00' + elif case == 'release-ready': + manifest['release_ready'] = True + elif case == 'publication': + manifest['publication_authority'] = True + elif case == 'compliance': + manifest['license_source_compliance_reviewed'] = True + elif case == 'unreferenced': + extra = dict(item, path='unreferenced.tar.gz') + extra['sha256'] = hashlib.sha256(b'unrelated').hexdigest() + extra['size'] = len(b'unrelated') + (materials / extra['path']).write_bytes(b'unrelated') + manifest['materials'].append(extra) + else: + row['review']['source_paths'] = ['unknown.tar.gz'] + with pytest.raises((ValueError, OSError)): + delivery.verify(output, manifest, materials) + + +@pytest.mark.parametrize('case', ['file', 'directory', 'fifo']) +def test_material_links_and_special_files_cannot_import_host_data(tmp_path: Path, case: str) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + if case == 'directory': + (materials / 'build/README.txt').unlink() + (materials / 'build').rmdir() + (materials / 'build').symlink_to(output, target_is_directory=True) + else: + path = materials / 'first-party.tar.gz' + path.unlink() + if case == 'file': + path.symlink_to(output / 'phios-source.tar.gz') + else: + import os + os.mkfifo(path) + with pytest.raises((ValueError, OSError)): + delivery.verify(output, manifest, materials) + + +@pytest.mark.parametrize('case', ['checksum', 'qa', 'coverage', 'sbom-source', 'duplicates']) +def test_candidate_metadata_cannot_be_silently_rebound(tmp_path: Path, case: str) -> None: + output = candidate(tmp_path) + if case == 'checksum': + (output / 'sbom.cdx.json').write_text('{}') + elif case == 'qa': + data = json.loads((output / 'provenance.json').read_text()) + data['ci_fixture_build'] = True + rebind(output, 'provenance.json', data) + elif case == 'coverage': + data = json.loads((output / 'source-review.json').read_text()) + data['required_review'].pop() + rebind(output, 'source-review.json', data) + elif case == 'sbom-source': + data = json.loads((output / 'sbom.cdx.json').read_text()) + data['metadata']['properties'][0]['value'] = 'b' * 40 + rebind(output, 'sbom.cdx.json', data) + else: + path = output / 'source-review.json' + path.write_text('{"schema_version":"old","schema_version":"new"}') + with pytest.raises(ValueError): + delivery.initialize(output) + + +def test_binary_arch_package_cannot_satisfy_a_source_record(tmp_path: Path) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + old = manifest['materials'][0]['path'] + new = 'arch-binary.pkg.tar.zst' + (materials / old).rename(materials / new) + manifest['materials'][0]['path'] = new + for row in manifest['components']: + row['review']['source_paths'] = [new] + with pytest.raises(ValueError, match='binary package'): + delivery.verify(output, manifest, materials) + + +def test_changed_bytes_during_sealing_do_not_leave_a_packet(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + original = delivery.hash_file + def changed(root: Path, name: str, destination=None): + if destination is not None: + (materials / name).write_bytes(b'changed between verification and sealing') + return original(root, name, destination) + monkeypatch.setattr(delivery, 'hash_file', changed) + archive = tmp_path / 'held.tar.gz' + with pytest.raises(ValueError, match='changed while sealing'): + delivery.bundle(output, manifest, materials, archive) + assert not archive.exists() + + +def test_candidate_change_after_check_cannot_seal_unmatched_metadata(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + original = delivery.verify + def changed(*args): + report = original(*args) + provenance = json.loads((output / 'provenance.json').read_text()) + provenance['source_date_epoch'] += 1 + rebind(output, 'provenance.json', provenance) + return report + monkeypatch.setattr(delivery, 'verify', changed) + archive = tmp_path / 'held.tar.gz' + with pytest.raises(ValueError, match='candidate changed'): + delivery.bundle(output, manifest, materials, archive) + assert not archive.exists() + + +def test_explicit_no_source_requirement_is_a_recorded_unauthenticated_assertion(tmp_path: Path) -> None: + output = candidate(tmp_path) + materials = tmp_path / 'materials' + manifest = complete(output, materials) + row = manifest['components'][0]['review'] + row['disposition'], row['source_paths'], row['build_paths'] = 'no-source-required', [], [] + report = delivery.verify(output, manifest, materials) + assert report['delivery_records_complete'] is True + assert report['review_declarations_authenticated'] is False + assert report['license_source_compliance_reviewed'] is False + + +def test_cli_distinguishes_pending_from_invalid_and_never_overwrites(tmp_path: Path) -> None: + output = candidate(tmp_path) + manifest_path = tmp_path / 'manifest.json' + run = subprocess.run([sys.executable, str(FILE), 'init', '--candidate', str(output), '--output', str(manifest_path)], capture_output=True, text=True) + assert run.returncode == 0 + command = [sys.executable, str(FILE), 'check', '--candidate', str(output), '--manifest', str(manifest_path), '--materials', str(tmp_path)] + pending = subprocess.run(command, capture_output=True, text=True) + assert pending.returncode == 2 and json.loads(pending.stdout)['delivery_records_complete'] is False + data = json.loads(manifest_path.read_text()) + data['candidate']['source_commit'] = 'b' * 40 + manifest_path.write_text(json.dumps(data)) + assert subprocess.run(command, capture_output=True).returncode == 1 + before = manifest_path.read_bytes() + assert subprocess.run(run.args, capture_output=True).returncode == 1 + assert manifest_path.read_bytes() == before