@@ -2268,64 +2268,3 @@ describe("createOptimizedContextStore metadata ownership (CL-10667)", () => {
22682268 expect ( ( await resumed . load ( ) ) . tokenUsage ) . toEqual ( USAGE_TWO ) ;
22692269 } ) ;
22702270} ) ;
2271-
2272- describe ( "live-turns generation cache staleness (CL-10757)" , ( ) => {
2273- test ( "in-process append invalidates the cache: load serves fresh turns" , async ( ) => {
2274- const dir = tempDir ( ) ;
2275- const store = await createOptimizedContextStore ( dir ) ;
2276- // The reactor extends its live turns array in place, so the store detects
2277- // the append by reference: keep the first turn object stable.
2278- const first = turn ( "one" ) ;
2279- await store . writeTurns ( [ first ] ) ;
2280- // Populates the generation cache.
2281- expect ( turnTexts ( ( await store . load ( ) ) . turns ) ) . toEqual ( [ "one" ] ) ;
2282-
2283- await store . writeTurns ( [ first , turn ( "two" ) ] ) ;
2284- expect ( turnTexts ( ( await store . load ( ) ) . turns ) ) . toEqual ( [ "one" , "two" ] ) ;
2285- } ) ;
2286-
2287- test ( "a committed rewrite is never served stale from the cache" , async ( ) => {
2288- const dir = tempDir ( ) ;
2289- const store = await createOptimizedContextStore ( dir ) ;
2290- await store . writeTurns ( [ turn ( "keep-a" ) , turn ( "drop-me" ) ] ) ;
2291- await store . writeMetadata ( EMPTY_CHECKPOINT_METADATA ) ;
2292- await store . commit ( { message : "published original" } ) ;
2293- // Populates the generation cache.
2294- expect ( turnTexts ( ( await store . load ( ) ) . turns ) ) . toEqual ( [
2295- "keep-a" ,
2296- "drop-me" ,
2297- ] ) ;
2298-
2299- // A rewrite stages off the live generation until commit, then the commit
2300- // lands it on disk: the post-commit load must serve it, not the cache.
2301- await store . writeTurns ( [ turn ( "[Compacted prior context]" ) , turn ( "keep-b" ) ] ) ;
2302- await store . commit ( { message : "publish compact" } ) ;
2303- expect ( turnTexts ( ( await store . load ( ) ) . turns ) ) . toEqual ( [
2304- "[Compacted prior context]" ,
2305- "keep-b" ,
2306- ] ) ;
2307- } ) ;
2308-
2309- test ( "a foreign write between loads is never served stale from the cache" , async ( ) => {
2310- const dir = tempDir ( ) ;
2311- const first = await createOptimizedContextStore ( dir ) ;
2312- await first . writeTurns ( [ turn ( "one" ) ] ) ;
2313- // Populates the first generation's cache.
2314- expect ( turnTexts ( ( await first . load ( ) ) . turns ) ) . toEqual ( [ "one" ] ) ;
2315-
2316- // A second live generation on the same dir (longer body so the segment
2317- // stat changes even at coarse mtime granularity).
2318- const second = await createOptimizedContextStore ( dir ) ;
2319- await second . writeTurns ( [ turn ( "one" ) , turn ( "two-with-a-longer-body" ) ] ) ;
2320- expect ( turnTexts ( ( await second . load ( ) ) . turns ) ) . toEqual ( [
2321- "one" ,
2322- "two-with-a-longer-body" ,
2323- ] ) ;
2324-
2325- // The first generation's cached parse must not shadow the foreign write.
2326- expect ( turnTexts ( ( await first . load ( ) ) . turns ) ) . toEqual ( [
2327- "one" ,
2328- "two-with-a-longer-body" ,
2329- ] ) ;
2330- } ) ;
2331- } ) ;
0 commit comments