@@ -1951,6 +1951,27 @@ describe('publisher-scoped visibility (#460)', () => {
19511951 await driver . close ( ) ;
19521952 } ) ;
19531953
1954+ it ( 'orders published notices by the instant they were created, whatever offset the invocation spelled' , async ( ) => {
1955+ const { driver, ledger } = await openLedger ( ) ;
1956+ const publishAt = ( id : string , startedAt : string ) => run ( ledger , { actorId : 'author' , id, kind : 'tool' , startedAt } ,
1957+ async ( ) => ( await agent ( ) ) . notices ! . publish ( {
1958+ content : document ( id ) ,
1959+ priority : 'normal' ,
1960+ recipient : { actor : { id : 'recipient' } } ,
1961+ } , { idempotencyKey : `publish:${ id } ` } ) ) ;
1962+ // Lexically the +02:00 stamp sorts after the Z stamp; chronologically it is 90 minutes earlier.
1963+ const later = await publishAt ( 'later' , '2026-01-01T00:30:00.000Z' ) ;
1964+ const earlier = await publishAt ( 'earlier' , '2026-01-01T01:00:00.000+02:00' ) ;
1965+ const own = await run ( ledger , {
1966+ actorId : 'author' ,
1967+ id : 'published-order' ,
1968+ kind : 'tool' ,
1969+ startedAt : '2026-01-01T03:00:00.000Z' ,
1970+ } , async ( ) => ( await agent ( ) ) . notices ! . published ( ) ) ;
1971+ expect ( own . map ( ( notice ) => notice . id ) ) . toEqual ( [ earlier . notice . id , later . notice . id ] ) ;
1972+ await driver . close ( ) ;
1973+ } ) ;
1974+
19541975 it ( 'discloses published content under the default internal ceiling and never another author\'s deduped content' , async ( ) => {
19551976 const { driver, ledger } = await openLedger ( ) ;
19561977 const publishAs = ( actorId : string , id : string , input : AgentNoticePublishInput ) =>
0 commit comments