@vostride/agent-qa-knowledge-local 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +105 -0
- package/NOTICE.md +15 -0
- package/assets/potion-retrieval-32m/LICENSE +29 -0
- package/assets/potion-retrieval-32m/golden-vectors.json +4144 -0
- package/assets/potion-retrieval-32m/manifest.json +37 -0
- package/assets/potion-retrieval-32m/potion-retrieval-32m.i8bin +0 -0
- package/assets/potion-retrieval-32m/tokenizer.json +63241 -0
- package/dist/embedder-worker/worker-entry.cjs +1424 -0
- package/dist/embedder-worker/worker-entry.cjs.map +1 -0
- package/dist/embedder-worker/worker-entry.d.cts +18 -0
- package/dist/embedder-worker/worker-entry.d.ts +18 -0
- package/dist/embedder-worker/worker-entry.js +1426 -0
- package/dist/embedder-worker/worker-entry.js.map +1 -0
- package/dist/index.cjs +21491 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3983 -0
- package/dist/index.d.ts +3983 -0
- package/dist/index.js +21612 -0
- package/dist/index.js.map +1 -0
- package/dist/mark-evidence-plan-BCkYN07i.d.cts +1014 -0
- package/dist/mark-evidence-plan-BCkYN07i.d.ts +1014 -0
- package/dist/reader.cjs +5829 -0
- package/dist/reader.cjs.map +1 -0
- package/dist/reader.d.cts +107 -0
- package/dist/reader.d.ts +107 -0
- package/dist/reader.js +5951 -0
- package/dist/reader.js.map +1 -0
- package/dist/worker-registration-C-9spEsf.d.cts +78 -0
- package/dist/worker-registration-C-9spEsf.d.ts +78 -0
- package/package.json +70 -4
- package/README.md +0 -3
|
@@ -0,0 +1,1014 @@
|
|
|
1
|
+
import { EmbeddingProfile, QuarantineLedgerEvent, QuarantineEntryState, VerdictClass, Verdict, RecordFrontmatter, BundleManifest, BundleProvenance, BundleRelations, BundleOutcomeEvent, ArtifactsIndex, ScreenState, MeasurementBaseline, MeasurementObservation, TrustPriorTable, DerivedTrustState, GateLine, RecordId, Anchor, BundleStatus, ScopeKey, IndexEntry, AuthoringBrief, ServedRetrievalTraceV1, InspectFilter, InspectRecordView, RecordChange, KnowledgeRecordShowResult, GateReceipt, EvidenceToken, MarkReceipt, CompletedRunHandoff } from '@vostride/agent-qa-schema';
|
|
2
|
+
import { AuthoringReadPort } from '@vostride/agent-qa-agent';
|
|
3
|
+
import { KnowledgeHintReader } from '@vostride/agent-qa-runner';
|
|
4
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* D-02's types-only memidex embedding seam from memory.md §5.2.
|
|
8
|
+
*
|
|
9
|
+
* Phase 376 binds the real implementation without changing rebuild logic. The fake embedder in
|
|
10
|
+
* Phase 375 Plan 06 is the first implementer, keeping this phase free of model runtime code.
|
|
11
|
+
*/
|
|
12
|
+
interface EmbedderPort {
|
|
13
|
+
/**
|
|
14
|
+
* Embed a canonical document rendering using the profile's document prefix (D-02, §5.2).
|
|
15
|
+
* Phase 376 supplies the runtime; callers never observe prefix application.
|
|
16
|
+
*/
|
|
17
|
+
embedDocument(rendering: string): Promise<Float32Array>;
|
|
18
|
+
/**
|
|
19
|
+
* Embed a query rendering using the profile's query prefix (D-02, §5.2).
|
|
20
|
+
* Phase 376 supplies the runtime through the same rebuild-logic-neutral contract.
|
|
21
|
+
*/
|
|
22
|
+
embedQuery(rendering: string): Promise<Float32Array>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const INDEX_DB_FILE = "knowledge.db";
|
|
26
|
+
/** Any other stamp resets the index. */
|
|
27
|
+
declare const INDEX_SCHEMA_VERSION = 2;
|
|
28
|
+
/**
|
|
29
|
+
* Phase 377 D-04 rendering epoch.
|
|
30
|
+
*
|
|
31
|
+
* Bump only when contextual-rendering bytes change. A stale stamp remains durable through writer
|
|
32
|
+
* open, forces one full render/vector pass, and is advanced only when that pass succeeds.
|
|
33
|
+
*/
|
|
34
|
+
declare const INDEX_RENDERING_SCHEMA_VERSION = 2;
|
|
35
|
+
/**
|
|
36
|
+
* Projection tables every readable index must expose.
|
|
37
|
+
*
|
|
38
|
+
* Per-profile vec tables are deliberately excluded: vec0 is a conditional
|
|
39
|
+
* capability, while operation-time failover and the next rebuild heal a lost
|
|
40
|
+
* capability-specific table.
|
|
41
|
+
*/
|
|
42
|
+
declare const REQUIRED_INDEX_TABLES: readonly ["records", "fts_records", "anchors", "graph_nodes", "graph_edges", "meta"];
|
|
43
|
+
/**
|
|
44
|
+
* Writer busy timeout in milliseconds.
|
|
45
|
+
*
|
|
46
|
+
* PROVISIONAL 2000 pending Phase 375 contention measurements. The value may be
|
|
47
|
+
* tuned, but the constant-driven shape remains internal and config-free.
|
|
48
|
+
*/
|
|
49
|
+
declare const WRITER_BUSY_TIMEOUT_MS = 2000;
|
|
50
|
+
/**
|
|
51
|
+
* Reader busy timeout in milliseconds.
|
|
52
|
+
*
|
|
53
|
+
* PROVISIONAL 500 pending Phase 375 contention measurements. The value may be
|
|
54
|
+
* tuned, but the constant-driven shape remains internal and config-free.
|
|
55
|
+
*/
|
|
56
|
+
declare const READER_BUSY_TIMEOUT_MS = 500;
|
|
57
|
+
/**
|
|
58
|
+
* Number of committed bundles between passive WAL checkpoints.
|
|
59
|
+
*
|
|
60
|
+
* PROVISIONAL 32 pending Phase 375 write-volume measurements. The value may be
|
|
61
|
+
* tuned, but the constant-driven shape remains internal and config-free.
|
|
62
|
+
*/
|
|
63
|
+
declare const CHECKPOINT_EVERY_N_BUNDLES = 32;
|
|
64
|
+
type VecCapability = 'vec0' | 'brute';
|
|
65
|
+
interface IndexWriterHandle {
|
|
66
|
+
db: DatabaseSync;
|
|
67
|
+
vec: VecCapability;
|
|
68
|
+
readonly renderingEpochStale: boolean;
|
|
69
|
+
completeRenderingEpoch(): void;
|
|
70
|
+
checkpointPassive(): void;
|
|
71
|
+
close(): void;
|
|
72
|
+
}
|
|
73
|
+
interface IndexReaderConnection {
|
|
74
|
+
db: DatabaseSync;
|
|
75
|
+
vec: VecCapability;
|
|
76
|
+
}
|
|
77
|
+
/** Durable writer work that can be inspected without opening a mutable index connection. */
|
|
78
|
+
interface IndexMaintenanceState {
|
|
79
|
+
indexAbsent: boolean;
|
|
80
|
+
pendingEmbeddings: number;
|
|
81
|
+
renderingEpochStale: boolean;
|
|
82
|
+
vectorReconciliationOutstanding: boolean;
|
|
83
|
+
}
|
|
84
|
+
type IndexHealth = {
|
|
85
|
+
ok: true;
|
|
86
|
+
} | {
|
|
87
|
+
ok: false;
|
|
88
|
+
probe: 'quick-check' | 'projection-schema' | 'schema-version';
|
|
89
|
+
reason: string;
|
|
90
|
+
};
|
|
91
|
+
interface IndexOpenOptions {
|
|
92
|
+
/** D-12 test seam. Production callers resolve sqlite-vec's pinned prebuild. */
|
|
93
|
+
vecLoadablePath?: string;
|
|
94
|
+
}
|
|
95
|
+
interface IndexReaderOpenOptions extends IndexOpenOptions {
|
|
96
|
+
/**
|
|
97
|
+
* For a probe that only ASKS about the index and releases the connection at once (`doctor`).
|
|
98
|
+
* With no `-wal` beside the database, no connection holds it in WAL mode and the writer's close
|
|
99
|
+
* checkpointed every page into the main file, so the open is `mode=ro&immutable=1` and SQLite
|
|
100
|
+
* creates no `-wal`/`-shm` (432-09 #5). With a `-wal` present the open is the ordinary read-only
|
|
101
|
+
* one, so a live writer's frames are still read. Serving readers never set it.
|
|
102
|
+
*/
|
|
103
|
+
inspectCheckpointedImmutably?: boolean;
|
|
104
|
+
}
|
|
105
|
+
declare function indexDbPath(knowledgeRoot: string): string;
|
|
106
|
+
/**
|
|
107
|
+
* Inspect bounded durable maintenance facts without bootstrapping, migrating, or restamping.
|
|
108
|
+
*
|
|
109
|
+
* Absence is a valid schedulable state. Once the database exists, malformed or incomplete
|
|
110
|
+
* projection schemas throw so callers cannot mistake an unreadable index for convergence.
|
|
111
|
+
*/
|
|
112
|
+
declare function readIndexMaintenanceState(knowledgeRoot: string): IndexMaintenanceState;
|
|
113
|
+
declare function resolveVecCapability(db: DatabaseSync, loadablePath?: string): VecCapability;
|
|
114
|
+
declare function vecTableName(profile: EmbeddingProfile): string;
|
|
115
|
+
/** Stable identity persisted in meta and used to select a closed-list profile. */
|
|
116
|
+
declare function embeddingProfileKey(profile: EmbeddingProfile): string;
|
|
117
|
+
/**
|
|
118
|
+
* Resolve the one active profile authority from the derived index's meta stamp.
|
|
119
|
+
*
|
|
120
|
+
* This is RESEARCH Pattern 5 step 1: Plan 07 flips this stamp atomically. D-18
|
|
121
|
+
* keeps M2 selection closed to schema-owned constants, so absent, unknown, or
|
|
122
|
+
* pre-bootstrap metadata always falls back to the ratified default.
|
|
123
|
+
*/
|
|
124
|
+
declare function resolveActiveProfile(db: DatabaseSync): EmbeddingProfile;
|
|
125
|
+
declare function openIndexWriter(knowledgeRoot: string, opts?: IndexOpenOptions): IndexWriterHandle;
|
|
126
|
+
declare function openIndexReaderConnection(knowledgeRoot: string, opts?: IndexReaderOpenOptions): IndexReaderConnection;
|
|
127
|
+
declare function probeIndexHealth(db: DatabaseSync): IndexHealth;
|
|
128
|
+
|
|
129
|
+
/** The ledger's fixed name directly under the committed knowledge root — never caller-supplied. */
|
|
130
|
+
declare const QUARANTINE_LEDGER_FILENAME = "quarantine.jsonl";
|
|
131
|
+
/** One line the read refused, surfaced as data so a caller can print or audit it. */
|
|
132
|
+
interface RefusedQuarantineLine {
|
|
133
|
+
/** 1-based, so it matches what an editor shows the human who has to fix the file. */
|
|
134
|
+
lineNumber: number;
|
|
135
|
+
reason: string;
|
|
136
|
+
}
|
|
137
|
+
interface QuarantineLedgerRead {
|
|
138
|
+
events: readonly QuarantineLedgerEvent[];
|
|
139
|
+
refusedLines: readonly RefusedQuarantineLine[];
|
|
140
|
+
}
|
|
141
|
+
/** The ledger's absolute path under one knowledge root. */
|
|
142
|
+
declare function quarantineLedgerPath(knowledgeRoot: string): string;
|
|
143
|
+
/**
|
|
144
|
+
* Read every event the committed ledger carries, in file order.
|
|
145
|
+
*
|
|
146
|
+
* A missing ledger is an EMPTY ledger — no test is quarantined and run behavior is byte-identical
|
|
147
|
+
* to pre-390 (the FLAK-03 empty-input edge). Blank lines are skipped silently; they are whitespace,
|
|
148
|
+
* not damage. Everything else that fails is refused and reported.
|
|
149
|
+
*
|
|
150
|
+
* Throws {@link QuarantineLedgerVersionError} (typed) when a line declares a schemaVersion this
|
|
151
|
+
* build cannot consume — committed truth hard-fails rather than degrading silently.
|
|
152
|
+
*/
|
|
153
|
+
declare function readQuarantineLedger(knowledgeRoot: string): QuarantineLedgerRead;
|
|
154
|
+
/**
|
|
155
|
+
* Fold the event log into current per-entry state. PURE — identical `(events, now)` inputs answer
|
|
156
|
+
* identically, and no clock is read.
|
|
157
|
+
*
|
|
158
|
+
* Per key, in event order: `entered` opens (or re-opens — D-10's re-entry needs no special rule,
|
|
159
|
+
* the sliding window self-heals) a window carrying owner/expiry/fingerprint/class; `renewed`
|
|
160
|
+
* extends the expiry and claims the owner when one is supplied; either released kind closes it.
|
|
161
|
+
*
|
|
162
|
+
* TWO OF THE ANSWERED FIELDS ARE HISTORY, NOT WINDOW FACTS (390-18). `enteredCount` is how many
|
|
163
|
+
* `entered` events this key has accumulated — a renewal extends a window rather than opening one,
|
|
164
|
+
* so it never increments — and `firstEnteredAt` is the first of those events' instant. They are
|
|
165
|
+
* DERIVED here from bytes the log already holds: no new event kind carries them, no migration
|
|
166
|
+
* exists for them and {@link CURRENT_QUARANTINE_LEDGER_SCHEMA_VERSION} is unmoved by them. A
|
|
167
|
+
* reader meeting two new fields on a versioned artifact's state type will reasonably ask whether
|
|
168
|
+
* the file format moved; it did not, and every ledger written before this fold existed answers
|
|
169
|
+
* both questions correctly on its next read. This is the question D-03 chose an append-only log to
|
|
170
|
+
* make free, finally being asked.
|
|
171
|
+
*
|
|
172
|
+
* THE TWO INSTANTS ANSWER DIFFERENT QUESTIONS and their names are close enough to be a drift
|
|
173
|
+
* hazard, so: `enteredAt` is WHEN THIS WINDOW OPENED, which is the fact `expiresAt` and the
|
|
174
|
+
* computed state are about; `firstEnteredAt` is WHEN THIS TEST'S QUARANTINE HISTORY BEGAN, which
|
|
175
|
+
* is the fact a human triaging it needs (and the key `triageOrder` sorts on, so that a test on its
|
|
176
|
+
* seventh re-entry cannot present as the newest thing in the queue).
|
|
177
|
+
*
|
|
178
|
+
* A renewal can extend an OPEN window — quarantined or lapsed — but NEVER re-opens a CLOSED one
|
|
179
|
+
* (390-11 / WR-04). A release is the operator's decision, and re-entry has its own event:
|
|
180
|
+
* `operations.add` already routes a released entry to the `entered` branch, so honoring a `renewed`
|
|
181
|
+
* against a closed window would only ever resurrect a suppression a human deliberately ended. That
|
|
182
|
+
* case is reachable solely through the committed file's documented human-editability (D-12) — no
|
|
183
|
+
* code path authors it — which is exactly why the fold, not the verb, is where it has to be
|
|
184
|
+
* refused. The guard keys on the EVENT state, never the computed one: a lapsed entry still carries
|
|
185
|
+
* `eventState: 'quarantined'` (expiry is applied after this loop), so D-11's renew-an-expired-entry
|
|
186
|
+
* behavior is untouched.
|
|
187
|
+
*
|
|
188
|
+
* `'expired'` is then COMPUTED, never read from an event: an open window whose `expiresAt` is at or
|
|
189
|
+
* before `now` answers `'expired'`. Its suppression has stopped — the test fails builds again — and
|
|
190
|
+
* the entry stays LISTED, renewable and releasable (D-11).
|
|
191
|
+
*
|
|
192
|
+
* SCOPE OF THAT GUARANTEE, stated because it is narrower than it reads: the lapse ends THIS
|
|
193
|
+
* window, not the suppression. A fingerprint still crossing the threshold re-enters on the very
|
|
194
|
+
* next fold with a fresh full-lifetime deadline, so a permanently failing test costs one red build
|
|
195
|
+
* per lifetime and no human decision, indefinitely. Nothing in this fold or in the ladder bounds
|
|
196
|
+
* that repetition (measured 2026-08-06; pinned in `cli/src/__tests__/quarantine-lifecycle.e2e.test.ts`'s
|
|
197
|
+
* multi-cycle leg, and made legible to a human by plan 390-18's re-entry counter). What the lapse
|
|
198
|
+
* IS, honestly: a 30-day review cadence on an indefinitely renewable suppression.
|
|
199
|
+
*
|
|
200
|
+
* `now` is an ISO-8601 instant, compared on the same scale the events are stamped on.
|
|
201
|
+
*/
|
|
202
|
+
declare function foldQuarantineLedgerState(events: readonly QuarantineLedgerEvent[], now: string): QuarantineEntryState[];
|
|
203
|
+
/** What an append answers: how many lines it wrote. */
|
|
204
|
+
type QuarantineAppendOutcome = {
|
|
205
|
+
kind: 'appended';
|
|
206
|
+
lines: number;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Visibility floor (D-06): distinct occurrence ordinals at which a fingerprint becomes suspected
|
|
211
|
+
* flaky. Pinned, never config — retune from operational evidence in this source, where the change
|
|
212
|
+
* is reviewable.
|
|
213
|
+
*/
|
|
214
|
+
declare const QUARANTINE_FLAG_FLOOR = 2;
|
|
215
|
+
/**
|
|
216
|
+
* `memory.md` §9.5's locked trigger, verbatim: the same fingerprint at three distinct ordinals
|
|
217
|
+
* inside the window escalates. Pinned constant with no config key (386 D-15) — retune it here.
|
|
218
|
+
*/
|
|
219
|
+
declare const QUARANTINE_ESCALATE_THRESHOLD = 3;
|
|
220
|
+
/**
|
|
221
|
+
* D-10's exit: M consecutive PASSING distinct build ordinals release a quarantined test. Five is
|
|
222
|
+
* symmetric with the detection window by design (~17% escape odds for a 30%-failure flake) and sits
|
|
223
|
+
* inside LAST_OUTCOMES_LIMIT, so no window widening is needed. Retune from operational evidence.
|
|
224
|
+
*/
|
|
225
|
+
declare const QUARANTINE_AUTO_EXIT_PASSES = 5;
|
|
226
|
+
/**
|
|
227
|
+
* D-11's default lifetime in days. On lapse suppression STOPS and the entry stays listed as
|
|
228
|
+
* `expired`.
|
|
229
|
+
*
|
|
230
|
+
* This is a REVIEW CADENCE, not a cap, and the difference is the fact somebody retuning the number
|
|
231
|
+
* most needs: a still-crossing fingerprint re-enters with a fresh `expiryFrom(now)` on the very
|
|
232
|
+
* next fold, indefinitely and with no attenuation. Measured over four full cycles (2026-08-06): 4
|
|
233
|
+
* `entered` lines, 4 distinct deadlines, 0 released, cycle 4 indistinguishable from cycle 1. So
|
|
234
|
+
* raising this number lengthens the gap between red builds; it does not change how many there
|
|
235
|
+
* eventually are. A human deadline in a human-reviewed file; retune from operational evidence,
|
|
236
|
+
* never from config.
|
|
237
|
+
*/
|
|
238
|
+
declare const QUARANTINE_DEFAULT_EXPIRY_DAYS = 30;
|
|
239
|
+
/** What escalation does with a verdict class. */
|
|
240
|
+
type QuarantineDisposition = 'auto-quarantine' | 'escalate-only';
|
|
241
|
+
/**
|
|
242
|
+
* The class gate, as a TOTAL function over the closed verdict vocabulary (D-05).
|
|
243
|
+
*
|
|
244
|
+
* `satisfies Record<VerdictClass, QuarantineDisposition>` is the load-bearing part: adding a ninth
|
|
245
|
+
* member to VERDICT_CLASSES makes this object a compile error until its quarantine disposition is
|
|
246
|
+
* decided. A `Set` of three names would have compiled forever while silently treating every future
|
|
247
|
+
* class as escalate-only by accident rather than by decision.
|
|
248
|
+
*/
|
|
249
|
+
declare const QUARANTINE_CLASS_DISPOSITIONS: {
|
|
250
|
+
readonly flake: "auto-quarantine";
|
|
251
|
+
readonly environment: "auto-quarantine";
|
|
252
|
+
readonly timeout: "auto-quarantine";
|
|
253
|
+
readonly app_bug: "escalate-only";
|
|
254
|
+
readonly test_bug: "escalate-only";
|
|
255
|
+
readonly config_error: "escalate-only";
|
|
256
|
+
readonly llm_error: "escalate-only";
|
|
257
|
+
readonly unknown: "escalate-only";
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Exactly `eval-and-core-types.md` §A9's A3 routing, DERIVED from the disposition table rather
|
|
261
|
+
* than spelled a second time (388 C13) — the set and the table can never disagree about a class.
|
|
262
|
+
*/
|
|
263
|
+
declare const AUTO_QUARANTINE_CLASSES: readonly VerdictClass[];
|
|
264
|
+
/**
|
|
265
|
+
* Whether the deterministic floor may decide this KIND of failure AT ALL. Never sufficient on
|
|
266
|
+
* its own: since 390-19 the floor arm also requires the crossing's own `sameBuildPassAndFail`,
|
|
267
|
+
* so no class auto-quarantines on the floor's word alone. The pre-390-19 gloss on this line said
|
|
268
|
+
* otherwise and was the same false-reachability shape 390-25 removed from the corpus header.
|
|
269
|
+
*/
|
|
270
|
+
type QuarantineFloorEligibility = 'floor-eligible' | 'authored-required';
|
|
271
|
+
/**
|
|
272
|
+
* The SECOND total table over the same closed vocabulary (390-16, G-390-3).
|
|
273
|
+
*
|
|
274
|
+
* The disposition table above answers "may this class ever auto-quarantine". It cannot answer the
|
|
275
|
+
* other question, because the answer is not a property of the class name: is the EVIDENCE behind
|
|
276
|
+
* the class a statement about THIS TEST, or about the run it happened to be in? This table answers
|
|
277
|
+
* that, and it is a table rather than `if (cls === 'environment' || cls === 'timeout')` for exactly
|
|
278
|
+
* the reason D-05 gave for the first one — a rule stated over a subset of its own input domain
|
|
279
|
+
* compiles forever while treating every future class as an accident. A ninth member of
|
|
280
|
+
* VERDICT_CLASSES is a compile error here until someone decides its floor eligibility.
|
|
281
|
+
*
|
|
282
|
+
* This table is ONE OF TWO CONJUNCTS on the floor arm since 390-19. It licenses a CLASS; the
|
|
283
|
+
* crossing's `sameBuildPassAndFail` supplies the per-test EVIDENCE. Neither alone may silence a
|
|
284
|
+
* failing test on the deterministic floor's word.
|
|
285
|
+
*
|
|
286
|
+
* Per class, with the reasoning that decides it:
|
|
287
|
+
*
|
|
288
|
+
* - `timeout` → FLOOR-ELIGIBLE (re-decided by 390-19 / G-390-5, and the row that carries the LIVE
|
|
289
|
+
* floor path). This row used to read authored-required because "exceeded the budget" is
|
|
290
|
+
* per-test but semantically THIN — as consistent with an infinite spinner as with flakiness.
|
|
291
|
+
* Thinness is exactly what a same-build pass∧fail cures: a test that passed and failed at the
|
|
292
|
+
* same build ordinal is flaky by direct observation, whatever the budget did. So `timeout` may
|
|
293
|
+
* now be decided on the floor's word PLUS the signature, and NEVER on the floor's word alone.
|
|
294
|
+
* - `environment` → AUTHORED-REQUIRED, on its own merits, unchanged. Two of its three arms are
|
|
295
|
+
* RUN-SCOPED probe reads (`baselineProbe.error !== undefined`, `baselineProbe.status >= 500`)
|
|
296
|
+
* that fire before any per-test signal. One down staging dependency classifies every failing
|
|
297
|
+
* member of a suite identically; the measured blast radius was 6 of 6 tests under one shared
|
|
298
|
+
* 30-day deadline. A flapping dependency produces same-build pass∧fail across MANY tests at
|
|
299
|
+
* once, so the signature does not make a run-scoped observation per-test — read the branch-order
|
|
300
|
+
* paragraph below before treating this row as the containment, because it is not.
|
|
301
|
+
* - `flake` → FLOOR-ELIGIBLE on the class's own merits, AND THIS ROW DECIDES NOTHING. Say it out
|
|
302
|
+
* loud, because G-390-5 exists precisely because a row nobody could reach was described as the
|
|
303
|
+
* mechanism keeping FLAK-01 alive. `classifyRootCause` mints `flake` only inside its
|
|
304
|
+
* `outcome === 'passed' || outcome === 'healed'` arm — the test LITERALLY passed on retry, so
|
|
305
|
+
* the class IS the signature — but a member that passed carries no `failure` row
|
|
306
|
+
* (`projection/run-outcomes.ts`'s `...(passed ? {} : { failure })` spread) and a
|
|
307
|
+
* `QuarantineDetectionFailure` is built only from `test.failure`. So no crossing can carry class
|
|
308
|
+
* `flake` AND producer `deterministic-classifier`: every `flake` crossing the pipeline can build
|
|
309
|
+
* is authored, and is admitted by the FIRST disjunct. `timeout` is the row that is
|
|
310
|
+
* reachable-and-deciding on the floor path; this one is correct and inert.
|
|
311
|
+
* - THE FIVE ESCALATE-ONLY CLASSES → AUTHORED-REQUIRED. They never reach the auto-quarantine
|
|
312
|
+
* branch today, so this value is not observable — which is precisely why it is the strict one.
|
|
313
|
+
* It makes authored-required the DEFAULT for any future widening of the disposition table, so a
|
|
314
|
+
* later one-line class flip cannot silently also license the floor (T-390-16-04).
|
|
315
|
+
*
|
|
316
|
+
* THE BRANCH-ORDER FACT THAT KILLS THE CLASS-BASED CONTAINMENT, measured at HEAD against
|
|
317
|
+
* `classifyRootCause` (`runner/src/run/root-cause.ts`). Its arms run in this order: the presence
|
|
318
|
+
* rule, then the `passed || healed` arm that mints `flake`, then the `outcome === 'timeout'` arm —
|
|
319
|
+
* WHICH RETURNS — and only THEN the `baselineProbe` reads that mint `environment`. So a hung or
|
|
320
|
+
* flapping staging dependency does NOT arrive classed `environment` for the members that blew their
|
|
321
|
+
* deadline: it arrives classed `timeout`, the class this table now licenses. The run-scoped
|
|
322
|
+
* objection stated on the `environment` row above applies VERBATIM to those `timeout` members.
|
|
323
|
+
*
|
|
324
|
+
* DRAW THE CONCLUSION HERE RATHER THAN LEAVING IT TO BE INFERRED: every class the floor can mint on
|
|
325
|
+
* a FAILING member (`timeout`, `environment`, `unknown`) is reachable from a RUN-SCOPED cause, so
|
|
326
|
+
* THIS TABLE CANNOT BE THE CONTAINMENT FOR MASS AUTO-QUARANTINE AND MUST NOT BE READ AS ONE.
|
|
327
|
+
* Keeping `environment` strict contains `environment`; it does not contain the hazard.
|
|
328
|
+
* QUARANTINE_FLOOR_AUTO_QUARANTINE_CAP does — a per-run COUNT, which is the form 390-16's
|
|
329
|
+
* motivating observation (one probe failure, 6 of 6 tests) actually took. A reader who inherits the
|
|
330
|
+
* older framing — that `environment` is THE run-scoped class and `timeout` is the per-test one —
|
|
331
|
+
* will re-derive exactly the defect this round closes: a true-sounding containment sentence about a
|
|
332
|
+
* path the code does not take.
|
|
333
|
+
*
|
|
334
|
+
* WHY NOT flip the disposition table instead. That is wrong in both directions: it would disable
|
|
335
|
+
* auto-quarantine for genuinely ANALYZED environment/timeout failures, and it would leave
|
|
336
|
+
* floor-minted `flake` firing. The consistent rule — the one 390-05 already ratified once when it
|
|
337
|
+
* made `unknown` escalate-only — is that a quarantine decision requires per-test EVIDENCE, and
|
|
338
|
+
* `producer` plus `sameBuildPassAndFail` are what make that rule expressible.
|
|
339
|
+
*/
|
|
340
|
+
declare const QUARANTINE_FLOOR_ELIGIBILITY: {
|
|
341
|
+
readonly flake: "floor-eligible";
|
|
342
|
+
readonly environment: "authored-required";
|
|
343
|
+
readonly timeout: "floor-eligible";
|
|
344
|
+
readonly app_bug: "authored-required";
|
|
345
|
+
readonly test_bug: "authored-required";
|
|
346
|
+
readonly config_error: "authored-required";
|
|
347
|
+
readonly llm_error: "authored-required";
|
|
348
|
+
readonly unknown: "authored-required";
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* One failed fingerprint this run contributed, with the recurrence the projection answered for it.
|
|
352
|
+
* Test identity travels beside the fingerprint because a crossing has to name the test it
|
|
353
|
+
* quarantines; the recurrence itself is keyed `(product, fingerprint)` (D-07).
|
|
354
|
+
*/
|
|
355
|
+
interface QuarantineDetectionFailure {
|
|
356
|
+
product: string;
|
|
357
|
+
filePath: string;
|
|
358
|
+
testName: string;
|
|
359
|
+
fingerprint: string;
|
|
360
|
+
verdictClass: VerdictClass;
|
|
361
|
+
/**
|
|
362
|
+
* WHICH pipeline authored `verdictClass` on the CROSSING run (390-16). The floor-eligibility
|
|
363
|
+
* gate reads this beside the class, because for some classes the class alone does not say
|
|
364
|
+
* whether the evidence is about this test or about the whole run.
|
|
365
|
+
*
|
|
366
|
+
* WHY THE CROSSING RUN'S PRODUCER, and not all three occurrence ordinals'. Gating on every
|
|
367
|
+
* ordinal in the window would need a new `producer` column on `run_fingerprint_windows` plus an
|
|
368
|
+
* index rebuild — cheap in itself, since L12 makes the projection a gitignored rebuildable
|
|
369
|
+
* derivation — but it is a strictly larger change that buys nothing: the crossing run is the one
|
|
370
|
+
* AUTHORING the `entered` line, so its evidence is the evidence the entry rests on. Recorded
|
|
371
|
+
* here so the next reader does not have to re-derive the choice (T-390-16-05, accepted).
|
|
372
|
+
*/
|
|
373
|
+
producer: Verdict['producer'];
|
|
374
|
+
/**
|
|
375
|
+
* THE PER-TEST FLAKE SIGNATURE for this crossing (390-19 / G-390-5): did this test both pass and
|
|
376
|
+
* not pass at some ONE build ordinal? Computed by `hasSameBuildPassAndFail` over the per-test
|
|
377
|
+
* outcome window the projection already keeps (`run_test_outcomes`.`last_outcomes_json`), so it
|
|
378
|
+
* is read off bytes this phase computes rather than invented for the gate.
|
|
379
|
+
*
|
|
380
|
+
* REQUIRED, not optional, on purpose: `tsc --noEmit` then enumerates every construction site,
|
|
381
|
+
* which is the completeness oracle 390-16 did not have and the reason its widening shipped with
|
|
382
|
+
* an unreachable arm.
|
|
383
|
+
*
|
|
384
|
+
* ITS THREE HONEST BOUNDS, so nobody reads a set field as a stronger claim than it is:
|
|
385
|
+
*
|
|
386
|
+
* 1. The window is CAPPED at LAST_OUTCOMES_LIMIT entries, so this is "a same-build pass∧fail
|
|
387
|
+
* within the recorded window", never "ever".
|
|
388
|
+
* 2. IT IS CONTEMPORANEOUS, and that bound is ENFORCED, not advisory (390-24, WR-05). The fold
|
|
389
|
+
* hands this predicate only the outcomes inside `[windowFloor(buildOrdinal), buildOrdinal]`
|
|
390
|
+
* — the crossing's OWN recurrence window, same floor `fingerprintRecurrence` counts over —
|
|
391
|
+
* so a same-build pass∧fail OLDER than that window answers false by construction. A
|
|
392
|
+
* since-fixed flake episode therefore cannot license the floor arm for a new hard
|
|
393
|
+
* regression. The scope lives at the construction site (`run-outcomes.ts`), named below.
|
|
394
|
+
* 3. WHAT IT TAKES TO PRODUCE ONE IN THE REAL WORLD — this is not a common event. An in-run
|
|
395
|
+
* RETRY does NOT produce it: the member-runner collapses retries into a single member
|
|
396
|
+
* outcome and `countedOutcome` maps `healed` to a PASS, so one applied run leaves exactly
|
|
397
|
+
* ONE entry per member. Two entries at one ordinal therefore require TWO SEPARATE APPLIED
|
|
398
|
+
* RUNS carrying the same `handoff.buildOrdinal` — in practice a CI job re-run without an
|
|
399
|
+
* ordinal bump. Every claim in this phase that the floor path is "live without an analysis
|
|
400
|
+
* budget" is true only under that condition, and this phase has already overstated
|
|
401
|
+
* reachability three times.
|
|
402
|
+
*/
|
|
403
|
+
sameBuildPassAndFail: boolean;
|
|
404
|
+
/** DISTINCT build ordinals inside the window carrying this fingerprint. */
|
|
405
|
+
occurrenceOrdinals: number;
|
|
406
|
+
/** DISTINCT build ordinals inside the window carrying ANY failure — the honest denominator. */
|
|
407
|
+
windowOrdinals: number;
|
|
408
|
+
}
|
|
409
|
+
/** One recorded outcome, ordinal-keyed. Mirrors the projection's per-test outcome window entry. */
|
|
410
|
+
interface QuarantineOrdinalOutcome {
|
|
411
|
+
buildOrdinal: number;
|
|
412
|
+
passed: boolean;
|
|
413
|
+
}
|
|
414
|
+
/** One quarantined test's recent outcome window — the auto-exit's only input. */
|
|
415
|
+
interface QuarantineDetectionTestWindow {
|
|
416
|
+
product: string;
|
|
417
|
+
filePath: string;
|
|
418
|
+
testName: string;
|
|
419
|
+
/** May carry several entries per ordinal (two runs in one build); order is irrelevant. */
|
|
420
|
+
ordinals: readonly QuarantineOrdinalOutcome[];
|
|
421
|
+
}
|
|
422
|
+
interface EvaluateQuarantineDetectionInput {
|
|
423
|
+
failures: readonly QuarantineDetectionFailure[];
|
|
424
|
+
testWindows: readonly QuarantineDetectionTestWindow[];
|
|
425
|
+
/** The ledger folded against this same `now` — the suppression and exit input. */
|
|
426
|
+
entries: readonly QuarantineEntryState[];
|
|
427
|
+
/** ISO-8601 instant. The ONLY way wall clock enters this rule. */
|
|
428
|
+
now: string;
|
|
429
|
+
}
|
|
430
|
+
/** A crossing the caller must SHOW: flagged, or escalated-and-deliberately-not-quarantined. */
|
|
431
|
+
interface QuarantineDetectionSighting {
|
|
432
|
+
product: string;
|
|
433
|
+
filePath: string;
|
|
434
|
+
testName: string;
|
|
435
|
+
fingerprint: string;
|
|
436
|
+
verdictClass: VerdictClass;
|
|
437
|
+
/**
|
|
438
|
+
* The crossing run's producer, carried onto the sighting so an operator can ACT on it — and
|
|
439
|
+
* RENDERED on the curation tail's withheld line since 390-22 / WR-03. Until then this docstring
|
|
440
|
+
* claimed the field existed so an operator could tell two causes apart on that line, and the
|
|
441
|
+
* field never reached the line: the claim was true of the shape and false of the operator. It is
|
|
442
|
+
* reduced here to what the render delivers.
|
|
443
|
+
*
|
|
444
|
+
* `escalatedNotQuarantined` has THREE distinct causes, and the producer separates the first two:
|
|
445
|
+
* a class that is never auto-quarantinable (run `analyze-run` and it still will not be), versus a
|
|
446
|
+
* class that would have been had a verdict been authored (run `analyze-run` and it will be).
|
|
447
|
+
* Those read identically on the curation tail's line unless the producer travels with the
|
|
448
|
+
* sighting.
|
|
449
|
+
*
|
|
450
|
+
* THE THIRD CAUSE, ADDED BY 390-19, AND THE FACT THAT THIS FIELD DOES NOT DISTINGUISH IT: the
|
|
451
|
+
* crossing was admissible on the floor arm but QUARANTINE_FLOOR_AUTO_QUARANTINE_CAP was already
|
|
452
|
+
* spent on this run. The information gap is bounded — an operator sees the withheld line either
|
|
453
|
+
* way, the build fails either way, and the identity crosses again on the next applied run — so no
|
|
454
|
+
* field is added to carry it, which would widen this shape and the cli render inside the very
|
|
455
|
+
* round that is closing a containment defect. Recorded as a STATED RESIDUAL instead, because a
|
|
456
|
+
* docstring that enumerates causes and misses one is the defect class this whole round closes.
|
|
457
|
+
*/
|
|
458
|
+
producer: Verdict['producer'];
|
|
459
|
+
occurrenceOrdinals: number;
|
|
460
|
+
windowOrdinals: number;
|
|
461
|
+
}
|
|
462
|
+
interface QuarantineDetectionResult {
|
|
463
|
+
/** Lifecycle events to append, entered-then-released, each group identity-sorted. */
|
|
464
|
+
events: QuarantineLedgerEvent[];
|
|
465
|
+
/** At the flag floor: suspected flaky, no state change, no ledger write (D-06). */
|
|
466
|
+
flagged: QuarantineDetectionSighting[];
|
|
467
|
+
/** Escalated but class-gated away from auto-quarantine — the build keeps failing (D-05). */
|
|
468
|
+
escalatedNotQuarantined: QuarantineDetectionSighting[];
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* The ladder, evaluated over one run's failures and the current ledger state.
|
|
472
|
+
*
|
|
473
|
+
* ORDERING IS DETERMINISTIC ON ANY HOST — entered events (identity-sorted) then released-auto
|
|
474
|
+
* events (identity-sorted) — so the committed ledger's bytes are a function of ledger CONTENT and
|
|
475
|
+
* not of projection iteration order. What makes that true rather than merely stated is
|
|
476
|
+
* {@link compareQuarantineIdentity}: a TOTAL order over {@link quarantineIdentityKey} by code
|
|
477
|
+
* unit. Total is the load-bearing word. A comparator that answers 0 for two DISTINCT identities
|
|
478
|
+
* hands the decision back to the caller's iteration order, because `Array.prototype.sort` is
|
|
479
|
+
* stable — so a zero here would falsify this paragraph directly. Code units also make the answer a
|
|
480
|
+
* property of the strings rather than of the machine's locale and ICU build.
|
|
481
|
+
*
|
|
482
|
+
* Both sorts below and `operations.ts`'s `triageOrder` share that one comparator; the fingerprint
|
|
483
|
+
* tiebreak uses the same `compareBytes` primitive. There is one ordering rule in this subsystem and
|
|
484
|
+
* it is spelled once (390-22 / WR-06).
|
|
485
|
+
*
|
|
486
|
+
* Suppression is keyed on ledger STATE, not on the existence of an entry: only `'quarantined'`
|
|
487
|
+
* suppresses a fresh `entered`. An `'expired'` entry has already stopped suppressing (D-11) and a
|
|
488
|
+
* `'released'` one closed its window, so a fresh crossing re-enters in both cases — D-10's stated
|
|
489
|
+
* "re-entry needs no special rule". The repeated `entered` lines are the ledger's own record that
|
|
490
|
+
* this test has been here before, which is exactly the history D-03 chose an event log to keep.
|
|
491
|
+
*/
|
|
492
|
+
declare function evaluateQuarantineDetection(input: EvaluateQuarantineDetectionInput): QuarantineDetectionResult;
|
|
493
|
+
|
|
494
|
+
interface LoadedBundle {
|
|
495
|
+
frontmatter: RecordFrontmatter;
|
|
496
|
+
summary: string;
|
|
497
|
+
body: string;
|
|
498
|
+
manifest: BundleManifest;
|
|
499
|
+
provenance: BundleProvenance;
|
|
500
|
+
relations: BundleRelations;
|
|
501
|
+
events: BundleOutcomeEvent[];
|
|
502
|
+
artifactsIndex: ArtifactsIndex;
|
|
503
|
+
screenStates: ScreenState[];
|
|
504
|
+
}
|
|
505
|
+
type LoadBundleOutcome = {
|
|
506
|
+
kind: 'loaded';
|
|
507
|
+
bundle: LoadedBundle;
|
|
508
|
+
} | {
|
|
509
|
+
kind: 'not-found';
|
|
510
|
+
} | {
|
|
511
|
+
kind: 'incomplete';
|
|
512
|
+
} | {
|
|
513
|
+
kind: 'version-error';
|
|
514
|
+
reason: string;
|
|
515
|
+
} | {
|
|
516
|
+
kind: 'invalid';
|
|
517
|
+
reason: string;
|
|
518
|
+
};
|
|
519
|
+
interface IntegrityReport {
|
|
520
|
+
ok: boolean;
|
|
521
|
+
violations: string[];
|
|
522
|
+
}
|
|
523
|
+
declare const GATES_REL_PATH = "evidence/gates.jsonl";
|
|
524
|
+
interface Measurements {
|
|
525
|
+
baseline: MeasurementBaseline;
|
|
526
|
+
observations: MeasurementObservation[];
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Read D-03's baseline-first append stream. Absence is normal for non-measurement
|
|
530
|
+
* bundles; any present malformed line fails loudly through the strict schemas.
|
|
531
|
+
*/
|
|
532
|
+
declare function readMeasurements(bundleDir: string): Measurements | undefined;
|
|
533
|
+
/** 416 D-03/D-04: absence is normal; a present receipt must attest this bundle and its bytes. */
|
|
534
|
+
declare function readGateReceipts(bundleDir: string, bundleId: string): GateLine[] | undefined;
|
|
535
|
+
declare function loadBundle(bundleDir: string): LoadBundleOutcome;
|
|
536
|
+
declare function verifyBundleIntegrity(bundleDir: string): IntegrityReport;
|
|
537
|
+
/**
|
|
538
|
+
* Phase 375 consumes this exact disk-derived projection seam; no model-produced scalar enters it.
|
|
539
|
+
*/
|
|
540
|
+
declare function deriveBundleTrust(loaded: LoadedBundle, priors?: TrustPriorTable): DerivedTrustState;
|
|
541
|
+
|
|
542
|
+
interface KnowledgeHit {
|
|
543
|
+
bundleId: string;
|
|
544
|
+
product: string;
|
|
545
|
+
kind: LoadedBundle['frontmatter']['kind'];
|
|
546
|
+
subtype: string | null;
|
|
547
|
+
status: BundleStatus;
|
|
548
|
+
trust: number;
|
|
549
|
+
validity: DerivedTrustState['validity'];
|
|
550
|
+
summary: string;
|
|
551
|
+
embeddingInput: string;
|
|
552
|
+
}
|
|
553
|
+
interface ScanBundlesOptions {
|
|
554
|
+
knowledgeRoot: string;
|
|
555
|
+
priors?: TrustPriorTable;
|
|
556
|
+
text?: string;
|
|
557
|
+
anchor?: Anchor;
|
|
558
|
+
product?: string;
|
|
559
|
+
k?: number;
|
|
560
|
+
}
|
|
561
|
+
interface ScanBundleByIdOptions {
|
|
562
|
+
knowledgeRoot: string;
|
|
563
|
+
priors?: TrustPriorTable;
|
|
564
|
+
bundleId: string;
|
|
565
|
+
}
|
|
566
|
+
type CanonicalBundleAnchorLookup = {
|
|
567
|
+
kind: 'resolved';
|
|
568
|
+
bundleId: RecordId;
|
|
569
|
+
product: string;
|
|
570
|
+
anchors: Anchor[];
|
|
571
|
+
} | {
|
|
572
|
+
kind: 'unresolved';
|
|
573
|
+
reason: 'not-found';
|
|
574
|
+
} | {
|
|
575
|
+
kind: 'unresolved';
|
|
576
|
+
reason: 'invalid';
|
|
577
|
+
detail: string;
|
|
578
|
+
};
|
|
579
|
+
interface EnumeratedBundleDir {
|
|
580
|
+
product: string;
|
|
581
|
+
dir: string;
|
|
582
|
+
}
|
|
583
|
+
/** Enumerate bundle directories in stable product-then-directory order. */
|
|
584
|
+
declare function enumerateBundleDirs(knowledgeRoot: string): EnumeratedBundleDir[];
|
|
585
|
+
/** The single withdrawn-fact firewall reused by degraded and indexed reader paths. */
|
|
586
|
+
declare function isServable(trust: Pick<DerivedTrustState, 'status' | 'validity'>): boolean;
|
|
587
|
+
declare function scanBundles(opts: ScanBundlesOptions): KnowledgeHit[];
|
|
588
|
+
declare function scanBundleById(opts: ScanBundleByIdOptions): KnowledgeHit | undefined;
|
|
589
|
+
/**
|
|
590
|
+
* Trusted, read-only lookup for post-verdict attribution. Unlike scanBundleById this deliberately
|
|
591
|
+
* ignores serving lifecycle state: a handoff may outlive a candidate's promotion, supersession, or
|
|
592
|
+
* deprecation. Canonical bytes still have to parse and pass the complete integrity oracle.
|
|
593
|
+
*/
|
|
594
|
+
declare function readCanonicalBundleAnchors(input: {
|
|
595
|
+
knowledgeRoot: string;
|
|
596
|
+
bundleId: RecordId;
|
|
597
|
+
}): CanonicalBundleAnchorLookup;
|
|
598
|
+
|
|
599
|
+
declare const REBUILD_MARKER_FILE = ".rebuild-requested";
|
|
600
|
+
type RebuildReason = 'absent' | 'corrupt' | 'locked' | 'schema-version';
|
|
601
|
+
interface RebuildRequest {
|
|
602
|
+
reason: RebuildReason;
|
|
603
|
+
detail: string;
|
|
604
|
+
/** D-17 diagnostic operations metadata only; never an input to validity or serving decisions. */
|
|
605
|
+
requestedAt: string;
|
|
606
|
+
}
|
|
607
|
+
interface RequestRebuildOptions {
|
|
608
|
+
knowledgeRoot: string;
|
|
609
|
+
reason: RebuildReason;
|
|
610
|
+
detail: string;
|
|
611
|
+
}
|
|
612
|
+
type ReadRebuildRequestOutcome = {
|
|
613
|
+
present: false;
|
|
614
|
+
} | {
|
|
615
|
+
present: true;
|
|
616
|
+
request: RebuildRequest | undefined;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Write the first rebuild signal atomically; later signals never overwrite its diagnostic cause.
|
|
620
|
+
*/
|
|
621
|
+
declare function requestRebuild(opts: RequestRebuildOptions): void;
|
|
622
|
+
/** Read a marker through a strict disk-boundary guard; malformed bytes remain a bare signal. */
|
|
623
|
+
declare function readRebuildRequest(knowledgeRoot: string): ReadRebuildRequestOutcome;
|
|
624
|
+
/** Consume the durable rebuild signal. Clearing an absent marker is intentionally a no-op. */
|
|
625
|
+
declare function clearRebuildRequest(knowledgeRoot: string): void;
|
|
626
|
+
|
|
627
|
+
interface KnowledgeSearchOptions {
|
|
628
|
+
product?: string;
|
|
629
|
+
k?: number;
|
|
630
|
+
}
|
|
631
|
+
interface DenseSearchOptions extends KnowledgeSearchOptions {
|
|
632
|
+
k: number;
|
|
633
|
+
}
|
|
634
|
+
type DenseHit = KnowledgeHit & {
|
|
635
|
+
distance: number;
|
|
636
|
+
};
|
|
637
|
+
interface KnowledgeReader {
|
|
638
|
+
/** Current serving face; permanently changes to scan after an index operation failure. */
|
|
639
|
+
readonly source: 'index' | 'scan';
|
|
640
|
+
/** Current vector capability; changes to none when the serving face degrades to scan. */
|
|
641
|
+
readonly vec: VecCapability | 'none';
|
|
642
|
+
getById(bundleId: string): KnowledgeHit | undefined;
|
|
643
|
+
searchLexical(text: string, opts?: KnowledgeSearchOptions): KnowledgeHit[];
|
|
644
|
+
lookupAnchor(anchor: Anchor, opts?: KnowledgeSearchOptions): KnowledgeHit[];
|
|
645
|
+
searchDense(embedding: Float32Array, opts: DenseSearchOptions): DenseHit[];
|
|
646
|
+
recheck(hits: readonly KnowledgeHit[]): KnowledgeHit[];
|
|
647
|
+
close(): void;
|
|
648
|
+
}
|
|
649
|
+
interface OpenKnowledgeReaderOptions {
|
|
650
|
+
/** Neutral host data retained across every read and index-to-scan transition. */
|
|
651
|
+
priors?: TrustPriorTable;
|
|
652
|
+
/** D-12 test seam. Production callers resolve sqlite-vec's pinned prebuild. */
|
|
653
|
+
vecLoadablePath?: string;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Which face the derived index presents to a reader RIGHT NOW (407 D-17).
|
|
657
|
+
*
|
|
658
|
+
* `scan` carries the reason the ladder degraded, the detail the rebuild request would have
|
|
659
|
+
* quoted, and whether the file was there at all — `absent` and `corrupt` are the same word to a
|
|
660
|
+
* serving caller but different operator situations, and `doctor` says which.
|
|
661
|
+
*/
|
|
662
|
+
type IndexFace = {
|
|
663
|
+
source: 'index';
|
|
664
|
+
} | {
|
|
665
|
+
source: 'scan';
|
|
666
|
+
reason: RebuildReason;
|
|
667
|
+
detail: string;
|
|
668
|
+
filePresent: boolean;
|
|
669
|
+
};
|
|
670
|
+
interface ClassifyIndexFaceOptions extends OpenKnowledgeReaderOptions {
|
|
671
|
+
/** `IndexReaderOpenOptions.inspectCheckpointedImmutably`: the probe only, never the facade. */
|
|
672
|
+
inspectCheckpointedImmutably?: boolean;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* The degrade ladder as a PURE READ (407 D-17, T-407-10).
|
|
676
|
+
*
|
|
677
|
+
* ONE ladder, ONE core, two callers. {@link openKnowledgeReader} below is the SERVING facade: it
|
|
678
|
+
* keeps the connection the core blessed and keeps the side effect — a degraded open still writes
|
|
679
|
+
* the durable D-07 rebuild request. This function is the PROBE half: the identical checks in the
|
|
680
|
+
* identical order over the identical core, but it releases the connection and writes no marker,
|
|
681
|
+
* because its other callers are the retrieval-rung resolver that `doctor` and the runner's
|
|
682
|
+
* evidence recorder invoke, and the local composition root's knowledge probes. A probe that
|
|
683
|
+
* requested a rebuild would make merely ASKING about the index a mutation of the knowledge root;
|
|
684
|
+
* a probe that returned a live handle would make every `doctor` call a connection leak. The probe
|
|
685
|
+
* hands back a face, never a handle — only the serving facade holds a connection.
|
|
686
|
+
*/
|
|
687
|
+
declare function classifyIndexFace(knowledgeRoot: string, opts?: ClassifyIndexFaceOptions): IndexFace;
|
|
688
|
+
/**
|
|
689
|
+
* The SERVING facade: classify once, then serve from the connection the classifier blessed.
|
|
690
|
+
*
|
|
691
|
+
* 407-13 (CR-02): this used to call the pure probe and then open a SECOND connection of its own,
|
|
692
|
+
* so a lock acquired in the gap between the probe's close and this open degraded a healthy index
|
|
693
|
+
* — writing the durable rebuild marker and dropping every later retrieval in the process to
|
|
694
|
+
* bundle scan on nothing but contention. It also let `resolveRetrievalRung` report `memidex` while
|
|
695
|
+
* the reader it was describing served `bundle-scan`, the exact banner/reality disagreement D-17's
|
|
696
|
+
* one-fold rule exists to prevent. The facade must never close what it is about to reopen: there
|
|
697
|
+
* is one open on the healthy path and no window for a lock to arrive in.
|
|
698
|
+
*/
|
|
699
|
+
declare function openKnowledgeReader$1(knowledgeRoot: string, opts?: OpenKnowledgeReaderOptions): KnowledgeReader;
|
|
700
|
+
|
|
701
|
+
interface OpenServingKnowledgeReaderConfig {
|
|
702
|
+
knowledgeRoot: string;
|
|
703
|
+
/** Neutral host data, snapshotted when this reader is opened. */
|
|
704
|
+
priors?: TrustPriorTable;
|
|
705
|
+
product?: string;
|
|
706
|
+
scopeDefaults?: {
|
|
707
|
+
asOfBuild?: number;
|
|
708
|
+
/** Known containing scopes for member requests (for example, the owning suite). */
|
|
709
|
+
parentScopes?: readonly ScopeKey[];
|
|
710
|
+
};
|
|
711
|
+
budgets?: {
|
|
712
|
+
recordCap?: number;
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
interface IndexRow {
|
|
716
|
+
bundle_id: string;
|
|
717
|
+
product: string;
|
|
718
|
+
scope_tier: string;
|
|
719
|
+
scope_key: string;
|
|
720
|
+
}
|
|
721
|
+
interface HydratedEntry {
|
|
722
|
+
dir: string;
|
|
723
|
+
bundle: LoadedBundle;
|
|
724
|
+
entry: IndexEntry;
|
|
725
|
+
}
|
|
726
|
+
/** @deprecated The safe serving reader reports misses as `undefined` and never throws this. */
|
|
727
|
+
declare class KnowledgeRecordNotFoundError extends Error {
|
|
728
|
+
readonly recordId: RecordId;
|
|
729
|
+
constructor(recordId: RecordId);
|
|
730
|
+
}
|
|
731
|
+
/** Shared serving internal: scope-laddered index rows (also feeds the authoring reader). */
|
|
732
|
+
declare function readIndexRows(config: OpenServingKnowledgeReaderConfig, scope?: ScopeKey): IndexRow[];
|
|
733
|
+
/** Shared serving internal: integrity-checked bundle hydration (also feeds the authoring reader). */
|
|
734
|
+
declare function hydrateRows(config: OpenServingKnowledgeReaderConfig, rows: readonly IndexRow[], audit: boolean): HydratedEntry[];
|
|
735
|
+
declare function openKnowledgeReader(config: OpenServingKnowledgeReaderConfig): KnowledgeHintReader;
|
|
736
|
+
declare function openKnowledgeReader(knowledgeRoot: string, opts?: OpenKnowledgeReaderOptions): KnowledgeReader;
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* The bundle facts the matcher folds. `LoadedBundle` satisfies this structurally, so the reader
|
|
740
|
+
* passes hydrated entries straight through; tests construct the narrow shape directly.
|
|
741
|
+
*/
|
|
742
|
+
interface ProcedureMatchCandidate {
|
|
743
|
+
entry: IndexEntry;
|
|
744
|
+
bundle: {
|
|
745
|
+
summary: string;
|
|
746
|
+
body: string;
|
|
747
|
+
events: readonly BundleOutcomeEvent[];
|
|
748
|
+
provenance: BundleProvenance;
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Screenless authoring-brief assembly (ABRF-01/ABRF-02, D-13/D-15/D-16).
|
|
754
|
+
*
|
|
755
|
+
* The 4th serving channel: facts/cautions/procedures from already-hydrated store entries plus
|
|
756
|
+
* projection-ranked exemplar TEST REFERENCES — no ScreenState anywhere in the signature. The
|
|
757
|
+
* assembly is pure (snapshot inputs only, no wall-clock, no file reads) and deterministic on the
|
|
758
|
+
* zero-embedder lexical floor: intent tokens drive the lexical relevance leg, `page:`/`flow:`
|
|
759
|
+
* target anchors drive the anchor leg, and dense scores join only as an optional additive term.
|
|
760
|
+
*
|
|
761
|
+
* Locked tight-budget precedence (Pitfall 8 — deliberately NOT the run brief's L0-L2 tiers):
|
|
762
|
+
* caution > procedure > exemplar > fact. Buckets admit in that order against one shared
|
|
763
|
+
* admission ledger; once a bucket sheds anything, every lower-precedence bucket is shed whole,
|
|
764
|
+
* so an exemplar can never be dropped before a fact at the same budget.
|
|
765
|
+
*/
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* PROVISIONAL exemplar cap (D-15's "~3-5"). Internal constitution value in the
|
|
769
|
+
* retrieval/constants.ts style — never a config key; M3 owns calibration.
|
|
770
|
+
*/
|
|
771
|
+
declare const AUTHORING_EXEMPLAR_CAP = 4;
|
|
772
|
+
/** PROVISIONAL top-N procedures served to the authoring consumer (D-15). */
|
|
773
|
+
declare const AUTHORING_PROCEDURE_CAP = 5;
|
|
774
|
+
/**
|
|
775
|
+
* PROVISIONAL bounded-excerpt budget in UTF-16 code units (D-16). The excerpt is title +
|
|
776
|
+
* outcome outline composed from projection-known metadata — never test file content.
|
|
777
|
+
*/
|
|
778
|
+
declare const AUTHORING_EXCERPT_CHAR_BUDGET = 240;
|
|
779
|
+
/** Hydrated store entry: `LoadedBundle`-backed entries satisfy this structurally. */
|
|
780
|
+
type AuthoringEntryCandidate = ProcedureMatchCandidate;
|
|
781
|
+
/** One run-outcome projection row (381-05 tables), read through the index reader connection. */
|
|
782
|
+
interface AuthoringExemplarRow {
|
|
783
|
+
filePath: string;
|
|
784
|
+
testName: string;
|
|
785
|
+
passes: number;
|
|
786
|
+
failures: number;
|
|
787
|
+
heals: number;
|
|
788
|
+
flakeCount: number;
|
|
789
|
+
/** Resolved by the hydrating reader from the committed quarantine ledger (390 D-02). */
|
|
790
|
+
quarantined: boolean;
|
|
791
|
+
/** Last-N window entries — ordinals only, wall-clock never. */
|
|
792
|
+
lastOutcomes: readonly {
|
|
793
|
+
buildOrdinal: number;
|
|
794
|
+
passed: boolean;
|
|
795
|
+
}[];
|
|
796
|
+
/** canonicalJson(normalizeAnchor(...)) keys — the ABRF-02 byte-deterministic encoding. */
|
|
797
|
+
anchorKeys: readonly string[];
|
|
798
|
+
}
|
|
799
|
+
/** A test reference in the caller-supplied discovery universe (refs only, never content). */
|
|
800
|
+
interface AuthoringTestRef {
|
|
801
|
+
filePath: string;
|
|
802
|
+
testName: string;
|
|
803
|
+
}
|
|
804
|
+
interface AssembleAuthoringBriefInput {
|
|
805
|
+
/** Already-hydrated entries; the reader's SQL scope ladder has applied the scope walls. */
|
|
806
|
+
entries: readonly AuthoringEntryCandidate[];
|
|
807
|
+
/** Per-test outcome counters + exercised-anchor sets from the run-outcome projection. */
|
|
808
|
+
projectionRows: readonly AuthoringExemplarRow[];
|
|
809
|
+
/**
|
|
810
|
+
* D-15 never-run discovery universe: test references the CALLER knows about (the consumer
|
|
811
|
+
* owns the filesystem; M4 passes its authored shelf, the M2 reader passes projection-known
|
|
812
|
+
* identities). Refs absent from the projection surface flagged `unverifiedOutcomes`,
|
|
813
|
+
* discounted, never dropped — and still work against an EMPTY projection.
|
|
814
|
+
*/
|
|
815
|
+
knownTests?: readonly AuthoringTestRef[];
|
|
816
|
+
intent: string;
|
|
817
|
+
scope: ScopeKey;
|
|
818
|
+
/** `page:`/`flow:` anchors derived from scope + intent by the caller — never a ScreenState. */
|
|
819
|
+
targetAnchors: readonly Anchor[];
|
|
820
|
+
budget: number;
|
|
821
|
+
/** Optional additive dense-leg scores keyed by record id, present only when an embedder is up. */
|
|
822
|
+
denseScoreByRecordId?: ReadonlyMap<string, number>;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* The §10.6 authoring brief together with its serve-time trace (D-16). The 4th channel returns the
|
|
826
|
+
* composite for the same reason the run brief does — capture is generic at the SEAM, so 393/394
|
|
827
|
+
* inherit it by destructuring rather than by re-implementing it.
|
|
828
|
+
*/
|
|
829
|
+
interface AssembledAuthoringBrief {
|
|
830
|
+
readonly brief: AuthoringBrief;
|
|
831
|
+
readonly trace: ServedRetrievalTraceV1;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Pure screenless assembly over already-loaded snapshot inputs. Retrieval SQL, hydration,
|
|
835
|
+
* budgets-as-plain-numbers, and the projection read all live at the composition boundary
|
|
836
|
+
* (`createAuthoringReader`); nothing here touches a connection, the clock, or the filesystem.
|
|
837
|
+
*
|
|
838
|
+
* The trace's `rank` is the candidate's 1-based position in the ONE admission walk below —
|
|
839
|
+
* caution, then procedure, then exemplar, then fact — which is the actual total order this
|
|
840
|
+
* assembly serves in. Everything the ledger admits becomes a served line; everything it sheds
|
|
841
|
+
* becomes a cut candidate, bounded by the pinned top-K.
|
|
842
|
+
*/
|
|
843
|
+
declare function assembleAuthoringBrief(input: AssembleAuthoringBriefInput): AssembledAuthoringBrief;
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* PROVISIONAL authoring-brief budget, computed as a plain number at this composition boundary
|
|
847
|
+
* (377 D-07 lineage: budgets are numbers passed down, never config reads inside assemblies).
|
|
848
|
+
*/
|
|
849
|
+
declare const AUTHORING_BRIEF_DEFAULT_BUDGET = 2000;
|
|
850
|
+
/** PROVISIONAL dense candidate cap pending authoring-channel retrieval telemetry. */
|
|
851
|
+
declare const AUTHORING_DENSE_K = 32;
|
|
852
|
+
interface AuthoringReaderDependencies {
|
|
853
|
+
/** Consumer-owned test inventory crossing this boundary as identity refs only. */
|
|
854
|
+
discoverKnownTests?: () => readonly AuthoringTestRef[];
|
|
855
|
+
/** Test/integration seam; production omission uses denseLeg's automatic acquisition ladder. */
|
|
856
|
+
embedder?: EmbedderPort;
|
|
857
|
+
/**
|
|
858
|
+
* ISO-8601 instant the quarantine fold compares expiry against (390 D-11). A seam rather than a
|
|
859
|
+
* clock read inside the fold: `'expired'` is COMPUTED from this value, so pinning an expiry
|
|
860
|
+
* boundary one second either side has to be possible without waiting for wall time. Production
|
|
861
|
+
* omission reads the clock ONCE per brief, at this composition boundary.
|
|
862
|
+
*/
|
|
863
|
+
now?: () => string;
|
|
864
|
+
}
|
|
865
|
+
/** Open the screenless authoring channel over the same store config as the serving reader. */
|
|
866
|
+
declare function createAuthoringReader(config: OpenServingKnowledgeReaderConfig, deps?: AuthoringReaderDependencies): AuthoringReadPort;
|
|
867
|
+
|
|
868
|
+
interface InspectRecordsOptions {
|
|
869
|
+
knowledgeRoot: string;
|
|
870
|
+
filter: InspectFilter;
|
|
871
|
+
}
|
|
872
|
+
type InspectionTrustState = Pick<DerivedTrustState, 'status' | 'counters' | 'validity'>;
|
|
873
|
+
/**
|
|
874
|
+
* Project ONE loaded bundle and its already-derived trust into the maintenance view.
|
|
875
|
+
*
|
|
876
|
+
* Extracted from the fold below so `showRecord` renders the SAME view rather than a second
|
|
877
|
+
* one built to the same description. The two would have agreed on the day they were written;
|
|
878
|
+
* the first field to disagree afterwards would have been one nobody compares, and a reviewer
|
|
879
|
+
* reading a record's detail page beside a record's row would have had no way to tell which of
|
|
880
|
+
* the two was lying. `bundle.events` is taken as given, so an as-of caller passes the bundle
|
|
881
|
+
* with its visible events already narrowed and this function has no opinion about time.
|
|
882
|
+
*/
|
|
883
|
+
declare function toInspectRecordView(entry: EnumeratedBundleDir, bundle: LoadedBundle, trust: InspectionTrustState): InspectRecordView;
|
|
884
|
+
/**
|
|
885
|
+
* Fold canonical committed bundles into maintenance views. Explicit non-live status filters and
|
|
886
|
+
* as-of queries enable audit visibility; an unqualified query retains the serving firewall.
|
|
887
|
+
*/
|
|
888
|
+
declare function inspectRecords(options: InspectRecordsOptions): InspectRecordView[];
|
|
889
|
+
|
|
890
|
+
interface DiffSinceOptions {
|
|
891
|
+
knowledgeRoot: string;
|
|
892
|
+
sinceOrdinal: number;
|
|
893
|
+
}
|
|
894
|
+
/** Pure build-ordinal fold over committed bundle outcomes and content-free purge receipts. */
|
|
895
|
+
declare function diffSince(options: DiffSinceOptions): RecordChange[];
|
|
896
|
+
|
|
897
|
+
interface ShowRecordOptions {
|
|
898
|
+
knowledgeRoot: string;
|
|
899
|
+
recordId: string;
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Show one record, or report by name that nothing is committed under that id.
|
|
903
|
+
*
|
|
904
|
+
* A knowledge root with no bundles — or no `memory/` directory at all — is an ordinary
|
|
905
|
+
* `not-found`, because the enumerator already treats a missing tree as empty. That is the
|
|
906
|
+
* FUNC-04 empty edge: an empty store answers, it does not throw.
|
|
907
|
+
*/
|
|
908
|
+
declare function showRecord(options: ShowRecordOptions): KnowledgeRecordShowResult;
|
|
909
|
+
|
|
910
|
+
type KnowledgeMaintenanceScanIssue = 'directory-read' | 'non-directory-entry' | 'bundle-load' | 'bundle-integrity' | 'receipt-read' | 'receipt-invalid';
|
|
911
|
+
/** Fail-closed maintenance read error: callers must never render a partial clean-looking view. */
|
|
912
|
+
declare class KnowledgeMaintenanceScanError extends Error {
|
|
913
|
+
readonly name = "KnowledgeMaintenanceScanError";
|
|
914
|
+
readonly issue: KnowledgeMaintenanceScanIssue;
|
|
915
|
+
readonly path: string;
|
|
916
|
+
constructor(issue: KnowledgeMaintenanceScanIssue, path: string, detail: string);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
type CanaryPostureFacts = {
|
|
920
|
+
kind: 'found';
|
|
921
|
+
gate1PassOrdinal?: number;
|
|
922
|
+
gate1PassDigest?: string;
|
|
923
|
+
/** Existing active authority cites this Gate-1 receipt; not admission eligibility. */
|
|
924
|
+
lowerTrustActiveGate1Digest?: string;
|
|
925
|
+
latestAttributionOrdinal?: number;
|
|
926
|
+
latestGate2Ordinal?: number;
|
|
927
|
+
activeInScope: number;
|
|
928
|
+
lowerTrustActiveInScope: number;
|
|
929
|
+
} | {
|
|
930
|
+
kind: 'not-found';
|
|
931
|
+
};
|
|
932
|
+
interface StandingReceiptDigest {
|
|
933
|
+
candidateId: string;
|
|
934
|
+
gate: GateReceipt['gate'];
|
|
935
|
+
verdict: GateReceipt['verdict'];
|
|
936
|
+
/** Gate 3 is user evidence and has no corpus citation. */
|
|
937
|
+
corpusDigest?: string;
|
|
938
|
+
producedAtOrdinal: number;
|
|
939
|
+
}
|
|
940
|
+
interface LowerTrustShare {
|
|
941
|
+
product: string;
|
|
942
|
+
active: number;
|
|
943
|
+
lowerTrust: number;
|
|
944
|
+
}
|
|
945
|
+
declare function canaryPostureFactsFor(input: {
|
|
946
|
+
knowledgeRoot: string;
|
|
947
|
+
candidateId: string;
|
|
948
|
+
scope: ScopeKey;
|
|
949
|
+
resolveTrustPriors?: () => TrustPriorTable | undefined;
|
|
950
|
+
}): CanaryPostureFacts;
|
|
951
|
+
declare function standingReceiptDigestsFor(input: {
|
|
952
|
+
knowledgeRoot: string;
|
|
953
|
+
}): StandingReceiptDigest[];
|
|
954
|
+
declare function lowerTrustSharesFor(input: {
|
|
955
|
+
knowledgeRoot: string;
|
|
956
|
+
resolveTrustPriors?: () => TrustPriorTable | undefined;
|
|
957
|
+
}): LowerTrustShare[];
|
|
958
|
+
|
|
959
|
+
declare const MARK_EVIDENCE_TOKEN_PREFIX = "mark:";
|
|
960
|
+
interface PlanMarkEvidenceInput {
|
|
961
|
+
knowledgeRoot: string;
|
|
962
|
+
/** markId is optional: a preview plans ephemeral effects; a resumed writer supplies it to see durable ones. */
|
|
963
|
+
mark: Pick<MarkReceipt, 'runId' | 'kind'> & {
|
|
964
|
+
markId?: string;
|
|
965
|
+
};
|
|
966
|
+
servedRecordIds: readonly string[];
|
|
967
|
+
/** Historical observation hashes require the original member/step coordinates. */
|
|
968
|
+
handoff?: CompletedRunHandoff;
|
|
969
|
+
/** Host-derived chainJobIdsForRun(runId, idSource).curateMemory; never guessed here. */
|
|
970
|
+
curationJobIds?: readonly string[];
|
|
971
|
+
}
|
|
972
|
+
type MarkEvidenceEffect = {
|
|
973
|
+
direction: 'confirm';
|
|
974
|
+
alreadyAppended: boolean;
|
|
975
|
+
} | {
|
|
976
|
+
direction: 'overturn';
|
|
977
|
+
overturnsEvidenceToken: EvidenceToken;
|
|
978
|
+
overturnsCurationJobId: string;
|
|
979
|
+
alreadyAppended: boolean;
|
|
980
|
+
};
|
|
981
|
+
type MarkEvidenceTarget = {
|
|
982
|
+
recordId: string;
|
|
983
|
+
kind: 'unreadable';
|
|
984
|
+
} | {
|
|
985
|
+
recordId: string;
|
|
986
|
+
kind: 'effects';
|
|
987
|
+
productKey: string;
|
|
988
|
+
served: boolean;
|
|
989
|
+
buildOrdinal: number;
|
|
990
|
+
effects: MarkEvidenceEffect[];
|
|
991
|
+
};
|
|
992
|
+
interface MarkEvidencePlan {
|
|
993
|
+
targets: MarkEvidenceTarget[];
|
|
994
|
+
/** Without the handoff, opaque historical canary hashes cannot all be correlated. */
|
|
995
|
+
correlationIncomplete?: true;
|
|
996
|
+
}
|
|
997
|
+
type AppendMarkEvidenceOutcome = {
|
|
998
|
+
confirmed: number;
|
|
999
|
+
overturned: number;
|
|
1000
|
+
skipped: {
|
|
1001
|
+
recordId: string;
|
|
1002
|
+
reason: 'bundle-unreadable' | 'already-appended';
|
|
1003
|
+
}[];
|
|
1004
|
+
/** Without the handoff, opaque historical canary hashes cannot all be correlated. */
|
|
1005
|
+
correlationIncomplete?: true;
|
|
1006
|
+
};
|
|
1007
|
+
declare function markEvidenceEvent(effect: MarkEvidenceEffect, markId: string, buildOrdinal: number): BundleOutcomeEvent;
|
|
1008
|
+
declare function planMarkEvidence(input: PlanMarkEvidenceInput): MarkEvidencePlan;
|
|
1009
|
+
/** The outcome an append executing this plan reports, with duplicates counted only on resume. */
|
|
1010
|
+
declare function projectMarkEvidenceOutcome(plan: MarkEvidencePlan, options: {
|
|
1011
|
+
includeAlreadyAppended: boolean;
|
|
1012
|
+
}): AppendMarkEvidenceOutcome;
|
|
1013
|
+
|
|
1014
|
+
export { type Measurements as $, type AppendMarkEvidenceOutcome as A, INDEX_SCHEMA_VERSION as B, CHECKPOINT_EVERY_N_BUNDLES as C, type DenseHit as D, type EmbedderPort as E, type IndexHealth as F, GATES_REL_PATH as G, type IndexWriterHandle as H, type IndexReaderConnection as I, type InspectRecordsOptions as J, type KnowledgeReader as K, type LoadedBundle as L, type IntegrityReport as M, type KnowledgeHit as N, KnowledgeMaintenanceScanError as O, type KnowledgeMaintenanceScanIssue as P, type QuarantineAppendOutcome as Q, type RefusedQuarantineLine as R, KnowledgeRecordNotFoundError as S, type KnowledgeSearchOptions as T, type LoadBundleOutcome as U, type VecCapability as V, type LowerTrustShare as W, MARK_EVIDENCE_TOKEN_PREFIX as X, type MarkEvidenceEffect as Y, type MarkEvidencePlan as Z, type MarkEvidenceTarget as _, type IndexFace as a, verifyBundleIntegrity as a$, type OpenKnowledgeReaderOptions as a0, type OpenServingKnowledgeReaderConfig as a1, type PlanMarkEvidenceInput as a2, QUARANTINE_AUTO_EXIT_PASSES as a3, QUARANTINE_CLASS_DISPOSITIONS as a4, QUARANTINE_DEFAULT_EXPIRY_DAYS as a5, QUARANTINE_ESCALATE_THRESHOLD as a6, QUARANTINE_FLAG_FLOOR as a7, QUARANTINE_LEDGER_FILENAME as a8, type QuarantineDetectionFailure as a9, foldQuarantineLedgerState as aA, indexDbPath as aB, inspectRecords as aC, isServable as aD, loadBundle as aE, lowerTrustSharesFor as aF, markEvidenceEvent as aG, openIndexReaderConnection as aH, openIndexWriter as aI, openKnowledgeReader as aJ, planMarkEvidence as aK, probeIndexHealth as aL, projectMarkEvidenceOutcome as aM, quarantineLedgerPath as aN, readCanonicalBundleAnchors as aO, readGateReceipts as aP, readMeasurements as aQ, readQuarantineLedger as aR, requestRebuild as aS, resolveActiveProfile as aT, resolveVecCapability as aU, scanBundleById as aV, scanBundles as aW, showRecord as aX, standingReceiptDigestsFor as aY, toInspectRecordView as aZ, vecTableName as a_, type QuarantineDetectionResult as aa, type QuarantineDetectionTestWindow as ab, type QuarantineDisposition as ac, type QuarantineLedgerRead as ad, type QuarantineOrdinalOutcome as ae, READER_BUSY_TIMEOUT_MS as af, REBUILD_MARKER_FILE as ag, REQUIRED_INDEX_TABLES as ah, type ReadRebuildRequestOutcome as ai, type RebuildReason as aj, type RequestRebuildOptions as ak, type ScanBundleByIdOptions as al, type ScanBundlesOptions as am, type ShowRecordOptions as an, type StandingReceiptDigest as ao, WRITER_BUSY_TIMEOUT_MS as ap, assembleAuthoringBrief as aq, canaryPostureFactsFor as ar, classifyIndexFace as as, clearRebuildRequest as at, createAuthoringReader as au, deriveBundleTrust as av, diffSince as aw, embeddingProfileKey as ax, enumerateBundleDirs as ay, evaluateQuarantineDetection as az, type QuarantineDetectionSighting as b, type HydratedEntry as b0, type IndexRow as b1, QUARANTINE_FLOOR_ELIGIBILITY as b2, type QuarantineFloorEligibility as b3, hydrateRows as b4, readIndexRows as b5, readIndexMaintenanceState as c, type RebuildRequest as d, AUTHORING_BRIEF_DEFAULT_BUDGET as e, AUTHORING_DENSE_K as f, AUTHORING_EXCERPT_CHAR_BUDGET as g, AUTHORING_EXEMPLAR_CAP as h, AUTHORING_PROCEDURE_CAP as i, AUTO_QUARANTINE_CLASSES as j, type AssembleAuthoringBriefInput as k, type AssembledAuthoringBrief as l, type AuthoringEntryCandidate as m, type AuthoringExemplarRow as n, openKnowledgeReader$1 as o, type AuthoringReaderDependencies as p, type AuthoringTestRef as q, readRebuildRequest as r, type CanaryPostureFacts as s, type CanonicalBundleAnchorLookup as t, type DenseSearchOptions as u, type DiffSinceOptions as v, type EnumeratedBundleDir as w, type EvaluateQuarantineDetectionInput as x, INDEX_DB_FILE as y, INDEX_RENDERING_SCHEMA_VERSION as z };
|