/** * Teacher-mode strategy repository (design/14). Stores the *generalized* strategies a teacher gave * that actually worked, so a later similar problem can be solved without re-consulting the teacher * (Inter-Cascade cross-session reuse). Retrieval is deliberately **high-precision / low-recall**: a * wrong strategy injected into a student costs wasted turns + a likely escalation (net negative), * while a missed strategy just falls back to asking the teacher (baseline). `scope` is a **mandatory * isolation boundary** (multi-tenant: one user's strategies must never leak to another). */ export interface StoredStrategy { /** Stable id. */ id: string; /** The raw task objective that triggered the teacher's help — matched against future objectives. */ problem: string; /** The teacher's generalized approach (1-2 sentences). */ strategy: string; /** The teacher's confidence (0-3) when it gave this. */ confidence: number; /** Tenant/isolation scope (e.g. "user:42"). Strategies are only ever retrieved within their scope. */ scope: string; /** ISO timestamp stored. */ ts: string; /** Teacher model id, for future staleness handling. */ teacherModel?: string; /** Reserved for a future generalized signature (v3 semantic matching). */ signature?: string; } export interface StrategyStore { /** Persist a strategy (implementations may merge an exact near-duplicate and cap per-scope size). */ save(s: StoredStrategy): Promise | void; /** The most relevant strategies for `query`, within `scope`, at most `limit`. */ find(scope: string, query: string, limit: number): Promise | StoredStrategy[]; /** Optional: trim a scope to `maxSize` (evicting the least useful). */ prune?(scope: string, maxSize: number): Promise | void; } /** * Default in-memory store. Retrieval: a stored problem must contain **every significant** query token * (and there must be ≥1) — near-exact on the meaningful words, ignoring stopword noise. High precision * by design. Ranked by `confidence × recency`. Per-scope capacity cap with eviction on save. */ export declare class InMemoryStrategyStore implements StrategyStore { private readonly maxPerScope; private byScope; constructor(maxPerScope?: number); save(s: StoredStrategy): void; find(scope: string, query: string, limit: number): StoredStrategy[]; prune(scope: string, maxSize: number): void; /** Total stored strategies (across scopes); for tests/observability. */ get size(): number; } //# sourceMappingURL=strategy-store.d.ts.map