docs: publish saved-view group selection verification and native evidence

This commit is contained in:
2026-09-23 02:19:57 -07:00
parent f6a6010bae
commit 7e348d967d
44 changed files with 4666 additions and 0 deletions
@@ -0,0 +1,2 @@
# Preserve pinned historical receipts and helper bytes through Git round trips.
* -text whitespace=cr-at-eol
@@ -0,0 +1,52 @@
# Captured inputs and committed source identity
This directory preserves exact historical `committed-desktop-4.json` and
`committed-desktop-5.json` receipts plus `verify-committed-inputs.py` as data.
The original helper contains its historical absolute checkout path; do not run
it for portable verification. The receipts do not themselves pin that helper;
`files.json` pins the copies distributed here and the new verifier/README.
The local `.gitattributes` preserves those pinned bytes through Git round trips;
retain it with this directory rather than normalizing the historical text.
With Python 3.10+, Git, a repository containing both commits, and the completed
sibling checks package, run:
```text
python -B SOURCE_DIRECTORY/verify.py --repo REPOSITORY --checks CHECKS_PACKAGE_DIRECTORY
```
Before that package exists, an explicitly optional raw-input mode is available:
```text
python -B harness/experiments/multiselect-20260923/source/verify.py --repo . --raw-gates .local/group-movement-gates
```
The verifier checks source-evidence pins, captured map byte hashes, recorded gate
success/unchanged flags, counts and 71 vendored iced_widget inputs. It compares the
complete relevant Git tree inventory and every blob's size/SHA-256 at these
commits with their corresponding captured input maps:
- `desktop-4`: `12a7352ddef5f69a144ead8219a50916233d63a9`
- `desktop-5`: `f6a6010baed9e6164a1fcc7ecd58256a562827d7`
The scope matches the historical helper: Cargo manifests/lock/toolchain file,
`crates/`, `build/`, `.cargo/`, `scripts/`, `docs/`, `examples/`,
`harness/fixtures/`, and `harness/prototypes/`. This is the complete inventory
within that scope, not a whole-repository identity claim. Worktree contents,
current HEAD, line-ending checkout conversion and original machine paths do not
participate. Git objects are read by object ID; no checkout, build or archived
helper runs. Both commits must already be available; lazy object fetching is
disabled for these reads.
In package mode, outer checks-package pins and selected member/run relationships
are also checked. Run the checks package's own verifier for its full source ZIP,
logs, helpers and all other gate relationships. Raw mode reads the named local
maps/receipts directly and is not a substitute for packaged-evidence verification.
No source maps or ZIPs are duplicated in this directory.
Historical receipts report an earlier comparison. A successful run of this new
verifier performs a fresh Git-object comparison against the pinned maps. A gate's
recorded HEAD can predate its later source-identical commit; that difference is
why blob comparison is necessary. This evidence identifies tested source bytes;
it does not rerun tests or establish native usability, release integration or
full #29 acceptance.
@@ -0,0 +1,11 @@
{
"checked": "2026-09-23T08:11:54.115058+00:00",
"commit": "12a7352ddef5f69a144ead8219a50916233d63a9",
"gate": "desktop-4",
"inputCount": 729,
"inputMap": {
"bytes": 121985,
"sha256": "55a5f354bb5049a8c77ba9bafa833438ebf754649b0cf5d175d0c8dcfcedd7bb"
},
"comparison": "Exact committed Git blobs equal every captured input; same complete filtered inventory"
}
@@ -0,0 +1,11 @@
{
"checked": "2026-09-23T08:53:15.452246+00:00",
"commit": "f6a6010baed9e6164a1fcc7ecd58256a562827d7",
"gate": "desktop-5",
"inputCount": 729,
"inputMap": {
"bytes": 121985,
"sha256": "99dc46645236e674244e7c4867595a6000d3d85b54bcc9ab2b0c601923ecf66c"
},
"comparison": "Exact committed Git blobs equal every captured input; same complete filtered inventory"
}
@@ -0,0 +1,26 @@
{
".gitattributes": {
"bytes": 109,
"sha256": "aca8eef17dbab8cfedcbe18e1175cfee115802376fac4ec69e8c3320a6399d6c"
},
"README.md": {
"bytes": 2792,
"sha256": "b8db0c2c71e491b6179b3e57d27e5dfb23c9283894219feea328bc632603f2aa"
},
"verify.py": {
"bytes": 7255,
"sha256": "2ed667c127470efb669fb43d5dcdb288f891e42e10e67ef98ca4cd1125df09d1"
},
"verify-committed-inputs.py": {
"bytes": 2138,
"sha256": "ac2b50a73f678456b9628684347484c013f5f9c78f054de72b74f56a34c990d5"
},
"committed-desktop-4.json": {
"bytes": 390,
"sha256": "47c6774bcb7d0c37c50e0ed50f8fb58ee9b55c6fcee30af488481c314a4e66e8"
},
"committed-desktop-5.json": {
"bytes": 390,
"sha256": "da1f08e06bd0af6512da4196618b71d0c4ecc090012f061bb82b6a36f5b7686c"
}
}
@@ -0,0 +1,36 @@
"""Check the tested source inventory against exact Git blobs, not HEAD alone."""
from pathlib import Path
import datetime, hashlib, json, subprocess, sys
root=Path('C:/ar-multiselect-9e8r6t')
run,=sys.argv[1:]
gate=root/'.local/group-movement-gates'/run
inputs=json.loads((gate/'inputs.json').read_bytes())
result=json.loads((gate/'result.json').read_bytes())
assert result['exitCode']==0 and result['inputsUnchanged']
head=subprocess.check_output(['git','rev-parse','HEAD'],cwd=root,text=True).strip()
def relevant(p):
return p in ('Cargo.toml','Cargo.lock','rust-toolchain.toml') or p.startswith(('crates/','build/','.cargo/','scripts/','docs/','examples/','harness/fixtures/','harness/prototypes/'))
paths=subprocess.check_output(['git','ls-tree','-r','--name-only','-z',head],cwd=root).decode().split('\0')
assert set(inputs)=={p for p in paths if p and relevant(p)}, 'Committed input inventory differs'
assert all('\n' not in p for p in inputs)
request=''.join(head+':'+p+'\n' for p in inputs).encode()
raw=subprocess.run(['git','cat-file','--batch'],cwd=root,input=request,capture_output=True,check=True).stdout
offset=0
actual={}
for path in inputs:
end=raw.index(b'\n',offset)
oid,kind,size=raw[offset:end].split()
assert kind==b'blob'
size=int(size)
data=raw[end+1:end+1+size]
assert len(data)==size and raw[end+1+size:end+2+size]==b'\n'
actual[path]={'bytes':size,'sha256':hashlib.sha256(data).hexdigest()}
offset=end+2+size
assert offset==len(raw)
changed=[p for p in inputs if inputs[p]!=actual[p]]
assert not changed, 'Tested bytes differ from committed blobs: '+repr(changed)
data=(gate/'inputs.json').read_bytes()
report={'checked':datetime.datetime.now(datetime.timezone.utc).isoformat(),'commit':head,'gate':run,'inputCount':len(inputs),'inputMap':{'bytes':len(data),'sha256':hashlib.sha256(data).hexdigest()},'comparison':'Exact committed Git blobs equal every captured input; same complete filtered inventory'}
out=root/'.local/group-movement-gates'/('committed-'+run+'.json')
with out.open('x',encoding='utf-8') as f: json.dump(report,f,indent=2)
print(json.dumps(report,indent=2))
@@ -0,0 +1,149 @@
"""Compare captured input maps to exact named Git trees; no builds or checkouts."""
from pathlib import Path, PurePosixPath
import argparse
import hashlib
import json
import os
import subprocess
import zipfile
HERE = Path(__file__).resolve().parent
COMMITS = {"desktop-4": "12a7352ddef5f69a144ead8219a50916233d63a9",
"desktop-5": "f6a6010baed9e6164a1fcc7ecd58256a562827d7"}
COMPARISON = "Exact committed Git blobs equal every captured input; same complete filtered inventory"
FILES = {".gitattributes", "verify.py", "README.md", "verify-committed-inputs.py",
"committed-desktop-4.json", "committed-desktop-5.json"}
def need(ok, message):
if not ok:
raise ValueError(message)
def pin(data):
return {"bytes": len(data), "sha256": hashlib.sha256(data).hexdigest()}
def parsed(data):
def unique(items):
result = {}
for key, value in items:
need(key not in result, "duplicate JSON key: " + key)
result[key] = value
return result
return json.loads(data, object_pairs_hook=unique)
def safe(name):
return (isinstance(name, str) and bool(name) and "\\" not in name and ":" not in name
and not PurePosixPath(name).is_absolute()
and all(part not in ("", ".", "..") for part in name.split("/")))
def relevant(path):
return path in ("Cargo.toml", "Cargo.lock", "rust-toolchain.toml") or path.startswith(
("crates/", "build/", ".cargo/", "scripts/", "docs/", "examples/", "harness/fixtures/", "harness/prototypes/"))
def git(repo, *arguments, data=None):
environment = dict(os.environ, GIT_NO_LAZY_FETCH="1")
return subprocess.run(["git", *arguments], cwd=repo, input=data, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, check=True, env=environment).stdout
def compare_commit(repo, commit, inputs):
need(git(repo, "rev-parse", "--verify", commit + "^{commit}").decode().strip() == commit, "named commit unavailable")
entries = git(repo, "ls-tree", "-r", "--full-tree", "-z", commit).split(b"\0")
blobs = {}
for entry in filter(None, entries):
header, path_bytes = entry.split(b"\t", 1)
path = path_bytes.decode("utf-8")
if relevant(path):
_mode, kind, oid = header.split()
need(kind == b"blob", "relevant non-blob tree entry: " + path)
need(path not in blobs, "duplicate tree path")
blobs[path] = oid
need(set(blobs) == set(inputs), "complete filtered Git inventory differs; missing="
+ repr(sorted(set(inputs) - set(blobs))) + "; additional=" + repr(sorted(set(blobs) - set(inputs))))
# Object IDs avoid path quoting and commit:path interpretation in batch input.
paths = sorted(blobs)
data = git(repo, "cat-file", "--batch", data=b"".join(blobs[path] + b"\n" for path in paths))
offset, actual = 0, {}
for path in paths:
end = data.index(b"\n", offset)
oid, kind, size_bytes = data[offset:end].split()
size = int(size_bytes)
need(oid == blobs[path] and kind == b"blob" and size >= 0, "Git batch object relationship")
content = data[end + 1:end + 1 + size]
need(len(content) == size and data[end + 1 + size:end + 2 + size] == b"\n", "Git batch framing")
actual[path] = pin(content)
offset = end + 2 + size
need(offset == len(data), "trailing Git batch bytes")
different = [path for path in paths if actual[path] != inputs[path]]
need(not different, "captured bytes differ from named commit: " + repr(different))
def packaged(checks, runs):
files = parsed((checks / "files.json").read_bytes())
need(set(files) == {"prepare.py", "verify.py", "README.md", "manifest.json", "evidence.zip"}, "checks outer inventory")
for name, expected in files.items():
need(pin((checks / name).read_bytes()) == expected, "checks outer pin: " + name)
manifest = parsed((checks / "manifest.json").read_bytes())
need(manifest["schema"] == 1 and manifest["kind"] == "multiselect-cargo-gates", "checks manifest kind")
captured = {}
with zipfile.ZipFile(checks / "evidence.zip") as archive:
names = archive.namelist()
need(len(names) == len(set(names)) and set(names) == set(manifest["members"])
and all(safe(name) for name in names), "checks exact safe members")
def raw(logical):
member = manifest["logicalFiles"][logical]
data = archive.read(member)
need(pin(data) == manifest["members"][member], "checks member pin: " + logical)
return data
for run in runs:
prefix = "cargo/" + run + "/"
result = parsed(raw(prefix + "result.json"))
spec = manifest["runs"][run]
need(all(result[key] == spec[key] for key in ("command", "head", "exitCode", "inputCount")), run + ": checks run relationships")
captured[run] = (raw(prefix + "inputs.json"), result)
return captured
def verify(repo, captured):
outer = parsed((HERE / "files.json").read_bytes())
need(set(outer) == FILES, "source evidence file inventory")
for name, expected in outer.items():
need(pin((HERE / name).read_bytes()) == expected, "source evidence pin: " + name)
for run, commit in COMMITS.items():
receipt = parsed((HERE / ("committed-" + run + ".json")).read_bytes())
need(receipt["gate"] == run and receipt["commit"] == commit
and receipt["comparison"] == COMPARISON, run + ": historical identity relationship")
map_bytes, result = captured[run]
inputs = parsed(map_bytes)
need(pin(map_bytes) == receipt["inputMap"] == result["inputs"], run + ": exact captured input map")
need(result["exitCode"] == 0 and result["inputsUnchanged"] is True, run + ": accepted unchanged gate")
need(len(inputs) == receipt["inputCount"] == result["inputCount"], run + ": input counts")
need(all(safe(path) and relevant(path) for path in inputs), run + ": input scope")
need(sum(path.startswith("crates/vendor/iced_widget/") for path in inputs) == 71, run + ": vendor count")
compare_commit(repo, commit, inputs)
print("PASS exact Git tree/blobs:", run, commit, len(inputs), "captured inputs")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--repo", type=Path, required=True, help="repository with both named commits already present")
source = parser.add_mutually_exclusive_group(required=True)
source.add_argument("--checks", type=Path, help="portable checks package directory")
source.add_argument("--raw-gates", type=Path, help="optional preparation mode: raw gate directory, not a packaged-evidence verification")
args = parser.parse_args()
if args.checks:
captured = packaged(args.checks, COMMITS)
else:
captured = {run: ((args.raw_gates / run / "inputs.json").read_bytes(),
parsed((args.raw_gates / run / "result.json").read_bytes())) for run in COMMITS}
verify(args.repo, captured)
print("Source identity only; no build, checkout, helper execution or native acceptance claim.")
if __name__ == "__main__":
main()