Prepare independent successor playtest with spawn recovery and casualty feedback

This commit is contained in:
2026-09-19 22:12:52 +02:00
parent 61e165ef5b
commit 6cf989a060
266 changed files with 134064 additions and 154 deletions
+12 -4
View File
@@ -11,6 +11,9 @@ RUNNER=ROOT/'tools/headless_workbench.py'
class FieldRunnerTests(unittest.TestCase):
def test_early_refusal_before_any_profile_or_lock(self):
cases=[
(['--project','chat','--rounds','1','--timeout','420','--smoke','aircraft-route','--field-terrain-audit'],'--field-terrain-audit requires'),
(['--project','chat','--rounds','1','--timeout','420','--smoke','aircraft-field','--field-terrain-audit','--field-service-cancel'],'mutually exclusive'),
(['--project','chat','--rounds','1','--timeout','420','--smoke','aircraft-field','--field-terrain-audit'],'must be a disposable cloned prefix'),
(['--project','core','--rounds','1','--timeout','420','--smoke','aircraft-field'],'requires Chat, one round'),
(['--project','chat','--rounds','2','--timeout','420','--smoke','aircraft-field'],'requires Chat, one round'),
(['--project','chat','--rounds','1','--timeout','419','--smoke','aircraft-field'],'requires Chat, one round'),
@@ -24,13 +27,13 @@ class FieldRunnerTests(unittest.TestCase):
root=Path(folder)
result=subprocess.run([sys.executable,str(RUNNER),'--compat',str(root/'missing'),'--profile',str(root/'profile'),*arguments],capture_output=True,text=True,timeout=10)
self.assertEqual(result.returncode,2);self.assertIn(error,result.stderr);self.assertEqual(list(root.iterdir()),[])
def command(self,smoke,cancel=False):
def command(self,smoke,cancel=False,audit=False):
tree=ast.parse(RUNNER.read_text());nodes=[]
for node in tree.body:
if isinstance(node,ast.Assign) and any(isinstance(t,ast.Name) and t.id=='command' for t in node.targets):nodes.append(node)
if isinstance(node,ast.If) and isinstance(node.test,ast.Attribute) and node.test.attr in ('field_service_cancel','route_service_cancel'):nodes.append(node)
self.assertEqual(len(nodes),3)
namespace={'a':SimpleNamespace(project='chat',smoke=smoke,field_service_cancel=cancel,route_service_cancel=False),'ROOT':Path('/private/source'),'proton':Path('/private/proton'),'wb':Path('/private/workbench'),'profile_arg':'Z:/private/profile'}
if isinstance(node,ast.If) and isinstance(node.test,ast.Attribute) and node.test.attr in ('field_service_cancel','route_service_cancel','field_terrain_audit'):nodes.append(node)
self.assertEqual(len(nodes),4)
namespace={'a':SimpleNamespace(project='chat',smoke=smoke,field_service_cancel=cancel,route_service_cancel=False,field_terrain_audit=audit),'ROOT':Path('/private/source'),'proton':Path('/private/proton'),'wb':Path('/private/workbench'),'profile_arg':'Z:/private/profile'}
exec(compile(ast.Module(body=nodes,type_ignores=[]),str(RUNNER),'exec'),namespace)
return namespace['command']
def test_exact_field_command_and_cancel_optin(self):
@@ -41,6 +44,11 @@ class FieldRunnerTests(unittest.TestCase):
self.assertEqual(normal[normal.index('--backend')+1],'headless')
self.assertIn('-disableCrashReporter',normal)
self.assertNotIn('-errSmokeFieldServiceCancel',self.command('aircraft-route'))
def test_terrain_audit_adds_only_explicit_flag(self):
normal=self.command('aircraft-field')
self.assertEqual(self.command('aircraft-field',audit=True),normal+['-errSmokeFieldTerrainAudit','1'])
self.assertNotIn('-errSmokeFieldTerrainAudit',normal)
self.assertNotIn('-errSmokeFieldTerrainAudit',self.command('aircraft-route'))
def test_cleanup_provenance_not_bypassed(self):
source=RUNNER.read_text()
self.assertIn('assert_prefix_idle(compat)',source)