@@ -3481,6 +3481,10 @@ it.effect("records every lifecycle event in order and erases bodies when forgott
34813481 { ...existing ( helpful , "history-down" ) , action : "feedback" , helpful : false } ,
34823482 { kind : "user" } ,
34833483 ) ;
3484+ const offTask = yield * knowledge . mutate (
3485+ { ...existing ( unhelpful , "history-off-task" ) , action : "feedback" , helpful : "irrelevant" } ,
3486+ agent ,
3487+ ) ;
34843488 const detail = yield * knowledge . readFact ( { projectId, factId : created . id } ) ;
34853489 assert . deepEqual (
34863490 detail . history . map ( ( entry ) => [ entry . event , entry . revision , entry . helpful ] ) ,
@@ -3489,8 +3493,11 @@ it.effect("records every lifecycle event in order and erases bodies when forgott
34893493 [ "edited" , 2 , null ] ,
34903494 [ "feedback" , 3 , true ] ,
34913495 [ "feedback" , 4 , false ] ,
3496+ [ "feedback" , 5 , false ] ,
34923497 ] ,
34933498 ) ;
3499+ assert . equal ( detail . history . at ( - 1 ) ?. feedbackScope , "task" ) ;
3500+ assert . equal ( detail . history . at ( - 1 ) ?. reason , "Unrelated to this task." ) ;
34943501 assert . deepEqual ( detail . history [ 0 ] ?. actor , agent ) ;
34953502 assert . equal ( detail . history [ 1 ] ?. content , "Cache keys include tenant and region IDs." ) ;
34963503 assert . match ( detail . history [ 1 ] ?. contentDigest ?? "" , / ^ [ a - f 0 - 9 ] { 64 } $ / ) ;
@@ -3500,12 +3507,13 @@ it.effect("records every lifecycle event in order and erases bodies when forgott
35003507 [
35013508 [ 0.5 , 0.55 ] ,
35023509 [ 0.55 , unhelpful . trust ] ,
3510+ [ unhelpful . trust , offTask . trust ] ,
35033511 ] ,
35043512 ) ;
35053513 assert . isFalse ( detail . historyTruncated ) ;
35063514
35073515 yield * knowledge . mutate (
3508- { ...existing ( unhelpful , "history-forget" ) , action : "forget" } ,
3516+ { ...existing ( offTask , "history-forget" ) , action : "forget" } ,
35093517 { kind : "user" } ,
35103518 ) ;
35113519 const forgotten = yield * knowledge . readFact ( { projectId, factId : created . id } ) ;
0 commit comments