Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
"""Archive the bounded BMP accounting correction after completed suite/native checks. Never launches tests or native."""
|
||||
from pathlib import Path
|
||||
import argparse,hashlib,json,shutil,datetime,re
|
||||
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path('/tmp/erri-bmp-ammo-root-1305');P=Path('/tmp/erri-bmp-ammo-1305');V=Path('/tmp/erri-bmp-ammo-review-1305')
|
||||
REVIEW_SHA='76fefed17668ec8d764a203f56951edb425f381ea9bb255a300e2dab1d58b436'
|
||||
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();load=lambda p:json.loads(p.read_text())
|
||||
def main():
|
||||
ap=argparse.ArgumentParser(description=__doc__)
|
||||
ap.add_argument('--native-evidence',type=Path,required=True,help='Settled archived native attempt, including failure, bound to exact suite-authored source')
|
||||
ap.add_argument('--output',type=Path,default=R/'docs/evidence/bmp-ammo-accounting-2026-10-03')
|
||||
a=ap.parse_args();n=a.native_evidence.resolve();out=a.output
|
||||
assert n.is_dir() and n.is_relative_to((R/'docs/evidence').resolve())
|
||||
assert out.parent.resolve()==(R/'docs/evidence').resolve() and not out.exists() and not out.is_symlink()
|
||||
manifest=load(P/'source-manifest.json');assert len(manifest)==4
|
||||
for path,row in manifest.items():
|
||||
assert sha(P/path)==sha(R/path)==row['proposed']
|
||||
assert sha(P/'baseline'/path)==row['before']
|
||||
assert (P/'baseline-index'/path).is_file()
|
||||
review=load(V/'review.json');assert sha(V/'review.json')==REVIEW_SHA and review['complete']
|
||||
assert review['patch_sha256']==sha(P/'fix.patch')==load(P/'resource-identity-proof.json')['patch_sha256']
|
||||
for path,h in review['resource_policy_review']['files'].items():assert sha(P/path)==h
|
||||
focused=load(P/'focused-result.json')
|
||||
assert focused['baseline']['exit']!=0 and focused['proposed']['exit']==0
|
||||
assert 'Assertion' in (P/'baseline-test.log').read_text() and 'SIGABRT' in (P/'baseline-test.log').read_text()
|
||||
assert 'PASS: WORKBENCH' in (P/'proposed-test.log').read_text()
|
||||
suite=load(B/'suite-result.json');inputs=load(B/'suite-inputs.json')
|
||||
assert suite['exit']==0 and suite['inputs_unchanged'] and not suite.get('resumed')
|
||||
assert len(suite['programs'])==suite['regression_programs'] and all(x['exit']==0 for x in suite['programs'])
|
||||
assert len({x['path'] for x in suite['programs']})==suite['regression_programs']
|
||||
assert 'All repository checks passed.' in (B/'full-suite.log').read_text()
|
||||
assert all(inputs[path]==row['proposed'] for path,row in manifest.items())
|
||||
report=load(n/'report.json');runner=load(n/'runner.json.txt');source=load(n/'source-sha256.json')
|
||||
assert source==load(n/'launch-source-sha256.json')=={k:v for k,v in inputs.items() if k.startswith('addons/')}
|
||||
# Native failure/completion counters are evidence, never an admission gate for preservation.
|
||||
assert runner['cleanup_confirmed'] and runner['source_unchanged_after_run'] and runner['external_addons_unchanged_after_run']
|
||||
assert sha(n/'console.log.txt')==runner['console_sha256']
|
||||
console=(n/'console.log.txt').read_text();lines=console.splitlines();bmp=[]
|
||||
sample_pattern=re.compile(r'ERR MOUNTED SAMPLE: source=(\S+) slot=4 complete=1 weapons=3 muzzles=3 magazines=3(?:\s|$)')
|
||||
counts_pattern=re.compile(r'ERR MOUNTED COUNTS: slot=4 rounds=(\d+) capacity=(\d+) chambers=(\d+) low=(\d+)(?:\s|$)')
|
||||
for i,line in enumerate(lines):
|
||||
match=sample_pattern.search(line)
|
||||
if not match:continue
|
||||
observation={'sample_line_number':i+1,'sample_line':line,'source_id':match.group(1),'slot':4,'complete':1,'weapons':3,'muzzles':3,'magazines':3,'counts':None}
|
||||
# Bind the following counts to this sample, never to another sample/report.
|
||||
for j in range(i+1,len(lines)):
|
||||
if 'ERR MOUNTED SAMPLE:' in lines[j]:break
|
||||
cm=counts_pattern.search(lines[j])
|
||||
if cm:
|
||||
observation['counts']={'rounds':int(cm.group(1)),'capacity':int(cm.group(2)),'chambers':int(cm.group(3)),'low':int(cm.group(4)),'line_number':j+1,'raw_line':lines[j]};break
|
||||
bmp.append(observation)
|
||||
bmp_proved=any(x['counts'] is not None for x in bmp)
|
||||
sampler='addons/core/Scripts/Game/ERR/10_AI/ERR_HQMountedAmmoSampler.c'
|
||||
package=R/'.build/playtest-2026-10-03-depot-mines'
|
||||
assert sha(package/'source'/sampler)==manifest[sampler]['before'], 'Existing candidate must remain the older tested snapshot'
|
||||
# Explicit metadata allowlist: never recurse into installed/ or copy third-party prefab/script payloads.
|
||||
artifacts={}
|
||||
for path in manifest:
|
||||
artifacts['proposed/'+path]=P/path
|
||||
artifacts['baseline/'+path]=P/'baseline'/path
|
||||
artifacts['baseline-index/'+path]=P/'baseline-index'/path
|
||||
for name in ['fix.patch','source-manifest.json','resource-identity-proof.json','finding.json','focused-result.json','baseline-test.log','proposed-test.log','run.txt','installed-manifest.json','vanilla-manifest.json','weapon-base-manifest.json']:
|
||||
artifacts['proposal/'+name]=P/name
|
||||
for name in ['review.json','installed-resource-review.json']:artifacts['review/'+name]=V/name
|
||||
for name in ['suite-inputs.json','suite-result.json','full-suite.log','run-suite.py']:artifacts['suite/'+name]=B/name
|
||||
artifacts['archive-change.py']=Path(__file__)
|
||||
for name in ['report.json','runner.json.txt','source-sha256.json','launch-source-sha256.json','console.log.txt']:artifacts['native-reference/'+name]=n/name
|
||||
before={name:{'source':str(p),'sha256':sha(p),'bytes':p.stat().st_size} for name,p in artifacts.items()}
|
||||
assert all('/installed/' not in str(p) for p in artifacts.values())
|
||||
out.mkdir()
|
||||
for name,p in artifacts.items():
|
||||
q=out/name;q.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(p,q)
|
||||
assert sha(q)==before[name]['sha256']==sha(p)
|
||||
native={'archive':str(n),'fixture_requested':'mounted-ammo','fixture_markers_observed':any('mounted ammo ' in line or 'ERR MOUNTED SAMPLE:' in line for line in lines),'console_sha256':sha(n/'console.log.txt'),'source_files':len(source),'assertions':report['assertions_passed'],'smoke_completions':report['smoke_completions'],'script_or_runtime_failures':report['script_or_runtime_failures'],'script_failure_count':len(report['script_or_runtime_failures']),'retained_engine_errors':report['engine_errors'],'engine_error_count':len(report['engine_errors']),'runner_result':runner.get('result'),'runner_result_before_cleanup':runner.get('result_before_cleanup'),'runner_error':runner.get('runner_error'),'cleanup_confirmed':True,'bmp_complete_3_3_3_with_counts_observed':bmp_proved,'bmp_observations':bmp,'scope':'Mounted-ammo fixture attempt; exact observed slot-4 snapshot only if matching sample and counts exist. Failures retained independently; no normal-route, BMP interception, ammunition transfer or combat qualification.'}
|
||||
observation_text=('The raw log contains a slot-4 complete snapshot with three weapons, three muzzles and three magazines, followed by its ammunition counts; exact lines and counts are retained in native-reference/reference.json. This proves only that observed fixture snapshot.' if bmp_proved else 'No matching slot-4 complete three-weapon/three-muzzle/three-magazine snapshot with associated counts was observed. No native BMP completeness claim is made.')
|
||||
(out/'native-reference/reference.json').write_text(json.dumps(native,indent=2)+'\n')
|
||||
(out/'README.md').write_text(f'''# BMP mounted-ammunition accounting correction — 3 October 2026
|
||||
|
||||
Two exact installed non-firing weapon placeholders previously made mounted-ammunition sampling incomplete. The correction omits a deduplicated zero-muzzle placeholder only after exact resource identity and reciprocal installation checks. Real weapons, unknown identities, malformed mounts and existing traversal/completeness limits retain their prior checks. Two resource-audit entries record the verified identities; no third-party prefab or script payload is copied into this archive.
|
||||
|
||||
Focused tests execute the actual sampler with documented native doubles. The old source compiles and fails a runtime assertion; the proposed source passes ordinary and WORKBENCH controls, including standalone inert placeholders and placeholders alongside a real gun. These are accounting controls, not physical BMP gameplay qualification. Historical finding/review files are preserved verbatim, including their earlier pending-validation wording; later results are recorded separately.
|
||||
|
||||
The completed suite records {suite['regression_programs']} programs with all exit codes zero and unchanged inputs. The requested **mounted-ammo** fixture attempt is archived at `{n}`: runner result `{native['runner_result']}`, {native['assertions']} passed assertions, {native['smoke_completions']} smoke completion(s), {native['script_failure_count']} script/runtime failure(s) and {native['engine_error_count']} retained engine errors. Cleanup and exact suite-authored source binding were verified. All original failures and counters remain preserved; this is not a normal-route run.
|
||||
|
||||
{observation_text} Snapshot evidence does not upgrade a failed overall fixture result or establish BMP interception, resupply or combat behavior.
|
||||
|
||||
The sealed `.build/playtest-2026-10-03-depot-mines` package predates and excludes this correction; its sampler bytes were checked against the baseline. There is no new BMP interception feature or refreshed runtime package in this archive. Manual, multiplayer, FPS and clean-release qualification remain absent.
|
||||
|
||||
`artifact-manifest.json` records all archived hashes and copied original paths. Baseline working/index and proposed copies cover exactly four owned files. Installed-resource evidence consists only of identity/hash metadata. Original logs and source artifacts are retained unchanged. The helper launches no compiler, tests or native process and makes no documentation changes outside this new evidence directory.
|
||||
''')
|
||||
result={'kind':'BMP ACCOUNTING SOURCE CORRECTION EVIDENCE','created_utc':datetime.datetime.now(datetime.timezone.utc).isoformat(),'copied_originals':before,'copies_verified_equal_originals':True,'review_sha256':REVIEW_SHA,'focused_baseline_runtime_failure':True,'focused_proposed_pass':True,'full_suite_programs':suite['regression_programs'],'native':native,'existing_depot_mines_package_excludes_fix':True,'new_runtime_package_created':False,'BMP_interception_implemented':False,'installed_payloads_copied':False,'files':{p.relative_to(out).as_posix():{'sha256':sha(p),'bytes':p.stat().st_size} for p in sorted(out.rglob('*')) if p.is_file()}}
|
||||
(out/'artifact-manifest.json').write_text(json.dumps(result,indent=2)+'\n')
|
||||
assert all(sha(out/name)==row['sha256'] for name,row in result['files'].items())
|
||||
print(json.dumps({'archive':str(out),'files':len(result['files'])+1,'manifest_sha256':sha(out/'artifact-manifest.json'),'native_archive':str(n)},indent=2))
|
||||
if __name__=='__main__':main()
|
||||
Reference in New Issue
Block a user