From 0c92d0e45681721143d2e1101e2bdb4643dd56de Mon Sep 17 00:00:00 2001 From: EHotwagner Date: Mon, 5 Oct 2026 09:08:42 +0200 Subject: [PATCH] Bind external inventory without mutating accepted seed data --- docs/roadmaps/barc-01-useful-play.md | 29 ++++++ .../helper/settings_custody.py | 43 ++++++++- .../helper/test_settings_custody.py | 95 +++++++++++++++++++ .../run-source-controls.py | 2 +- 4 files changed, 163 insertions(+), 6 deletions(-) diff --git a/docs/roadmaps/barc-01-useful-play.md b/docs/roadmaps/barc-01-useful-play.md index af7fdc9..89fbb2b 100644 --- a/docs/roadmaps/barc-01-useful-play.md +++ b/docs/roadmaps/barc-01-useful-play.md @@ -623,3 +623,32 @@ generation changes immediately and retains both the original unresolved generation and later hard-failure evidence. Its separately reviewed seal and exact admission remain prerequisites for another copy. This source correction grants no runtime authority; native useful play remains 0/6. + +### External inventory for the accepted seed data (2026-10-05) + +The separately admitted fifth data copy completed all 17,756 files and +2,111,386,119 bytes with natural exit zero and clean retirement. Its original +receipt contains the complete physical data pins, but it did not produce +`packet-inventory.json`. The accepted data and all consumed failures remain +unchanged. + +The seed settings helper now accepts an optional explicit `packetInventory` +physical pin for a separately attributed external projection. Its digest must +equal `packetSha256`, and its declared root must equal the existing packet root. +The bounded read checks the original, opened, completed and current file +identities, private directory custody and physical root stability. External +mode requires the accepted packet root to retain its immutable mode `0500`; +legacy mode keeps its original private root mode `0700`. External +mode checks every packet file; an unlisted `packet-inventory.json` is refused. +The existing in-packet inventory route keeps its original behavior. + +All 143 portable controls passed, including replacement during open/read, +parent or packet-root replacement, hash and root drift, aliases, missing +external input, complete post-use data preservation and legacy settings copy. +The source-only projection derives from the accepted copy pins; it is not an +output of that original copy operation. Root must separately pin its authority +and refresh the policy helper manifest after protected source delivery. + +Actual native map/game checksums, loaded configuration/VFS/AI custody and seed +attribution still require distinct exact admission. Native useful play remains +0/6. diff --git a/tests/Broker.NativeProof/RuntimeEvidence/fixtures/seed-attribution-helper/helper/settings_custody.py b/tests/Broker.NativeProof/RuntimeEvidence/fixtures/seed-attribution-helper/helper/settings_custody.py index e240e1c..d2f2bb8 100644 --- a/tests/Broker.NativeProof/RuntimeEvidence/fixtures/seed-attribution-helper/helper/settings_custody.py +++ b/tests/Broker.NativeProof/RuntimeEvidence/fixtures/seed-attribution-helper/helper/settings_custody.py @@ -1,14 +1,47 @@ """Root-selected immutable settings seed and attempt-scoped engine output.""" -import hashlib,os,stat +import hashlib,json,os,stat from pathlib import Path -from private_io import Refused,atomic_bytes_new,atomic_new,canonical,components,hash_artifact,need,read_bytes,read_json +from private_io import SHA,Refused,atomic_bytes_new,atomic_new,canonical,components,hash_artifact,need,read_bytes,read_json MAX_SETTINGS=65536 MAX_INVENTORY=16*1024*1024 MAX_FILES=65536 +def external_inventory(config,root,root_before): + pin=config['packetInventory'];fields={'path','sha256','bytes','device','inode','uid','mode','nlink'} + need(type(pin)is dict and set(pin)==fields,'closed external inventory pin') + need(type(pin['sha256'])is str and SHA.fullmatch(pin['sha256']) and pin['sha256']==config['packetSha256'],'external inventory digest join') + need(all(type(pin[k])is int for k in fields-{'path','sha256'}),'external inventory physical pin types') + path=components(pin['path']);need(not path.is_relative_to(root),'external inventory outside packet root') + anchor=path.parent.lstat();before=path.lstat() + need(stat.S_ISDIR(anchor.st_mode) and anchor.st_uid==os.geteuid() and stat.S_IMODE(anchor.st_mode)==0o700,'private external inventory anchor') + need(stat.S_ISREG(before.st_mode) and before.st_uid==os.geteuid() and stat.S_IMODE(before.st_mode)in(0o400,0o600) and before.st_nlink==1 and 0