@@ -1138,13 +1138,23 @@ describe('dead / experimental / planned / live-elsewhere verdicts are distinct,
11381138 // contract test on the two rows that are still planned — `translation.flows`
11391139 // just above and `object.externalSharingModel` just below.
11401140
1141- it ( 'REAL LEDGER: object.externalSharingModel (planned, no authorHint — falls back to `note` ) — planned rule id, note hint does not say Remove it ' , ( ) => {
1141+ it ( 'REAL LEDGER: object.externalSharingModel (planned, no authorHint) — planned rule id, the planned DEFAULT hint, never its ledger note ' , ( ) => {
11421142 const findings = lintLivenessProperties ( { objects : [ { name : 'widget' , externalSharingModel : 'read' } ] } ) ;
11431143 const f = findings . find ( ( x ) => x . message . includes ( 'externalSharingModel' ) ) ;
11441144 expect ( f ) . toBeDefined ( ) ;
11451145 expect ( f ! . rule ) . toBe ( 'liveness-planned-property' ) ;
11461146 expect ( f ! . message ) . not . toContain ( 'dead' ) ;
1147- expect ( f ! . hint ) . not . toMatch ( / ^ R e m o v e i t / ) ;
1147+ const ledger = JSON . parse ( readFileSync ( join ( shippedLedgerDir ( ) , 'object.json' ) , 'utf8' ) ) ;
1148+ const row = ledger . props . externalSharingModel ;
1149+ // Anti-vacuity: the row is still the leaking shape this pin exists for.
1150+ expect ( row . authorWarn ) . toBe ( true ) ;
1151+ expect ( row . authorHint ) . toBeUndefined ( ) ;
1152+ expect ( row . note ) . toMatch ( / # \d + / ) ;
1153+ expect ( f ! . hint ) . toBe (
1154+ checkItemAgainstWarnMap ( 'gadget' , { name : 'g1' , gizmo : 'x' } , "gadget 'g1'" , oneEntry ( { status : 'planned' , authorWarn : true } ) ) [ 0 ] . hint ,
1155+ ) ;
1156+ expect ( f ! . hint ) . not . toMatch ( / # \d + / ) ;
1157+ expect ( f ! . hint ) . not . toContain ( row . note ) ;
11481158 } ) ;
11491159
11501160 // ── SYNTHETIC: the default hint per verdict, when neither authorHint nor
@@ -1218,11 +1228,11 @@ describe('dead / experimental / planned / live-elsewhere verdicts are distinct,
12181228 expect ( f . hint ) . toContain ( 'evidence' ) ;
12191229 } ) ;
12201230
1221- it ( 'SYNTHETIC: live-elsewhere keeps the shared hint precedence — authorHint over note over the default ' , ( ) => {
1231+ it ( 'SYNTHETIC: live-elsewhere shares the hint precedence — authorHint over the default, never the note ' , ( ) => {
12221232 const hintOf = ( entry : Record < string , unknown > ) =>
12231233 checkItemAgainstWarnMap ( 'gadget' , { name : 'g1' , gizmo : 'x' } , "gadget 'g1'" , oneEntry ( entry ) ) [ 0 ] . hint ;
12241234 expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true , authorHint : 'H' , note : 'N' } ) ) . toBe ( 'H' ) ;
1225- expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true , note : 'N' } ) ) . toBe ( 'N ') ;
1235+ expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true , note : 'N' } ) ) . toContain ( 'sibling repo ') ;
12261236 expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true } ) ) . toContain ( 'sibling repo' ) ;
12271237 } ) ;
12281238
@@ -1714,9 +1724,10 @@ describe('the dead and live-elsewhere verdicts warn on their own (#16094)', () =
17141724// the 105 newly warned entries' notes cite a tracker id, and three of the four
17151725// an author can reach say the row was deliberately not warned. AGENTS.md keeps
17161726// tracker numbers out of anything an author is shown. So such a row shows its
1717- // `authorHint`, else the verdict's default hint; a row that opted in, and an
1718- // `experimental` row, keep the hint they had before the ruling, byte for byte.
1719- describe ( 'the hint a verdict-triggered row shows an author (#16094)' , ( ) => {
1727+ // `authorHint`, else the verdict's default hint. The same rule holds for every
1728+ // other row class (an opted-in `planned`/`dead`/`live-elsewhere` row and an
1729+ // `experimental` row), pinned below (#21096).
1730+ describe ( 'the hint a warned row shows an author (#16094, #21096)' , ( ) => {
17201731 type ShippedRow = { type : string ; path : string ; entry : Record < string , unknown > } ;
17211732
17221733 /** Every shipped row at the depth the warn map reads (props + one level of `children`). */
@@ -1774,38 +1785,56 @@ describe('the hint a verdict-triggered row shows an author (#16094)', () => {
17741785 }
17751786 } ) ;
17761787
1777- it ( 'CONTROL, REAL LEDGER: every row that warned before the ruling keeps its hint byte for byte ' , ( ) => {
1788+ it ( 'REAL LEDGER: no opted-in or experimental row shows its note either, and none without an authorHint carries a tracker id ' , ( ) => {
17781789 // A `live` row that opts in is outside this population: `describe()` throws
1779- // on it before and after the ruling (the COVERAGE pin above holds that it
1780- // stays loud), so it has no hint to keep.
1781- const before = shippedRows ( ) . filter (
1790+ // on it (the COVERAGE pin above holds that it stays loud).
1791+ const warned = shippedRows ( ) . filter (
17821792 ( r ) => ( r . entry . authorWarn === true || r . entry . status === 'experimental' ) && r . entry . status !== 'live' ,
17831793 ) ;
1784- // Anti-vacuity: an opted-in row and an experimental row both fall back to
1785- // their note today, so the control would see a change in either.
1786- expect ( before . some ( ( r ) => r . entry . authorWarn === true && r . entry . authorHint === undefined && typeof r . entry . note === 'string' ) ) . toBe ( true ) ;
1787- expect ( before . some ( ( r ) => r . entry . status === 'experimental' && r . entry . authorHint === undefined && typeof r . entry . note === 'string' ) ) . toBe ( true ) ;
1788- for ( const row of before ) {
1789- const expected = row . entry . authorHint ?? row . entry . note ;
1790- if ( typeof expected !== 'string' ) continue ; // only the default remains — unchanged by construction
1791- expect ( hintFor ( row ) , `${ row . type } /${ row . path } ` ) . toBe ( expected ) ;
1794+ // Anti-vacuity: an opted-in row and an experimental row, each without an
1795+ // authorHint and each with a note, exist, so the leak this pin forbids is a real one.
1796+ const leakers = ( pred : ( r : ShippedRow ) => boolean ) =>
1797+ warned . filter ( ( r ) => pred ( r ) && r . entry . authorHint === undefined && typeof r . entry . note === 'string' ) ;
1798+ expect ( leakers ( ( r ) => r . entry . authorWarn === true ) . length ) . toBeGreaterThan ( 0 ) ;
1799+ expect ( leakers ( ( r ) => r . entry . status === 'experimental' ) . length ) . toBeGreaterThan ( 0 ) ;
1800+ expect ( leakers ( ( r ) => typeof r . entry . note === 'string' && TRACKER_ID . test ( r . entry . note as string ) ) . length ) . toBeGreaterThan ( 0 ) ;
1801+ for ( const row of warned ) {
1802+ const where = `${ row . type } /${ row . path } ` ;
1803+ const hint = hintFor ( row ) ;
1804+ if ( typeof row . entry . authorHint === 'string' ) {
1805+ expect ( hint , where ) . toBe ( row . entry . authorHint ) ; // CONTROL: the authored hint, exactly
1806+ } else {
1807+ expect ( hint , where ) . not . toBe ( row . entry . note ) ;
1808+ expect ( TRACKER_ID . test ( hint ) , `${ where } hint carries a tracker id` ) . toBe ( false ) ;
1809+ }
17921810 }
17931811 } ) ;
17941812
1795- it ( 'SYNTHETIC: the opt-in, not the verdict, decides whether the note may be shown ' , ( ) => {
1813+ it ( 'SYNTHETIC: authorHint wins, otherwise the verdict default — for every row class, never the note ' , ( ) => {
17961814 const hintOf = ( entry : Record < string , unknown > ) =>
17971815 checkItemAgainstWarnMap ( 'gadget' , { name : 'g1' , gizmo : 'x' } , "gadget 'g1'" , gizmoEntry ( entry ) ) [ 0 ] . hint ;
17981816 const deadDefault = hintOf ( { status : 'dead' } ) ;
17991817 const elsewhereDefault = hintOf ( { status : 'live-elsewhere' } ) ;
1800- // Verdict-triggered: authorHint wins, otherwise the default — never the note.
1801- expect ( hintOf ( { status : 'dead' , note : 'N #123' } ) ) . toBe ( deadDefault ) ;
1802- expect ( hintOf ( { status : 'live-elsewhere' , note : 'N #123' } ) ) . toBe ( elsewhereDefault ) ;
1803- expect ( hintOf ( { status : 'dead' , authorHint : 'H' , note : 'N' } ) ) . toBe ( 'H' ) ;
1804- // Opted in: today's precedence, unchanged — the note is shown.
1805- expect ( hintOf ( { status : 'dead' , authorWarn : true , note : 'N' } ) ) . toBe ( 'N' ) ;
1806- expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true , note : 'N' } ) ) . toBe ( 'N' ) ;
1807- // Experimental needs no opt-in and keeps its note, as before the ruling.
1808- expect ( hintOf ( { status : 'experimental' , note : 'N' } ) ) . toBe ( 'N' ) ;
1818+ const plannedDefault = hintOf ( { status : 'planned' , authorWarn : true } ) ;
1819+ const experimentalDefault = hintOf ( { status : 'experimental' } ) ;
1820+ const NOTE = 'N #123' ;
1821+ // Verdict-triggered, with or without the opt-in: the default, never the note.
1822+ expect ( hintOf ( { status : 'dead' , note : NOTE } ) ) . toBe ( deadDefault ) ;
1823+ expect ( hintOf ( { status : 'live-elsewhere' , note : NOTE } ) ) . toBe ( elsewhereDefault ) ;
1824+ expect ( hintOf ( { status : 'dead' , authorWarn : true , note : NOTE } ) ) . toBe ( deadDefault ) ;
1825+ expect ( hintOf ( { status : 'live-elsewhere' , authorWarn : true , note : NOTE } ) ) . toBe ( elsewhereDefault ) ;
1826+ // Opted-in planned and experimental rows: the default, never the note.
1827+ expect ( hintOf ( { status : 'planned' , authorWarn : true , note : NOTE } ) ) . toBe ( plannedDefault ) ;
1828+ expect ( hintOf ( { status : 'experimental' , note : NOTE } ) ) . toBe ( experimentalDefault ) ;
1829+ expect ( hintOf ( { status : 'experimental' , authorWarn : true , note : NOTE } ) ) . toBe ( experimentalDefault ) ;
1830+ for ( const hint of [ deadDefault , elsewhereDefault , plannedDefault , experimentalDefault ] ) {
1831+ expect ( hint ) . not . toMatch ( / # \d + / ) ;
1832+ }
1833+ // Control: an authorHint is printed exactly, note or no note.
1834+ for ( const status of [ 'dead' , 'live-elsewhere' , 'planned' , 'experimental' ] ) {
1835+ expect ( hintOf ( { status, authorWarn : true , authorHint : 'H' , note : NOTE } ) , status ) . toBe ( 'H' ) ;
1836+ expect ( hintOf ( { status, authorWarn : true , authorHint : 'H' } ) , status ) . toBe ( 'H' ) ;
1837+ }
18091838 } ) ;
18101839
18111840 it ( 'END TO END: the authored dead RLS keys show the dead default hint, not the ledger note' , ( ) => {
0 commit comments