Simplify investigation replies and derive controller bookkeeping
This commit is contained in:
1 parent
57984e5793
commit
49095ac803
26 files changed
+2072
-207
No files matched your search
@@ -45,10 +45,10 @@ class LoopAdapter:
|
||||
result["next"]={"kind":"test","executor":"human","question":"What occurs after interaction?","steps":["Interact once"],
|
||||
"prerequisites":["Use the specified build"],"requested_observations":["Record the observed state"],"environment":"build-A"}
|
||||
if self.change:self.change(result,context)
|
||||
if request['prompt_version'] in {'investigation_project_v12','investigation_project_v13'}:
|
||||
if request['prompt_version'] in {'investigation_project_v12','investigation_project_v13','investigation_project_v14'}:
|
||||
result['update'].setdefault('causal_review',{'effect':'neutral','support':[],'against':[],
|
||||
'reason':'This fixture gathers context without establishing a causal defect.'})
|
||||
if request['prompt_version']=='investigation_project_v13':
|
||||
if request['prompt_version'] in {'investigation_project_v13','investigation_project_v14'}:
|
||||
existing=context.get('working_brief')
|
||||
review=result['update']['causal_review']
|
||||
findings=[]
|
||||
@@ -62,6 +62,16 @@ class LoopAdapter:
|
||||
'uncertainties':['Causal defect not established.'],'next_question':'Check the selected mechanism.',
|
||||
'changes':[{'id':fid,'reason':'Fixture revises the finding.',
|
||||
'evidence_refs':result['update']['evidence_refs']} for fid,f in old.items() if new.get(fid)!=f]})
|
||||
if request['prompt_version']=='investigation_project_v14':
|
||||
b=result['update']['working_brief']
|
||||
if b['format_version']==1:
|
||||
reasons={v['id']:v['reason'] for v in b.pop('changes')}
|
||||
b['format_version']=2
|
||||
for f in b['findings']:
|
||||
if f['id'] in reasons:f['revision_reason']=reasons[f['id']]
|
||||
b['retired']=[{'id':fid,'reason':reason} for fid,reason in reasons.items() if fid not in {f['id'] for f in b['findings']}]
|
||||
for k in ('evidence_refs','causal_review','note'):result['update'].pop(k,None)
|
||||
if result['assessment']:result['assessment'].pop('evidence_refs',None)
|
||||
return ProviderResponse(result,"fixture-investigation",100,50)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user