Show all analysis phases in token chart legend and preview

This commit is contained in:
Nico committed 2026-10-21 21:39:26 +02:00
1 parent 58fc00601e
commit cbb69a2115
6 files changed
+70 -7

No files matched your search

+15 -3
View File
@@ -37,14 +37,26 @@ def seed(root, case_id, title, completed=False):
ref=pointer+'.json';store.advance(*identity,state,step_id=state,
artifacts={pointer:ref},additions={ref:json_bytes({'analysis_revision':1})})
store.advance(*identity,'INVESTIGATING_HYPOTHESES',step_id='investigate')
for i,(category,inp,out) in enumerate([('regular',12000,3000),('correction',3000,900)]):
measured = [
('BUILDING_CASE','entity_resolution_plan_v4','regular',2500,500),
('INTERPRETING_CASE','case_interpretation_v1','regular',2000,500),
('GENERATING_HYPOTHESES','hypotheses_v4','regular',1500,500),
('INVESTIGATING_HYPOTHESES','investigation_lean_v21','regular',4000,1000),
]
if completed:
measured += [
('BUILDING_DIAGNOSIS','diagnosis_v8','regular',1500,500),
('BUILDING_DIAGNOSIS','change_request_v9','regular',500,0),
]
measured.append(('INVESTIGATING_HYPOTHESES','investigation_format_repair_v1','correction',3000,900))
for i,(phase,prompt,category,inp,out) in enumerate(measured):
ref=f'call{i}.json';request=f'request{i}.json'
call={'rounds':1,'phase':'INVESTIGATING_HYPOTHESES','request_ref':request,'outcome':{
call={'rounds':1,'phase':phase,'request_ref':request,'outcome':{
'usage_classification':category,'metadata':{'input_tokens':inp,'output_tokens':out,
'reasoning_tokens':out//2,'cached_input_tokens':1000}}}
store.advance(*identity,'INVESTIGATING_HYPOTHESES',step_id=f'call{i}',
details={'operation':'llm-round','result_ref':ref},
additions={ref:json_bytes(call),request:json_bytes({'prompt_version':'investigation_lean_v21'})})
additions={ref:json_bytes(call),request:json_bytes({'prompt_version':prompt})})
if completed:
store.advance(*identity,'BUILDING_DIAGNOSIS',step_id='diagnosis')
store.advance(*identity,'OUTPUT_READY',step_id='done')