@@ -903,10 +903,19 @@ export function createPruningCompactor(
903903 version : "1.9.0" ,
904904 async apply (
905905 turns : ConversationTurn [ ] ,
906- _ctx : StrategyContext ,
906+ ctx : StrategyContext ,
907907 ) : Promise < StrategyResult < ConversationTurn [ ] > > {
908908 // Prior compacted summaries fold into the next handoff, not frozen.
909909 const shape = resolveCompactionShape ( cfg . compactionShape ) ;
910+ // Operator and automatic folds share one human reason string. Keep the
911+ // reactor's raw trigger (director: prefix included) on the manifest so
912+ // a later reader can tell them apart.
913+ const withTrigger = (
914+ fields : Record < string , unknown > ,
915+ ) : Record < string , unknown > => ( {
916+ ...fields ,
917+ trigger : ctx . trigger ,
918+ } ) ;
910919
911920 if ( turns . length <= COMPACT_NOOP_FLOOR ) {
912921 return {
@@ -919,7 +928,7 @@ export function createPruningCompactor(
919928 ...extraInstructionParameter ( cfg ) ,
920929 } ,
921930 reason : "no compaction needed" ,
922- decisions : { agedImageCount : 0 } ,
931+ decisions : withTrigger ( { agedImageCount : 0 } ) ,
923932 } ,
924933 } ;
925934 }
@@ -988,14 +997,14 @@ export function createPruningCompactor(
988997 ...extraInstructionParameter ( cfg ) ,
989998 } ,
990999 reason : "no compaction needed" ,
991- decisions : {
1000+ decisions : withTrigger ( {
9921001 tailBudgetTokens : shape . tailBudgetTokens ,
9931002 tailTokenEstimate : tail . tailTokenEstimate ,
9941003 shortenedToolOutputs : tail . shortenedToolOutputs ,
9951004 agedImageCount : aged . agedImageCount ,
9961005 supersededReadCount : supersededReads . size ,
9971006 liveTokenEstimate : estimateContextTokens ( output ) ,
998- } ,
1007+ } ) ,
9991008 } ,
10001009 ...( aged . blobs . length > 0 ? { blobs : aged . blobs } : { } ) ,
10011010 } ;
@@ -1036,10 +1045,10 @@ export function createPruningCompactor(
10361045 ...extraInstructionParameter ( cfg ) ,
10371046 } ,
10381047 reason : "summarize failed" ,
1039- decisions : {
1048+ decisions : withTrigger ( {
10401049 summarizeFailed : 1 ,
10411050 agedImageCount : aged . agedImageCount ,
1042- } ,
1051+ } ) ,
10431052 } ,
10441053 } ;
10451054 }
@@ -1061,10 +1070,10 @@ export function createPruningCompactor(
10611070 ...extraInstructionParameter ( cfg ) ,
10621071 } ,
10631072 reason : "summarize failed" ,
1064- decisions : {
1073+ decisions : withTrigger ( {
10651074 summarizeFailed : 1 ,
10661075 agedImageCount : aged . agedImageCount ,
1067- } ,
1076+ } ) ,
10681077 } ,
10691078 } ;
10701079 }
@@ -1090,12 +1099,12 @@ export function createPruningCompactor(
10901099 compactionShape : shape ,
10911100 } ,
10921101 reason : "verify failed — keeping prior context" ,
1093- decisions : {
1102+ decisions : withTrigger ( {
10941103 verifyAborted : 1 ,
10951104 verifyAbortReason : abortReason ,
10961105 verifyMissing : misses . map ( ( m ) => m . kind ) ,
10971106 agedImageCount : aged . agedImageCount ,
1098- } ,
1107+ } ) ,
10991108 } ,
11001109 } ) ;
11011110 if ( verified . aborted && verified . abortReason === "contradiction" ) {
@@ -1198,7 +1207,7 @@ export function createPruningCompactor(
11981207 ? ` (statistics-only stub: ${ summarizeFallback } )`
11991208 : ""
12001209 } `,
1201- decisions : {
1210+ decisions : withTrigger ( {
12021211 summarizedTurnCount : summarizedTurns . length ,
12031212 anchorTurnCount : 0 ,
12041213 recentTurnCount : tailTurns . length ,
@@ -1220,7 +1229,7 @@ export function createPruningCompactor(
12201229 }
12211230 : { } ) ,
12221231 ...verifyDecisions ,
1223- } ,
1232+ } ) ,
12241233 } ,
12251234 blobs : [ ...aged . blobs , handoff . blob ] ,
12261235 } ;
0 commit comments