@@ -228,6 +228,30 @@ test('the anonymous disclosure table never appears without the signed-in caveat'
228228 `${ name } prints the anonymous refusal table without saying what a signed-in reader sees` ) ;
229229 assert . ok ( / e n v : / . test ( text ) && / \b l o g \b / i. test ( text ) ,
230230 `${ name } does not name the mechanism - the job log echoing a step's env: block` ) ;
231+
232+ // And it must not still call the same thing unknown somewhere else in the file.
233+ //
234+ // The first version of this guard asked only whether the caveat appeared ANYWHERE, and
235+ // it passed a file that carried both: the correction near the top, and thirty lines
236+ // below it the original "treat that as unknown rather than safe", untouched and reading
237+ // as current. A reader reaching the second sentence would have believed it.
238+ //
239+ // A stale sentence surviving beside its own correction is the defect ADR-0035 names,
240+ // committed in the act of recording it.
241+ //
242+ // The second version was worse: it was VACUOUS. It tried to match "signed-in user" and
243+ // "unknown rather than safe" in one line-anchored expression, and those sit on separate
244+ // lines, so `[^\n]*` could never bridge them and nothing could ever fail it. Found by
245+ // running the red check, which is the only reason this comment is not describing a
246+ // guard that silently guards nothing.
247+ //
248+ // Quoting the superseded claim is allowed and is the house style; asserting it is not.
249+ // So the phrase may appear only on a line that also marks it as past.
250+ const stale = text . split ( '\n' ) . filter ( ( line ) => / u n k n o w n r a t h e r t h a n s a f e / i. test ( line )
251+ && ! / u s e d t o | n o l o n g e r | s u p e r s e d e d | t h i s u s e d t o s a y / i. test ( line ) ) ;
252+ assert . deepEqual ( stale , [ ] ,
253+ `${ name } still asserts the signed-in surface is unknown, in the same file that measures it:\n `
254+ + stale . map ( ( l ) => l . trim ( ) ) . join ( '\n ' ) ) ;
231255 }
232256} ) ;
233257
0 commit comments