Files
EscapistsReintroduced/docs/evidence/hq-search-radius-2026-10-03/validation/archive.py
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

50 lines
4.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pathlib import Path
import hashlib,json,shutil
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path('/tmp/erri-gameplay-root-1611');P=Path('/tmp/erri-search-radius-1611')
E=R/'docs/evidence/hq-search-radius-2026-10-03'
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
result=json.loads((B/'suite-result.json').read_text())
assert result['exit']==0 and result['inputs_unchanged'] and result['regression_programs']==305
assert all(v['exit']==0 for v in result['programs'])
assert json.loads((B/'preservation.json').read_text())['complete']
inputs=json.loads((B/'suite-inputs.json').read_text())
for name,h in inputs.items():assert sha(R/name)==h,name
manifest=json.loads((P/'source-manifest.json').read_text())
for name,v in manifest['files'].items():assert sha(R/name)==v['proposal_sha256'],name
D=json.loads((B/'docs-manifest.json').read_text())
for name,v in D.items():
assert sha(R/name)==v['before'],name
assert sha(B/'docs-proposal'/name)==v['after'],name
assert not E.exists()
stage=B/'archive';stage.mkdir()
def copy(src,relative):
dest=stage/relative;dest.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,dest);assert sha(src)==sha(dest)
for name in manifest['files']:
copy(R/name,'source/'+name);copy(P/'baseline'/name,'baseline/'+name)
for name in ['fix.patch','source-manifest.json','test-results.json','finding.json','sdk-proof.json','independent-review.json','run-focused.py','apply-check.log']:
copy(P/name,'proposal/'+name)
for p in P.glob('*-green.log'):copy(p,'proposal/'+p.name)
for p in P.glob('*-red.log'):copy(p,'proposal/'+p.name)
for name in ['baseline.json','native-deferred.json','suite-inputs.json','suite-result.json','full-suite.log','preservation.json','integrate.py','run-suite.py','docs-manifest.json','archive.py']:
copy(B/name,'validation/'+name)
for name in D:copy(B/'docs-proposal'/name,'documentation/'+name)
copy(Path('/tmp/erri-current-gaps-1611/coverage.json'),'review/current-feature-coverage.json')
(stage/'README.md').write_text('''# HQ search radius — 3 October 2026
Ordinary memory SEARCH orders snapshot delivered uncertainty, clamped to 45–110 m, at assignment or retasking. Radio delivery rejects invalid values before allocating or releasing a waypoint and installs the snapshot once. The native SDK uses this value as a square investigation-grid half-width, not proof of a cleared circle.
All 305 registered regression programs pass with unchanged inputs. Six focused programs pass; the compiled baseline fails the intended radius assertion, and two mutations expose missing admission and retask guards. The independent review binds proposal and evidence hashes. Existing 40 m / 30 s negative-search evidence remains unchanged. Missing-patrol, road/site defence, other pursuit roles and direct air-team tasks retain their defaults.
No native run was started because an existing game was running. Native compilation, search movement, grid cost, multiplayer and FPS remain unverified. The larger grid requires more native cell/navigation work. Sealed packages predate this source change. Original missions, the index and all four recorded candidates are unchanged.
`validation/suite-inputs.json` records the tested snapshot. Only the two prose files in `validation/docs-manifest.json` were changed afterward; their final text is in `documentation/`. `artifact-sha256.json` seals every other evidence file. SDK evidence contains metadata and hashes only; no external asset or SDK source is copied. The current feature coverage is a source audit, not full runtime qualification.
''')
files={str(p.relative_to(stage)):sha(p) for p in sorted(stage.rglob('*')) if p.is_file()}
(stage/'artifact-sha256.json').write_text(json.dumps(files,indent=2)+'\n')
shutil.copytree(stage,E)
for name,h in files.items():assert sha(E/name)==h,name
for name in D:(R/name).write_bytes((B/'docs-proposal'/name).read_bytes())
for name,h in inputs.items():assert sha(R/name)==(D[name]['after'] if name in D else h),name
assert sha(R/'.git/index')==json.loads((B/'baseline.json').read_text())['index_sha256']
print(json.dumps({'sealed_files':len(files),'documentation_changes':list(D),'suite_programs':305,'archive':str(E)}))