@@ -146,12 +146,13 @@ describe("verifyCompactionSummary", () => {
146146 expect ( kinds ) . toContain ( "exactName" ) ;
147147 } ) ;
148148
149- test ( "auth as a goal token does not match authored, author, or preauth " , ( ) => {
149+ test ( "auth as a goal token does not match authored, author, preauth, or pre-auth " , ( ) => {
150150 const facts = extractContinuationFacts ( [ textTurn ( "user" , "Fix auth now" ) ] ) ;
151151 for ( const summary of [
152152 "The authored notes: next step module plan is set." ,
153153 "The author notes: next step module plan is set." ,
154154 "The preauth notes: next step module plan is set." ,
155+ "The pre-auth notes: next step module plan is set." ,
155156 ] ) {
156157 const report = verifyCompactionSummary ( summary , facts ) ;
157158 expect ( report . supported ) . toBe ( false ) ;
@@ -168,6 +169,15 @@ describe("verifyCompactionSummary", () => {
168169 expect ( report . misses . some ( ( m ) => m . kind === "contradiction" ) ) . toBe ( true ) ;
169170 } ) ;
170171
172+ test ( "a half-overlap paraphrase does not cover the standing goal" , ( ) => {
173+ const facts = extractContinuationFacts ( droppedTurns ( ) ) ;
174+ const report = verifyCompactionSummary (
175+ "The module tokens migrate elsewhere on schedule." ,
176+ facts ,
177+ ) ;
178+ expect ( report . misses . some ( ( m ) => m . kind === "goal" ) ) . toBe ( true ) ;
179+ } ) ;
180+
171181 test ( "oauth.ts does not cover src/auth.ts" , ( ) => {
172182 const facts = extractContinuationFacts ( [
173183 textTurn ( "user" , "Fix auth now" ) ,
@@ -379,6 +389,7 @@ describe("verifyOrRepair", () => {
379389 expect ( repair ) . not . toContain ( "src/auth.ts" ) ;
380390 expect ( repair ) . not . toContain ( "Goal:" ) ;
381391 expect ( repair ) . not . toContain ( "Next:" ) ;
392+ expect ( repair ) . not . toMatch ( / ^ S t a t e : / m) ;
382393 } ) ;
383394
384395 test ( "repair lines are goal, next, exact names, then the rest" , ( ) => {
@@ -397,6 +408,26 @@ describe("verifyOrRepair", () => {
397408 expect ( ranAt ) . toBeGreaterThan ( blockersAt ) ;
398409 } ) ;
399410
411+ test ( "repair does not emit a State line even when state is independent" , ( ) => {
412+ const facts = {
413+ goal : "Migrate the auth module to opaque tokens" ,
414+ constraints : [ ] as string [ ] ,
415+ nextAction : "Fix the token refresh assertion next." ,
416+ state : "The cache is still cold after warmup." ,
417+ verification : [ ] as string [ ] ,
418+ blockers : [ "token refresh assertion failed" ] ,
419+ exactNames : [ ] as string [ ] ,
420+ } ;
421+ const summary = "Work continues." ;
422+ const misses = verifyCompactionSummary ( summary , facts ) . misses ;
423+ expect ( misses . some ( ( m ) => m . kind === "blocker" ) ) . toBe ( true ) ;
424+ expect ( misses . some ( ( m ) => m . kind === "nextAction" ) ) . toBe ( true ) ;
425+ const repaired = repairSummary ( summary , facts , misses ) ;
426+ const repair = repaired . slice ( repaired . indexOf ( VERIFY_REPAIR_HEADING ) ) ;
427+ expect ( repair ) . not . toMatch ( / ^ S t a t e : / m) ;
428+ expect ( repair ) . not . toContain ( "cache is still cold" ) ;
429+ } ) ;
430+
400431 test ( "a tight cap keeps goal, next, and names before aborting on the tail" , ( ) => {
401432 const facts = extractContinuationFacts ( droppedTurns ( ) ) ;
402433 const misses = verifyCompactionSummary ( "Work continues." , facts ) . misses ;
0 commit comments