From 694a31f4999ded547e565929186ae898875cf13f Mon Sep 17 00:00:00 2001 From: David Snelling Date: Tue, 9 Jun 2026 14:23:03 -0700 Subject: [PATCH] =?UTF-8?q?refactor(8.0):=20drop=20strictConfig=20?= =?UTF-8?q?=E2=80=94=20surface=20too=20small=20to=20justify=20the=20option?= =?UTF-8?q?=20(scaffold=20step=209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per user direction: after the step-8 simplification reduced `config.vector` to three knobs (`recall`, `quantization`, `persistMode`), the `strictConfig` field's only remaining job was warning about `quantization.bits` being silently ignored on the cortex DiskANN path — one mismatch case across the entire public surface. That's not enough surface to justify a declared-but-undelivered config field. Cleaner to drop it now; if 8.x or 9.0 adds enough provider-knob mismatch cases to warrant a general-purpose strictness flag, we can add it back then. CHANGES src/types/brainy.types.ts - Removed BrainyConfig.strictConfig field + its JSDoc block. - Removed the `strictConfig: 'warn' flags this at init time` reference from quantization JSDoc; replaced with a plain "silently ignored on DiskANN" note (cortex's B.4 contract still applies). src/brainy.ts - normalizeConfig() no longer emits a strictConfig field. NO-OP scope Field was declared but had no enforcement logic. Removing it is a pure type-surface change. No behaviour change. VERIFICATION - npx tsc --noEmit: clean - npm test: 1408 / 1409 (same pre-existing race-condition outstanding) --- src/brainy.ts | 3 --- src/types/brainy.types.ts | 26 +------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/brainy.ts b/src/brainy.ts index 9024d1f8..61f8a8bb 100644 --- a/src/brainy.ts +++ b/src/brainy.ts @@ -9289,9 +9289,6 @@ export class Brainy implements BrainyInterface { // { except: [...] }: strict, but listed types may omit subtype. // Becomes the default in 8.0.0. requireSubtype: config?.requireSubtype ?? false, - // Provider-knob mismatch strictness (8.0). Default is 'warn' (one-shot - // teaching message). See BRAINY-8.0-RENAME-COORDINATION § B.6. - strictConfig: config?.strictConfig ?? 'warn', // Multi-process safety mode: config?.mode ?? 'writer', force: config?.force ?? false diff --git a/src/types/brainy.types.ts b/src/types/brainy.types.ts index a91059a4..0c8a1acd 100644 --- a/src/types/brainy.types.ts +++ b/src/types/brainy.types.ts @@ -1145,7 +1145,7 @@ export interface BrainyConfig { * `distance:sq4` SIMD providers accelerate them when available. * * Silently ignored on a native DiskANN-style provider path (it uses its - * own PQ math); `strictConfig: 'warn'` flags this at init time. + * own PQ math instead). */ quantization?: { enabled?: boolean @@ -1220,30 +1220,6 @@ export interface BrainyConfig { */ requireSubtype?: boolean | { except: Array } - /** - * Validation strictness for provider-knob mismatches (Brainy 8.0). - * - * When a registered provider silently ignores a configuration knob the - * user passed (e.g. `config.vector.advanced.diskann.*` on the open-core JS - * HNSW path, or `config.vector.advanced.hnsw.*` on a native DiskANN-style - * path), the user otherwise gets no feedback that their override has no - * effect. This option controls the response: - * - * - `false` — no enforcement. Mismatched knobs are silently accepted. - * - `'warn'` — (default in 8.0) one-shot warning per call site via - * `prodLog.warn`, listing the ignored knobs and the docs link to the - * appropriate `advanced.*` escape hatch. - * - `true` — hard error at `init()`. Refuses to start until the config - * is consistent with the resolved provider impl. - * - * The warning / error format matches the 7.30.1 teaching-error pattern: - * problem → escape valves → caller location → docs link. - * - * **Contract** locked in handoff thread BRAINY-8.0-RENAME-COORDINATION - * § B.6 (cortex-confirmed 2026-06-09). - */ - strictConfig?: boolean | 'warn' - /** * Process role for multi-process safety on filesystem storage. *