@@ -103,16 +103,23 @@ describe('dogfood: the object-existence gates are actually WIRED (#3770, #3867,
103103 // Without this, every 404 below could be passing for the wrong reason.
104104 // ─────────────────────────────────────────────────────────────
105105
106- it ( 'premise: the unregistered name IS a real table the engine can read' , async ( ) => {
107- // Straight through the ENGINE, which is deliberately ungated — #3770 put
108- // the gate at the protocol ingress, the external API boundary, precisely so
109- // internal callers (hooks, flows, migrations, raw ObjectQL) keep working.
110- // So this both establishes ground truth and pins that boundary choice.
106+ it ( 'premise: the unregistered name IS a real table — readable at the driver, refused by the engine' , async ( ) => {
107+ // Ground truth through the DRIVER, the declared internal path a body
108+ // cannot reach (host code holding the engine). Without this, every 404
109+ // below could be passing for the wrong reason.
111110 // eslint-disable-next-line @typescript-eslint/no-explicit-any
112111 const ql = await stack . kernel . getServiceAsync < any > ( 'objectql' ) ;
113- const rows = ( await ql . find ( UNREGISTERED_BUT_REAL , { context : { isSystem : true } } ) ) as unknown [ ] ;
112+ const driver = ql . getDriverForObject ( UNREGISTERED_BUT_REAL ) ;
113+ expect ( driver , 'the default driver answers the name' ) . toBeDefined ( ) ;
114+ const rows = ( await driver . find ( UNREGISTERED_BUT_REAL , { } ) ) as unknown [ ] ;
114115 expect ( Array . isArray ( rows ) ) . toBe ( true ) ;
115116 expect ( rows . length ) . toBeGreaterThan ( 0 ) ;
117+ // [#21516] One name space with the door: the engine's in-process verbs no
118+ // longer read a table by a name the registry does not hold — #3770's gate
119+ // at the protocol ingress stays, and the engine now answers the same name
120+ // with the same envelope.
121+ await expect ( ql . find ( UNREGISTERED_BUT_REAL , { context : { isSystem : true } } ) )
122+ . rejects . toMatchObject ( { code : 'OBJECT_NOT_FOUND' , status : 404 } ) ;
116123 } ) ;
117124
118125 // ─────────────────────────────────────────────────────────────
0 commit comments