@@ -58,23 +58,10 @@ import { DbJobAdapter } from '@objectstack/service-job';
5858import { SysJob , SysJobRun } from '@objectstack/platform-objects/audit' ;
5959import { AppPlugin } from './app-plugin.js' ;
6060import type { JobHandlerContext } from './job-handler-context.js' ;
61- import {
62- captureExpectedReadRefusals ,
63- type ExpectedReadRefusalCapture ,
64- } from './expected-read-refusal-noise.js' ;
6561
6662/** The reason a #5529-shaped handler reports when its store is unreachable. */
6763const REASON = 'STORE_UNAVAILABLE' ;
6864
69- /**
70- * [#10629] This fixture provisions the two job tables and nothing else, so the
71- * engine's own single-tenant probe (`ObjectQL.probeInstallOrganizations`) reads
72- * a `sys_organization` that was never created. The probe is fail-soft by
73- * construction, but the driver and the engine each log the fault on the way
74- * out. Withheld and ASSERTED rather than muted.
75- */
76- const ABSENT_TENANCY_TABLE = 'sys_organization' ;
77-
7865interface Harness {
7966 engine : ObjectQL ;
8067 adapter : DbJobAdapter ;
@@ -90,61 +77,46 @@ const live: Array<{
9077 engine ?: ObjectQL ;
9178 adapter ?: DbJobAdapter ;
9279 driver ?: SqlDriver ;
93- noise ?: ExpectedReadRefusalCapture ;
94- /** The channels this test's path MUST have provoked — see `harness()`. */
95- requiredChannels ?: readonly string [ ] ;
9680} > = [ ] ;
9781
9882afterEach ( async ( ) => {
9983 for ( const entry of live . splice ( 0 ) ) {
10084 try { await entry . adapter ?. destroy ( ) ; } catch { /* noop */ }
10185 try { await entry . engine ?. destroy ( ) ; } catch { /* noop */ }
10286 try { await entry . driver ?. disconnect ( ) ; } catch { /* noop */ }
103- // A capture nobody asserts is a mute. The probe is memoised behind the
104- // FIRST data operation, so only the paths that actually touch the store
105- // provoke it — `silentChannels(required)` is the API's own answer to a
106- // table read on some of a file's paths and not others. The withholding
107- // is unconditional either way; only the must-have-fired set narrows.
108- if ( entry . noise ) {
109- expect ( entry . noise . silentChannels ( entry . requiredChannels ?? [ ABSENT_TENANCY_TABLE ] ) ) . toEqual ( [ ] ) ;
110- }
11187 }
11288} ) ;
11389
114- /** A real engine over the migrated test backend, carrying the REAL `sys_job*`. */
115- async function bootEngine ( ) : Promise < { engine : ObjectQL ; driver : SqlDriver ; noise : ExpectedReadRefusalCapture } > {
90+ /**
91+ * A real engine over the migrated test backend, carrying the REAL `sys_job*`.
92+ *
93+ * ⚠️ [#10629] No expected-read-refusal capture here, deliberately and by
94+ * MEASUREMENT: every read this file performs carries `isSystem`, so the
95+ * engine's single-tenant probe over the unprovisioned `sys_organization` never
96+ * fires and neither refusal channel emits a frame (checked on the red run: zero
97+ * `refused a read on` and zero `Find operation failed` lines for the whole
98+ * file). Installing a capture that nothing provokes would assert a mute.
99+ */
100+ async function bootEngine ( ) : Promise < { engine : ObjectQL ; driver : SqlDriver } > {
116101 const driver = new SqlDriver ( {
117102 client : 'better-sqlite3' ,
118103 connection : { filename : ':memory:' } ,
119104 useNullAsDefault : true ,
120105 } ) ;
121- const noise = captureExpectedReadRefusals ( [ ABSENT_TENANCY_TABLE ] ) ;
122- noise . captureDriver ( driver ) ;
123106 await driver . initObjects ( [ SysJob as never , SysJobRun as never ] ) ;
124107 const engine = new ObjectQL ( ) ;
125- noise . captureEngine ( engine ) ;
126108 engine . registerDriver ( driver as never , true ) ;
127109 await engine . init ( ) ;
128110 engine . registry . registerObject ( SysJob as never ) ;
129111 engine . registry . registerObject ( SysJobRun as never ) ;
130- return { engine, driver, noise } ;
112+ return { engine, driver } ;
131113}
132114
133- /**
134- * @param opts.touchesStore whether this test's path performs a data operation.
135- * `true` (the default) requires the tenancy probe to have fired and been
136- * withheld; the one case that swaps `DbJobAdapter` out for a recording
137- * `IJobService` never reads or writes and passes `false`, which keeps the
138- * withholding and drops only the must-have-fired requirement.
139- */
140- async function harness ( opts : { touchesStore ?: boolean } = { } ) : Promise < Harness > {
141- const { engine, driver, noise } = await bootEngine ( ) ;
115+ async function harness ( ) : Promise < Harness > {
116+ const { engine, driver } = await bootEngine ( ) ;
142117 // The adapter that RECORDS the outcome — the coordinate the card names.
143118 const adapter = new DbJobAdapter ( { engine : engine as never } ) ;
144- live . push ( {
145- engine, adapter, driver, noise,
146- requiredChannels : opts . touchesStore === false ? [ ] : [ ABSENT_TENANCY_TABLE ] ,
147- } ) ;
119+ live . push ( { engine, adapter, driver } ) ;
148120
149121 const readyHooks : Array < ( ) => Promise < void > > = [ ] ;
150122 const ctx = {
@@ -306,7 +278,7 @@ describe('#14256 — the controls that keep the assertion honest', () => {
306278 // The reporter's probe, kept as corroboration and NOT as the deliverable:
307279 // it re-states the repair, while the cases above pin its consequence.
308280 // Typed only at the contract, exactly as a third-party `IJobService` is.
309- const h = await harness ( { touchesStore : false } ) ;
281+ const h = await harness ( ) ;
310282 const scheduled : Array < { name : string ; handler : JobHandler } > = [ ] ;
311283 const recording : IJobService = {
312284 async schedule ( name : string , _schedule : JobSchedule , handler : JobHandler ) {
0 commit comments