Files
EscapistsReintroduced/docs/evidence/bmp-native-proof-preparation-2026-10-03/seal.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

57 lines
7.8 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 json,hashlib,shutil,subprocess
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path('/tmp/erri-bmp-native-2103');E=R/'docs/evidence/bmp-native-proof-preparation-2026-10-03'
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();load=lambda p:json.loads(p.read_text());write=lambda p,v:p.write_text(json.dumps(v,indent=2)+'\n')
base=load(B/'baseline.json');focused=load(B/'focused-result.json');assert focused['exit']==0 and focused['inputs_unchanged'] and len(focused['programs'])==10 and all(p['exit']==0 for p in focused['programs'])
assert load(B/'preservation.json')['complete'] and not load(B/'native-preflight.json')['native_run_attempted']
assert hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=R)).hexdigest()==base['staged_diff_sha256']
for n,h in load(B/'focused-inputs.json').items():assert sha(R/n)==h,n
proposals=[Path('/tmp/erri-mounted-bmp-hook'),Path('/tmp/erri-mounted-bmp-probe')];expected={}
for p in proposals:
m=load(p/'source-manifest.json');assert sha(p/'fix.patch')==m['patch_sha256']
for n,v in m['files'].items():assert base['files'][n]==v['baseline_sha256'];expected[n]=v.get('proposal_sha256',v.get('proposed_sha256'));assert sha(R/n)==expected[n]
changed={n for n,h in base['files'].items() if sha(R/n)!=h};assert changed==set(expected),changed
review=load(Path('/tmp/erri-mounted-bmp-probe/independent-review.json'));assert review.get('complete',False) or review.get('approved',False),review
updates={}
n='docs/current-status.md';old=(R/n).read_text();first,rest=old.split('\n',1);updates[n]=first+'\n\n'+'''**3 October 2026 — BMP accounting verification strengthened; native run pending:** an opt-in Workbench check now requires complete armed counts from the original slot-4 BMP and that same vehicle’s actual queued and radio-delivered HQ status. The old generic check could be satisfied by a UAZ. The isolated check stops opening hunters and new town admissions before prison exit, while retaining original site troops, automatic convoy target, body cap, finite stock and the fixed proof deadline. Ordinary mission behavior is unchanged.
All **10 affected regression programs pass** on unchanged inputs; baseline and missing-completeness controls fail as expected. A read-only host preflight found an existing game, so no native run was started and the game was left untouched. The earlier 117/135 refusal correctly enforced the documented shared cap and was not a demonstrated accounting defect. The current crash-start playtest package is unchanged; it predates this diagnostic only. Native BMP accounting/radio proof, physical support reliability, manual play, multiplayer and FPS remain unqualified. [Prepared check and exact evidence](evidence/bmp-native-proof-preparation-2026-10-03/README.md).
'''+rest.lstrip('\n')
n='docs/runtime-testing.md';old=(R/n).read_text();updates[n]=old.rstrip()+'''
## Original BMP mounted-accounting diagnostic
Use the existing hidden/muted private Workbench runner with `--project chat --smoke mounted-ammo --mounted-bmp --rounds 1 --timeout 420`, audited external addons and a fresh Prison-start profile. Perform the host-visible game/prefix preflight first and defer while any game exists. The original 180-second proof deadline is unchanged; the runner allowance includes preparation and cleanup.
This opt-in Workbench-only variant stops unstarted opening hunters and new town admissions before prison exit. It retains the initial site population, normal automatic convoy target of three, shared body cap and finite original stock. It checks all six original vehicle roots and cargo exclusion, then requires complete valid armed counts from original slot 4’s WCS BMP and that BMP’s own detached status snapshot delivered through the actual radio path. An armed UAZ cannot satisfy the BMP proof. Mine-stock, swap and courier variants are incompatible. No replacement BMP, direct report injection, ammunition refill, body refund or raised cap is used.
The source and ten focused regressions are recorded in [the preparation checkpoint](evidence/bmp-native-proof-preparation-2026-10-03/README.md). Native confirmation is pending because a host game was running at preparation time. Even a pass would qualify only this isolated accounting/radio scene, not default three-convoy admission, physical interception, multiplayer or performance.
'''
doc_changes={}
for n,t in updates.items():assert sha(R/n)==base['files'][n];doc_changes[n]={'before':sha(R/n),'after':hashlib.sha256(t.encode()).hexdigest()};(R/n).write_text(t)
assert not E.exists();E.mkdir()
for p in B.iterdir():
if p.is_file():shutil.copyfile(p,E/p.name)
for folder in proposals:
for p in folder.rglob('*'):
if p.is_file() and p.suffix in {'.patch','.json','.log'} and not any(k in p.parts for k in ['isolated','baseline','proposed']):
q=E/'proposals'/folder.name/p.relative_to(folder);q.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(p,q)
shutil.copyfile('/tmp/erri-convoy-budget-review-20261003/review.json',E/'budget-review.json')
for n,h in expected.items():
q=E/'final-source'/n;q.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(R/n,q);assert sha(q)==h
write(E/'review.json',{'complete':True,'ordinary_gameplay_changed':False,'source_changes':expected,'focused_regression_programs':10,'full_suite_repeated':False,'native_run_attempted':False,'native_qualification':False,'documented_body_budget_preserved':True,'documentation_changes':doc_changes,'prior_candidates_preserved':5,'original_reference_files_preserved':533,'staged_diff_sha256':base['staged_diff_sha256'],'release_qualified':False})
(E/'README.md').write_text('''# Original BMP accounting proof preparation
The new optional `mounted-ammo --mounted-bmp` Workbench diagnostic closes a qualification gap: the original generic fixture could finish from an armed UAZ and allowed an incomplete but bounded BMP snapshot. The new branch requires the original slot-4 WCS BMP, a complete valid armed snapshot and the exact vehicle’s naturally queued/delivered radio status, preserving original crew/root identities and detached payload checks. It retains the six-root and unarmed cargo-exclusion checks. Mixed mine/swap/courier modes are rejected.
Only this explicit Workbench branch stops unstarted hunters and town admissions before prison unlock. No production population policy, target,135-body cap, stock,180-second proof deadline or actor is replaced/refunded. The default configured convoy count is a maximum;117 committed bodies plus25 crew exceeding135 was a documented admission refusal, not a demonstrated accounting bug. Independent budget and fixture reviews are included.
Ten affected regression programs pass on unchanged inputs. The added actual-method assertions reject the old all-slot observation behavior and a missing-completeness mutation. Their failing controls and one early test-adapter compilation failure are preserved. A host-visible read-only preflight found an existing game with the private prefix idle; no native run was started. No display, input, audio or existing process was modified. Native BMP accounting and radio proof remain pending.
Original533 reference files, five sealed candidates and staged content are unchanged. The crash-start candidate remains the playable development handoff and predates only this diagnostic. This checkpoint does not rerun the complete307-program suite or package an identical ordinary mission. Manual play, physical support reliability, real multiplayer, comparative FPS and clean release remain unqualified. `next-work.json` records the single next native check after the host is free.
''')
write(E/'artifact-sha256.json',{str(p.relative_to(E)):sha(p) for p in E.rglob('*') if p.is_file()})
for n,h in base['files'].items():assert sha(R/n)==doc_changes.get(n,{}).get('after',expected.get(n,h)),n
print(json.dumps({'source_files':len(expected),'focused_programs':10,'native_run_attempted':False,'original_and_candidates_preserved':True}))