@@ -309,6 +309,20 @@ Output ONLY the JSON array. If no gaps, return [].`,
309309 description : "Lists review-gated lesson and prompt-template candidates for the current repository." ,
310310 inputSchema : { type : "object" , properties : { } }
311311 } ,
312+ {
313+ name : "record_terminal_outcome" ,
314+ description : "Records one evidence-backed terminal goal outcome and an optional review-gated lesson candidate." ,
315+ inputSchema : {
316+ type : "object" ,
317+ properties : {
318+ goal_id : { type : "string" } ,
319+ status : { type : "string" , enum : [ "completed" , "failed" , "cancelled" , "blocked" , "budget_exhausted" ] } ,
320+ evidence : { type : "array" , items : { type : "string" } , minItems : 1 } ,
321+ summary : { type : "string" }
322+ } ,
323+ required : [ "goal_id" , "status" , "evidence" , "summary" ]
324+ }
325+ } ,
312326 {
313327 name : "review_lesson" ,
314328 description : "Approves or rejects a proposed lesson before it can influence future prompts." ,
@@ -552,6 +566,19 @@ Output ONLY the JSON array. If no gaps, return [].`,
552566 const candidates = this . eventStore . getLearningCandidates ( this . repository . id ) ;
553567 return { content : [ { type : "text" , text : JSON . stringify ( candidates ) } ] } ;
554568 }
569+ case "record_terminal_outcome" : {
570+ const outcome = z . object ( {
571+ goal_id : z . string ( ) . min ( 1 ) ,
572+ status : z . enum ( [ "completed" , "failed" , "cancelled" , "blocked" , "budget_exhausted" ] ) ,
573+ evidence : z . array ( z . string ( ) . min ( 1 ) ) . min ( 1 ) ,
574+ summary : z . string ( ) . min ( 1 ) ,
575+ } ) . parse ( request . params . arguments ) ;
576+ const recorded = this . eventStore . recordTerminalOutcome ( {
577+ ...outcome ,
578+ repo_id : this . repository . id ,
579+ } ) ;
580+ return { content : [ { type : "text" , text : JSON . stringify ( { recorded, goal_id : outcome . goal_id } ) } ] } ;
581+ }
555582 case "review_lesson" : {
556583 const { id, approved } = z . object ( { id : z . string ( ) , approved : z . boolean ( ) } ) . parse ( request . params . arguments ) ;
557584 const changed = this . eventStore . reviewLesson ( this . repository . id , id , approved ) ;
0 commit comments