@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
22import { goalCreatedManagedSession } from "../src/features/personal-workspace/goal-created-session" ;
33import { preparedAcceptancePlan } from "../src/data/goal-acceptance-actions" ;
44import { conversationChannelId , conversationContextKey , createChatSession , fetchChatHistory ,
5- readManagedTaskValidation , type ManagedTaskTurn , type TypedActionProposal } from "../src/data/chat" ;
5+ readManagedTaskOutcome , type ManagedTaskTurn , type TypedActionProposal } from "../src/data/chat" ;
66
77const resources = { goal_id : "research" , goal_instance_id : null , agent_id : "codex" ,
88 managed_agent_id : "codex" , channel_id : "agent.codex" , session_id : "original-session" } ;
@@ -89,21 +89,21 @@ const postcondition = {schema_version: "loopx_turn_execution_v0", dry_run: false
8989 validation_stage : "task_postcondition" , receipt : { ok : true , lineage} } ;
9090const passingCheck = { schema_version : "loopx_turn_task_validation_v0" , ok : true , status : "passed" , summary : "Checks passed" } ;
9191const checkedTurn = { ...turn , response : { native_loopx : { ...postcondition , validation : passingCheck } } } ;
92- assert . equal ( readManagedTaskValidation ( checkedTurn ) ?. status , "passed" ) ;
93- assert . equal ( readManagedTaskValidation ( { ...turn , response : { native_loopx : { ...postcondition ,
94- validation : { ...passingCheck , ok : false , status : "failed" , summary : "One required check failed" } } } } ) ?. status , "failed" ,
92+ assert . equal ( readManagedTaskOutcome ( checkedTurn ) ?. validation . status , "passed" ) ;
93+ assert . equal ( readManagedTaskOutcome ( { ...turn , response : { native_loopx : { ...postcondition ,
94+ validation : { ...passingCheck , ok : false , status : "failed" , summary : "One required check failed" } } } } ) ?. validation . status , "failed" ,
9595 "A terminal conversation receipt can carry a failed independent check" ) ;
9696for ( const native_loopx of [
9797 { ...postcondition , dry_run : true , validation : passingCheck } ,
9898 { ...postcondition , validation_stage : "host_result_contract" , validation : passingCheck } ,
9999 { ...postcondition , validation : { ...passingCheck , ok : false } } ,
100100 { ...postcondition , receipt : { ok : true , lineage : { ...lineage , todo_id : "another-task" } } , validation : passingCheck } ,
101101] ) {
102- assert . equal ( readManagedTaskValidation ( { ...turn , response : { native_loopx} } ) , undefined ,
102+ assert . equal ( readManagedTaskOutcome ( { ...turn , response : { native_loopx} } ) , undefined ,
103103 "Simulation, unrelated lineage and inconsistent receipts cannot certify the selected Task" ) ;
104104}
105- assert . equal ( readManagedTaskValidation ( turn ) , undefined , "Legacy responses cannot attest a check" ) ;
106- assert . equal ( readManagedTaskValidation ( { ...checkedTurn , status : "running" } ) , undefined ) ;
105+ assert . equal ( readManagedTaskOutcome ( turn ) , undefined , "Legacy responses cannot attest a check" ) ;
106+ assert . equal ( readManagedTaskOutcome ( { ...checkedTurn , status : "running" } ) , undefined ) ;
107107const preparedCheck = ( scope : Record < string , unknown > ) : TypedActionProposal => ( {
108108 ...proposal , action_kind : "goal.acceptance.check" , status : "preview_ready" ,
109109 context : { kind : "goal" , goal_id : target . goalId } ,
0 commit comments