/** * Mock providers for CI / integration testing. * * Used when ASTRA_MEMORY_MOCK_PROVIDERS=1 is set (or injected directly in tests). * * - MockLLMProvider: compaction returns the input text unchanged; * extraction checks a small deterministic keyword table (see below) and * returns one atom per matched keyword, or an empty atoms list if none match. * - MockEmbedProvider: deterministic vector (dim defaults to * DEFAULT_EMBED_DIM = 1024, configurable) seeded from text hash. No * network, no Ollama required. * * These mocks satisfy the LLMProvider / EmbedProvider contracts and make * the full 8-stage distillation pipeline runnable in CI. * * TEST-ONLY deterministic extraction vocabulary (SLICE-SMOKE-1 orchestrator * decision, 2026-07-04: extending this file additively was approved as a * relaxation of "no product-code changes" for test-double code specifically * — see the smoke-suite run brief). The keyword -> atom-type -> entity table * itself now lives in ./mock-extraction-vocab.ts (FEAT-414) — the single * source of truth shared with tests/hygiene/mock-vocab-fixture-lockstep.test.ts, * which asserts tests/smoke/_fixtures/session-canonical.json still triggers * every rule. Edit the vocab there, not here; drift between the vocab and * the fixture is now a failing test, not silence. This file is never * reachable outside ASTRA_MEMORY_MOCK_PROVIDERS=1 (CI/test only — real * serving never sets it). * * FEAT-456 SLICE-1 adds a second deterministic branch for the contradiction * judge (../consolidate/contradiction-judge.ts) — also a `chat()` call, but * a distinct call SHAPE (single-pair classification, not atom extraction). * Both ask for `json: true`, so the judge branch is routed on the stable * `CONTRADICTION_JUDGE_MARKER` system-prompt marker, checked BEFORE the * extraction detection below (design §3.1) — without that ordering a judge * call would be misrouted into the atom-extraction branch. Vocabulary lives * in ../consolidate/mock-judge-pairs.ts, same closed-table pattern as * MOCK_EXTRACTION_VOCAB. * * P2.2 (saturation soak test, tests/soak/) adds an opt-in * ASTRA_MOCK_EMBED_DELAY_MS knob read by MockEmbedProvider.embed() below — * a non-negative integer number of milliseconds to `setTimeout`-delay before * resolving, simulating an embed provider queued/saturated the way real * Ollama was during the 2026-07-15 incident (measured 62-142s), WITHOUT * blocking the event loop (the delay is a Promise/setTimeout, not a sync * sleep — a sync delay here would defeat the entire point of the soak test, * which asserts the event loop stays responsive during induced saturation). * Defaults to 0 (no delay, byte-identical to pre-P2.2 behavior) whenever the * env var is unset/non-numeric/non-positive. Same reachability guarantee as * the rest of this file: only read behind ASTRA_MEMORY_MOCK_PROVIDERS=1, * never in real serving. */ import type { ProviderSet } from '../providers/index.js'; export type MockProviderSet = ProviderSet; /** * Returns a ProviderSet backed entirely by mock providers. * Safe to call multiple times — each call returns fresh instances. * `dim` defaults to DEFAULT_EMBED_DIM (1024); pass e.g. cfg.embedding.dim * to exercise a non-default dim under ASTRA_MEMORY_MOCK_PROVIDERS=1 * (FEAT-409 AC-2). */ export declare function makeMockProviders(dim?: number): MockProviderSet;