Files
EscapistsReintroduced/docs/evidence/config-supply-recovery-2026-10-03/root/update-docs.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

19 lines
4.3 KiB
Python

from pathlib import Path
import json,hashlib
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path('/tmp/erri-gameplay-root-1509')
suite=json.loads((B/'suite-result.json').read_text());assert suite['exit']==0 and suite['inputs_unchanged']
assert (R/'docs/evidence/config-supply-recovery-2026-10-03/README.md').is_file()
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
changes={}
p=R/'docs/configuration.md';old=p.read_text();needle='allows recovery from a damaged primary. Unsupported schema versions are kept\nread-only. Unknown fields and preferences for absent mods are retained.'
assert old.count(needle)==1
new=old.replace(needle,needle+'\n\nA malformed known section also prevents unrelated menu changes from being saved.\nThis preserves the last valid backup instead of replacing it with damaged data.\nRepair invalid sections while the mission is stopped; a valid replacement for the\nonly damaged section can also be saved through its existing menu. Successful repair\nkeeps the good backup, and subsequent ordinary saves resume normal backup rotation.\nMissing optional sections still use defaults, and unknown fields remain intact.',1)
changes[str(p.relative_to(R))]={'before':sha(p)};p.write_text(new);changes[str(p.relative_to(R))]['after']=sha(p)
p=R/'docs/infantry-resupply.md';old=p.read_text()
append='''\n\n## Ordinary ammunition claims survive unresolved cancellation — 3 October 2026\n\nAn interrupted ordinary rifle-magazine trip now retains its exact recipient and\ntruck reservations while its existing transfer leaf reports an unresolved native\noperation. Previously only mine and launcher trips retained these claims, allowing\na later truck to reserve the same group while an accepted empty-magazine return\nwas still pending. Owned waypoints and the downlink are cleared immediately. The\nexisting polling path releases only matching claims when the leaf settles; stopped\nservices also continue this observation. No new submission, refund, replacement\nstock or late success is granted. The leaf's existing custody and callback rules\nare unchanged.\n\nThe recorded source regression checks cover delayed settlement, competing claims\nand cancellation. Native transfers, real convoy movement and multiplayer remain\nunverified for this change; an existing game prevented isolated engine checks.\n[Exact source and regression checkpoint](evidence/config-supply-recovery-2026-10-03/README.md).\n'''
changes[str(p.relative_to(R))]={'before':sha(p)};p.write_text(old+append);changes[str(p.relative_to(R))]['after']=sha(p)
p=R/'docs/current-status.md';old=p.read_text();head='# Current development status\n\n';assert old.startswith(head)
text=f'''**3 October 2026 — configuration recovery and interrupted rifle resupply corrected:** changing one setting can no longer overwrite the only valid backup of another malformed section. Invalid recognized sections block unrelated saves before disk writes; repairing the damaged section preserves the good backup. Ordinary ammunition trips now retain their exact truck and recipient claims while an accepted native move remains unresolved, preventing a second supply job from racing the first. Existing finite stock, radio demand, deadlines and transfer rules remain in place.\n\nAll **{suite['regression_programs']} registered regression programs pass** on the recorded unchanged snapshot. Baseline failures and focused controls reproduce both bugs. Repository and source-bundle validation now recognize one audited optional resource-name comparison without adding a runtime dependency, and the existing vanilla character load has verified resource metadata. The initial validation failure remains archived. A separate bounded base-loop review found no new demonstrated defect in radio defence, extraction ordering, player identity or terminal cleanup. Native checks were deferred because an existing game was running; no window, input, audio or process changes were made. Native transfers, manual escape, multiplayer and FPS remain unqualified. The sealed development packages predate these source changes. [Implementation and evidence](evidence/config-supply-recovery-2026-10-03/README.md).\n\n'''
changes[str(p.relative_to(R))]={'before':sha(p)};p.write_text(head+text+old[len(head):]);changes[str(p.relative_to(R))]['after']=sha(p)
(B/'post-suite-docs.json').write_text(json.dumps(changes,indent=2)+'\n');print(json.dumps(changes,indent=2))