harness-everything 0.47.0 → 0.47.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/workflows/ci.yml +12 -0
  4. package/CHANGELOG.md +18 -0
  5. package/benchmarks/issue290-pilot/README.md +199 -0
  6. package/benchmarks/issue290-pilot/analyze.py +299 -0
  7. package/benchmarks/issue290-pilot/analyze.test.py +146 -0
  8. package/benchmarks/issue290-pilot/check.py +19 -0
  9. package/benchmarks/issue290-pilot/evidence/archive.json +7 -0
  10. package/benchmarks/issue290-pilot/evidence/group-summary.json +684 -0
  11. package/benchmarks/issue290-pilot/evidence/inventory.json +3728 -0
  12. package/benchmarks/issue290-pilot/evidence/ledger.json +4644 -0
  13. package/benchmarks/issue290-pilot/evidence/replay/pairs.json +482 -0
  14. package/benchmarks/issue290-pilot/evidence/replay/provenance.json +24 -0
  15. package/benchmarks/issue290-pilot/evidence/replay/tables.md +37 -0
  16. package/benchmarks/issue290-pilot/evidence.tar.gz +0 -0
  17. package/benchmarks/issue290-pilot/export.py +110 -0
  18. package/benchmarks/issue290-pilot/export.test.py +65 -0
  19. package/benchmarks/issue290-pilot/fable-supplement.py +55 -0
  20. package/benchmarks/issue290-pilot/fixture.test.py +28 -0
  21. package/benchmarks/issue290-pilot/fixtures/polyglot/instructions.md +19 -0
  22. package/benchmarks/issue290-pilot/fixtures/polyglot/package.json +29 -0
  23. package/benchmarks/issue290-pilot/fixtures/polyglot/simple-linked-list.js +44 -0
  24. package/benchmarks/issue290-pilot/fixtures/polyglot/simple-linked-list.spec.js +131 -0
  25. package/benchmarks/issue290-pilot/fixtures/quixbugs/LICENSE +7 -0
  26. package/benchmarks/issue290-pilot/fixtures/quixbugs/cases.json +7 -0
  27. package/benchmarks/issue290-pilot/fixtures/quixbugs/find_in_sorted.py +31 -0
  28. package/benchmarks/issue290-pilot/fixtures/quixbugs/test_find_in_sorted.py +15 -0
  29. package/benchmarks/issue290-pilot/frozen-documents.json +41 -0
  30. package/benchmarks/issue290-pilot/grader.cjs +43 -0
  31. package/benchmarks/issue290-pilot/grader.test.cjs +10 -0
  32. package/benchmarks/issue290-pilot/hook.test.cjs +27 -0
  33. package/benchmarks/issue290-pilot/host-hook.cjs +35 -0
  34. package/benchmarks/issue290-pilot/metrics.test.py +131 -0
  35. package/benchmarks/issue290-pilot/preflight/amendment.md +32 -0
  36. package/benchmarks/issue290-pilot/preflight/environment.json +15 -0
  37. package/benchmarks/issue290-pilot/preflight/fable-amendment.md +20 -0
  38. package/benchmarks/issue290-pilot/preflight/fable-frozen-files.json +4 -0
  39. package/benchmarks/issue290-pilot/preflight/fable-infrastructure-amendment.md +27 -0
  40. package/benchmarks/issue290-pilot/preflight/fable-retry-frozen-files.json +4 -0
  41. package/benchmarks/issue290-pilot/preflight/fable-supplement-v1.py +47 -0
  42. package/benchmarks/issue290-pilot/preflight/frozen-files.json +18 -0
  43. package/benchmarks/issue290-pilot/preflight/graders.json +67 -0
  44. package/benchmarks/issue290-pilot/pricing-assumptions.json +29 -0
  45. package/benchmarks/issue290-pilot/protocol.json +32 -0
  46. package/benchmarks/issue290-pilot/read_metrics.py +166 -0
  47. package/benchmarks/issue290-pilot/replay.py +167 -0
  48. package/benchmarks/issue290-pilot/reporting.py +82 -0
  49. package/benchmarks/issue290-pilot/run.py +262 -0
  50. package/benchmarks/issue290-pilot/sources.json +10 -0
  51. package/benchmarks/issue290-pilot/verification/analyzer-tests.log +5 -0
  52. package/benchmarks/issue290-pilot/verification/final-gates.json +58 -0
  53. package/benchmarks/issue290-pilot/verification/fixture-tests.log +5 -0
  54. package/benchmarks/issue290-pilot/verification/gates.json +58 -0
  55. package/benchmarks/issue290-pilot/verification/npm-audit.json +84 -0
  56. package/benchmarks/issue290-pilot/verification/offline-correction.json +59 -0
  57. package/benchmarks/issue290-pilot/verification/post-report/helper-tests.log +22 -0
  58. package/benchmarks/issue290-pilot/verification/post-report/test-consistency.log +626 -0
  59. package/benchmarks/issue290-pilot/verification/post-report/test-references.log +6 -0
  60. package/benchmarks/issue290-pilot/verification/post-report/waza-tokens.log +710 -0
  61. package/benchmarks/issue290-pilot/verification/test-collision.log +28 -0
  62. package/benchmarks/issue290-pilot/verification/test-consistency.log +28 -0
  63. package/benchmarks/issue290-pilot/verification/test-docs-capabilities.log +131 -0
  64. package/benchmarks/issue290-pilot/verification/test-mechanism.log +1829 -0
  65. package/benchmarks/issue290-pilot/verification/test-mutations.log +16 -0
  66. package/benchmarks/issue290-pilot/verification/test-platform-compatibility.log +9 -0
  67. package/benchmarks/issue290-pilot/verification/test-plugin-openai.log +6 -0
  68. package/benchmarks/issue290-pilot/verification/test-plugin-submission.log +5 -0
  69. package/benchmarks/issue290-pilot/verification/test-references.log +6 -0
  70. package/benchmarks/issue290-pilot/verification/test-release.log +59 -0
  71. package/benchmarks/issue290-pilot/verification/test-repo-contract.log +5 -0
  72. package/benchmarks/issue290-pilot/verification/test-routing-invariants.log +785 -0
  73. package/benchmarks/issue290-pilot/verification/test-routing-skills.log +28 -0
  74. package/benchmarks/issue290-pilot/verification/test.log +3373 -0
  75. package/benchmarks/issue290-pilot/verification/verification-report.md +76 -0
  76. package/benchmarks/issue290-pilot/verification/waza-tokens.log +710 -0
  77. package/benchmarks/issue290-pilot/verification/with-dependencies/gates.json +26 -0
  78. package/benchmarks/issue290-pilot/verification/with-dependencies/test-collision.log +8 -0
  79. package/benchmarks/issue290-pilot/verification/with-dependencies/test-consistency.log +626 -0
  80. package/benchmarks/issue290-pilot/verification/with-dependencies/test-mechanism.log +1693 -0
  81. package/benchmarks/issue290-pilot/verification/with-dependencies/test-release.log +38 -0
  82. package/benchmarks/issue290-pilot/verification/with-dependencies/test-routing-skills.log +44 -0
  83. package/benchmarks/issue290-pilot/verification/with-dependencies/test.log +3253 -0
  84. package/ci/mechanism-379-self-evolve-workspace.test.js +151 -0
  85. package/ci/mechanism-383-doc-glob-line-terminators.test.js +131 -0
  86. package/docs/document-lifecycle.md +1 -1
  87. package/docs/platform-capabilities.md +4 -0
  88. package/harness-everything/SKILL.md +1 -1
  89. package/harness-everything/scripts/doc-check.js +1 -1
  90. package/harness-everything/scripts/doc-lifecycle.js +2 -2
  91. package/harness-everything/scripts/doc-obligations.js +2 -2
  92. package/hooks/scripts/lib/doc-reconciliation-core.js +2 -2
  93. package/hooks/scripts/lib/doc-reconciliation-provider.js +1 -1
  94. package/opencode-plugin/plugin.json +1 -1
  95. package/package.json +1 -1
  96. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  97. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-core.js +2 -2
  98. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +1 -1
  99. package/plugins/harness-everything/plugin.json +1 -1
  100. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  101. package/plugins/harness-everything/skills/harness-everything/scripts/doc-check.js +1 -1
  102. package/plugins/harness-everything/skills/harness-everything/scripts/doc-lifecycle.js +2 -2
  103. package/plugins/harness-everything/skills/harness-everything/scripts/doc-obligations.js +2 -2
  104. package/plugins/harness-everything/skills/self-evolve/SKILL.md +1 -1
  105. package/plugins/harness-everything/skills/self-evolve/references/memory-resolution.md +11 -0
  106. package/plugins/harness-everything/skills/self-evolve/scripts/lesson-candidate.js +9 -12
  107. package/plugins/harness-everything/skills/self-evolve/scripts/persist-memory.js +1 -14
  108. package/plugins/harness-everything/skills/self-evolve/scripts/register-dynamic-skill.js +5 -9
  109. package/plugins/harness-everything/skills/self-evolve/scripts/workspace-helper.js +98 -0
  110. package/sbom.cdx.json +7 -7
  111. package/self-evolve/SKILL.md +1 -1
  112. package/self-evolve/references/memory-resolution.md +11 -0
  113. package/self-evolve/scripts/lesson-candidate.js +9 -12
  114. package/self-evolve/scripts/persist-memory.js +1 -14
  115. package/self-evolve/scripts/register-dynamic-skill.js +5 -9
  116. package/self-evolve/scripts/workspace-helper.js +98 -0
@@ -0,0 +1,262 @@
1
+ #!/usr/bin/env python3
2
+ """Bounded, evidence-retaining #290 pilot using existing subscription CLIs."""
3
+ import argparse
4
+ import hashlib
5
+ import json
6
+ import os
7
+ from pathlib import Path
8
+ import shutil
9
+ import subprocess
10
+ import tempfile
11
+ import time
12
+ import uuid
13
+ from read_metrics import collect_reads
14
+
15
+ HERE = Path(__file__).resolve().parent
16
+ ROOT = HERE.parent.parent
17
+ PROTOCOL = json.loads((HERE / 'protocol.json').read_text())
18
+ FABLE = ['fable-mode/SKILL.md', 'fable-mode/references/profile-lookup.md',
19
+ 'fable-mode/references/model-matrix.md', 'fable-mode/CONTRACT-FORMAT.md',
20
+ 'fable-mode/references/execution-phases.md',
21
+ 'fable-mode/execution-guardrails/SKILL.md']
22
+ DOCUMENTS = {
23
+ 'profile-lookup': FABLE,
24
+ 'quixbugs-find-in-sorted': ['tdd/SKILL.md', 'verification-loop/SKILL.md',
25
+ 'harness-everything/references/triage-and-tiers.md'],
26
+ 'polyglot-simple-linked-list-staged': FABLE + ['tdd/SKILL.md', 'verification-loop/SKILL.md'],
27
+ }
28
+ PROMPTS = {
29
+ 'profile-lookup': "Explain what 'fable on sonnect' means; return only a small JSON selection record with requestedProfile, effectiveProfile, profileAlias, assignedRole, runtimeModel, runtimeEffort. No orchestration or delegation.",
30
+ 'quixbugs-find-in-sorted': "Repair find_in_sorted.py so all cases in cases.json pass. Preserve the documented function contract and keep the repair within that file. Verify with python3 check.py before completing.",
31
+ 'polyglot-simple-linked-list-staged': "Implement the Simple Linked List module described in instructions.md. Execute a staged workflow with three dependent stages: (1) Element value and next representation; (2) List insertion, constructor, head and length using Element; (3) array conversion and reversal using List, followed by cold verification. Preserve all upstream API requirements. Keep implementation changes within simple-linked-list.js. Use the supplied dev-check.cjs to execute all 23 activated upstream tests. Keep the requested runtime model and high effort for any workers.",
32
+ }
33
+
34
+ def digest(data):
35
+ return hashlib.sha256(data).hexdigest()
36
+
37
+ def write_json(path, data):
38
+ path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + '\n')
39
+
40
+ def command(args, cwd=None, timeout=30):
41
+ p = subprocess.run(args, cwd=cwd, capture_output=True, text=True, timeout=timeout)
42
+ return {'command': args, 'exit': p.returncode, 'stdout': p.stdout, 'stderr': p.stderr}
43
+
44
+ def quix_check():
45
+ return '''import json\nfrom find_in_sorted import find_in_sorted\nfrom pathlib import Path\nfor line in Path('cases.json').read_text().splitlines():\n args, expected = json.loads(line)\n assert find_in_sorted(*args) == expected, (args,expected)\nprint('PASS: all 7 pinned upstream cases')\n'''
46
+
47
+ def prepare(base, workload, arm, model, repeat):
48
+ episode = base / f'{model["engine"]}-{workload}-r{repeat}-{arm}-{uuid.uuid4().hex[:8]}'
49
+ episode.mkdir()
50
+ ws = Path(tempfile.mkdtemp(prefix='harness290-'))
51
+ (ws / '.harness').symlink_to(ROOT, target_is_directory=True)
52
+ if workload == 'quixbugs-find-in-sorted':
53
+ shutil.copyfile(HERE/'fixtures/quixbugs/find_in_sorted.py', ws/'find_in_sorted.py')
54
+ shutil.copyfile(HERE/'fixtures/quixbugs/cases.json', ws/'cases.json')
55
+ (ws/'check.py').write_text(quix_check())
56
+ if workload == 'polyglot-simple-linked-list-staged':
57
+ for name in ['instructions.md', 'simple-linked-list.js']:
58
+ shutil.copyfile(HERE/'fixtures/polyglot'/name, ws/name)
59
+ (ws/'package.json').write_text('{"type":"module"}\n')
60
+ # Permitted development tests are the same full activated spec as the
61
+ # independent post-run grader, never the reference solution.
62
+ (ws/'dev-check.cjs').write_text(f"require({json.dumps(str(HERE/'grader.cjs'))}).grade(process.argv[2] || './simple-linked-list.js').then(p => process.exitCode=p?0:1);\n")
63
+ (ws/'AGENTS.md').write_text('Follow the selected Harness workflow and required checks. Harness skills and references are available under .harness. Resolve required bindings at their applicable steps. Preserve requested model and effort. Do not read experiment runner files, other episode directories, or gold/reference solutions. Do not edit .pilot.json, hooks, graders, instructions, or acceptance tests. Do not commit, push, create issues, or modify user configuration.\n')
64
+ docs = DOCUMENTS[workload]
65
+ for doc in docs:
66
+ if not (ROOT/doc).is_file():
67
+ raise RuntimeError(f'missing document {doc}')
68
+ write_json(ws/'.pilot.json', {'source': str(ROOT), 'arm': arm, 'documents': docs,
69
+ 'trace': str(episode/'host-events.jsonl'), 'routerTrace': str(episode/'router.txt')})
70
+ subprocess.run(['git','init','-q'], cwd=ws, check=True)
71
+ subprocess.run(['git','add','.'], cwd=ws, check=True)
72
+ subprocess.run(['git','-c','user.name=Pilot','-c','user.email=pilot@example.invalid',
73
+ '-c','commit.gpgsign=false','commit','-qm','fixture'], cwd=ws, check=True)
74
+ hook = 'node ' + json.dumps(str(HERE/'host-hook.cjs'))
75
+ hooks = {event: [{'hooks':[{'type':'command','command':hook+' '+event}]}]
76
+ for event in ['UserPromptSubmit','PreToolUse','PostToolUse','Stop']}
77
+ write_json(ws/'hook-settings.json', {'hooks': hooks})
78
+ return episode, ws, hooks
79
+
80
+ def invocation(model, ws, hooks, smoke=False):
81
+ if model['engine'] == 'claude':
82
+ return ['claude','-p','--verbose','--output-format','stream-json','--include-hook-events',
83
+ '--model', model['model'],'--effort','high','--max-turns','35',
84
+ '--setting-sources','project,local','--settings',str(ws/'hook-settings.json'),
85
+ '--allowedTools','Read,Edit,Write,Bash','--strict-mcp-config']
86
+ # Configured automation trusts the reviewed experiment adapter, not an
87
+ # action-gate override. Existing native permission policy stays never.
88
+ def toml_value(value):
89
+ if isinstance(value, dict):
90
+ return '{'+','.join(k+'='+toml_value(v) for k,v in value.items())+'}'
91
+ if isinstance(value,list): return '['+','.join(map(toml_value,value))+']'
92
+ return json.dumps(value)
93
+ args = ['codex','exec','--json','--ignore-user-config','--dangerously-bypass-hook-trust',
94
+ '-m',model['model'],'-c','model_reasoning_effort="high"',
95
+ '-c','approval_policy="never"','-s','workspace-write','-C',str(ws)]
96
+ for event, groups in hooks.items():
97
+ args += ['-c', 'hooks.'+event+'='+toml_value(groups)]
98
+ return args + ['-']
99
+
100
+ def grade(workload, ws, transcript):
101
+ if workload == 'profile-lookup':
102
+ # Locate a JSON selection object, not incidental occurrences in tool
103
+ # input. Final answer extraction is engine-specific in summarize().
104
+ return {'external_check': 'selection-final-json', 'pending_parse': True}
105
+ if workload == 'quixbugs-find-in-sorted':
106
+ result = command(['python3','check.py'], ws, 20)
107
+ else:
108
+ result = command(['node',str(HERE/'grader.cjs'), str(ws/'simple-linked-list.js')], ws, 20)
109
+ result['pass'] = result['exit'] == 0
110
+ return result
111
+
112
+ def require_router_attribution(episode):
113
+ router = episode/'router.txt'
114
+ text = router.read_text() if router.exists() else ''
115
+ if 'ROUTER WORKFLOW PLAN' not in text and 'RETAINED EXECUTION CONTRACT' not in text:
116
+ raise RuntimeError('router attribution absent; stop before further model calls')
117
+
118
+ def run_episode(base, model, workload, arm, repeat, smoke=False):
119
+ episode, ws, hooks = prepare(base,workload,arm,model,repeat)
120
+ prompt = PROMPTS[workload]
121
+ env = dict(os.environ)
122
+ env['HARNESS_STATE_HOME'] = str(ws/'.pilot-state')
123
+ env['HARNESS_WORKSPACE_ROOT'] = str(ws)
124
+ args = invocation(model,ws,hooks,smoke)
125
+ manifest = {'model':model,'workload':workload,'arm':arm,'repeat':repeat,'preflight':smoke,
126
+ 'workspace':str(ws),'argv':args,'prompt_sha256':digest(prompt.encode()),
127
+ 'protocol_sha256':digest((HERE/'protocol.json').read_bytes()),
128
+ 'documents': {p:digest((ROOT/p).read_bytes()) for p in DOCUMENTS[workload]},
129
+ 'fixture':{p.name:digest(p.read_bytes()) for p in ws.iterdir() if p.is_file()},
130
+ 'started_at':time.strftime('%Y-%m-%dT%H:%M:%SZ',time.gmtime())}
131
+ write_json(episode/'manifest.json',manifest)
132
+ (episode/'prompt.txt').write_text(prompt+'\n')
133
+ start = time.monotonic()
134
+ timeout = 90 if smoke else PROTOCOL['episode_timeout_seconds'][workload]
135
+ with (episode/'transcript.jsonl').open('w') as out, (episode/'stderr.txt').open('w') as err:
136
+ try:
137
+ p = subprocess.Popen(args,cwd=ws,stdin=subprocess.PIPE,stdout=out,stderr=err,env=env,
138
+ text=True,start_new_session=True)
139
+ p.stdin.write(prompt+'\n'); p.stdin.close()
140
+ while p.poll() is None:
141
+ if time.monotonic()-start > timeout:
142
+ raise subprocess.TimeoutExpired(args, timeout)
143
+ # Check emitted cumulative usage, never sum repeated snapshots.
144
+ output_tokens = 0
145
+ for line in (episode/'transcript.jsonl').read_text().splitlines():
146
+ try: event=json.loads(line)
147
+ except json.JSONDecodeError: continue
148
+ if event.get('type') in ['result','turn.completed']:
149
+ output_tokens = max(output_tokens,event.get('usage',{}).get('output_tokens',0))
150
+ if output_tokens > PROTOCOL['episode_output_token_cap']:
151
+ raise subprocess.TimeoutExpired(args, timeout)
152
+ time.sleep(1)
153
+ status, reason = p.returncode, None
154
+ except subprocess.TimeoutExpired:
155
+ import signal
156
+ os.killpg(p.pid,signal.SIGTERM)
157
+ try: p.wait(timeout=5)
158
+ except subprocess.TimeoutExpired:
159
+ os.killpg(p.pid,signal.SIGKILL);p.wait()
160
+ status, reason = p.returncode, 'wall-time-budget'
161
+ result = {'exit':status,'stop_reason':reason,'wall_seconds':round(time.monotonic()-start,3),
162
+ 'grader':grade(workload,ws,episode/'transcript.jsonl')}
163
+ for name in ['find_in_sorted.py','simple-linked-list.js']:
164
+ if (ws/name).exists(): shutil.copyfile(ws/name,episode/name)
165
+ state = ws/'.pilot-state'
166
+ if state.exists(): shutil.copytree(state,episode/'state')
167
+ write_json(episode/'result.json',result)
168
+ print(json.dumps({'episode':str(episode),'result':result}),flush=True)
169
+ return episode
170
+
171
+ def summarize(base):
172
+ rows = []
173
+ for episode in sorted(base.iterdir()):
174
+ if not (episode/'result.json').exists(): continue
175
+ m=json.loads((episode/'manifest.json').read_text()); r=json.loads((episode/'result.json').read_text())
176
+ events=[]
177
+ for line in (episode/'transcript.jsonl').read_text().splitlines():
178
+ try: events.append(json.loads(line))
179
+ except json.JSONDecodeError: pass
180
+ final='';usage=None;actual=None;tool_calls=0;reads=[];reported_cost=None
181
+ for e in events:
182
+ if e.get('type')=='turn.completed': usage=e.get('usage')
183
+ if e.get('type')=='item.completed':
184
+ item=e.get('item',{})
185
+ if item.get('type')=='agent_message': final=item.get('text','')
186
+ if item.get('type')=='command_execution':
187
+ tool_calls+=1
188
+ reads.append({'command':item.get('command'),'output_bytes':len(item.get('aggregated_output','').encode())})
189
+ if e.get('type')=='result':
190
+ final=e.get('result','');usage=e.get('usage');reported_cost=e.get('total_cost_usd')
191
+ actual=e.get('modelUsage')
192
+ if e.get('type')=='assistant':
193
+ actual=e.get('message',{}).get('model',actual)
194
+ for item in e.get('message',{}).get('content',[]):
195
+ if item.get('type')=='tool_use':
196
+ tool_calls+=1
197
+ if item.get('name') in ['Read','Bash']:
198
+ reads.append({'tool':item.get('name'),'input':item.get('input')})
199
+ router=(episode/'router.txt').read_text() if (episode/'router.txt').exists() else ''
200
+ host_trace=(episode/'host-events.jsonl').read_text() if (episode/'host-events.jsonl').exists() else ''
201
+ attributed='ROUTER WORKFLOW PLAN' in router or 'RETAINED EXECUTION CONTRACT' in router
202
+ if m['workload']=='profile-lookup':
203
+ decoder=json.JSONDecoder(); selection=None
204
+ for pos,char in enumerate(final):
205
+ if char!='{': continue
206
+ try: obj,_=decoder.raw_decode(final[pos:])
207
+ except json.JSONDecodeError: continue
208
+ if isinstance(obj,dict) and 'requestedProfile' in obj: selection=obj;break
209
+ expected={'requestedProfile':'reasoning','effectiveProfile':'reasoning','profileAlias':'sonnect',
210
+ 'assignedRole':'reasoning-worker','runtimeModel':None,'runtimeEffort':None}
211
+ import re
212
+ clean=re.sub(r'<!--\s*harness-label\s+.*?-->','',final,flags=re.S).strip()
213
+ if clean.startswith('```json\n') and clean.endswith('```'):
214
+ clean=clean[len('```json\n'):-3].strip()
215
+ try: format_pass=json.loads(clean)==expected
216
+ except json.JSONDecodeError: format_pass=False
217
+ r['grader']={'pass':selection==expected and format_pass,'selection_pass':selection==expected,
218
+ 'format_pass':format_pass,'selection':selection,'expected':expected}
219
+ thread=next((e.get('thread_id') for e in events if e.get('type')=='thread.started'),None)
220
+ effective_effort=None
221
+ if thread:
222
+ session_root=Path.home()/'.codex/sessions'
223
+ for session_file in session_root.glob('*/*/*/*'+thread+'*'):
224
+ for line in session_file.read_text().splitlines():
225
+ event=json.loads(line)
226
+ if event.get('type')=='turn_context':
227
+ actual=event['payload'].get('model');effective_effort=event['payload'].get('effort')
228
+ reference_reads, _, _ = collect_reads(events, {name:(ROOT/name).read_text() for name in m['documents']}, str(ROOT))
229
+ row={**m,**r,'actual_model_reported':actual,'usage':usage,'host_reported_cost_usd':reported_cost,
230
+ 'tool_calls':tool_calls,'reference_read_operations':reference_reads,'router_attributed':attributed,
231
+ 'hook_event_count':len(host_trace.splitlines()),'final':final,
232
+ 'effective_effort_reported':effective_effort,
233
+ 'classification':'definitive' if attributed and usage is not None else 'inconclusive'}
234
+ write_json(episode/'analysis.json',row);rows.append(row)
235
+ write_json(base/'summary.json',rows)
236
+ print(json.dumps([{k:r[k] for k in ['model','workload','arm','repeat','classification','exit','wall_seconds','usage','router_attributed','grader']} for r in rows],indent=2))
237
+
238
+ if __name__=='__main__':
239
+ parser=argparse.ArgumentParser();parser.add_argument('mode',choices=['preflight','run','summarize'])
240
+ parser.add_argument('--output',required=True);parser.add_argument('--engine',choices=['codex','claude'])
241
+ args=parser.parse_args();base=Path(args.output).resolve();base.mkdir(parents=True,exist_ok=True)
242
+ if args.mode=='summarize': summarize(base)
243
+ else:
244
+ suite_start=time.monotonic()
245
+ for workload in (['profile-lookup'] if args.mode=='preflight' else PROTOCOL['workloads']):
246
+ for model in PROTOCOL['models']:
247
+ if args.engine and model['engine']!=args.engine:continue
248
+ for repeat in ([0] if args.mode=='preflight' else [1,2]):
249
+ for arm in (['B'] if args.mode=='preflight' else (['A','B'] if repeat==1 else ['B','A'])):
250
+ if time.monotonic()-suite_start > PROTOCOL['aggregate_wall_budget_seconds']:
251
+ raise SystemExit('aggregate wall budget reached; remaining trials not attempted')
252
+ total_output=0
253
+ for file in base.glob('*/transcript.jsonl'):
254
+ for line in file.read_text().splitlines():
255
+ try: event=json.loads(line)
256
+ except json.JSONDecodeError:continue
257
+ if event.get('type') in ['result','turn.completed']:
258
+ total_output+=event.get('usage',{}).get('output_tokens',0)
259
+ if total_output > PROTOCOL['aggregate_output_token_cap']:
260
+ raise SystemExit('aggregate output budget reached; remaining trials not attempted')
261
+ completed = run_episode(base,model,workload,arm,repeat,args.mode=='preflight')
262
+ require_router_attribution(completed)
@@ -0,0 +1,10 @@
1
+ {
2
+ "quixbugs/find_in_sorted.py": "https://raw.githubusercontent.com/jkoppel/QuixBugs/4257f44b0ff1181dedaedee6a447e133219fcebf/python_programs/find_in_sorted.py",
3
+ "quixbugs/test_find_in_sorted.py": "https://raw.githubusercontent.com/jkoppel/QuixBugs/4257f44b0ff1181dedaedee6a447e133219fcebf/python_testcases/test_find_in_sorted.py",
4
+ "polyglot/instructions.md": "https://raw.githubusercontent.com/Aider-AI/polyglot-benchmark/7e0611e77b54e2dea774cdc0aa00cf9f7ed6144f/javascript/exercises/practice/simple-linked-list/.docs/instructions.md",
5
+ "polyglot/package.json": "https://raw.githubusercontent.com/Aider-AI/polyglot-benchmark/7e0611e77b54e2dea774cdc0aa00cf9f7ed6144f/javascript/exercises/practice/simple-linked-list/package.json",
6
+ "polyglot/simple-linked-list.spec.js": "https://raw.githubusercontent.com/Aider-AI/polyglot-benchmark/7e0611e77b54e2dea774cdc0aa00cf9f7ed6144f/javascript/exercises/practice/simple-linked-list/simple-linked-list.spec.js",
7
+ "polyglot/simple-linked-list.js": "https://raw.githubusercontent.com/Aider-AI/polyglot-benchmark/7e0611e77b54e2dea774cdc0aa00cf9f7ed6144f/javascript/exercises/practice/simple-linked-list/simple-linked-list.js",
8
+ "quixbugs/cases.json": "https://raw.githubusercontent.com/jkoppel/QuixBugs/4257f44b0ff1181dedaedee6a447e133219fcebf/json_testcases/find_in_sorted.json",
9
+ "quixbugs/LICENSE": "https://raw.githubusercontent.com/jkoppel/QuixBugs/4257f44b0ff1181dedaedee6a447e133219fcebf/LICENSE"
10
+ }
@@ -0,0 +1,5 @@
1
+ ....
2
+ ----------------------------------------------------------------------
3
+ Ran 4 tests in 0.002s
4
+
5
+ OK
@@ -0,0 +1,58 @@
1
+ [
2
+ {
3
+ "check": "test",
4
+ "exit": 0
5
+ },
6
+ {
7
+ "check": "test:mutations",
8
+ "exit": 0
9
+ },
10
+ {
11
+ "check": "test:mechanism",
12
+ "exit": 0
13
+ },
14
+ {
15
+ "check": "test:consistency",
16
+ "exit": 0
17
+ },
18
+ {
19
+ "check": "test:repo-contract",
20
+ "exit": 0
21
+ },
22
+ {
23
+ "check": "test:docs:capabilities",
24
+ "exit": 0
25
+ },
26
+ {
27
+ "check": "test:references",
28
+ "exit": 0
29
+ },
30
+ {
31
+ "check": "test:release",
32
+ "exit": 0
33
+ },
34
+ {
35
+ "check": "test:collision",
36
+ "exit": 0
37
+ },
38
+ {
39
+ "check": "test:routing:skills",
40
+ "exit": 0
41
+ },
42
+ {
43
+ "check": "test:routing:invariants",
44
+ "exit": 0
45
+ },
46
+ {
47
+ "check": "test:plugin:openai",
48
+ "exit": 0
49
+ },
50
+ {
51
+ "check": "test:plugin:submission",
52
+ "exit": 0
53
+ },
54
+ {
55
+ "check": "test:platform:compatibility",
56
+ "exit": 0
57
+ }
58
+ ]
@@ -0,0 +1,5 @@
1
+ .
2
+ ----------------------------------------------------------------------
3
+ Ran 1 test in 0.045s
4
+
5
+ OK
@@ -0,0 +1,58 @@
1
+ [
2
+ {
3
+ "check": "test",
4
+ "exit": 1
5
+ },
6
+ {
7
+ "check": "test:mutations",
8
+ "exit": 0
9
+ },
10
+ {
11
+ "check": "test:mechanism",
12
+ "exit": 1
13
+ },
14
+ {
15
+ "check": "test:consistency",
16
+ "exit": 1
17
+ },
18
+ {
19
+ "check": "test:repo-contract",
20
+ "exit": 0
21
+ },
22
+ {
23
+ "check": "test:docs:capabilities",
24
+ "exit": 0
25
+ },
26
+ {
27
+ "check": "test:references",
28
+ "exit": 0
29
+ },
30
+ {
31
+ "check": "test:release",
32
+ "exit": 1
33
+ },
34
+ {
35
+ "check": "test:collision",
36
+ "exit": 1
37
+ },
38
+ {
39
+ "check": "test:routing:skills",
40
+ "exit": 1
41
+ },
42
+ {
43
+ "check": "test:routing:invariants",
44
+ "exit": 0
45
+ },
46
+ {
47
+ "check": "test:plugin:openai",
48
+ "exit": 0
49
+ },
50
+ {
51
+ "check": "test:plugin:submission",
52
+ "exit": 0
53
+ },
54
+ {
55
+ "check": "test:platform:compatibility",
56
+ "exit": 0
57
+ }
58
+ ]
@@ -0,0 +1,84 @@
1
+ {
2
+ "auditReportVersion": 2,
3
+ "vulnerabilities": {
4
+ "fast-uri": {
5
+ "name": "fast-uri",
6
+ "severity": "high",
7
+ "isDirect": false,
8
+ "via": [
9
+ {
10
+ "source": 1239943,
11
+ "name": "fast-uri",
12
+ "dependency": "fast-uri",
13
+ "title": "fast-uri vulnerable to authority injection via an unvalidated port in serialize",
14
+ "url": "https://github.com/advisories/GHSA-qw65-cvwx-89v3",
15
+ "severity": "high",
16
+ "cwe": [
17
+ "CWE-116"
18
+ ],
19
+ "cvss": {
20
+ "score": 7.5,
21
+ "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
22
+ },
23
+ "range": ">=3.0.0 <3.1.7"
24
+ },
25
+ {
26
+ "source": 1239946,
27
+ "name": "fast-uri",
28
+ "dependency": "fast-uri",
29
+ "title": "fast-uri vulnerable to host confusion via an unclosed bracket in the URI authority",
30
+ "url": "https://github.com/advisories/GHSA-58mr-gqgx-xq4g",
31
+ "severity": "high",
32
+ "cwe": [
33
+ "CWE-436"
34
+ ],
35
+ "cvss": {
36
+ "score": 7.5,
37
+ "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
38
+ },
39
+ "range": "=3.1.6"
40
+ },
41
+ {
42
+ "source": 1240091,
43
+ "name": "fast-uri",
44
+ "dependency": "fast-uri",
45
+ "title": "fast-uri vulnerable to inconsistent host case normalization via percent-encoded octets",
46
+ "url": "https://github.com/advisories/GHSA-hrr3-gc8f-f4qj",
47
+ "severity": "moderate",
48
+ "cwe": [
49
+ "CWE-178"
50
+ ],
51
+ "cvss": {
52
+ "score": 4.8,
53
+ "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
54
+ },
55
+ "range": ">=3.0.0 <3.1.8"
56
+ }
57
+ ],
58
+ "effects": [],
59
+ "range": "3.0.0 - 3.1.7",
60
+ "nodes": [
61
+ "node_modules/fast-uri"
62
+ ],
63
+ "fixAvailable": true
64
+ }
65
+ },
66
+ "metadata": {
67
+ "vulnerabilities": {
68
+ "info": 0,
69
+ "low": 0,
70
+ "moderate": 0,
71
+ "high": 1,
72
+ "critical": 0,
73
+ "total": 1
74
+ },
75
+ "dependencies": {
76
+ "prod": 1,
77
+ "dev": 123,
78
+ "optional": 20,
79
+ "peer": 21,
80
+ "peerOptional": 0,
81
+ "total": 123
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "date": "2026-10-31",
3
+ "evidence_layer": "deterministic mechanism and offline analysis; no model calls",
4
+ "implementation_sha256": {
5
+ "analyze.py": "7001dfd507c354e95483172bf55f5ffa836a936390cfa777d3955bfce00ae4f1",
6
+ "analyze.test.py": "571cd99fa1b63170c7079407bdc5d1ce5a383bc997c2e689202d5441fdc8a2f8",
7
+ "read_metrics.py": "ccddb2599500cfdd9c80bb32afc6265aa1f09fd17d19e467d558ab6a0ae68ee3",
8
+ "metrics.test.py": "28845c1af7570834e29b033e0407f3d7ecb41bf0df44185a007b81772c8033ec",
9
+ "reporting.py": "5ec38030eb1235a8226e43c9aec86153abc59b65f9a829c58a4d74b1e175713d",
10
+ "replay.py": "e4820db94f2684a549db45017485546ebd68448f8e1c0cc9856639aead948750",
11
+ "export.py": "75144035c383d17f408bc12adcbaed9b5c2e062c32702f28ea4199f3b2ed5a8f",
12
+ "export.test.py": "8311c4cfafc8cdf89d2310495c9c2ed821449b9fe32f7dd131f6132be4e09de2",
13
+ "grader.cjs": "2204bf0999b3ea191a84bc1f7817bb60b3ff38ef925ee77faf8bd68aed7c711b",
14
+ "grader.test.cjs": "1296407409c16057ce4491431001fcd924283fbd134ee15eace4fb203e6d33a2",
15
+ "run.py": "c669cddf520fecd0ee956549cc8c9cb5e3ceb56dff1fa0d4abbd5515965eba51",
16
+ "fable-supplement.py": "fa92e32b85e74aa2b3e848ad8611f98bb179bb4e2a2e11bd68bacceb445dc82d",
17
+ "fixture.test.py": "cc62a42ca33aebe47454836d1267a4136dca87a8f530cf405c73b0662a40488a",
18
+ "check.py": "78fc05e706e0c89087f992575fe4fa1c6e04c0a5da48e591b28ce54c8d4b09ee"
19
+ },
20
+ "commands": [
21
+ {
22
+ "command": "python3 benchmarks/issue290-pilot/check.py",
23
+ "exit": 0
24
+ }
25
+ ],
26
+ "results": {
27
+ "python_tests": 26,
28
+ "node_hook": "PASS",
29
+ "node_grader": "PASS",
30
+ "syntax": "PASS",
31
+ "replay_episodes": 40,
32
+ "verified_exported_hashes": 621,
33
+ "readme_tables": "exact generated match",
34
+ "final_scan": "PASS for configured credential classes; not a proof of universal absence"
35
+ },
36
+ "filesystem_order_regression": {
37
+ "counterexample": "Reversed Path.rglob enumeration changed stage-binding order in the ledger.",
38
+ "before": "isolated regression fails on unsorted analyzer",
39
+ "after": "sorted state traversal passes, including reversed-enumeration control"
40
+ },
41
+ "historical_failures_retained": [
42
+ {
43
+ "ci_run": 41176140722,
44
+ "head": "8c8e6c1e770bf6aac85420e6d1bf0a4e350abda0",
45
+ "failure": "offline replay ledger mismatch"
46
+ },
47
+ {
48
+ "ci_run": 41176337714,
49
+ "head": "664da1e4f32251bd9e4c79d78fef5152cd9b86cd",
50
+ "failure": "diagnostics identify stage-binding ordering from filesystem enumeration"
51
+ }
52
+ ],
53
+ "limits": [
54
+ "Original archive and model observations unchanged.",
55
+ "Private session/worker telemetry remains frozen or unknown.",
56
+ "Final CI is separate from these local results.",
57
+ "Governance REVIEW_REQUIRED is not waived by this report."
58
+ ]
59
+ }
@@ -0,0 +1,22 @@
1
+ # node v24.14.1
2
+ ## analyze.test.py
3
+ ....
4
+ ----------------------------------------------------------------------
5
+ Ran 4 tests in 0.002s
6
+
7
+ OK
8
+ exit 0
9
+ ## fixture.test.py
10
+ .
11
+ ----------------------------------------------------------------------
12
+ Ran 1 test in 0.043s
13
+
14
+ OK
15
+ exit 0
16
+ ## hook.test.cjs
17
+ PASS canonical host-hook attribution and isolated A/B timing
18
+ exit 0
19
+ ## py_compile
20
+ OK
21
+ ## node --check
22
+ OK