@@ -415,3 +415,73 @@ export function captureExpectedCrossFieldRefusalNoise(
415415 } ,
416416 } ;
417417}
418+
419+ /**
420+ * ═══════════════════════════════════════════════════════════════════════════
421+ * [#11571] ⛔ There is deliberately NO third, console-level predicate — the
422+ * kernel's ERROR frames never pass through `console` under Node
423+ * ═══════════════════════════════════════════════════════════════════════════
424+ *
425+ * ## The case that asked for one
426+ *
427+ * Three memory-driver fixtures in `@objectstack/trigger-record-change`
428+ * (`bulk-write-per-row-context`, `formula-context`, `multilookup-context`)
429+ * boot a kernel with no datasource, so every boot-time fail-soft read refuses.
430+ * Measured on this branch by floating each fixture to `level: 'info'`, their
431+ * ENTIRE ERROR surface is one invariant trio, repeated once per boot:
432+ *
433+ * | fixture | ERROR frames | distinct messages |
434+ * |------------------------------|---------------|-------------------|
435+ * | `bulk-write-per-row-context` | 15 (5 boots) | 3 |
436+ * | `formula-context` | 3 (1 boot) | 3 |
437+ * | `multilookup-context` | 3 (1 boot) | 3 |
438+ *
439+ * 1. `sys_metadata could NOT be read at boot …` (`objectql/src/plugin.ts`);
440+ * 2. `[wait] suspended wait-timer re-arm ABORTED …`
441+ * (`service-automation/src/builtin/wait-node.ts`);
442+ * 3. `[Automation] sys_automation_run could not be read at startup …`
443+ * (`service-automation/src/plugin.ts`).
444+ *
445+ * Neither predicate above can reach them: with no SqlDriver there is no
446+ * `refused a read on '<table>'` line — so no `pending` entry for the engine
447+ * gate to sit above — and no `Find operation failed` frame at all. Those three
448+ * fixtures therefore KEEP the blanket `logger: { level: 'silent' }` that the
449+ * two SqlDriver-backed fixtures were able to drop.
450+ *
451+ * ## Why the obvious third mechanism does not exist
452+ *
453+ * The proposal was a console-level capture: patch `console.error`/`console.warn`
454+ * for the file and float the kernel to `level: 'error'` so INFO/WARN stay
455+ * suppressed. **Measured: it captures ZERO of the 21 frames.**
456+ * `ObjectLogger.write` (`core/src/logger.ts`) prefers the process streams and
457+ * reaches console only as a fallback:
458+ *
459+ * if (stream) { // process.stderr for error/fatal
460+ * stream.write(line + '\n');
461+ * } else if (typeof console !== 'undefined') {
462+ * … console.error … // browsers / bundler shims ONLY
463+ * }
464+ *
465+ * Under vitest's `environment: 'node'`, `process.stderr` always exists, so the
466+ * `console` arm is unreachable there. A probe booting this exact plugin stack
467+ * at `level: 'error'` with all four sinks counted scored `console.error: 0,
468+ * console.warn: 0, process.stderr.write: 3, process.stdout.write: 0`.
469+ *
470+ * ⇒ The only variant that DOES intercept them patches `process.stderr.write`,
471+ * and it is refused here as disproportionate rather than as unworkable. Both
472+ * predicates above patch an OBJECT seam (`driver.logger`, `engine.logger`)
473+ * whose blast radius is one instance the fixture itself owns; a stream patch
474+ * is process-global and sits in the path of everything the worker writes —
475+ * the reporter's own diagnostics included — for as long as it is installed.
476+ * Twenty-one invariant per-boot frames that carry no per-test signal do not
477+ * buy a third capture mechanism of that reach, and #11569 (this module's
478+ * engine pass-through already lands in a silenced logger) means the two
479+ * mechanisms here want repairing before a third is stacked on them.
480+ *
481+ * ⛔ Nor is the repair a predicate pointed at `kernel.logger`: the kernel takes
482+ * a logger CONFIG, builds its own and hands it to the plugin loader and the
483+ * service context BY REFERENCE (`core/src/kernel.ts`), so a post-construction
484+ * swap propagates only partially. That yields a capture which misses frames
485+ * while asserting it does not — the exact inversion this module exists to
486+ * prevent, and strictly worse than the honest silence of a blanket mute.
487+ */
0 commit comments