@@ -447,7 +447,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
447447 'decomposition, and the multi-PR group trap' : 6 ,
448448 'the verdict table, both events' : 10 ,
449449 'the pull_request leg is an EARLY WARNING and never reddens' : 5 ,
450- 'the replay fixtures: the three incidents this guard descends from' : 9 ,
450+ 'the replay fixtures: the three incidents this guard descends from' : 11 ,
451451 '⭐ the ordering guarantee, measured with a spy that THROWS' : 7 ,
452452 'the words a reader acts on (requirement (e))' : 26 ,
453453 '⭐ #14063 END TO END: what the dependency install actually buys' : 9 ,
@@ -2214,10 +2214,14 @@ export async function selfTest() {
22142214 // The same authorized approval, on a commit that is no longer the head. Under
22152215 // the retired sha pin this exact fixture was the REFUSAL case.
22162216 const authorizedPassOnOlder = ( login = GOVERNED_APPROVERS [ 0 ] ) => authorizedApprovalVerdict ( [ approvedAt ( login , OLD ) ] , HEAD ) ;
2217- const run = ( event , rows , approvals = new Map ( ) ) => {
2217+ const run = ( event , rows , approvals = new Map ( ) , records = new Map ( ) ) => {
22182218 const { governed, unattributed } = decomposeGovernedWork ( rows ) ;
2219- return guardVerdict ( { event, governed, unattributed, approvals, apiCalls : governed . length } ) ;
2219+ return guardVerdict ( { event, governed, unattributed, approvals, records , apiCalls : governed . length } ) ;
22202220 } ;
2221+ // The record reading a Tier S entry gets when the thread was READ and held
2222+ // nothing — the incident shape (#19133): "no record" is a refusal of its own
2223+ // kind, distinct from "the thread could not be read".
2224+ const absentRecord = ( pr ) => new Map ( [ [ pr , { state : 'absent' , read : { pr : 0 , card : 0 } , readSummary : '0 on the PR and 0 on its card' , cardNote : 'replay fixture, no card thread searched' } ] ] ) ;
22212225
22222226 // ── the register is READ, never restated (#9840) ──────────────────────────
22232227 //
@@ -2440,8 +2444,18 @@ export async function selfTest() {
24402444 battery ( 'the replay fixtures: the three incidents this guard descends from' ) ;
24412445 for ( const replay of REPLAYS ) {
24422446 const rows = [ row ( replay . pr , replay . files , 'e' . repeat ( 40 ) , replay . subject ) ] ;
2443- const queued = run ( 'merge_group' , rows , new Map ( [ [ replay . pr , authorizedApprovalVerdict ( [ ] , HEAD ) ] ] ) ) ;
2444- assert ( `replay-REFUSES-at-the-queue: ${ replay . name } ` , queued . exitCode === EXIT_REFUSED_UNAPPROVED , JSON . stringify ( queued . conclusion ) ) ;
2447+ // #19133: two of the three incidents are `.claude/**` and therefore Tier S
2448+ // today, so the queue judges them on the record leg too. Each incident's
2449+ // thread carried no record — the reading is ABSENT, and the refusal is the
2450+ // same "unapproved" the incident deserved. A Tier S entry with NO reading
2451+ // at all refuses as UNREADABLE instead: "could not find out" never clears.
2452+ const tier = governedTierFor ( replay . files ) ;
2453+ const queued = run ( 'merge_group' , rows , new Map ( [ [ replay . pr , authorizedApprovalVerdict ( [ ] , HEAD ) ] ] ) , tier === TIER_S ? absentRecord ( replay . pr ) : new Map ( ) ) ;
2454+ assert ( `replay-REFUSES-at-the-queue: ${ replay . name } ` , queued . exitCode === EXIT_REFUSED_UNAPPROVED , JSON . stringify ( [ queued . conclusion , tier ] ) ) ;
2455+ if ( tier === TIER_S ) {
2456+ const unread = run ( 'merge_group' , rows , new Map ( [ [ replay . pr , authorizedApprovalVerdict ( [ ] , HEAD ) ] ] ) ) ;
2457+ assert ( `replay-is-Tier-S-and-with-NO-record-reading-refuses-UNREADABLE-never-clears: ${ replay . name } ` , unread . exitCode === EXIT_REFUSED_UNREADABLE , JSON . stringify ( unread . conclusion ) ) ;
2458+ }
24452459 const early = run ( 'pull_request' , rows , new Map ( [ [ replay . pr , approvalVerdict ( [ ] ) ] ] ) ) ;
24462460 assert ( `replay-only-WARNS-on-the-pr: ${ replay . name } ` , early . conclusion === 'warned' && early . exitCode === EXIT_CLEAR ) ;
24472461 const text = renderGuardVerdict ( queued ) ;
@@ -3677,7 +3691,7 @@ export async function selfTest() {
36773691
36783692 // The words a reader acts on — requirement (e) reaches the new leg too.
36793693 const tierRefusalText = renderGuardVerdict ( tierAbsent ) ;
3680- assert ( 'the-refusal-names-the-tier-on-the-entry-so-a-reader-knows-why-a-record-would-help' , / l a n d i n g t i e r : R E F E R E N C E S / . test ( tierRefusalText ) ) ;
3694+ assert ( 'the-refusal-names-the-tier-on-the-entry-so-a-reader-knows-why-a-record-would-help' , / l a n d i n g t i e r : S / . test ( tierRefusalText ) , tierRefusalText ) ;
36813695 assert ( 'and-offers-the-record-as-a-THIRD-remedy-naming-the-three-facts-it-must-carry' , / 3 \. O r — O N L Y f o r a p u l l r e q u e s t w h o s e g o v e r n e d p a t h s a l l l i e u n d e r / . test ( tierRefusalText ) && / R e v i e w e d - b y : / . test ( tierRefusalText ) && / S e r v e d - t i e r : / . test ( tierRefusalText ) ) ;
36823696 assert ( '⛔ and-a-RULES-layer-refusal-is-offered-no-such-remedy-the-control-for-the-line-above' , ! / 3 \. O r — O N L Y f o r a p u l l r e q u e s t / . test ( renderGuardVerdict ( rulesDismissed ) ) ) ;
36833697 assert ( 'the-below-tier-refusal-names-the-reading-it-actually-got' , / d o e s n o t s t a n d / . test ( renderGuardVerdict ( tierBelow ) ) && / a - l e s s e r - t i e r / . test ( renderGuardVerdict ( tierBelow ) ) ) ;
0 commit comments