@vostride/agent-qa-knowledge-local 0.2.3 → 0.2.4
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/dist/embedder-worker/worker-entry.cjs.map +1 -1
- package/dist/embedder-worker/worker-entry.d.cts +1 -1
- package/dist/embedder-worker/worker-entry.d.ts +1 -1
- package/dist/embedder-worker/worker-entry.js.map +1 -1
- package/dist/index.cjs +571 -913
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1190
- package/dist/index.d.ts +18 -1190
- package/dist/index.js +232 -584
- package/dist/index.js.map +1 -1
- package/dist/mark-evidence-plan-CmOkzw6u.d.cts +556 -0
- package/dist/mark-evidence-plan-CmOkzw6u.d.ts +556 -0
- package/dist/reader.cjs +68 -274
- package/dist/reader.cjs.map +1 -1
- package/dist/reader.d.cts +4 -38
- package/dist/reader.d.ts +4 -38
- package/dist/reader.js +83 -300
- package/dist/reader.js.map +1 -1
- package/dist/{worker-registration-C-9spEsf.d.cts → worker-registration-DAYLDaFV.d.cts} +0 -3
- package/dist/{worker-registration-C-9spEsf.d.ts → worker-registration-DAYLDaFV.d.ts} +0 -3
- package/package.json +10 -9
- package/dist/mark-evidence-plan-BCkYN07i.d.cts +0 -1014
- package/dist/mark-evidence-plan-BCkYN07i.d.ts +0 -1014
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { KnowledgePort } from '@vostride/agent-qa-agent';
|
|
2
2
|
import { KnowledgeHintReader } from '@vostride/agent-qa-runner';
|
|
3
3
|
import * as _vostride_agent_qa_schema from '@vostride/agent-qa-schema';
|
|
4
|
-
import { CurationSnapshotChange, CurationSnapshot, EntityKind, EmbeddingProfile, EntityDescriptor, EntityResolution, VerdictClass, QuarantineOperationsPort, ArtifactRef, MaskFn, CurationAuthorship, BundleDraft, BundleDiscriminant, OriginClass, ScreenState, BundleOutcomeEvent, BundleRelation, DistilledObservation, RecordId, BundleIdentityCore, GateReceipt, MeasurementObservation, PromotionReceipt, MeasurementBaseline, RetrievalTraceLeg, RecordedRetrievalRung, Anchor, IndexEntry,
|
|
4
|
+
import { CurationSnapshotChange, CurationSnapshot, EntityKind, EmbeddingProfile, EntityDescriptor, EntityResolution, VerdictClass, QuarantineOperationsPort, ArtifactRef, MaskFn, CurationAuthorship, BundleDraft, BundleDiscriminant, OriginClass, ScreenState, BundleOutcomeEvent, BundleRelation, DistilledObservation, RecordId, BundleIdentityCore, GateReceipt, MeasurementObservation, PromotionReceipt, MeasurementBaseline, RetrievalTraceLeg, RecordedRetrievalRung, Anchor, IndexEntry, CompletedRunHandoff, PerTestOutcome, StepEvidence, QuarantineLedgerEvent, RunAnalysisArtifact, Verdict, ScopeKey, ExecutionContext, BundleKind, FactSubtype, Delta, CurationFallbackReason, CompareAndSet, BundleStatus, PromotionGateHoldReason, PromotionPath, KnowledgeAcceptInput, KnowledgeRejectInput, KnowledgeForgetInput, KnowledgeMarkInput, KnowledgeProjection, KnowledgeReviewVerb, CommitReceipt, ForgetReceiptV1, KnowledgeTargetRef, DraftReceipt, MarkReceipt, OriginStage, NoDraftableFixChecked, MarkQuarantineClass, ImprovementPlan, Mark } from '@vostride/agent-qa-schema';
|
|
5
5
|
export { testFingerprintElements } from '@vostride/agent-qa-schema';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import { I as IndexReaderConnection, E as EmbedderPort, a as IndexFace, K as KnowledgeReader, V as VecCapability, Q as QuarantineAppendOutcome, b as QuarantineDetectionSighting, R as RefusedQuarantineLine, r as readRebuildRequest, c as readIndexMaintenanceState, d as RebuildRequest, o as openKnowledgeReader, L as LoadedBundle, A as AppendMarkEvidenceOutcome } from './mark-evidence-plan-
|
|
8
|
-
export { e as AUTHORING_BRIEF_DEFAULT_BUDGET, f as AUTHORING_DENSE_K, g as AUTHORING_EXCERPT_CHAR_BUDGET, h as AUTHORING_EXEMPLAR_CAP, i as AUTHORING_PROCEDURE_CAP, j as AUTO_QUARANTINE_CLASSES, k as AssembleAuthoringBriefInput, l as AssembledAuthoringBrief, m as AuthoringEntryCandidate, n as AuthoringExemplarRow, p as AuthoringReaderDependencies, q as AuthoringTestRef, C as CHECKPOINT_EVERY_N_BUNDLES, s as
|
|
7
|
+
import { I as IndexReaderConnection, E as EmbedderPort, a as IndexFace, K as KnowledgeReader, V as VecCapability, Q as QuarantineAppendOutcome, b as QuarantineDetectionSighting, R as RefusedQuarantineLine, r as readRebuildRequest, c as readIndexMaintenanceState, d as RebuildRequest, o as openKnowledgeReader, L as LoadedBundle, A as AppendMarkEvidenceOutcome } from './mark-evidence-plan-CmOkzw6u.js';
|
|
8
|
+
export { e as AUTHORING_BRIEF_DEFAULT_BUDGET, f as AUTHORING_DENSE_K, g as AUTHORING_EXCERPT_CHAR_BUDGET, h as AUTHORING_EXEMPLAR_CAP, i as AUTHORING_PROCEDURE_CAP, j as AUTO_QUARANTINE_CLASSES, k as AssembleAuthoringBriefInput, l as AssembledAuthoringBrief, m as AuthoringEntryCandidate, n as AuthoringExemplarRow, p as AuthoringReaderDependencies, q as AuthoringTestRef, C as CHECKPOINT_EVERY_N_BUNDLES, s as CanonicalBundleAnchorLookup, D as DenseHit, t as DenseSearchOptions, u as DiffSinceOptions, v as EnumeratedBundleDir, w as EvaluateQuarantineDetectionInput, G as GATES_REL_PATH, x as INDEX_DB_FILE, y as INDEX_RENDERING_SCHEMA_VERSION, z as INDEX_SCHEMA_VERSION, B as IndexHealth, F as IndexWriterHandle, H as InspectRecordsOptions, J as IntegrityReport, M as KnowledgeHit, N as KnowledgeMaintenanceScanError, O as KnowledgeMaintenanceScanIssue, P as KnowledgeRecordNotFoundError, S as KnowledgeSearchOptions, T as LoadBundleOutcome, U as MARK_EVIDENCE_TOKEN_PREFIX, W as MarkEvidenceEffect, X as MarkEvidencePlan, Y as MarkEvidenceTarget, Z as Measurements, _ as OpenKnowledgeReaderOptions, $ as OpenServingKnowledgeReaderConfig, a0 as PlanMarkEvidenceInput, a1 as QUARANTINE_AUTO_EXIT_PASSES, a2 as QUARANTINE_CLASS_DISPOSITIONS, a3 as QUARANTINE_DEFAULT_EXPIRY_DAYS, a4 as QUARANTINE_ESCALATE_THRESHOLD, a5 as QUARANTINE_FLAG_FLOOR, a6 as QUARANTINE_LEDGER_FILENAME, a7 as QuarantineDetectionFailure, a8 as QuarantineDetectionResult, a9 as QuarantineDetectionTestWindow, aa as QuarantineDisposition, ab as QuarantineLedgerRead, ac as QuarantineOrdinalOutcome, ad as READER_BUSY_TIMEOUT_MS, ae as REBUILD_MARKER_FILE, af as REQUIRED_INDEX_TABLES, ag as ReadRebuildRequestOutcome, ah as RebuildReason, ai as RequestRebuildOptions, aj as ScanBundleByIdOptions, ak as ScanBundlesOptions, al as ShowRecordOptions, am as WRITER_BUSY_TIMEOUT_MS, an as assembleAuthoringBrief, ao as classifyIndexFace, ap as clearRebuildRequest, aq as createAuthoringReader, ar as deriveBundleTrust, as as diffSince, at as embeddingProfileKey, au as enumerateBundleDirs, av as evaluateQuarantineDetection, aw as foldQuarantineLedgerState, ax as indexDbPath, ay as inspectRecords, az as isServable, aA as loadBundle, aB as markEvidenceEvent, aC as openIndexReaderConnection, aD as openIndexWriter, aE as openKnowledgeReader, aF as planMarkEvidence, aG as probeIndexHealth, aH as projectMarkEvidenceOutcome, aI as quarantineLedgerPath, aJ as readCanonicalBundleAnchors, aK as readGateReceipts, aL as readMeasurements, aM as readQuarantineLedger, aN as requestRebuild, aO as resolveActiveProfile, aP as resolveVecCapability, aQ as scanBundleById, aR as scanBundles, aS as showRecord, aT as toInspectRecordView, aU as vecTableName, aV as verifyBundleIntegrity } from './mark-evidence-plan-CmOkzw6u.js';
|
|
9
9
|
import { DatabaseSync } from 'node:sqlite';
|
|
10
10
|
import { Tokenizer } from '@huggingface/tokenizers';
|
|
11
|
-
import { E as EmbedderWorkerRegistration, a as EmbedderWorkerIncarnationVerdict } from './worker-registration-
|
|
12
|
-
export { b as EMBEDDER_WORKER_REGISTRATION_FILE, c as EMBEDDER_WORKER_REGISTRATION_SCHEMA_VERSION, d as EMBEDDER_WORKER_REQUEST_TIMEOUT_MS, e as EMBEDDER_WORKER_START_TIMEOUT_MS, f as EMBEDDER_WORKER_TERM_GRACE_MS, g as EMBEDDER_WORKER_UNVERIFIABLE_INCARNATION, h as EmbedderWorkerTimeoutError, i as EmbedderWorkerTimeoutPhase, R as ReadEmbedderWorkerRegistrationOutcome, j as embedderWorkerProcessIsAlive, k as embedderWorkerSocketPath, p as probeEmbedderWorkerSocket, r as readEmbedderWorkerRegistration, l as removeEmbedderWorkerRegistration, w as writeEmbedderWorkerRegistration } from './worker-registration-
|
|
11
|
+
import { E as EmbedderWorkerRegistration, a as EmbedderWorkerIncarnationVerdict } from './worker-registration-DAYLDaFV.js';
|
|
12
|
+
export { b as EMBEDDER_WORKER_REGISTRATION_FILE, c as EMBEDDER_WORKER_REGISTRATION_SCHEMA_VERSION, d as EMBEDDER_WORKER_REQUEST_TIMEOUT_MS, e as EMBEDDER_WORKER_START_TIMEOUT_MS, f as EMBEDDER_WORKER_TERM_GRACE_MS, g as EMBEDDER_WORKER_UNVERIFIABLE_INCARNATION, h as EmbedderWorkerTimeoutError, i as EmbedderWorkerTimeoutPhase, R as ReadEmbedderWorkerRegistrationOutcome, j as embedderWorkerProcessIsAlive, k as embedderWorkerSocketPath, p as probeEmbedderWorkerSocket, r as readEmbedderWorkerRegistration, l as removeEmbedderWorkerRegistration, w as writeEmbedderWorkerRegistration } from './worker-registration-DAYLDaFV.js';
|
|
13
13
|
|
|
14
14
|
interface ReadCurationEffectsOptions {
|
|
15
15
|
knowledgeRoot: string;
|
|
@@ -22,7 +22,6 @@ declare function readCurationEffects(options: ReadCurationEffectsOptions): Curat
|
|
|
22
22
|
declare function foldCurationSnapshot(effects: readonly CurationSnapshotChange[]): CurationSnapshot;
|
|
23
23
|
|
|
24
24
|
declare const PAYLOAD_BENEFITS: readonly ["exercised-benefited", "rode-along", "exercised-harmed"];
|
|
25
|
-
declare const PAYLOAD_STATE_VALIDITIES: readonly ["valid", "stale", "unknown"];
|
|
26
25
|
declare const canaryOutcomePayloadSchema: z.ZodObject<{
|
|
27
26
|
schemaVersion: z.ZodLiteral<2>;
|
|
28
27
|
benefit: z.ZodEnum<{
|
|
@@ -30,31 +29,6 @@ declare const canaryOutcomePayloadSchema: z.ZodObject<{
|
|
|
30
29
|
"rode-along": "rode-along";
|
|
31
30
|
"exercised-harmed": "exercised-harmed";
|
|
32
31
|
}>;
|
|
33
|
-
stateValidity: z.ZodEnum<{
|
|
34
|
-
unknown: "unknown";
|
|
35
|
-
valid: "valid";
|
|
36
|
-
stale: "stale";
|
|
37
|
-
}>;
|
|
38
|
-
corpusDigest: z.ZodOptional<z.ZodString>;
|
|
39
|
-
observedStateDigest: z.ZodOptional<z.ZodString>;
|
|
40
|
-
ablation: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
crossCheck: z.ZodEnum<{
|
|
42
|
-
inconclusive: "inconclusive";
|
|
43
|
-
flipped: "flipped";
|
|
44
|
-
held: "held";
|
|
45
|
-
"not-run": "not-run";
|
|
46
|
-
}>;
|
|
47
|
-
k: z.ZodNumber;
|
|
48
|
-
baseSeed: z.ZodNumber;
|
|
49
|
-
seeds: z.ZodArray<z.ZodNumber>;
|
|
50
|
-
seedHonored: z.ZodBoolean;
|
|
51
|
-
spend: z.ZodObject<{
|
|
52
|
-
modelCalls: z.ZodNumber;
|
|
53
|
-
screens: z.ZodNumber;
|
|
54
|
-
promptTokens: z.ZodNumber;
|
|
55
|
-
completionTokens: z.ZodNumber;
|
|
56
|
-
}, z.core.$strict>;
|
|
57
|
-
}, z.core.$strict>>;
|
|
58
32
|
jobKind: z.ZodLiteral<"canary-outcome">;
|
|
59
33
|
candidateId: z.ZodString;
|
|
60
34
|
runId: z.ZodString;
|
|
@@ -80,26 +54,9 @@ type QueuedCanaryPayloadRead = {
|
|
|
80
54
|
};
|
|
81
55
|
declare function readQueuedCanaryPayload(value: unknown): QueuedCanaryPayloadRead;
|
|
82
56
|
|
|
83
|
-
/**
|
|
84
|
-
* Stamped into `PRAGMA user_version` at creation and checked on every open.
|
|
85
|
-
*
|
|
86
|
-
* Stamp and hard-fail, never migrate — the 385 D-04 convention. The milestone ships nothing
|
|
87
|
-
* between its releases, so a ledger written by another build is a development artifact, and
|
|
88
|
-
* migration machinery for it would be code with no user that everything afterwards has to
|
|
89
|
-
* keep working. Note what this does NOT license: the ROWS are permanent regardless. A version
|
|
90
|
-
* refusal tells an operator to move a stale development file aside; it never rewrites one.
|
|
91
|
-
*/
|
|
92
57
|
declare const ADDRESSING_LEDGER_USER_VERSION = 2;
|
|
93
|
-
/**
|
|
94
|
-
* Busy timeout for every connection.
|
|
95
|
-
*
|
|
96
|
-
* D-02's story is "any process mints, sqlite arbitrates", which only works if a writer
|
|
97
|
-
* waiting on the write lock retries rather than failing immediately. Matched to the job
|
|
98
|
-
* store's window because the transactions are the same shape and size: retune from observed
|
|
99
|
-
* contention, not from a guess about how many hosts there are.
|
|
100
|
-
*/
|
|
101
58
|
declare const ADDRESSING_LEDGER_BUSY_TIMEOUT_MS = 2000;
|
|
102
|
-
/** The ledger's own file name under the agent-qa root, beside `agent-jobs.db
|
|
59
|
+
/** The ledger's own file name under the agent-qa root, beside `agent-jobs.db`. */
|
|
103
60
|
declare const ADDRESSING_LEDGER_DB_FILE = "entity-addresses.db";
|
|
104
61
|
/** A ledger file this build cannot read. Refused before a single schema statement runs. */
|
|
105
62
|
declare class AddressingLedgerSchemaVersionError extends Error {
|
|
@@ -108,15 +65,6 @@ declare class AddressingLedgerSchemaVersionError extends Error {
|
|
|
108
65
|
readonly found: number;
|
|
109
66
|
constructor(path: string, expected: number, found: number);
|
|
110
67
|
}
|
|
111
|
-
/**
|
|
112
|
-
* An EXPLICITLY recorded target rename (D-03).
|
|
113
|
-
*
|
|
114
|
-
* There is no heuristic rename detection in this file and there must not be. Inferring that
|
|
115
|
-
* two target slugs are "the same target" from their spelling, their order of appearance or
|
|
116
|
-
* their contents is a guess, and ENTY-01's never-guess law is not weaker inside the ledger
|
|
117
|
-
* than it is inside the resolver — a wrong link here would silently re-point a published
|
|
118
|
-
* address, which is the exact failure D-02 exists to make impossible.
|
|
119
|
-
*/
|
|
120
68
|
interface TargetRename {
|
|
121
69
|
readonly fromSlug: string;
|
|
122
70
|
readonly toSlug: string;
|
|
@@ -126,7 +74,7 @@ interface TargetRename {
|
|
|
126
74
|
interface EntityAddress {
|
|
127
75
|
readonly kind: EntityKind;
|
|
128
76
|
readonly machineId: string;
|
|
129
|
-
/** Present for ordinal-addressed kinds; absent for slug-addressed ones
|
|
77
|
+
/** Present for ordinal-addressed kinds; absent for slug-addressed ones. */
|
|
130
78
|
readonly ordinal?: number;
|
|
131
79
|
readonly shortId: string;
|
|
132
80
|
readonly mintedAt: string;
|
|
@@ -144,23 +92,7 @@ interface AddressingLedger {
|
|
|
144
92
|
lookup(kind: EntityKind, machineId: string): EntityAddress | undefined;
|
|
145
93
|
/** The address a published short-ID names, or `undefined`. Tier (a)'s whole job. */
|
|
146
94
|
lookupByShortId(shortId: string): EntityAddress | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Every address ever minted, in a fixed order (kind, then short-ID).
|
|
149
|
-
*
|
|
150
|
-
* READ-only, and the append-only law is what makes it worth having: this list only grows, so
|
|
151
|
-
* a caller enumerating it is reading a complete history rather than a snapshot that could
|
|
152
|
-
* have lost rows. The entity index is rebuilt FROM this (D-06) — a projection can only claim
|
|
153
|
-
* to heal if the thing it is rebuilt from can be enumerated in full.
|
|
154
|
-
*/
|
|
155
95
|
listAddresses(): EntityAddress[];
|
|
156
|
-
/**
|
|
157
|
-
* Record that a config target was renamed (D-03). See {@link TargetRename} for why this is
|
|
158
|
-
* the only way a link between two slugs ever comes to exist.
|
|
159
|
-
*
|
|
160
|
-
* Both slugs are minted, so both keep their own permanent address: the predecessor keeps
|
|
161
|
-
* the one already sitting in somebody's CI log, and the successor gets its own rather than
|
|
162
|
-
* inheriting one. Recording is idempotent — a repeat is the same fact, not a second one.
|
|
163
|
-
*/
|
|
164
96
|
recordTargetRename(fromSlug: string, toSlug: string): TargetRename;
|
|
165
97
|
/** The rename recorded FOR this slug, if any. Never the reverse direction. */
|
|
166
98
|
lookupTargetRename(fromSlug: string): TargetRename | undefined;
|
|
@@ -175,37 +107,8 @@ interface OpenAddressingLedgerOptions {
|
|
|
175
107
|
}
|
|
176
108
|
declare function openAddressingLedger(options: OpenAddressingLedgerOptions): AddressingLedger;
|
|
177
109
|
|
|
178
|
-
/**
|
|
179
|
-
* The projection's own file name, beside the knowledge index rather than inside it.
|
|
180
|
-
*
|
|
181
|
-
* Beside, because an entity is not a learned fact (D-06). Its own file, because the knowledge
|
|
182
|
-
* index's schema version, rebuild and per-profile vec bookkeeping belong to records, and
|
|
183
|
-
* sharing them would have coupled two projections whose only similarity is their shape.
|
|
184
|
-
*/
|
|
185
110
|
declare const ENTITY_INDEX_DB_FILE = "entity-index.db";
|
|
186
|
-
/**
|
|
187
|
-
* Stamped into `PRAGMA user_version` at creation and checked on every open.
|
|
188
|
-
*
|
|
189
|
-
* Stamp and hard-fail, never migrate — the 385 D-04 house style. Migration would be effort
|
|
190
|
-
* spent on a file whose contents can be regenerated in full from the ledger; a refusal that
|
|
191
|
-
* says which version it found is more useful than a migration nobody would maintain.
|
|
192
|
-
*/
|
|
193
111
|
declare const ENTITY_INDEX_USER_VERSION = 2;
|
|
194
|
-
/**
|
|
195
|
-
* How often a standing daemon re-renders the projection from its sources (D-06).
|
|
196
|
-
*
|
|
197
|
-
* PROVISIONAL 600_000 (ten minutes); retune from operational evidence without adding config,
|
|
198
|
-
* the `LEASE_HEARTBEAT_TTL_MS` house style. What it is bounding is STALENESS of a title or a
|
|
199
|
-
* status in a fuzzy-match target — never correctness of an address, which the ledger owns and
|
|
200
|
-
* no cadence can affect. Sightings already refresh an entity the moment anything touches it,
|
|
201
|
-
* so this sweep exists for the entities nothing has touched since their source data moved.
|
|
202
|
-
*
|
|
203
|
-
* Deliberately its own interval rather than the daemon's `MAINTENANCE_CADENCE_MS`. That
|
|
204
|
-
* cadence runs the lease-holding maintenance tail; this sweep must never require the writer
|
|
205
|
-
* lease (D-02/D-06) because it writes only this file, and sharing a timer with lease-gated
|
|
206
|
-
* work would have made a lease-free projection stop being maintained the moment a lease was
|
|
207
|
-
* lost — a coupling nothing in the projection's own contract asks for.
|
|
208
|
-
*/
|
|
209
112
|
declare const ENTITY_INDEX_SWEEP_INTERVAL_MS = 600000;
|
|
210
113
|
declare class EntityIndexSchemaVersionError extends Error {
|
|
211
114
|
readonly path: string;
|
|
@@ -214,7 +117,7 @@ declare class EntityIndexSchemaVersionError extends Error {
|
|
|
214
117
|
constructor(path: string, supportedVersion: number, foundVersion: number);
|
|
215
118
|
}
|
|
216
119
|
interface EntityIndexHandle {
|
|
217
|
-
/**
|
|
120
|
+
/** `vec` is `brute`: `denseVec0` needs the records index's private vec-cleanup epoch marker. */
|
|
218
121
|
readonly connection: IndexReaderConnection;
|
|
219
122
|
readonly path: string;
|
|
220
123
|
close(): void;
|
|
@@ -222,45 +125,18 @@ interface EntityIndexHandle {
|
|
|
222
125
|
interface OpenEntityIndexOptions {
|
|
223
126
|
/** Absolute path to the projection file, typically `entityIndexDbPath(knowledgeRoot)`. */
|
|
224
127
|
readonly path: string;
|
|
225
|
-
/**
|
|
226
|
-
* The knowledge root the path lives under. When given, the path's directory chain must stay
|
|
227
|
-
* inside it (261003-mqc): a linked `memory/` or `memory/index/` is refused before the open.
|
|
228
|
-
*/
|
|
229
128
|
readonly knowledgeRoot?: string;
|
|
230
129
|
readonly timeoutMs?: number;
|
|
231
130
|
}
|
|
232
131
|
/** The projection's path: beside the knowledge index, never inside it. */
|
|
233
132
|
declare function entityIndexDbPath(knowledgeRoot: string): string;
|
|
234
133
|
declare function openEntityIndex(options: OpenEntityIndexOptions): EntityIndexHandle;
|
|
235
|
-
/**
|
|
236
|
-
* Project one entity into the index (D-06's incremental half).
|
|
237
|
-
*
|
|
238
|
-
* Called from the resolver's sighting/mint path, so every process posture — daemon, one-shot
|
|
239
|
-
* CLI, a test harness — maintains the projection by using it. Idempotent: re-projecting an
|
|
240
|
-
* unchanged entity leaves the same row.
|
|
241
|
-
*/
|
|
242
134
|
declare function refreshEntity(handle: EntityIndexHandle, descriptor: EntityDescriptor): void;
|
|
243
|
-
/**
|
|
244
|
-
* Drop everything and re-project from the supplied descriptor set (D-06's healing half).
|
|
245
|
-
*
|
|
246
|
-
* The set comes from the ledger plus the owning stores, which is what makes this a rebuild
|
|
247
|
-
* rather than a repair: nothing in this file is consulted to produce the new contents, so a
|
|
248
|
-
* file damaged in any way at all converges to the same result as a file that never existed.
|
|
249
|
-
* Embeddings are re-derived rather than carried, because a rebuild that preserved derived
|
|
250
|
-
* bytes would preserve exactly the state a rebuild is run to be rid of.
|
|
251
|
-
*/
|
|
252
135
|
declare function rebuildEntityIndex(handle: EntityIndexHandle, descriptors: Iterable<EntityDescriptor>): number;
|
|
253
136
|
interface EntityIndexSweepReport {
|
|
254
137
|
readonly examined: number;
|
|
255
138
|
readonly refreshed: number;
|
|
256
139
|
}
|
|
257
|
-
/**
|
|
258
|
-
* Re-project the entities whose source data moved (D-06's maintenance-cadence half).
|
|
259
|
-
*
|
|
260
|
-
* A sweep is maintenance of a disposable projection, so it writes only where a row disagrees
|
|
261
|
-
* with its source. It never touches the addressing ledger — the ledger is not a projection
|
|
262
|
-
* (D-02) — and it takes no writer lease, because everything it writes lives in this file.
|
|
263
|
-
*/
|
|
264
140
|
declare function sweepEntityIndex(handle: EntityIndexHandle, descriptors: Iterable<EntityDescriptor>): EntityIndexSweepReport;
|
|
265
141
|
/**
|
|
266
142
|
* Embed every row whose rendering has no vector yet, returning how many were embedded.
|
|
@@ -275,13 +151,6 @@ declare function sweepEntityIndex(handle: EntityIndexHandle, descriptors: Iterab
|
|
|
275
151
|
*/
|
|
276
152
|
declare function embedPendingEntities(handle: EntityIndexHandle, embedder: EmbedderPort, profile?: EmbeddingProfile): Promise<number>;
|
|
277
153
|
|
|
278
|
-
/**
|
|
279
|
-
* One store's answer to "do you own an entity with exactly this machine id?".
|
|
280
|
-
*
|
|
281
|
-
* A port rather than a switch over kinds, because each kind's machine ids live behind a
|
|
282
|
-
* different store and the tracer wires only one of them. 387-03 adds sources for the
|
|
283
|
-
* remaining kinds and neither this function nor its callers change.
|
|
284
|
-
*/
|
|
285
154
|
interface EntitySightingSource {
|
|
286
155
|
readonly kind: EntityKind;
|
|
287
156
|
/** The entity with this exact machine id, or `undefined`. Never a fuzzy match. */
|
|
@@ -293,69 +162,17 @@ interface EntitySightingSource {
|
|
|
293
162
|
interface EntitySighting {
|
|
294
163
|
readonly machineId: string;
|
|
295
164
|
readonly title: string;
|
|
296
|
-
/**
|
|
297
|
-
* The status as the OWNING store reports it. Validated against the kind's closed union at
|
|
298
|
-
* the card boundary (D-12), not here: this layer reports, the producer renders, and the
|
|
299
|
-
* schema refuses. Three responsibilities, three places.
|
|
300
|
-
*/
|
|
301
165
|
readonly statusSource: string;
|
|
302
166
|
}
|
|
303
167
|
interface ResolveEntityRefDeps {
|
|
304
168
|
readonly ledger: AddressingLedger;
|
|
305
169
|
readonly sources: readonly EntitySightingSource[];
|
|
306
|
-
/**
|
|
307
|
-
* The D-06 projection, maintained by USE.
|
|
308
|
-
*
|
|
309
|
-
* Optional, and that is the degradation ladder rather than a convenience: a composition that
|
|
310
|
-
* supplies no index gets tier (a) and the honest `none` arm, which is exactly what 387-01
|
|
311
|
-
* shipped. Nothing here silently becomes a guess when the projection is absent.
|
|
312
|
-
*/
|
|
313
170
|
readonly entityIndex?: EntityIndexHandle;
|
|
314
171
|
/** Test/integration seam for tier (b)'s dense leg; omission runs the acquisition ladder. */
|
|
315
172
|
readonly embedder?: EmbedderPort;
|
|
316
173
|
}
|
|
317
|
-
/**
|
|
318
|
-
* Every entity the ledger has ever addressed and a source can still describe.
|
|
319
|
-
*
|
|
320
|
-
* This is the set `rebuildEntityIndex` is rebuilt FROM and the set the daemon sweep re-renders
|
|
321
|
-
* (D-06). It reads the LEDGER, never the index: a projection rebuilt from itself would
|
|
322
|
-
* preserve exactly the state a rebuild is run to be rid of.
|
|
323
|
-
*
|
|
324
|
-
* An address whose source can no longer describe it is skipped rather than projected as a
|
|
325
|
-
* husk. The address keeps resolving through tier (a) either way — D-04's permanence lives in
|
|
326
|
-
* the ledger — but a row with no title is not something fuzzy text should ever match.
|
|
327
|
-
*/
|
|
328
174
|
declare function describeAllEntities(deps: ResolveEntityRefDeps): EntityDescriptor[];
|
|
329
|
-
/**
|
|
330
|
-
* THE sighting leg (D-01): exact machine-id equality, mint, project, describe.
|
|
331
|
-
*
|
|
332
|
-
* Extracted so the resolver's own leg and the LIST VERBS' sighting site are one mechanism
|
|
333
|
-
* rather than two that mint the same way today. D-01 names four sighting sites — a resolver
|
|
334
|
-
* hit, a card render, verdict authoring, a list verb — and a second minting path written for
|
|
335
|
-
* the fourth would be a second place where "first sighting mints" could stop being true, with
|
|
336
|
-
* nothing comparing them.
|
|
337
|
-
*
|
|
338
|
-
* `undefined` means no registered source recognises the id at all.
|
|
339
|
-
*
|
|
340
|
-
* EXACT equality, always. A prefix or case-insensitive comparison here would be tier (b)
|
|
341
|
-
* smuggled in below the never-guess contract. Sources are consulted in registered order so
|
|
342
|
-
* the answer does not depend on iteration accidents.
|
|
343
|
-
*/
|
|
344
175
|
declare function sightEntity(machineId: string, deps: ResolveEntityRefDeps): EntityResolution | undefined;
|
|
345
|
-
/**
|
|
346
|
-
* Resolve a reference through the three tiers, minting on first sighting (D-01).
|
|
347
|
-
*
|
|
348
|
-
* Order matters and is fixed: URI, then short-ID, then exact machine id, then — for free text
|
|
349
|
-
* only — the hybrid tiers. Addresses are tried before machine ids because an address is
|
|
350
|
-
* unambiguous by construction, and a machine id that happened to LOOK like a short-ID would
|
|
351
|
-
* otherwise be able to shadow a published address.
|
|
352
|
-
*
|
|
353
|
-
* ASYNC because tier (b)'s dense leg is: an embedding query cannot be made synchronous, and
|
|
354
|
-
* the alternative — a second, synchronous entry that quietly answers with tier (a) only —
|
|
355
|
-
* would be a resolver that under-answers depending on which function a caller happened to
|
|
356
|
-
* import. The PORT this reaches surfaces through was already asynchronous, so no composition
|
|
357
|
-
* edge changes shape.
|
|
358
|
-
*/
|
|
359
176
|
declare function resolveEntityRef(ref: string, deps: ResolveEntityRefDeps): Promise<EntityResolution>;
|
|
360
177
|
/**
|
|
361
178
|
* `entities.get`'s read path: the descriptor for an EXACT address, or `undefined`.
|
|
@@ -366,22 +183,6 @@ declare function resolveEntityRef(ref: string, deps: ResolveEntityRefDeps): Prom
|
|
|
366
183
|
*/
|
|
367
184
|
declare function getEntityDescriptor(ref: string, deps: ResolveEntityRefDeps): EntityDescriptor | undefined;
|
|
368
185
|
|
|
369
|
-
/**
|
|
370
|
-
* The two leg weights, and they are EQUAL for a reason that is not aesthetic.
|
|
371
|
-
*
|
|
372
|
-
* The degradation invariant (D-08) says a floor host may only produce MORE disambiguation,
|
|
373
|
-
* never a different answer. Floor mode is full mode minus the dense leg, so each candidate's
|
|
374
|
-
* floor score is its full score minus its own dense contribution. With equal weights the most
|
|
375
|
-
* any candidate can gain from the dense leg is one rank-1 contribution, which is what bounds
|
|
376
|
-
* how far the dense leg can reorder the lexical ranking — and that bound is what
|
|
377
|
-
* `RESOLVER_STRONG_HIT_MARGIN` is set against. Weighting the dense leg above the lexical one
|
|
378
|
-
* (as the `semantic` query-class vector does for records) would let the dense leg invert an
|
|
379
|
-
* ordering by more than the margin, and floor mode could then resolve to a different entity.
|
|
380
|
-
*
|
|
381
|
-
* The resolver therefore owns its own weights rather than importing a query-class vector: this
|
|
382
|
-
* pair is load-bearing for a safety property, and a vector tuned for record retrieval has no
|
|
383
|
-
* obligation to stay equal.
|
|
384
|
-
*/
|
|
385
186
|
declare const RESOLVER_LEG_WEIGHT_LEXICAL = 1;
|
|
386
187
|
declare const RESOLVER_LEG_WEIGHT_DENSE = 1;
|
|
387
188
|
/**
|
|
@@ -397,66 +198,7 @@ declare const RESOLVER_LEG_WEIGHT_DENSE = 1;
|
|
|
397
198
|
* to tier (a)'s 1.0 without inventing a second vocabulary for confidence.
|
|
398
199
|
*/
|
|
399
200
|
declare const RESOLVER_FUSED_SCORE_NORMALIZER: number;
|
|
400
|
-
/**
|
|
401
|
-
* The absolute half of the D-07 rule: a strong hit is at the head of at least one leg.
|
|
402
|
-
*
|
|
403
|
-
* 0.5 is exactly one leg's rank-1 contribution on the normalised scale, and picking it says
|
|
404
|
-
* something narrow and true: a candidate that no leg ranked first is never a strong hit, no
|
|
405
|
-
* matter how far ahead of the runner-up it ended up. That case is reachable in practice — the
|
|
406
|
-
* index is refreshed on sighting, so it can hold a row for an entity whose owning store has
|
|
407
|
-
* since forgotten it; when that row heads a leg it is dropped after fusion, and the survivor
|
|
408
|
-
* behind it must NOT be promoted into a confident answer just because the leader vanished.
|
|
409
|
-
*
|
|
410
|
-
* Honest about its limits: on an RRF scale an absolute threshold cannot do much more than
|
|
411
|
-
* this. The fused top is always at least one leg's rank-1 contribution whenever any leg head
|
|
412
|
-
* survives, so a threshold below 0.5 would never fire, and a threshold above 0.5 would forbid
|
|
413
|
-
* a floor host from ever resolving anything — including a reference that matched exactly one
|
|
414
|
-
* entity. The discrimination work is therefore done by the margin below, which is where the
|
|
415
|
-
* two-part rule's second half earns its place rather than restating the first.
|
|
416
|
-
*
|
|
417
|
-
* The corpus report confirms both halves of that claim rather than only the comfortable one:
|
|
418
|
-
* 31 of its 110 cases resolve at the floor, so the threshold is not quietly forbidding the
|
|
419
|
-
* floor rung; and the case where a leg head is dropped after fusion still refuses, so it is not
|
|
420
|
-
* quietly permitting a survivor to inherit a leader's confidence.
|
|
421
|
-
*/
|
|
422
201
|
declare const RESOLVER_STRONG_HIT_MIN_SCORE = 0.5;
|
|
423
|
-
/**
|
|
424
|
-
* The margin half of the D-07 rule, and the number that makes a safety property structural.
|
|
425
|
-
*
|
|
426
|
-
* A candidate can gain at most 0.5 on the normalised scale by being ranked first in the dense
|
|
427
|
-
* leg. For floor mode (which has no dense leg) to resolve entity E while full mode resolves a
|
|
428
|
-
* DIFFERENT entity Z, the dense leg would have to move Z past E by more than twice the margin.
|
|
429
|
-
* Any margin above 0.25 therefore makes that impossible rather than unlikely: floor mode can
|
|
430
|
-
* only ever produce the same resolved entity or refuse to resolve at all. 0.26 is the pinned
|
|
431
|
-
* value with room above the bound so an adjacent-rank rounding difference cannot reach it.
|
|
432
|
-
*
|
|
433
|
-
* Its everyday meaning is simpler: a strong hit is one the legs AGREE on more than they agree
|
|
434
|
-
* on anything else. Two near-twins ranked 1 and 2 differ by 0.016 and always disambiguate —
|
|
435
|
-
* including the equal-strength typo case, which differs by exactly zero and therefore cannot
|
|
436
|
-
* be resolved by any positive margin at all (D-07).
|
|
437
|
-
*
|
|
438
|
-
* WHERE THE BOUNDARY ACTUALLY IS, measured by the 387-05 corpus rather than argued.
|
|
439
|
-
*
|
|
440
|
-
* The 0.25 above comes from a CONTINUOUS inequality, and this scale is not continuous. A floor
|
|
441
|
-
* host's score comes from the lexical leg alone, so its top is one leg's rank-1 contribution
|
|
442
|
-
* (0.5) and its runner-up, when it has one, is rank 2 (0.4919). The largest margin a floor host
|
|
443
|
-
* can therefore ever clear against a rival is the gap between two adjacent ranks — 1/124, about
|
|
444
|
-
* 0.00806 — and above that the floor can only resolve a reference that matched exactly ONE
|
|
445
|
-
* entity, which no dense leg can reorder. So the real bound is thirty times smaller than the
|
|
446
|
-
* one the paragraph above derives, and 0.26 clears both with room to spare.
|
|
447
|
-
*
|
|
448
|
-
* That is not a licence to lower it. The corpus runs its whole population through this same
|
|
449
|
-
* rule at several margins and reports what it finds: no divergence at 0.26, none at 1.5×1/124,
|
|
450
|
-
* and a real one BELOW 1/124, where a case whose two lexical candidates sit 0.008 apart resolves
|
|
451
|
-
* the first at the floor while the dense leg promotes the second in full. That measurement is
|
|
452
|
-
* what makes the invariant's test a gate rather than an arithmetic tautology — and it is only
|
|
453
|
-
* reachable because the decision is applied through one exported function (`applyStrongHitRule`)
|
|
454
|
-
* that the corpus can hand a different margin. Nothing in production passes it one.
|
|
455
|
-
*
|
|
456
|
-
* Retune only alongside `RESOLVER_STRONG_HIT_MIN_SCORE`, and only against the corpus report
|
|
457
|
-
* named at the top of this file: dropping below 1/124 trades the degradation guarantee for
|
|
458
|
-
* recall, and dropping to 0.25 or below gives up the argument that it cannot be traded at all.
|
|
459
|
-
*/
|
|
460
202
|
declare const RESOLVER_STRONG_HIT_MARGIN = 0.26;
|
|
461
203
|
/**
|
|
462
204
|
* How many candidates each leg is asked for.
|
|
@@ -466,67 +208,11 @@ declare const RESOLVER_STRONG_HIT_MARGIN = 0.26;
|
|
|
466
208
|
* into a disambiguation. Bounded because the entity corpus is bounded by what a human can name.
|
|
467
209
|
*/
|
|
468
210
|
declare const RESOLVER_CANDIDATE_K = 32;
|
|
469
|
-
/**
|
|
470
|
-
* The lexical admission floor for the ENTITY corpus, which is not the records corpus floor.
|
|
471
|
-
*
|
|
472
|
-
* `TAU_LEX` is 6.86, calibrated from a recorded serving replay over knowledge records. Measured
|
|
473
|
-
* against entity renderings on 2026-08-02, the entire observed positive BM25 range was 0.0 to
|
|
474
|
-
* 3.24 — an entity rendering is six words where a record rendering is a paragraph, so the two
|
|
475
|
-
* corpora are not on the same scale and `TAU_LEX` rejects EVERY entity lexical candidate. The
|
|
476
|
-
* dense leg keeps its own floor, `tau_dense`, which is profile-owned and therefore correct
|
|
477
|
-
* wherever it is applied; only the lexical floor is corpus-specific, and applying a record
|
|
478
|
-
* corpus's number here would have silently deleted the lexical leg.
|
|
479
|
-
*
|
|
480
|
-
* Zero means "the FTS query matched at all", and that is deliberately permissive. Under the
|
|
481
|
-
* never-guess rule a weak extra candidate can only ADD a runner-up, and a runner-up can only
|
|
482
|
-
* turn a resolve into a disambiguation — never into a different answer, because `lexicalLeg`
|
|
483
|
-
* orders by BM25, so a genuine match always outranks a noise match. Raising this floor would
|
|
484
|
-
* make small corpora answer `none` where several entities plainly do mention the word, which
|
|
485
|
-
* is a worse lie than an honest disambiguation card.
|
|
486
|
-
*/
|
|
487
211
|
declare const RESOLVER_LEXICAL_MIN_BM25 = 0;
|
|
488
212
|
|
|
489
213
|
/** Build the MEM sighting source over a knowledge root. */
|
|
490
214
|
declare function createMemorySightingSource(resolveKnowledgeRoot: () => string): EntitySightingSource;
|
|
491
215
|
|
|
492
|
-
/**
|
|
493
|
-
* Read side of the fingerprint-keyed recurrence window (Phase 390, D-07).
|
|
494
|
-
*
|
|
495
|
-
* `run_fingerprint_windows` is written by `applyRunOutcomes`; this module is the one place that
|
|
496
|
-
* queries it. Strictly read-only: prepared SELECTs, no statement that mutates a row, ever — the
|
|
497
|
-
* writer half stays whole in `run-outcomes.ts`, exactly as `run-outcome-read.ts` does for the
|
|
498
|
-
* per-test counters it is the sibling of.
|
|
499
|
-
*
|
|
500
|
-
* KEY LAW — a window row is addressed by `(product, fingerprint)`. Stable test identity
|
|
501
|
-
* `(product, filePath, testName)` travels ON the row because a crossing has to name the test it
|
|
502
|
-
* quarantines, but it is never part of the recurrence key: one fingerprint may be exercised by
|
|
503
|
-
* several tests, and D-07's rule is about the FAILURE recurring, not the test.
|
|
504
|
-
*
|
|
505
|
-
* THE WINDOW SLIDES OVER ORDINALS, NOT RUNS (D-07). Recurrence is counted over the ordinal range
|
|
506
|
-
* `[current - QUARANTINE_WINDOW_ORDINALS + 1, current]`:
|
|
507
|
-
*
|
|
508
|
-
* - two failing runs inside ONE build ordinal count once (the numerator counts DISTINCT ordinals),
|
|
509
|
-
* - a failure at ordinals 5/7/9 still crosses at 9 even though no two runs were consecutive,
|
|
510
|
-
* - and an occurrence that has slid out of the range is FORGIVEN. That is the whole point of a
|
|
511
|
-
* window: the lifetime `flake_count` never forgives, which is exactly why D-07 demoted it to a
|
|
512
|
-
* ranking input and made this the trigger substrate instead.
|
|
513
|
-
*
|
|
514
|
-
* `windowOrdinals` is the honest denominator: how many distinct ordinals in the range this product
|
|
515
|
-
* recorded a failure in at all. A caller renders "3rd occurrence in 5 builds" from the pair, and an
|
|
516
|
-
* empty window answers typed zeros rather than an absence a renderer has to guess about.
|
|
517
|
-
*
|
|
518
|
-
* PRECONDITION — the caller supplies a connection where `ensureRunOutcomeTables` has run (every
|
|
519
|
-
* `openIndexWriter` does). A read-only connection against a store predating these tables raises
|
|
520
|
-
* sqlite's `no such table`, which the composition layer folds to typed absence the same way it
|
|
521
|
-
* already does for `readTestOutcomeHistory`.
|
|
522
|
-
*/
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* §7.3's locked detection window, verbatim: the same fingerprint recurring within the last five
|
|
526
|
-
* build ordinals. A pinned constant with no config key (386 D-15) — retune it from operational
|
|
527
|
-
* evidence, in the source, where the change is reviewable. Plan 05's rule reads the threshold
|
|
528
|
-
* against this window; D-10's auto-exit is symmetric with it by design.
|
|
529
|
-
*/
|
|
530
216
|
declare const QUARANTINE_WINDOW_ORDINALS = 5;
|
|
531
217
|
/** The recurrence key: the failure, inside one product partition. */
|
|
532
218
|
interface FingerprintWindowIdentity {
|
|
@@ -549,20 +235,7 @@ interface FingerprintRecurrence {
|
|
|
549
235
|
/** DISTINCT build ordinals inside the window carrying ANY failure for this product. */
|
|
550
236
|
windowOrdinals: number;
|
|
551
237
|
}
|
|
552
|
-
/**
|
|
553
|
-
* Every stored row for one fingerprint inside the bounded read scope, ordinal-ascending.
|
|
554
|
-
*
|
|
555
|
-
* The read scope is the last {@link LAST_OUTCOMES_LIMIT} ordinals rather than the detection window,
|
|
556
|
-
* so a caller that wants to SHOW the recent history (D-10's M-consecutive-passes exit, the list
|
|
557
|
-
* verb) sees the same depth the per-test outcome window carries. An identity the projection never
|
|
558
|
-
* recorded answers `[]` — typed absence, never a stand-in row.
|
|
559
|
-
*/
|
|
560
238
|
declare function readFingerprintWindow(db: DatabaseSync, identity: FingerprintWindowIdentity, currentBuildOrdinal: number): FingerprintWindowRow[];
|
|
561
|
-
/**
|
|
562
|
-
* One fingerprint's recurrence over the sliding ordinal window (D-07) — computed LIVE on every
|
|
563
|
-
* call, never stored. Both legs count DISTINCT ordinals, which is what makes two failing runs in
|
|
564
|
-
* one build one occurrence.
|
|
565
|
-
*/
|
|
566
239
|
declare function fingerprintRecurrence(db: DatabaseSync, identity: FingerprintWindowIdentity, currentBuildOrdinal: number): FingerprintRecurrence;
|
|
567
240
|
|
|
568
241
|
declare const LEASE_FILE = ".lease";
|
|
@@ -580,15 +253,6 @@ declare const WRITER_AUTHORITY_DB_FILE = ".writer-authority.sqlite";
|
|
|
580
253
|
* observable so the contender can apply the lease and verified-termination policy.
|
|
581
254
|
*/
|
|
582
255
|
declare const MUTATION_LOCK_BUSY_TIMEOUT_MS = 2000;
|
|
583
|
-
/**
|
|
584
|
-
* Transient guard serializing the beat's read-check-write with release's read-check-delete.
|
|
585
|
-
*
|
|
586
|
-
* A directory holding exactly one `owner-<token>` file, published whole by renaming a staged
|
|
587
|
-
* directory into place. It lives under `memory/queue/`, which every scaffolded knowledge
|
|
588
|
-
* `.gitignore` already ignores, so neither a guard in use nor one a crash left behind is ever a
|
|
589
|
-
* commit-visible file in a user's knowledge repository (261002-lse follow-up; the user's
|
|
590
|
-
* `.gitignore` is never rewritten, D-22).
|
|
591
|
-
*/
|
|
592
256
|
declare const LEASE_GUARD_DIR = "memory/queue/lease-guard";
|
|
593
257
|
declare const writerLeaseSchema: z.ZodObject<{
|
|
594
258
|
leaseId: z.ZodString;
|
|
@@ -618,13 +282,6 @@ type AcquireWriterLeaseOutcome = {
|
|
|
618
282
|
reason: 'corrupt-epoch-state';
|
|
619
283
|
error: CorruptEpochStateError;
|
|
620
284
|
} | {
|
|
621
|
-
/**
|
|
622
|
-
* CR-01 (round 5): the lease file's own sibling of `corrupt-epoch-state`.
|
|
623
|
-
*
|
|
624
|
-
* `code` is the raw errno so an operator sees EACCES rather than a contender that silently
|
|
625
|
-
* spun to its deadline over an authority state nobody can evaluate; `error` keeps this arm
|
|
626
|
-
* inside the union's stated contract that every refusal is rethrowable.
|
|
627
|
-
*/
|
|
628
285
|
kind: 'refused';
|
|
629
286
|
reason: 'unreadable-lease-state';
|
|
630
287
|
code: string;
|
|
@@ -632,15 +289,6 @@ type AcquireWriterLeaseOutcome = {
|
|
|
632
289
|
} | {
|
|
633
290
|
kind: 'refused';
|
|
634
291
|
reason: 'mutation-lock-unreclaimable';
|
|
635
|
-
/**
|
|
636
|
-
* Both refusal arms carry a thrown-shaped `error` ON PURPOSE.
|
|
637
|
-
*
|
|
638
|
-
* Every caller of this union already renders `refused` as `[reason]: error.message` or
|
|
639
|
-
* rethrows it, so a new arm that also carries one is surfaced by name at every entry point —
|
|
640
|
-
* including any added later — without a list of call sites to keep in step. Naming the
|
|
641
|
-
* refusal is the requirement; enumerating the callers who must name it is the failure mode
|
|
642
|
-
* this phase keeps rediscovering.
|
|
643
|
-
*/
|
|
644
292
|
error: WriterLeaseUnreclaimableError;
|
|
645
293
|
attempts: number;
|
|
646
294
|
waitedMs: number;
|
|
@@ -665,9 +313,7 @@ type HeartbeatLeaseOutcome = {
|
|
|
665
313
|
holder: WriterLease;
|
|
666
314
|
} | {
|
|
667
315
|
kind: 'refused';
|
|
668
|
-
reason: 'lease-missing' | 'lease-malformed'
|
|
669
|
-
/** CR-01: the lease exists and could not be opened — never write over what you cannot read. */
|
|
670
|
-
| 'lease-unreadable' | 'lease-id-mismatch' | 'stale-epoch' | 'corrupt-epoch-state';
|
|
316
|
+
reason: 'lease-missing' | 'lease-malformed' | 'lease-unreadable' | 'lease-id-mismatch' | 'stale-epoch' | 'corrupt-epoch-state';
|
|
671
317
|
holder?: WriterLease;
|
|
672
318
|
observedEpoch?: number;
|
|
673
319
|
error?: CorruptEpochStateError;
|
|
@@ -703,15 +349,6 @@ declare class CorruptEpochStateError extends Error {
|
|
|
703
349
|
readonly rawPreview: string;
|
|
704
350
|
constructor(path: string, reason: CorruptEpochStateReason, rawPreview: string);
|
|
705
351
|
}
|
|
706
|
-
/**
|
|
707
|
-
* Fail-closed acquisition refusal after the deadline; carries why the wait could not end well.
|
|
708
|
-
*
|
|
709
|
-
* A contender that gives up is reporting a fact about the SYSTEM, not about itself, so the
|
|
710
|
-
* diagnostics travel with the error: the owner it kept losing to, whether that owner was even
|
|
711
|
-
* attributable (an unattributed row can never be escalated against, which is usually the whole
|
|
712
|
-
* story), and the lease it kept reading. `agent-qa daemon` prints this and exits non-zero where it
|
|
713
|
-
* previously hung with no output at all.
|
|
714
|
-
*/
|
|
715
352
|
declare class WriterLeaseUnreclaimableError extends Error {
|
|
716
353
|
readonly name = "WriterLeaseUnreclaimableError";
|
|
717
354
|
readonly reason: "mutation-lock-unreclaimable";
|
|
@@ -721,33 +358,12 @@ declare class WriterLeaseUnreclaimableError extends Error {
|
|
|
721
358
|
readonly observedLease?: WriterLease;
|
|
722
359
|
constructor(attempts: number, waitedMs: number, observedOwner?: UnreclaimableMutationLockOwner, observedLease?: WriterLease);
|
|
723
360
|
}
|
|
724
|
-
/**
|
|
725
|
-
* The lease file's sibling of `CorruptEpochStateError`, for a read that produced no throwable.
|
|
726
|
-
*
|
|
727
|
-
* `readFileSync` threw, but the value that reaches a consumer is a kinded outcome rather than an
|
|
728
|
-
* exception, and `AcquireWriterLeaseOutcome`'s own contract is that EVERY refusal arm carries a
|
|
729
|
-
* thrown-shaped `error` — three call sites rethrow or render it without knowing which arm they
|
|
730
|
-
* hold (`drain.ts:842` among them). A refusal that carried only an errno string would have made
|
|
731
|
-
* that contract a list of call sites to keep in step, which is the failure mode this module keeps
|
|
732
|
-
* rediscovering. Deliberately not re-exported from the package index (IN-04): the refusal is fully
|
|
733
|
-
* legible from `reason`, `code` and `error.message`.
|
|
734
|
-
*/
|
|
735
361
|
declare class UnreadableWriterLeaseStateError extends Error {
|
|
736
362
|
readonly name = "UnreadableWriterLeaseStateError";
|
|
737
363
|
readonly path: string;
|
|
738
364
|
readonly code: string;
|
|
739
365
|
constructor(path: string, code: string);
|
|
740
366
|
}
|
|
741
|
-
/**
|
|
742
|
-
* The authority-file read verdict, and it has four values rather than three.
|
|
743
|
-
*
|
|
744
|
-
* Round-5 CR-01: `unreadable` is the sibling of the epoch read's
|
|
745
|
-
* `CorruptEpochStateError(…, 'unreadable', …)`. A file that EXISTS and could not be opened is a
|
|
746
|
-
* different fact from a file that is not there and from a file whose bytes were read and failed to
|
|
747
|
-
* parse, and the previous three arms had nowhere to put it — so EACCES, EIO, EMFILE and ENFILE all
|
|
748
|
-
* landed on `malformed`, which every consumer reads as "nobody holds authority". `code` carries
|
|
749
|
-
* the errno so the refusal that follows can name the cause to an operator.
|
|
750
|
-
*/
|
|
751
367
|
type ReadWriterLeaseOutcome = {
|
|
752
368
|
kind: 'absent';
|
|
753
369
|
} | {
|
|
@@ -759,33 +375,6 @@ type ReadWriterLeaseOutcome = {
|
|
|
759
375
|
kind: 'parsed';
|
|
760
376
|
lease: WriterLease;
|
|
761
377
|
};
|
|
762
|
-
/**
|
|
763
|
-
* Opaque process-incarnation token for one pid, anchored OUTSIDE any value this module writes.
|
|
764
|
-
*
|
|
765
|
-
* CR-04: a durable row's pid is not an identity. Once the recorded process dies, the kernel is
|
|
766
|
-
* free to hand that number to a stranger, and every later decision keyed on the number alone
|
|
767
|
-
* (above all `SIGKILL`) targets whoever holds it now. The one fact that distinguishes them is
|
|
768
|
-
* assigned by the OS and cannot be forged from inside the store: when the process at that pid
|
|
769
|
-
* started.
|
|
770
|
-
*
|
|
771
|
-
* Linux reads field 22 (`starttime`) of `/proc/<pid>/stat`, counted from the LAST `)` because the
|
|
772
|
-
* `comm` field is parenthesised and may itself contain spaces and parentheses. Other POSIX hosts
|
|
773
|
-
* read `/bin/ps -p <pid> -o lstart=` in the C locale and UTC, so every reader renders one start
|
|
774
|
-
* time as one token. Windows has no equivalent builtin, so it resolves to `undefined` and every
|
|
775
|
-
* incarnation check there fails closed.
|
|
776
|
-
*
|
|
777
|
-
* Returns `undefined` — never throws — whenever the pid cannot be attributed. `undefined` means
|
|
778
|
-
* "do not signal", never "safe to signal".
|
|
779
|
-
*
|
|
780
|
-
* WR-04: `timeoutMs` bounds the POSIX arm's `ps` fork, which is the last wait beneath the
|
|
781
|
-
* acquisition deadline that used to be able to outlive it — a wedged `ps` never returns, and this
|
|
782
|
-
* resolution sits directly on the pre-signal path. A cap that expires resolves
|
|
783
|
-
* through the SAME funnel every other failure uses (`undefined`), so a timed-out resolution is
|
|
784
|
-
* unverifiable and therefore signal-ineligible. Callers with no budget of their own omit it.
|
|
785
|
-
*
|
|
786
|
-
* 386-32 consumes this same helper for the embedder-worker signal path, so both kill paths speak
|
|
787
|
-
* one incarnation vocabulary.
|
|
788
|
-
*/
|
|
789
378
|
declare function resolveProcessIncarnation(pid: number, timeoutMs?: number, psExecutable?: string): string | undefined;
|
|
790
379
|
interface MutationLockOptions {
|
|
791
380
|
/** Test/chaos seam after the claim is committed and before the held transaction begins. */
|
|
@@ -805,13 +394,6 @@ interface MutationLockOptions {
|
|
|
805
394
|
psExecutable?: string;
|
|
806
395
|
}
|
|
807
396
|
interface AcquireWriterLeaseOptions extends MutationLockOptions {
|
|
808
|
-
/**
|
|
809
|
-
* Test/chaos seam for the pinned acquisition deadline; production never sets it.
|
|
810
|
-
*
|
|
811
|
-
* The same shape as `mutationLockTakeoverMs` and the heartbeat supervisor's `stopTimeoutMs`: a
|
|
812
|
-
* real unreclaimable wait is 60 s, which no test can afford to sit through, and shortening the
|
|
813
|
-
* window is the only way to reach the refusal branch (D-15 — a seam, never a config key).
|
|
814
|
-
*/
|
|
815
397
|
acquireDeadlineMs?: number;
|
|
816
398
|
}
|
|
817
399
|
interface CurrentWriterAuthority {
|
|
@@ -822,53 +404,9 @@ interface CurrentWriterAuthorityHooks extends MutationLockOptions {
|
|
|
822
404
|
/** Test/chaos seam after the lock-held epoch comparison and before mutation. */
|
|
823
405
|
afterFinalAuthorityCompare?: () => void;
|
|
824
406
|
}
|
|
825
|
-
/**
|
|
826
|
-
* Read and strictly validate current writer authority without acquiring or refreshing it.
|
|
827
|
-
*
|
|
828
|
-
* CR-01 (round 5): ENOENT is the only read failure that is evidence of absence, and NO read
|
|
829
|
-
* failure is evidence of corruption. This is `readEpoch`'s rule applied to the file it was not
|
|
830
|
-
* applied to — the derivation's own W-01 note says the guard belongs at the READ, so that
|
|
831
|
-
* consumers inherit it rather than each re-deriving it, and this read has three consumers that
|
|
832
|
-
* select SIGKILL, epoch minting and registration deletion from its answer.
|
|
833
|
-
*
|
|
834
|
-
* The `existsSync` fallback that used to sit here is deleted rather than kept beside the errno
|
|
835
|
-
* test: under fd exhaustion it fails for the same reason the open did, so it degraded an EMFILE
|
|
836
|
-
* read from `malformed` to `absent` — the strongest possible statement that nobody holds the
|
|
837
|
-
* lease, produced by the weakest possible evidence.
|
|
838
|
-
*/
|
|
839
407
|
declare function readWriterLease(knowledgeRoot: string): ReadWriterLeaseOutcome;
|
|
840
408
|
/** Purely classify a guarded or untrusted lease value against one explicit wall-clock instant. */
|
|
841
409
|
declare function isLeaseStale(lease: unknown, nowMs: number): boolean;
|
|
842
|
-
/**
|
|
843
|
-
* The one freshness answer, and it has three values rather than two.
|
|
844
|
-
*
|
|
845
|
-
* CR-01: the previous derivation returned a boolean, so every way of failing to READ the epoch
|
|
846
|
-
* collapsed into the same value a genuinely expired lease produces. `readEpoch` raises
|
|
847
|
-
* `CorruptEpochStateError(…, 'unreadable', …)` for EACCES, EIO, EMFILE and ENFILE, not only for
|
|
848
|
-
* corrupt bytes, and fd exhaustion produces both that failure and the daemon identity-handshake
|
|
849
|
-
* failure at once. A live, healthy holder therefore became de-registrable and SIGKILL-eligible on
|
|
850
|
-
* a transient read error.
|
|
851
|
-
*
|
|
852
|
-
* `unknown` is deliberately NOT resolved to either boolean here. Resolving it toward "fresh" makes
|
|
853
|
-
* a permanently unreadable epoch an immortal phantom holder no contender can ever reclaim;
|
|
854
|
-
* resolving it toward "reclaimable" is the kill this closes. It is returned to the consumers so
|
|
855
|
-
* each of them names what it does with it, and so a fourth consumer added later cannot inherit a
|
|
856
|
-
* default it never chose.
|
|
857
|
-
*
|
|
858
|
-
* W-01: the epoch conjunct lives HERE, in the derivation, not at the consumers. Three surfaces
|
|
859
|
-
* classify recoverability from this verdict — `leasePermitsEscalation`, the acquisition
|
|
860
|
-
* pre-check, and `classifyDaemonRegistration` in the CLI — and a fix applied consumer by consumer
|
|
861
|
-
* is a list that the next surface joins without joining the guard. A lease naming a superseded
|
|
862
|
-
* epoch is recovery input no matter how fresh its bytes are: nobody can still be inside a
|
|
863
|
-
* transaction for an epoch that has already been replaced.
|
|
864
|
-
*
|
|
865
|
-
* WR-04: a crash between the epoch rewrite and the lease rewrite leaves a lease naming the
|
|
866
|
-
* previous epoch. Reporting that lease as held manufactures a phantom holder no TTL sweep ever
|
|
867
|
-
* reclaims, so an epoch-invalid lease is recovery input rather than an answer.
|
|
868
|
-
*
|
|
869
|
-
* The inputs are the disk epoch and the lease value, and nothing else. There is no second
|
|
870
|
-
* freshness channel and no further conjunct: three conjuncts produced three defects.
|
|
871
|
-
*/
|
|
872
410
|
type WriterLeaseFreshness = {
|
|
873
411
|
kind: 'fresh';
|
|
874
412
|
} | {
|
|
@@ -886,44 +424,6 @@ declare function acquireWriterLease(knowledgeRoot: string, hooks?: AcquireWriter
|
|
|
886
424
|
* bounded takeover. Mutation implementations must keep irreversible work inside `mutate`.
|
|
887
425
|
*/
|
|
888
426
|
declare function withCurrentWriterAuthority<T>(knowledgeRoot: string, authority: CurrentWriterAuthority, mutate: () => T, hooks?: CurrentWriterAuthorityHooks): T;
|
|
889
|
-
/**
|
|
890
|
-
* Refresh the matching current-epoch holder without entering the mutation lock.
|
|
891
|
-
*
|
|
892
|
-
* CR-03 dissolves here rather than being worked around. The beat used to share
|
|
893
|
-
* `withMutationLock` with every governed write, and it runs in a worker THREAD, so the daemon's
|
|
894
|
-
* long synchronous mutation on the main thread held the lock while the worker blocked on it: the
|
|
895
|
-
* holder starved its own heartbeat, crossed the TTL and became a takeover target. Writing `.lease`
|
|
896
|
-
* directly means a governed mutation of any length cannot starve the beat at all, so heartbeat
|
|
897
|
-
* independence is structural instead of a fallback that has to be maintained beside the real path.
|
|
898
|
-
*
|
|
899
|
-
* What the lock used to buy was check-then-write atomicity of the identity/epoch ladder below
|
|
900
|
-
* against a concurrent reclaim, and dropping it opens exactly one race: a holder resuming from a
|
|
901
|
-
* >=TTL wedge can land its read-check-write astride a contender's reclaim and clobber the
|
|
902
|
-
* successor's lease. That is contained rather than prevented, and the containment is the epoch
|
|
903
|
-
* fence: a reclaim rewrites `.epoch` strictly BEFORE it publishes its lease, both inside the lock,
|
|
904
|
-
* so any lease clobbered afterwards names a superseded epoch. Every classifier reads it as
|
|
905
|
-
* recovery input, no store write is admitted under it (the epoch fence at the store verbs), and
|
|
906
|
-
* the successor's next authority check surfaces WriterAuthorityLostError, after which a fresh
|
|
907
|
-
* acquisition reclaims at the next epoch. The worst case is one successor bounce in a microsecond
|
|
908
|
-
* window after a 30 s wedge — a liveness hiccup, never minted authority. During the exact schedule
|
|
909
|
-
* this lock-free write exists for (the holder's own mutation in flight) no contender can be
|
|
910
|
-
* mid-reclaim at all, because a reclaim requires the very lock that mutation is holding.
|
|
911
|
-
*
|
|
912
|
-
* 2026-08-01 W-02 re-scope: `MUTATION_LOCK_TAKEOVER_MS` now governs reclaim from DEAD and
|
|
913
|
-
* whole-process-STOPPED owners, which write no beats and cross the TTL. Auto-takeover of a LIVE
|
|
914
|
-
* holder whose beat thread is still ticking is deliberately impossible; a wedged-forever live
|
|
915
|
-
* daemon surfaces at every contender as the typed `mutation-lock-unreclaimable` refusal naming its
|
|
916
|
-
* pid. That is an operator kill rather than an automated one, which is this module's own law: a
|
|
917
|
-
* wrong kill is unrecoverable, a wedged contender is not.
|
|
918
|
-
*
|
|
919
|
-
* Identity is still proven first, and every refusal below leaves `.lease` byte-identical.
|
|
920
|
-
*
|
|
921
|
-
* 2026-10-02 (quick 261002-lse, 432-19 #7): the ladder and the write run under the lease-file
|
|
922
|
-
* guard `releaseLease` also takes. Without it a beat that read before a release wrote after it,
|
|
923
|
-
* and since release deliberately keeps the epoch, the resurrected lease named the CURRENT epoch:
|
|
924
|
-
* the fence above contains a reclaim but not a release, and the next acquire answered `held`.
|
|
925
|
-
* The guard is not the mutation lock, so everything said above about CR-03 still holds.
|
|
926
|
-
*/
|
|
927
427
|
declare function heartbeatLease(opts: LeaseOperationOptions, hooks?: LeaseGuardHooks): HeartbeatLeaseOutcome;
|
|
928
428
|
/**
|
|
929
429
|
* Refresh one exact maintenance writer at a non-mutating boundary.
|
|
@@ -934,14 +434,6 @@ declare function heartbeatLease(opts: LeaseOperationOptions, hooks?: LeaseGuardH
|
|
|
934
434
|
* irreversible mutation must instead run inside `withCurrentWriterAuthority`.
|
|
935
435
|
*/
|
|
936
436
|
declare function refreshWriterLeaseAuthority(authority: WriterLeaseAuthority): WriterLeaseAuthority;
|
|
937
|
-
/**
|
|
938
|
-
* Remove only the matching lease file; the monotonic epoch is deliberately retained forever.
|
|
939
|
-
*
|
|
940
|
-
* The read and the deletion run under the lease-file guard, taken inside the mutation lock, so a
|
|
941
|
-
* heartbeat in flight finishes before the lease is read and any later beat finds it gone
|
|
942
|
-
* (261002-lse). The guard is always taken second, and the beat never takes the mutation lock, so
|
|
943
|
-
* the two cannot wait on each other.
|
|
944
|
-
*/
|
|
945
437
|
declare function releaseLease(opts: LeaseOperationOptions, hooks?: LeaseGuardHooks): ReleaseLeaseOutcome;
|
|
946
438
|
|
|
947
439
|
/**
|
|
@@ -962,29 +454,6 @@ declare const QUARANTINE_MANUAL_ENTRY_FINGERPRINT = "manual-entry";
|
|
|
962
454
|
* the class of AUTO entries only, so no rule changes behaviour on the strength of this value.
|
|
963
455
|
*/
|
|
964
456
|
declare const QUARANTINE_MANUAL_ENTRY_CLASS: VerdictClass;
|
|
965
|
-
/**
|
|
966
|
-
* The `filePath` a caller sent cannot mint the durable identity the ledger is keyed on (390-12).
|
|
967
|
-
*
|
|
968
|
-
* Same shape and same reason as the lease refusal above: the port's result unions carry no refusal
|
|
969
|
-
* arm by design (390-04), so a refusal that is not one of the named outcomes surfaces as a typed
|
|
970
|
-
* throw. Raised BEFORE the knowledge root is resolved, before the lease is acquired and before a
|
|
971
|
-
* byte is read, so a refused call costs the ledger nothing and the next writer nothing.
|
|
972
|
-
*
|
|
973
|
-
* WHAT THIS OWNS, AND WHAT THE LEDGER'S OWN WRITE GUARD OWNS (390-11). They are not two spellings
|
|
974
|
-
* of one rule and neither subsumes the other:
|
|
975
|
-
*
|
|
976
|
-
* - THIS decides what the identity IS. It is the only gate that knows the checkout root, so it is
|
|
977
|
-
* the only one that can turn `/Users/me/repo/tests/a.yaml` — a real file inside the workspace,
|
|
978
|
-
* the exact bytes an operator pastes out of a failure report — into `tests/a.yaml` and ACCEPT
|
|
979
|
-
* it. The structural guard would refuse that input; refusing it is the wrong answer, because
|
|
980
|
-
* the operator named a file the workspace genuinely contains.
|
|
981
|
-
* - The STRUCTURAL guard in `appendQuarantineEvents` decides what the FILE may carry, for every
|
|
982
|
-
* writer including one that never met a mint. It is a backstop with no host context, and it
|
|
983
|
-
* throws rather than answering data because a line the reader refuses is corruption.
|
|
984
|
-
*
|
|
985
|
-
* What cannot be canonicalized at all — a path escaping the config directory — is refused here,
|
|
986
|
-
* with the mint's own message carried so the operator learns why rather than that.
|
|
987
|
-
*/
|
|
988
457
|
declare class QuarantineIdentityRefusedError extends Error {
|
|
989
458
|
readonly filePath: string;
|
|
990
459
|
readonly reason: unknown;
|
|
@@ -995,56 +464,12 @@ interface QuarantineOperationsOptions {
|
|
|
995
464
|
resolveKnowledgeRoot: () => Promise<string> | string;
|
|
996
465
|
/** The ONLY way wall clock enters these verbs. Required — see the module head. */
|
|
997
466
|
now: () => string;
|
|
998
|
-
/**
|
|
999
|
-
* Mints the durable workspace-relative identity a `filePath` is stored under (390-12 / D-01).
|
|
1000
|
-
*
|
|
1001
|
-
* Production supplies core's ONE recipe, `workspaceRelativeIdentityPath`, pre-bound to the host's
|
|
1002
|
-
* own config directory. INJECTED rather than imported for two independent reasons, and either
|
|
1003
|
-
* alone would be sufficient: this package may not depend on `@vostride/agent-qa-core` (only the
|
|
1004
|
-
* surface packages may), and — the load-bearing one — the checkout root is a HOST fact these
|
|
1005
|
-
* verbs cannot discover. A verb that guessed it would mint identities against the wrong root.
|
|
1006
|
-
*
|
|
1007
|
-
* REQUIRED, with no default. A default passthrough is exactly the unvalidated pass-through that
|
|
1008
|
-
* produced the round-2 regression: the verbs answered `entered` over lines the reader is
|
|
1009
|
-
* guaranteed to refuse. An absent mint must be a compile error at the composition that forgot it,
|
|
1010
|
-
* not a runtime surprise inside a committed artifact.
|
|
1011
|
-
*
|
|
1012
|
-
* @throws whatever the mint throws for a path it cannot canonicalize; re-raised as
|
|
1013
|
-
* {@link QuarantineIdentityRefusedError}.
|
|
1014
|
-
*/
|
|
1015
467
|
mintIdentityPath: (filePath: string) => string;
|
|
1016
|
-
/**
|
|
1017
|
-
* The writer lease THIS process already holds, when it holds one (387-08 D-18 / D-5).
|
|
1018
|
-
*
|
|
1019
|
-
* Supplied by the daemon host, which acquires at startup and holds for its whole lifetime: a
|
|
1020
|
-
* holder that calls `acquireWriterLease` is answered `held` by itself and, unlike the apply path,
|
|
1021
|
-
* has nobody to delegate to. Absent on the CLI in-process host, which holds nothing and therefore
|
|
1022
|
-
* takes the lease per call.
|
|
1023
|
-
*
|
|
1024
|
-
* THE VALUE IS CONSULTED FOR FENCING (390-15 / G-390-2R), and this sentence used to say the
|
|
1025
|
-
* opposite. It is re-validated against disk on every write verb, so the question it answers is
|
|
1026
|
-
* "is this process STILL the holder?" rather than "did this process already serialize itself?".
|
|
1027
|
-
* The two are the same question only while nothing reclaims: a daemon whose heartbeat starved
|
|
1028
|
-
* and whose lease was then taken answers yes to the second one forever, and the two-OS-process
|
|
1029
|
-
* harness measured what that costs — two `entered` lines for one identity, and the verb
|
|
1030
|
-
* returning an owner committed truth does not record. See {@link underWriterLease}.
|
|
1031
|
-
*
|
|
1032
|
-
* AND WHAT THE RE-VALIDATION DOES NOT BUY (390-22 / WR-07): it is a read, not a lock. It answers
|
|
1033
|
-
* "still the holder?" as of the read, and the decide it licenses runs after it. A reclaim landing
|
|
1034
|
-
* between the two is still unfenced. `lease/under-writer-lease.ts` states the residual in full.
|
|
1035
|
-
*/
|
|
1036
468
|
resolveWriterAuthority?: () => {
|
|
1037
469
|
leaseId: string;
|
|
1038
470
|
epoch: number;
|
|
1039
471
|
} | undefined;
|
|
1040
472
|
}
|
|
1041
|
-
/**
|
|
1042
|
-
* The three verbs over one committed ledger.
|
|
1043
|
-
*
|
|
1044
|
-
* Each call is a full read-fold-decide-append cycle. Nothing is cached between calls, which is what
|
|
1045
|
-
* makes `quarantine.list` and the sentence's ladder clause two readings of ONE live computation
|
|
1046
|
-
* (SC4): an event appended between two calls is visible to both.
|
|
1047
|
-
*/
|
|
1048
473
|
declare function createQuarantineOperations(options: QuarantineOperationsOptions): QuarantineOperationsPort;
|
|
1049
474
|
|
|
1050
475
|
declare const ARTIFACT_STEP_CAP_BYTES: number;
|
|
@@ -1126,7 +551,6 @@ interface BundleStoreConfig {
|
|
|
1126
551
|
/** Absolute committed-root path. Deliberately no working-directory default. */
|
|
1127
552
|
knowledgeRoot: string;
|
|
1128
553
|
productKey: string;
|
|
1129
|
-
commitArtifacts: 'none' | 'thumbnails';
|
|
1130
554
|
/** Active writer identity used to attribute crash-left staging trees. */
|
|
1131
555
|
writerLeaseId?: string;
|
|
1132
556
|
/** Fencing epoch embedded in reader-invisible staging names. */
|
|
@@ -1170,18 +594,12 @@ type AppendOutcome = {
|
|
|
1170
594
|
} | {
|
|
1171
595
|
kind: 'not-found';
|
|
1172
596
|
};
|
|
1173
|
-
/** 416 D-04: receipt identity is its verified content digest, before any committed write. */
|
|
1174
597
|
declare function appendGateReceipt(config: BundleStoreConfig, id: RecordId, receipt: GateReceipt): AppendOutcome;
|
|
1175
|
-
/** 416 D-05/D-07: one promotion line per candidate/path; lifecycle bytes remain unchanged. */
|
|
1176
598
|
declare function appendPromotionReceipt(config: BundleStoreConfig, id: RecordId, lineWithoutDigest: Omit<PromotionReceipt, 'receiptDigest' | 'citedReceiptDigests'> & {
|
|
1177
599
|
citedReceiptDigests: readonly string[];
|
|
1178
600
|
}): AppendOutcome;
|
|
1179
601
|
declare const MEASUREMENTS_REL_PATH = "evidence/measurements.json";
|
|
1180
602
|
declare function appendOutcomeEvent(config: BundleStoreConfig, id: RecordId, event: BundleOutcomeEvent): AppendOutcome;
|
|
1181
|
-
/**
|
|
1182
|
-
* Persist D-03's immutable validity-window snapshot. An existing measurements
|
|
1183
|
-
* file is an idempotent refusal: baseline bytes are never rewritten.
|
|
1184
|
-
*/
|
|
1185
603
|
declare function writeMeasurementBaseline(config: BundleStoreConfig, id: RecordId, baseline: MeasurementBaseline): AppendOutcome;
|
|
1186
604
|
/**
|
|
1187
605
|
* Append one observation through the full journaled replacement path. Existing
|
|
@@ -1190,17 +608,6 @@ declare function writeMeasurementBaseline(config: BundleStoreConfig, id: RecordI
|
|
|
1190
608
|
declare function appendMeasurementObservation(config: BundleStoreConfig, id: RecordId, observation: MeasurementObservation): AppendOutcome;
|
|
1191
609
|
declare function appendRelation(config: BundleStoreConfig, id: RecordId, relation: BundleRelation): AppendOutcome;
|
|
1192
610
|
|
|
1193
|
-
type CanonicalBundleStateDigests = {
|
|
1194
|
-
kind: 'found';
|
|
1195
|
-
digests: string[];
|
|
1196
|
-
} | {
|
|
1197
|
-
kind: 'not-found';
|
|
1198
|
-
};
|
|
1199
|
-
declare function readCanonicalBundleStateDigests(input: {
|
|
1200
|
-
knowledgeRoot: string;
|
|
1201
|
-
candidateId: string;
|
|
1202
|
-
}): CanonicalBundleStateDigests;
|
|
1203
|
-
|
|
1204
611
|
/**
|
|
1205
612
|
* The leg Channel-1 run-brief assembly attributes to. See the module header: the assembly's whole
|
|
1206
613
|
* ordering signal is the scope/anchor token overlap, so this is a statement about the code that
|
|
@@ -1246,13 +653,6 @@ declare function getCachedEmbedding({ db, profile, leg, rendering, }: EmbedCache
|
|
|
1246
653
|
declare function putCachedEmbedding({ db, profile, leg, rendering, vector, }: EmbedCachePut): void;
|
|
1247
654
|
/** Evict every cached leg/revision/dtype row owned by one model id. */
|
|
1248
655
|
declare function dropEmbedCacheForModel(db: DatabaseSync, modelId: string): void;
|
|
1249
|
-
/**
|
|
1250
|
-
* Decorate an embedder with the M2 connection-role posture.
|
|
1251
|
-
*
|
|
1252
|
-
* Reader connections use check-only: they benefit from materialized rows but never write on a
|
|
1253
|
-
* miss. Writer-role backfill, migration, and bench paths use check-and-store, which is where the
|
|
1254
|
-
* steady-state cache materializes. Callers must ensure the table once through a writer first.
|
|
1255
|
-
*/
|
|
1256
656
|
declare function wrapEmbedderWithCache({ embedder, profile, db, mode, }: EmbedCacheWrapperOptions): EmbedderPort;
|
|
1257
657
|
|
|
1258
658
|
type WorkerDiscoveryResult = {
|
|
@@ -1274,12 +674,6 @@ type AcquireEmbedderOutcome = {
|
|
|
1274
674
|
} | {
|
|
1275
675
|
kind: 'lexical-only';
|
|
1276
676
|
};
|
|
1277
|
-
/**
|
|
1278
|
-
* D-12/D-17 test-only capability injection seam.
|
|
1279
|
-
*
|
|
1280
|
-
* Production callers must omit this field so rung selection reflects host truth. No probe is a
|
|
1281
|
-
* user-facing selector, configuration key, environment variable, or CLI switch.
|
|
1282
|
-
*/
|
|
1283
677
|
interface EmbedderProbes {
|
|
1284
678
|
discoverWorker?: (agentQaRoot: string) => Promise<WorkerDiscoveryResult>;
|
|
1285
679
|
createNativeEmbedder?: (options: {
|
|
@@ -1299,7 +693,6 @@ interface AcquireEmbedderOptions {
|
|
|
1299
693
|
db: DatabaseSync;
|
|
1300
694
|
mode: EmbedCacheMode;
|
|
1301
695
|
};
|
|
1302
|
-
/** D-12/D-17 test seam. Production callers resolve actual host capabilities. */
|
|
1303
696
|
probes?: EmbedderProbes;
|
|
1304
697
|
}
|
|
1305
698
|
interface ResolveEmbedderCapabilityOptions {
|
|
@@ -1309,7 +702,6 @@ interface ResolveEmbedderCapabilityOptions {
|
|
|
1309
702
|
workerPolicy?: EmbedderWorkerPolicy;
|
|
1310
703
|
/** Explicit hosted runtime root. Required policy must never infer it from ambient cwd. */
|
|
1311
704
|
agentQaRoot?: string;
|
|
1312
|
-
/** D-12/D-17 test seam. Production callers resolve actual host capabilities. */
|
|
1313
705
|
probes?: EmbedderProbes;
|
|
1314
706
|
}
|
|
1315
707
|
type CapabilityOutcome = AcquireEmbedderOutcome;
|
|
@@ -1324,86 +716,24 @@ interface DiscoverEmbedderWorkerOptions {
|
|
|
1324
716
|
/** Test-only shortening seam; production omits this and uses the pinned request deadline. */
|
|
1325
717
|
readonly requestTimeoutMs?: number;
|
|
1326
718
|
}
|
|
1327
|
-
/** D-09's worker arm, rooted in the hosted project rather than ambient process cwd. */
|
|
1328
719
|
declare function discoverEmbedderWorker(agentQaRoot: string, options?: DiscoverEmbedderWorkerOptions): Promise<WorkerDiscoveryResult>;
|
|
1329
|
-
/**
|
|
1330
|
-
* Resolve the automatic ladder once per profile for this process (D-17).
|
|
1331
|
-
*
|
|
1332
|
-
* Every host/runtime failure collapses to a typed capability outcome; callers cannot select a
|
|
1333
|
-
* rung. Injected test seams receive an isolated memo while production keys solely by the stable
|
|
1334
|
-
* embedding profile identity.
|
|
1335
|
-
*/
|
|
1336
720
|
declare function resolveEmbedderCapability(options: ResolveEmbedderCapabilityOptions): Promise<CapabilityOutcome>;
|
|
1337
721
|
declare function acquireEmbedder(options: AcquireEmbedderOptions): Promise<AcquireEmbedderOutcome>;
|
|
1338
722
|
|
|
1339
|
-
/**
|
|
1340
|
-
* The ONE fold from the host's two retrieval axes to the recorded rung (407 TRST-01 · D-13/D-17).
|
|
1341
|
-
*
|
|
1342
|
-
* ONE resolver, three callers: the runner's evidence recorder (407-07) stamps the value into
|
|
1343
|
-
* `StepEvidence.retrievalRung`, `doctor` (407-08) grades it live, and the run header banner
|
|
1344
|
-
* (407-10) renders the recorded copy. Three callers deriving a rung independently from the same
|
|
1345
|
-
* two axes is exactly how a banner and a doctor row come to disagree about one machine, so the
|
|
1346
|
-
* fold table lives here once and its cells are pinned by `__tests__/retrieval-rung.test.ts`.
|
|
1347
|
-
*
|
|
1348
|
-
* WHAT THE VALUE MEANS. It is the HOST's ladder at serve time — never a claim about how any
|
|
1349
|
-
* individual brief line was ranked. The run-brief serve path reads index rows directly and
|
|
1350
|
-
* attributes channels 1 and 3 to the `anchor` leg by construction; the dense leg and the
|
|
1351
|
-
* bundle-scan fallback belong to the general `retrieve()` path the curator, the entity resolver
|
|
1352
|
-
* and the authoring reader use. A surface renders "retrieval was on rung X for this run".
|
|
1353
|
-
*
|
|
1354
|
-
* This module lives in knowledge-local because it is the only package that can see either axis:
|
|
1355
|
-
* the index face is `index-reader`'s degrade ladder and the embedder outcome is
|
|
1356
|
-
* `embedder-acquire`'s capability probe. What it hands back is the schema-owned value.
|
|
1357
|
-
*/
|
|
1358
|
-
|
|
1359
723
|
/** The index half of the fold — `index-reader`'s degrade ladder, read without side effects. */
|
|
1360
724
|
type IndexAxis = IndexFace;
|
|
1361
725
|
/** The embedder half of the fold — `embedder-acquire`'s capability outcome, unchanged. */
|
|
1362
726
|
type EmbedderAxis = AcquireEmbedderOutcome;
|
|
1363
|
-
/**
|
|
1364
|
-
* Fold the two axes into the value that gets recorded (D-17).
|
|
1365
|
-
*
|
|
1366
|
-
* ORDERING IS PART OF THE CONTRACT: the index axis is consulted FIRST. No dense leg can run
|
|
1367
|
-
* against an index that will not open, whatever the embedder resolved to, so a `scan` face is
|
|
1368
|
-
* `bundle-scan` even on a host with a live native embedder. Folding the embedder first would
|
|
1369
|
-
* label a host with an unopenable index `memidex` and make the banner lie.
|
|
1370
|
-
*
|
|
1371
|
-
* `reason` is ABSENT for `memidex` — the top rung is not a degradation and has no cause to name.
|
|
1372
|
-
* Every lower rung carries one, which is what lets the banner say rung AND cause in one line.
|
|
1373
|
-
*/
|
|
1374
727
|
declare function foldRetrievalRung(index: IndexAxis, embedder: EmbedderAxis, preferredProfile?: EmbeddingProfile): RecordedRetrievalRung;
|
|
1375
728
|
interface ResolveRetrievalRungOptions {
|
|
1376
729
|
knowledgeRoot: string;
|
|
1377
730
|
/** Explicit hosted runtime root for worker discovery; defaults to the acquirer's own rule. */
|
|
1378
731
|
agentQaRoot?: string;
|
|
1379
732
|
preferredProfile?: EmbeddingProfile;
|
|
1380
|
-
/** D-12/D-17 test seam, passed through unchanged. Production callers omit it. */
|
|
1381
733
|
probes?: EmbedderProbes;
|
|
1382
734
|
}
|
|
1383
|
-
/**
|
|
1384
|
-
* Probe both axes and fold them (D-17). NEVER throws, NEVER downloads, NEVER writes.
|
|
1385
|
-
*
|
|
1386
|
-
* - `allowDownload: false` is hard-coded, not an option: this call answers "what is this host
|
|
1387
|
-
* doing today", and a probe that fetched a model would change the answer by asking it (T-407-09).
|
|
1388
|
-
* - A `scan` face short-circuits before the embedder is touched at all. The fold does not need the
|
|
1389
|
-
* embedder axis in that arm, and the probe can cost a model load.
|
|
1390
|
-
* - A rejected capability probe folds to `deferred/load-failure` rather than propagating. This
|
|
1391
|
-
* resolver's callers are a banner, a doctor row and an evidence recorder; none of them has a
|
|
1392
|
-
* sensible behaviour for "asking about the ladder threw".
|
|
1393
|
-
* - `classifyIndexFace` writes no rebuild marker, so asking is not a mutation of the knowledge root.
|
|
1394
|
-
*
|
|
1395
|
-
* The memo inside `resolveEmbedderCapability` is what makes a second call in the same process free,
|
|
1396
|
-
* which is why `doctor` and the runner can both ask without paying twice.
|
|
1397
|
-
*/
|
|
1398
735
|
declare function resolveRetrievalRung(options: ResolveRetrievalRungOptions): Promise<RecordedRetrievalRung>;
|
|
1399
736
|
|
|
1400
|
-
/**
|
|
1401
|
-
* Fixed weighted-RRF vector for each deterministic query class (D-06).
|
|
1402
|
-
*
|
|
1403
|
-
* PROVISIONAL vectors pending M3's learned per-product replacements. Plain RRF with all three
|
|
1404
|
-
* weights equal to 1 is the declared cold-start floor; learning may replace vectors, never the
|
|
1405
|
-
* classifier itself.
|
|
1406
|
-
*/
|
|
1407
737
|
declare const QUERY_CLASS_WEIGHTS: {
|
|
1408
738
|
readonly literal: {
|
|
1409
739
|
readonly wLex: 1.5;
|
|
@@ -1422,18 +752,8 @@ declare const QUERY_CLASS_WEIGHTS: {
|
|
|
1422
752
|
};
|
|
1423
753
|
};
|
|
1424
754
|
|
|
1425
|
-
/**
|
|
1426
|
-
* D-06's closed query-class contract. The classifier is deterministic and total; future learned
|
|
1427
|
-
* weights may replace class vectors, but they must not replace or widen these classes implicitly.
|
|
1428
|
-
*/
|
|
1429
755
|
type QueryClass = 'literal' | 'mixed' | 'semantic';
|
|
1430
756
|
|
|
1431
|
-
/**
|
|
1432
|
-
* The deterministic memory.md §5.5.8 query door (377 D-13). Every identity anchor is normalized
|
|
1433
|
-
* through the schema authority before keys or matching helpers are derived. Raw selector atoms
|
|
1434
|
-
* remain lexical-only; dense text and fallback regions are assembled from structured fields.
|
|
1435
|
-
*/
|
|
1436
|
-
|
|
1437
757
|
interface RetrievalQueryInput {
|
|
1438
758
|
screenState?: ScreenState;
|
|
1439
759
|
intent: string;
|
|
@@ -1456,11 +776,6 @@ interface RetrievalQuery {
|
|
|
1456
776
|
weights: (typeof QUERY_CLASS_WEIGHTS)[QueryClass];
|
|
1457
777
|
fallbackRenderings: FallbackRendering[];
|
|
1458
778
|
}
|
|
1459
|
-
/**
|
|
1460
|
-
* Build both recall inputs from structured runner state. Fallback renderings are candidates only:
|
|
1461
|
-
* callers use them after exact/normalized anchor lookup misses and may set the admission
|
|
1462
|
-
* anchorExact carve-out only after a lexical hit re-confirms reconfirmToken (T-377-23).
|
|
1463
|
-
*/
|
|
1464
779
|
declare function buildRetrievalQuery(input: RetrievalQueryInput): RetrievalQuery;
|
|
1465
780
|
|
|
1466
781
|
interface AsOfRange {
|
|
@@ -1468,13 +783,6 @@ interface AsOfRange {
|
|
|
1468
783
|
hi: number;
|
|
1469
784
|
}
|
|
1470
785
|
|
|
1471
|
-
/**
|
|
1472
|
-
* Public memory.md §5.5 retrieval composition.
|
|
1473
|
-
*
|
|
1474
|
-
* Usage telemetry (§5.5.9) is deferred by architecture: reader connections are query_only, so
|
|
1475
|
-
* counters land with Phases 378/380's writer-owned paths and are never an input to trust.
|
|
1476
|
-
*/
|
|
1477
|
-
|
|
1478
786
|
interface RetrieveOptions {
|
|
1479
787
|
n: number;
|
|
1480
788
|
product: string;
|
|
@@ -1513,19 +821,12 @@ interface RebuildIndexHooks {
|
|
|
1513
821
|
}
|
|
1514
822
|
interface RebuildIndexOptions {
|
|
1515
823
|
knowledgeRoot: string;
|
|
1516
|
-
priors?: TrustPriorTable;
|
|
1517
824
|
embedder?: EmbedderPort;
|
|
1518
825
|
vecLoadablePath?: string;
|
|
1519
826
|
writerAuthority?: WriterLeaseAuthority;
|
|
1520
827
|
hooks?: RebuildIndexHooks;
|
|
1521
828
|
}
|
|
1522
|
-
/**
|
|
1523
|
-
* WR-01 record-scoped healing: delete the total projection set for exactly the supplied bundle
|
|
1524
|
-
* ids inside one transaction and return the number of records removed. An absent index db,
|
|
1525
|
-
* empty ids, and ids without records rows are no-ops; embed_cache is untouched (purge-only A4).
|
|
1526
|
-
*/
|
|
1527
829
|
declare function removeBundleProjectionRows(knowledgeRoot: string, bundleIds: readonly string[], writerAuthority: WriterLeaseAuthority): number;
|
|
1528
|
-
/** Hash-selected projection plus the independent D-02 backfill and D-10 reconciliation passes. */
|
|
1529
830
|
declare function rebuildIndex(opts: RebuildIndexOptions): Promise<RebuildReport>;
|
|
1530
831
|
|
|
1531
832
|
declare function readLatestBuildOrdinal(runtimeRoot: string, product: string): number | undefined;
|
|
@@ -1588,23 +889,8 @@ declare function applySuiteFingerprints(db: DatabaseSync, projection: SuiteFinge
|
|
|
1588
889
|
* fingerprint half (the gate evaluator's own harness, and this module's corpus).
|
|
1589
890
|
*/
|
|
1590
891
|
declare function foldSuiteFingerprints(db: DatabaseSync, handoff: CompletedRunHandoff, opts: FoldSuiteFingerprintsOptions): SuiteFingerprintsProjection;
|
|
1591
|
-
/**
|
|
1592
|
-
* The read port gate 3 consumes through composition (D-15).
|
|
1593
|
-
*
|
|
1594
|
-
* MINIMAL BY DESIGN. Conservatism lives in the normalizer (D-14), not here: this port answers
|
|
1595
|
-
* what the table holds and nothing more, so a later retune of "near-same elements normalize
|
|
1596
|
-
* equal" moves in exactly one place. There is no similarity verb here because there is no
|
|
1597
|
-
* similarity threshold to defend — gate 3's value test is set membership, spec §6.3 verbatim.
|
|
1598
|
-
*/
|
|
1599
892
|
interface SuiteFingerprintIndex {
|
|
1600
|
-
/** The union D-14's novel-element test compares against. Empty table, empty union. */
|
|
1601
893
|
elementUnion(): Set<string>;
|
|
1602
|
-
/**
|
|
1603
|
-
* The identities that HAVE fingerprint rows, sorted. The consumer subtracts these from the
|
|
1604
|
-
* authored-test universe to derive the evidence-less set that rides D-16's text lane — which is
|
|
1605
|
-
* why this port reports coverage rather than trying to enumerate the suite, a fact it does not
|
|
1606
|
-
* own and could only guess at.
|
|
1607
|
-
*/
|
|
1608
894
|
coveredTests(): Array<{
|
|
1609
895
|
filePath: string;
|
|
1610
896
|
testName: string;
|
|
@@ -1622,72 +908,19 @@ interface SuiteFingerprintIndexOptions {
|
|
|
1622
908
|
}
|
|
1623
909
|
declare function createSuiteFingerprintIndex(db: DatabaseSync, opts: SuiteFingerprintIndexOptions): SuiteFingerprintIndex;
|
|
1624
910
|
|
|
1625
|
-
/**
|
|
1626
|
-
* PROVISIONAL last-N window for per-test outcome history (~10 pending ABRF-02 ranking
|
|
1627
|
-
* measurements). Entries are {buildOrdinal, passed} — ordinals only, wall-clock never.
|
|
1628
|
-
* Shared by readers and writers without pulling writer authority into the read closure.
|
|
1629
|
-
*/
|
|
1630
911
|
declare const LAST_OUTCOMES_LIMIT = 10;
|
|
1631
912
|
|
|
1632
|
-
/**
|
|
1633
|
-
* Stamped into the curation-tail receipt's projection component. Bump when the fold
|
|
1634
|
-
* semantics or table shapes change so already-receipted runs refold on the next tail.
|
|
1635
|
-
*
|
|
1636
|
-
* HOW THAT REFOLD ACTUALLY HAPPENS (393 CR-02), because the receipt alone cannot do it. The tail
|
|
1637
|
-
* stores this number in each run's receipt, so a bump invalidates every receipt and the sweep
|
|
1638
|
-
* re-runs each historical run — but the per-run fold then answers 'already-applied' off the
|
|
1639
|
-
* durable marker and writes nothing. The stamp is therefore ALSO stored in the index itself, in
|
|
1640
|
-
* `run_outcome_projection_version`, and `reconcileRunOutcomesProjection` compares the two ONCE per
|
|
1641
|
-
* curation-tail sweep, before the per-run loop: a differing or absent stamp rebuilds the whole
|
|
1642
|
-
* projection family from the runs root through `rebuildRunOutcomes`, which clears the family
|
|
1643
|
-
* (marker included) and re-reads every `handoff.json` + `analysis.json` from disk. THAT is how an
|
|
1644
|
-
* already-receipted run contributes its elements. The per-run receipts then rewrite at the new
|
|
1645
|
-
* version through the same sweep. The family is derived, so the rebuild is the whole upgrade, and
|
|
1646
|
-
* it is a mechanism that runs, not an argument that it is unnecessary.
|
|
1647
|
-
*
|
|
1648
|
-
* NOT the case argued at `cli/src/commands/run.ts:1949` (390-08 D-01), where a bump was
|
|
1649
|
-
* deliberately declined: there the rebuild would have replayed stored handoffs carrying the OLD
|
|
1650
|
-
* identities, landing in the same mixed state the bump was meant to clear. Here the new table has
|
|
1651
|
-
* no historical rows at all, and every row it will hold is derivable from evidence the stored
|
|
1652
|
-
* handoffs already carry — so the refold produces the complete answer rather than a mixed one.
|
|
1653
|
-
*/
|
|
1654
913
|
declare const RUN_OUTCOMES_PROJECTION_VERSION = 2;
|
|
1655
914
|
|
|
1656
915
|
/** Anchor extraction seam: the CLI tail passes its exercisedAnchors(step) walk. */
|
|
1657
916
|
type ExtractStepAnchors = (step: StepEvidence) => Anchor[];
|
|
1658
|
-
/**
|
|
1659
|
-
* Projection inputs contain no exclusion override. The durable handoff marker is the sole
|
|
1660
|
-
* authority for current-run folds, sibling backfill, and full rebuild alike (D-14 §6).
|
|
1661
|
-
*/
|
|
1662
917
|
interface ProjectRunOutcomesOptions {
|
|
1663
918
|
extractAnchors: ExtractStepAnchors;
|
|
1664
|
-
/**
|
|
1665
|
-
* The run's persisted analysis artifact when one exists (390 D-09, the `ProjectCanaryOutcomes
|
|
1666
|
-
* Input.artifact` precedent). DATA, not a port: `foldRunOutcomes` and `rebuildRunOutcomes` each
|
|
1667
|
-
* load it from the run's own dir through the one shared loader and hand it here, so ONE
|
|
1668
|
-
* projection function with ONE signature serves both paths — a second signature only one path
|
|
1669
|
-
* calls is exactly how L12 rebuild parity breaks in silence.
|
|
1670
|
-
*/
|
|
1671
919
|
artifact?: RunAnalysisArtifact;
|
|
1672
920
|
}
|
|
1673
|
-
/**
|
|
1674
|
-
* What a FAILED member contributes to the fingerprint-keyed recurrence window (390 D-07).
|
|
1675
|
-
*
|
|
1676
|
-
* The fingerprint is composed through the ONE exported vocabulary — `failingStepOf`/`errorTextOf`
|
|
1677
|
-
* over `exercisedAnchors`, keyed by `failureFingerprint` — so this window and the render-time
|
|
1678
|
-
* cluster presentation cannot disagree about what "the same failure" is. The verdict class is part
|
|
1679
|
-
* of the key by recipe, which is why it travels beside it rather than being re-derived downstream.
|
|
1680
|
-
*/
|
|
1681
921
|
interface RunOutcomeFailureKey {
|
|
1682
922
|
fingerprint: string;
|
|
1683
923
|
verdictClass: VerdictClass;
|
|
1684
|
-
/**
|
|
1685
|
-
* WHICH pipeline authored the class (390-16). Not part of the fingerprint and not stored on
|
|
1686
|
-
* `run_fingerprint_windows` — it travels on the in-memory delta only, because the quarantine
|
|
1687
|
-
* ladder's floor-eligibility gate needs to know whether the class is a statement about THIS
|
|
1688
|
-
* TEST (an authored `analyze-run` verdict) or about the RUN (the deterministic floor, whose
|
|
1689
|
-
* `environment` arms are one health-probe result applied to every failing member).
|
|
1690
|
-
*/
|
|
1691
924
|
producer: Verdict['producer'];
|
|
1692
925
|
}
|
|
1693
926
|
interface RunOutcomeTestDelta {
|
|
@@ -1696,9 +929,8 @@ interface RunOutcomeTestDelta {
|
|
|
1696
929
|
passed: boolean;
|
|
1697
930
|
heals: number;
|
|
1698
931
|
flake: boolean;
|
|
1699
|
-
/** canonicalJson(normalizeAnchor(...)) keys — byte-deterministic (ABRF-02 encoding edge). */
|
|
1700
932
|
anchorKeys: string[];
|
|
1701
|
-
/** Present for exactly the failed members — a pass contributes no window row
|
|
933
|
+
/** Present for exactly the failed members — a pass contributes no window row. */
|
|
1702
934
|
failure?: RunOutcomeFailureKey;
|
|
1703
935
|
}
|
|
1704
936
|
interface RunOutcomesProjection {
|
|
@@ -1708,12 +940,6 @@ interface RunOutcomesProjection {
|
|
|
1708
940
|
buildOrdinal: number;
|
|
1709
941
|
excluded: boolean;
|
|
1710
942
|
tests: RunOutcomeTestDelta[];
|
|
1711
|
-
/**
|
|
1712
|
-
* The suite-fingerprint deltas for the SAME members (393 D-15). They travel on this projection
|
|
1713
|
-
* rather than being folded by a second pass so that one traversal of the handoff produces both
|
|
1714
|
-
* tables, one transaction commits them, and one applied-runs marker covers them — which is what
|
|
1715
|
-
* makes rebuild parity structural instead of asserted.
|
|
1716
|
-
*/
|
|
1717
943
|
fingerprints: SuiteFingerprintTestDelta[];
|
|
1718
944
|
}
|
|
1719
945
|
type ApplyRunOutcomesResult = {
|
|
@@ -1726,35 +952,13 @@ type ApplyRunOutcomesResult = {
|
|
|
1726
952
|
interface RebuildRunOutcomesOptions {
|
|
1727
953
|
extractAnchors: ExtractStepAnchors;
|
|
1728
954
|
}
|
|
1729
|
-
/**
|
|
1730
|
-
* What one rebuild did, with its two skip causes kept APART (393 round 7, CR-01-WIDENED).
|
|
1731
|
-
*
|
|
1732
|
-
* A single conflating counter answered "how many runs did not fold" and nothing an operator could
|
|
1733
|
-
* act on: a malformed `handoff.json` and an unloadable `analysis.json` are different files, written
|
|
1734
|
-
* by different producers, and fixed differently. There is deliberately no third counter for a
|
|
1735
|
-
* projection or write failure — that class is no longer a skip at all. It propagates out of
|
|
1736
|
-
* `rebuildRunOutcomes` and the rebuild produces no report.
|
|
1737
|
-
*/
|
|
1738
955
|
interface RebuildRunOutcomesReport {
|
|
1739
956
|
folded: number;
|
|
1740
|
-
/** Runs whose `handoff.json` would not load or
|
|
957
|
+
/** Runs whose `handoff.json` would not load or has an old or structurally unsafe shape. */
|
|
1741
958
|
skippedHandoffs: number;
|
|
1742
|
-
/** Runs whose `handoff.json` loaded but whose `analysis.json` threw (the D-09 second document). */
|
|
1743
959
|
skippedArtifacts: number;
|
|
1744
960
|
}
|
|
1745
|
-
/**
|
|
1746
|
-
* What the fold needs before it may evaluate the quarantine detection ladder (390 D-08).
|
|
1747
|
-
*
|
|
1748
|
-
* Grouped and OPTIONAL on purpose: a caller that cannot supply a clock does
|
|
1749
|
-
* not get a silently empty evaluation, it gets `{kind: 'not-evaluated', reason: 'not-requested'}`
|
|
1750
|
-
* on the report. "Detection ran and found nothing" and "detection never ran" are different facts.
|
|
1751
|
-
*/
|
|
1752
961
|
interface QuarantineDetectionOptions {
|
|
1753
|
-
/**
|
|
1754
|
-
* The ISO-8601 instant the evaluation is anchored to — the drain's own wall clock, read ONCE by
|
|
1755
|
-
* the caller. The fold and the rule below it stay clock-free (390-01's purity-by-argument), which
|
|
1756
|
-
* is what lets both expiry and the ladder be pinned one step either side.
|
|
1757
|
-
*/
|
|
1758
962
|
now: string;
|
|
1759
963
|
}
|
|
1760
964
|
interface FoldRunOutcomesOptions {
|
|
@@ -1762,23 +966,9 @@ interface FoldRunOutcomesOptions {
|
|
|
1762
966
|
knowledgeRoot: string;
|
|
1763
967
|
handoff: CompletedRunHandoff;
|
|
1764
968
|
extractAnchors: ExtractStepAnchors;
|
|
1765
|
-
/**
|
|
1766
|
-
* The run's own directory (`.agent-qa/runs/<slug(runId)>/`). When supplied, the fold loads
|
|
1767
|
-
* `analysis.json` from it so the counters read RESOLVED verdicts (D-09). Absent — a caller that
|
|
1768
|
-
* has no run dir — folds the deterministic floor, byte-identically to pre-390.
|
|
1769
|
-
*/
|
|
1770
969
|
runDir?: string;
|
|
1771
|
-
/** Present when the caller wants the D-08 detection step; absent skips it explicitly. */
|
|
1772
970
|
quarantine?: QuarantineDetectionOptions;
|
|
1773
971
|
}
|
|
1774
|
-
/**
|
|
1775
|
-
* What the fold's detection step did, as DATA (390 Pitfall 4).
|
|
1776
|
-
*
|
|
1777
|
-
* Every arm is a fact the caller can print. A ledger that could not be read is a value, not an
|
|
1778
|
-
* exception: a failure that vanished inside a catch is exactly how an `entered` event goes missing
|
|
1779
|
-
* in silence, and a missing `entered` event is a test that keeps failing builds with nobody told
|
|
1780
|
-
* why it was supposed to stop.
|
|
1781
|
-
*/
|
|
1782
972
|
type QuarantineFoldOutcome = {
|
|
1783
973
|
kind: 'not-evaluated';
|
|
1784
974
|
reason: 'already-applied' | 'not-requested';
|
|
@@ -1806,27 +996,6 @@ declare function projectRunOutcomes(handoff: CompletedRunHandoff, opts: ProjectR
|
|
|
1806
996
|
* refolds an already-applied partition (receipt withheld mid-tail) changes nothing.
|
|
1807
997
|
*/
|
|
1808
998
|
declare function applyRunOutcomes(db: DatabaseSync, projection: RunOutcomesProjection): ApplyRunOutcomesResult;
|
|
1809
|
-
/**
|
|
1810
|
-
* Full rebuild: scan and read every run dir under `runsRoot`, then clear the projection tables
|
|
1811
|
-
* and refold each loadable handoff. Reproduces tables byte-identical to the incremental fold
|
|
1812
|
-
* (L12); a rebuild over zero handoff dirs yields empty tables without error (ABRF-02
|
|
1813
|
-
* empty edge). BAD-BYTES load failures and pre-381 shapes are counted skips — including a run whose
|
|
1814
|
-
* `analysis.json` will not decode, which costs that run's contribution and nothing else (393 round
|
|
1815
|
-
* 6, CR-01). One undecodable artifact must never truncate a family this function has already
|
|
1816
|
-
* read; an errno-coded HOST fault on either document, on the runs root, or on any run dir
|
|
1817
|
-
* propagates BEFORE the family is deleted, so no sweep can stamp — or empty — a family the
|
|
1818
|
-
* filesystem prevented it from reading (418-12, CR-01-EXISTS).
|
|
1819
|
-
*
|
|
1820
|
-
* Phase A: no document is destroyed before every document was read — a host fault during reads
|
|
1821
|
-
* leaves the previous family and its stamp untouched (418-12, CR-02-DESTRUCTIVE, load-before-delete).
|
|
1822
|
-
* The list holds parsed handoffs for one sweep; the runs root is bounded by host run retention.
|
|
1823
|
-
*
|
|
1824
|
-
* Phase B is DELETE-FIRST, STAMP-LAST, and that order is the crash story rather than a style choice (393
|
|
1825
|
-
* CR-02). The version row is cleared with the family it describes and re-written only after the
|
|
1826
|
-
* refold loop has run to completion, so a crash anywhere in between leaves NO stamp — which
|
|
1827
|
-
* `reconcileRunOutcomesProjection` reads as a mismatch and rebuilds again. The projection
|
|
1828
|
-
* therefore self-heals from a partial rebuild instead of stamping a half-built family as current.
|
|
1829
|
-
*/
|
|
1830
999
|
declare function rebuildRunOutcomes(db: DatabaseSync, runsRoot: string, opts: RebuildRunOutcomesOptions): RebuildRunOutcomesReport;
|
|
1831
1000
|
/** What one reconcile did — a fact the caller can print, never a silent side effect. */
|
|
1832
1001
|
type ReconcileRunOutcomesProjectionResult = {
|
|
@@ -1850,60 +1019,9 @@ interface ReconcileRunOutcomesProjectionOptions {
|
|
|
1850
1019
|
runsRoot: string;
|
|
1851
1020
|
extractAnchors: ExtractStepAnchors;
|
|
1852
1021
|
}
|
|
1853
|
-
/**
|
|
1854
|
-
* THE version trigger: reconcile the stored fold semantics with the shipped ones (393 CR-02).
|
|
1855
|
-
*
|
|
1856
|
-
* `RUN_OUTCOMES_PROJECTION_VERSION`'s doc block has always promised that a bump makes
|
|
1857
|
-
* already-receipted runs refold. Nothing performed that refold: `applyRunOutcomes` short-circuits
|
|
1858
|
-
* on the `run_outcome_applied_runs` marker before it can reach the fingerprint write, and nothing
|
|
1859
|
-
* cleared the marker on a version change — so on any project that folded runs before a bump, the
|
|
1860
|
-
* new table stayed empty forever and gate 3's fingerprint lane never had data to decide on. This
|
|
1861
|
-
* function is what makes that promise true, and it composes machinery that already existed rather
|
|
1862
|
-
* than adding a parallel path: `rebuildRunOutcomes` already clears the family, already re-reads
|
|
1863
|
-
* every `handoff.json` + `analysis.json` through the one shared loader, and already reaches
|
|
1864
|
-
* `applySuiteFingerprints` for every fold.
|
|
1865
|
-
*
|
|
1866
|
-
* ABSENT MEANS MISMATCH, deliberately. Every pre-stamp index reads as absent, which is exactly the
|
|
1867
|
-
* population that needs to converge; so does an index whose file was deleted, which is exactly the
|
|
1868
|
-
* population that needs to re-heal. Treating absence as "probably fine" would have made the
|
|
1869
|
-
* upgrade path the one path this function does not serve.
|
|
1870
|
-
*
|
|
1871
|
-
* WHY A REBUILD RATHER THAN A PER-RUN VERSION COLUMN. Refolding runs in place through the
|
|
1872
|
-
* incremental path would add each run's counters a SECOND time — the fold accumulates, it does not
|
|
1873
|
-
* replace. The rebuild is the mechanism precisely because it clears before it refolds, which is
|
|
1874
|
-
* also why the derived family is safe to move this way at all (L12: every row here is reproducible
|
|
1875
|
-
* from run artifacts on disk).
|
|
1876
|
-
*
|
|
1877
|
-
* 418-12 WR-03: a destructive rebuild of a shared derived family is a leased act. A caller
|
|
1878
|
-
* without authority gets a typed skip before opening a writer; it stays stale until a leased
|
|
1879
|
-
* sweep. The version check and entire rebuild share the current-authority generation lock.
|
|
1880
|
-
*/
|
|
1881
1022
|
declare function reconcileRunOutcomesProjection(opts: ReconcileRunOutcomesProjectionOptions): ReconcileRunOutcomesProjectionResult;
|
|
1882
|
-
/**
|
|
1883
|
-
* Incremental fold wrapper for the post-verdict tail: opens the one index writer, applies
|
|
1884
|
-
* the projection, and closes. The tail invokes it inside the SAME crash boundary and the
|
|
1885
|
-
* SAME (extended) receipt as candidate/canary emit — never a second marker file.
|
|
1886
|
-
*
|
|
1887
|
-
* Detection hangs off the `'applied'` arm ONLY (D-08). `applyRunOutcomes` answers
|
|
1888
|
-
* `'already-applied'` from an early return that fires before its transaction even opens, so
|
|
1889
|
-
* "a refold never double-quarantines" is true by POSITION — there is no second idempotency
|
|
1890
|
-
* condition here to keep in sync with the marker.
|
|
1891
|
-
*/
|
|
1892
1023
|
declare function foldRunOutcomes(opts: FoldRunOutcomesOptions): FoldRunOutcomesReport;
|
|
1893
1024
|
|
|
1894
|
-
/**
|
|
1895
|
-
* Read side of the run-outcome projection (389 ANLZ-03, RESEARCH Pitfall 2).
|
|
1896
|
-
*
|
|
1897
|
-
* `run_test_outcomes` is written by `foldRunOutcomes`/`applyRunOutcomes`; this module is
|
|
1898
|
-
* the one place that queries it. Strictly read-only: one prepared SELECT, no statement
|
|
1899
|
-
* that mutates a row, ever — the writer half stays whole in `run-outcomes.ts`.
|
|
1900
|
-
*
|
|
1901
|
-
* KEY LAW — stable test identity is `(product, filePath, testName)`, exactly the
|
|
1902
|
-
* projection's primary key and per-test-outcome.ts's identity rule. Callers joining from
|
|
1903
|
-
* a handoff use `PerTestOutcome.filePath` + `testName`, NEVER `testId` (a per-run
|
|
1904
|
-
* explicit id, not a durable identity).
|
|
1905
|
-
*/
|
|
1906
|
-
|
|
1907
1025
|
/** One window entry: ordinals only, wall-clock never (mirrors the writer's OutcomeEntry). */
|
|
1908
1026
|
interface TestOutcomeEntry {
|
|
1909
1027
|
buildOrdinal: number;
|
|
@@ -1929,29 +1047,10 @@ interface TestOutcomeIdentity {
|
|
|
1929
1047
|
* projection has never counted the test — typed absence, never an empty stand-in row.
|
|
1930
1048
|
*/
|
|
1931
1049
|
declare function readTestOutcomeHistory(db: DatabaseSync, identity: TestOutcomeIdentity): TestOutcomeHistory | undefined;
|
|
1932
|
-
/**
|
|
1933
|
-
* Every identity the projection has counted inside ONE file, in one product (394-17 · WTST-05).
|
|
1934
|
-
*
|
|
1935
|
-
* The neighbours side of D-14's stability read: "which tests does this suite file already have run
|
|
1936
|
-
* evidence for". Keyed on the projection's own primary key, so `product` is REQUIRED for the same
|
|
1937
|
-
* reason `readTestOutcomeHistory` requires it — a query that dropped it would serve every
|
|
1938
|
-
* product's rows under one file path and report another application's tests as this target's.
|
|
1939
|
-
*
|
|
1940
|
-
* `test_name` ORDER, so a caller's message names its neighbours in a stable order across runs. An
|
|
1941
|
-
* empty array is the honest answer for a file the projection has never counted; the caller turns
|
|
1942
|
-
* that into a `no-history` posture rather than into a clean bill of health.
|
|
1943
|
-
*/
|
|
1944
1050
|
declare function listTestsInFile(db: DatabaseSync, scope: {
|
|
1945
1051
|
product: string;
|
|
1946
1052
|
filePath: string;
|
|
1947
1053
|
}): string[];
|
|
1948
|
-
/**
|
|
1949
|
-
* D-02's forced discriminator channel: did the same step pass on the previous build?
|
|
1950
|
-
* Answers the entry with the greatest buildOrdinal STRICTLY below `currentBuildOrdinal`,
|
|
1951
|
-
* or `undefined` when no prior build is in the window (empty history, a single
|
|
1952
|
-
* current-build entry, or every entry at/above current) — prior-build honestly absent,
|
|
1953
|
-
* never faked from the current entry.
|
|
1954
|
-
*/
|
|
1955
1054
|
declare function priorBuildOutcome(history: TestOutcomeHistory, currentBuildOrdinal: number): TestOutcomeEntry | undefined;
|
|
1956
1055
|
interface FailureRecurrence {
|
|
1957
1056
|
/** Failed entries with buildOrdinal AT OR BELOW current — includes the current failure when recorded. */
|
|
@@ -1959,25 +1058,9 @@ interface FailureRecurrence {
|
|
|
1959
1058
|
/** Distinct buildOrdinals observed in lastOutcomes — honest about the ≤LAST_OUTCOMES_LIMIT window. */
|
|
1960
1059
|
windowBuilds: number;
|
|
1961
1060
|
}
|
|
1962
|
-
/**
|
|
1963
|
-
* Feeds "Kth failure in the last N builds", computed LIVE at render time (D-08) — counts
|
|
1964
|
-
* derived from the window on every call, never stored prose. 390 rebinds the same seam to
|
|
1965
|
-
* its fingerprint-window computation; this derivation is 389's binding, not the seam's
|
|
1966
|
-
* final owner. An empty history answers {kth: 0, windowBuilds: 0}: the renderer (plan 05)
|
|
1967
|
-
* turns zero-history into an explicit no-history clause, so absence stays typed.
|
|
1968
|
-
*/
|
|
1969
1061
|
declare function failureRecurrence(history: TestOutcomeHistory, currentBuildOrdinal: number): FailureRecurrence;
|
|
1970
1062
|
|
|
1971
|
-
/**
|
|
1972
|
-
* PROVISIONAL D-13 superseded-generation retention depth. M3 may calibrate the
|
|
1973
|
-
* value against gate receipts, but it remains an internal constitution value
|
|
1974
|
-
* and never a runtime config key.
|
|
1975
|
-
*/
|
|
1976
1063
|
declare const GC_SUPERSEDED_RETAIN_K = 3;
|
|
1977
|
-
/**
|
|
1978
|
-
* D-13 gate seam. M2 always passes `{ kind: 'none' }`; M3 plugs real gate
|
|
1979
|
-
* receipt ordinals into the second variant with zero shape change.
|
|
1980
|
-
*/
|
|
1981
1064
|
type GateHorizon = {
|
|
1982
1065
|
kind: 'none';
|
|
1983
1066
|
} | {
|
|
@@ -2002,26 +1085,8 @@ interface RunKnowledgeGcHooks {
|
|
|
2002
1085
|
/** Test/chaos seam immediately before the authority check for one planned removal. */
|
|
2003
1086
|
beforeGcRemoval?(recordId: RecordId): void;
|
|
2004
1087
|
}
|
|
2005
|
-
/**
|
|
2006
|
-
* Trim only whole superseded bundle directories after constructing every D-13
|
|
2007
|
-
* exclusion set. No projection SQL exists here by design: the drain tail feeds
|
|
2008
|
-
* trimmedRecordIds straight into removeBundleProjectionRows, so the disposable
|
|
2009
|
-
* index heals in the same drain (WR-01).
|
|
2010
|
-
*
|
|
2011
|
-
* RATIFICATION: this typed in-memory summary, surfaced through drain diagnostics,
|
|
2012
|
-
* is the low-cost §9.2-style operational note. GC writes no persisted note artifact.
|
|
2013
|
-
*/
|
|
2014
1088
|
declare function runKnowledgeGc(input: RunKnowledgeGcInput, writerAuthority: WriterLeaseAuthority, hooks?: RunKnowledgeGcHooks): GcSummary;
|
|
2015
1089
|
|
|
2016
|
-
/**
|
|
2017
|
-
* D-19 active-profile migration over the derived index.
|
|
2018
|
-
*
|
|
2019
|
-
* M2 keeps this library-only: Phase 378's drainer binds it to runtime
|
|
2020
|
-
* coordination, while Phase 382 owns any eventual CLI cutover surface. Rows
|
|
2021
|
-
* projected after the frozen snapshot take the benign lag direction: the flip
|
|
2022
|
-
* marks them pending so 375's unchanged backfill selector heals them.
|
|
2023
|
-
*/
|
|
2024
|
-
|
|
2025
1090
|
type MigrationOutcome = {
|
|
2026
1091
|
flipped: true;
|
|
2027
1092
|
profileKey: string;
|
|
@@ -2091,40 +1156,8 @@ declare function createNativeEmbedder(options: {
|
|
|
2091
1156
|
}): Promise<EmbedderPort>;
|
|
2092
1157
|
|
|
2093
1158
|
declare const MODEL_CACHE_DIR_ENV_VAR = "AGENT_QA_MODEL_CACHE_DIR";
|
|
2094
|
-
/**
|
|
2095
|
-
* Resolve the shared model cache used by every native embedder acquisition.
|
|
2096
|
-
*
|
|
2097
|
-
* D-11: one download per machine across all projects, with artifacts identified
|
|
2098
|
-
* by (model_id, revision). An explicit agent-qa override wins, then the XDG
|
|
2099
|
-
* cache root, with the conventional home cache as the final fallback.
|
|
2100
|
-
*/
|
|
2101
1159
|
declare function resolveModelCacheDir(): string;
|
|
2102
1160
|
|
|
2103
|
-
/**
|
|
2104
|
-
* The embedder worker's half of the one process-identity vocabulary in this package.
|
|
2105
|
-
*
|
|
2106
|
-
* This is a separate module from `worker-registration.ts` on purpose. Registration reading and
|
|
2107
|
-
* socket probing are reachable from the read-only serving entry, and `reader-import-closure`
|
|
2108
|
-
* forbids that closure from crossing into `lease/`. The *signal decision* is a writer-side concern
|
|
2109
|
-
* that the reader never makes, so it lives here — which lets both kill paths in this package share
|
|
2110
|
-
* CR-04's single `resolveProcessIncarnation` definition instead of growing a second, subtly
|
|
2111
|
-
* different identity scheme.
|
|
2112
|
-
*/
|
|
2113
|
-
|
|
2114
|
-
/**
|
|
2115
|
-
* Compare the registration's recorded incarnation against the pid's CURRENT occupant.
|
|
2116
|
-
*
|
|
2117
|
-
* CR-05: a schema-valid registration naming a live pid whose socket has stopped answering is not
|
|
2118
|
-
* proof that the worker is still there. Once the worker died, the kernel is free to hand its pid to
|
|
2119
|
-
* a stranger, and every decision keyed on that number alone targets whoever holds it now. The one
|
|
2120
|
-
* fact that separates them is assigned by the OS and cannot be forged from inside the file: when
|
|
2121
|
-
* the process at that pid started.
|
|
2122
|
-
*
|
|
2123
|
-
* `mismatch` means the registered worker is provably gone; `unverifiable` means we cannot say, and
|
|
2124
|
-
* that is a refusal rather than a default-allow. Neither may be signalled — and neither needs to
|
|
2125
|
-
* be, because generation-specific sockets (Plan 24) let a fresh worker take a clean address without
|
|
2126
|
-
* the old pid ever being touched.
|
|
2127
|
-
*/
|
|
2128
1161
|
declare function verifyEmbedderWorkerIncarnation(registration: EmbedderWorkerRegistration): EmbedderWorkerIncarnationVerdict;
|
|
2129
1162
|
|
|
2130
1163
|
declare const CURATION_QUEUE_SCHEMA_VERSION = 2;
|
|
@@ -2400,7 +1433,7 @@ declare function buildCurationCandidateAddressFields(input: BuildCurationCandida
|
|
|
2400
1433
|
*/
|
|
2401
1434
|
declare function candidateContentAddress(fields: CurationCandidateAddressFields): string;
|
|
2402
1435
|
|
|
2403
|
-
/** Gitignored durable curation transport root
|
|
1436
|
+
/** Gitignored durable curation transport root. */
|
|
2404
1437
|
declare const QUEUE_DIR = "memory/queue";
|
|
2405
1438
|
/** Pending candidates visible to a drainer. */
|
|
2406
1439
|
declare const QUEUED_SUBDIR = "queued";
|
|
@@ -2678,11 +1711,6 @@ type NeighborRecord = NeighborRecordBase & ({
|
|
|
2678
1711
|
kind: 'fact';
|
|
2679
1712
|
subtype: FactSubtype;
|
|
2680
1713
|
} | NonFactNeighborRecord);
|
|
2681
|
-
/**
|
|
2682
|
-
* One authored outcome may carry multiple deltas (D-02): a procedure-extraction job can yield
|
|
2683
|
-
* whole-flow AND sub-flow candidates from one trajectory. Fact/caution authoring produces a
|
|
2684
|
-
* one-element array. The array is never empty.
|
|
2685
|
-
*/
|
|
2686
1714
|
type AuthorOutcome = {
|
|
2687
1715
|
kind: 'authored';
|
|
2688
1716
|
deltas: Delta[];
|
|
@@ -2693,33 +1721,13 @@ type AuthorOutcome = {
|
|
|
2693
1721
|
};
|
|
2694
1722
|
/** Provider-neutral author seam injected by the CLI composition root. */
|
|
2695
1723
|
type CuratorAuthor = (job: CurationJobView, neighbors: NeighborRecord[]) => Promise<AuthorOutcome>;
|
|
2696
|
-
/**
|
|
2697
|
-
* Caller-owned disposition authority. Phase 379 may extend this profile with its deterministic
|
|
2698
|
-
* born-active drift-supersede carve-out without changing the author or checkpoint contracts.
|
|
2699
|
-
*/
|
|
2700
1724
|
interface DispositionProfile {
|
|
2701
1725
|
mode: 'drain-to-active' | 'propose-only';
|
|
2702
1726
|
}
|
|
2703
|
-
/**
|
|
2704
|
-
* Resolve automatic curation authority from the run's already-captured execution context.
|
|
2705
|
-
* Local work applies directly (432 D-08); CI and cloud stay proposed for the rolling-PR flow.
|
|
2706
|
-
*/
|
|
2707
1727
|
declare function resolveDispositionProfile(executionContext: ExecutionContext): DispositionProfile;
|
|
2708
1728
|
type CheckpointBundleDraft = BundleDraft & {
|
|
2709
1729
|
needsEnrichment?: true;
|
|
2710
1730
|
};
|
|
2711
|
-
/**
|
|
2712
|
-
* The SHARED structural boundary for a checkpoint. Neighbor membership and CAS freshness are
|
|
2713
|
-
* deliberately disposition checks, so this schema validates structure without applying them.
|
|
2714
|
-
* D-02: the checkpoint carries the authored outcome's FULL delta array — one durable authoring
|
|
2715
|
-
* checkpoint per job, disposed delta-by-delta through the commit boundary.
|
|
2716
|
-
*
|
|
2717
|
-
* Deliberately origin-WIDE, and that is not an oversight — see
|
|
2718
|
-
* `AUTHORED_CHECKPOINT_ORIGIN_ADMISSION` below. `AuthoredCheckpoint`'s inferred delta type is
|
|
2719
|
-
* the type every in-process checkpoint carries, including the user-origin deltas the review
|
|
2720
|
-
* verbs commit and the system-origin deltas rollback and the canary commit. Origin admission is
|
|
2721
|
-
* a property of the DRAIN's parse boundary, not of the checkpoint shape.
|
|
2722
|
-
*/
|
|
2723
1731
|
declare const authoredCheckpointSchema: z.ZodObject<{
|
|
2724
1732
|
schemaVersion: z.ZodLiteral<2>;
|
|
2725
1733
|
deltas: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2826,11 +1834,6 @@ type AuthoredCheckpoint = z.infer<typeof authoredCheckpointSchema>;
|
|
|
2826
1834
|
* the autonomy floor would then let tombstone standing knowledge.
|
|
2827
1835
|
*/
|
|
2828
1836
|
declare function parseAuthoredCheckpoint(value: unknown): AuthoredCheckpoint;
|
|
2829
|
-
/**
|
|
2830
|
-
* The per-delta commit unit sliced from a widened checkpoint. `commitCurationDelta` remains
|
|
2831
|
-
* the ONE serialized mutation boundary and disposes exactly one delta per call; the drain
|
|
2832
|
-
* slices the checkpoint and disposes each delta independently (D-02).
|
|
2833
|
-
*/
|
|
2834
1837
|
interface AuthoredDeltaCheckpoint {
|
|
2835
1838
|
schemaVersion: typeof AUTHORED_CHECKPOINT_SCHEMA_VERSION;
|
|
2836
1839
|
delta: AuthoredCheckpoint['deltas'][number];
|
|
@@ -2854,13 +1857,8 @@ interface CanonicalBundleSnapshot {
|
|
|
2854
1857
|
curationJobId?: string;
|
|
2855
1858
|
}
|
|
2856
1859
|
|
|
2857
|
-
/** Provisional §7.3.1 cap. Phase 379 may retune it only through an explicit constant edit. */
|
|
2858
1860
|
declare const BLAST_RADIUS_MAX_SUPERSEDES_PER_ANCHOR_PER_DRAIN = 1;
|
|
2859
1861
|
|
|
2860
|
-
/**
|
|
2861
|
-
* 381-03 (PROC-01 D-02/D-03): the verified queue evidence the procedure-extraction wall
|
|
2862
|
-
* validates against. It is code-derived queue truth — distilled observations — never LLM text.
|
|
2863
|
-
*/
|
|
2864
1862
|
interface ProcedureDispositionEvidence {
|
|
2865
1863
|
distilledObservations: readonly DistilledObservation[];
|
|
2866
1864
|
}
|
|
@@ -2881,7 +1879,7 @@ interface RelationIntent {
|
|
|
2881
1879
|
}
|
|
2882
1880
|
interface DispositionDrainState {
|
|
2883
1881
|
supersedesSeenByAnchorKey: Map<string, number>;
|
|
2884
|
-
/**
|
|
1882
|
+
/** One canonical O(store) scan, lazily cached per drain. */
|
|
2885
1883
|
canonicalBundles?: CanonicalBundleSnapshot[];
|
|
2886
1884
|
/** Test-only observability seam for proving the canonical scan runs once. */
|
|
2887
1885
|
onCanonicalBundleScan?: () => void;
|
|
@@ -2918,7 +1916,6 @@ interface DisposeDeltaInput {
|
|
|
2918
1916
|
checkpoint: AuthoredDeltaCheckpoint;
|
|
2919
1917
|
profile: DispositionProfile;
|
|
2920
1918
|
knowledgeRoot: string;
|
|
2921
|
-
priors?: TrustPriorTable;
|
|
2922
1919
|
/**
|
|
2923
1920
|
* Verified queue evidence needed for anchor and new-ordinal checks. Optional only for the
|
|
2924
1921
|
* non-mutating delta shapes; Add and Supersede fail closed when it is absent.
|
|
@@ -2958,47 +1955,8 @@ type DispositionOutcome = {
|
|
|
2958
1955
|
kind: 'noop';
|
|
2959
1956
|
reason: string;
|
|
2960
1957
|
};
|
|
2961
|
-
/**
|
|
2962
|
-
* Every way `checkCitedIdIntegrity` can decide this store cannot stand behind a cited id.
|
|
2963
|
-
*
|
|
2964
|
-
* The registry exists so the count stops being something a comment or a corpus has to keep in
|
|
2965
|
-
* step. Round 2 measured what happens when it is not one: the check's second return is a
|
|
2966
|
-
* three-way disjunction, the corpus and the doc comment both said "three conditions", and
|
|
2967
|
-
* carving `scope-mismatch` out of the refusal for every origin left 3 files / 70 tests green.
|
|
2968
|
-
* A fifth member added here is a compile error at `citedIdIntegrityFailure`'s derivation and at
|
|
2969
|
-
* the corpus's `satisfies Record<CitedIdIntegrityCondition, …>` fixture table.
|
|
2970
|
-
*/
|
|
2971
1958
|
declare const CITED_ID_INTEGRITY_CONDITIONS: readonly ["not-a-persisted-neighbor", "missing-from-disk", "deprecated", "scope-mismatch"];
|
|
2972
1959
|
type CitedIdIntegrityCondition = (typeof CITED_ID_INTEGRITY_CONDITIONS)[number];
|
|
2973
|
-
/**
|
|
2974
|
-
* The typed refusal a USER-authored delta receives when its cited-id integrity check fails.
|
|
2975
|
-
*
|
|
2976
|
-
* Thrown rather than returned, and out of the check funnel rather than out of the commit, so it
|
|
2977
|
-
* fires before any canonical byte moves for this delta: `disposeDelta` runs `checkCitedIdIntegrity`
|
|
2978
|
-
* first of the six §7.3.1 checks, ahead of every append, projection and promotion.
|
|
2979
|
-
* `applyReview`'s `commitAndPublish` catches it, restores the proposal to pending and rethrows,
|
|
2980
|
-
* which is how the caller gets a typed answer instead of a receipt for work nobody did.
|
|
2981
|
-
*
|
|
2982
|
-
* WHAT MAKES "NOTHING MOVED" TRUE, and it is not this sentence. The previous version of this
|
|
2983
|
-
* comment asserted whole-store neutrality as free-standing prose, naming no mechanism, and the
|
|
2984
|
-
* round-2 verifier measured that claim FALSE: the delta had already reached disposition through
|
|
2985
|
-
* `knowledge-store.ts`'s bridge, which materialized a claimed curation candidate on disk before
|
|
2986
|
-
* `commitWithProfile` ever called into the commit, and the throw left it there for the next
|
|
2987
|
-
* drain's reconcile to requeue (CR-02″). Two mechanisms now establish the claim, and each of them
|
|
2988
|
-
* reds if it is removed:
|
|
2989
|
-
*
|
|
2990
|
-
* 1. `bridgeDelta` is WRITE-FREE (`curator/knowledge-store.ts`). It computes the candidate's
|
|
2991
|
-
* address and materializes nothing, so a check that throws at any position has nothing to
|
|
2992
|
-
* leave behind. Reintroducing its two write statements reds the case in (2).
|
|
2993
|
-
* 2. `review/__tests__/apply-review.test.ts` asserts `hashTree(knowledgeRoot)` and the tree's
|
|
2994
|
-
* full entry listing — QUEUE TREE INCLUDED — are identical across a refused `accept`, with
|
|
2995
|
-
* a potency control proving the digest is falsifiable over that exact root.
|
|
2996
|
-
*
|
|
2997
|
-
* The scope of the guarantee is the knowledge root. The writer lease's own fencing state
|
|
2998
|
-
* (`.epoch`, `.writer-authority.sqlite`) advances on acquisition regardless of what the caller
|
|
2999
|
-
* then does, which is why the case above holds the lease across its measurement rather than
|
|
3000
|
-
* excusing those two names.
|
|
3001
|
-
*/
|
|
3002
1960
|
declare class UserDeltaCitationIntegrityError extends Error {
|
|
3003
1961
|
readonly recordId: RecordId;
|
|
3004
1962
|
readonly deltaKind: Delta['kind'];
|
|
@@ -3021,14 +1979,6 @@ interface CommitCurationDependencies {
|
|
|
3021
1979
|
epoch: number;
|
|
3022
1980
|
profile: DispositionProfile;
|
|
3023
1981
|
drainState: DispositionDrainState;
|
|
3024
|
-
/** Host-resolved posture as data; absent means the v51 floor. */
|
|
3025
|
-
resolvePromotionPosture?: ResolvePromotionPosture;
|
|
3026
|
-
priors?: TrustPriorTable;
|
|
3027
|
-
/**
|
|
3028
|
-
* Multi-delta disposal (D-02): when set, terminal paths skip queue completion so the
|
|
3029
|
-
* claimed candidate directory stays available for the checkpoint's remaining deltas.
|
|
3030
|
-
* The drain leaves it unset on the final delta, which completes the job as before.
|
|
3031
|
-
*/
|
|
3032
1982
|
deferCompletion?: true;
|
|
3033
1983
|
hooks?: {
|
|
3034
1984
|
/**
|
|
@@ -3064,16 +2014,9 @@ interface CommittedBundleResult {
|
|
|
3064
2014
|
bundleId: RecordId;
|
|
3065
2015
|
bundleDir: string;
|
|
3066
2016
|
deltaKind: Delta['kind'];
|
|
3067
|
-
/** D-16 exception-bucket observability; absent when the gate promotes or never runs. */
|
|
3068
2017
|
promotionHoldReason?: PromotionGateHoldReason;
|
|
3069
2018
|
promotionPath?: PromotionPath;
|
|
3070
2019
|
}
|
|
3071
|
-
/**
|
|
3072
|
-
* 381-47 (F-381-45-1): WHY a delta-noop disposition had nothing to apply. `authored-noop`
|
|
3073
|
-
* = a capable-model author deliberately emitted a Noop delta; the `fallback-*` members
|
|
3074
|
-
* name WHICH author fallback defeated extraction (the §7.9 one-element procedure Noop).
|
|
3075
|
-
* Benign noop reasons (evidence-token dedup, disposition rejects) never carry a cause.
|
|
3076
|
-
*/
|
|
3077
2020
|
type EmptyDeltaCause = 'authored-noop' | 'fallback-malformed' | 'fallback-no-model' | 'fallback-token-budget' | 'fallback-model-error';
|
|
3078
2021
|
type CommitCurationOutcome = ({
|
|
3079
2022
|
kind: 'applied';
|
|
@@ -3102,11 +2045,9 @@ type CommitCurationOutcome = ({
|
|
|
3102
2045
|
};
|
|
3103
2046
|
interface ApplyIndexDeltaForBundleInput {
|
|
3104
2047
|
knowledgeRoot: string;
|
|
3105
|
-
priors?: TrustPriorTable;
|
|
3106
2048
|
bundleId: string;
|
|
3107
2049
|
product?: string;
|
|
3108
2050
|
}
|
|
3109
|
-
/** Shared Plan 378-10 projection authority used by commit and journal reconciliation. */
|
|
3110
2051
|
declare function applyIndexDeltaForBundle(input: ApplyIndexDeltaForBundleInput): void;
|
|
3111
2052
|
/** Recovery alias deliberately delegates to the same projection unit as the live tail. */
|
|
3112
2053
|
declare function deriveIndexRowFromBundle(input: ApplyIndexDeltaForBundleInput): void;
|
|
@@ -3146,14 +2087,6 @@ interface ReconcileReport {
|
|
|
3146
2087
|
}
|
|
3147
2088
|
declare function reconcileOnDrainStart(deps: ReconcileOnDrainStartDependencies): ReconcileReport;
|
|
3148
2089
|
|
|
3149
|
-
/**
|
|
3150
|
-
* CR-02 takeover barriers. Test-only seams naming the three points at which a canary flow is
|
|
3151
|
-
* about to make canonical state durable; production callers omit them.
|
|
3152
|
-
*
|
|
3153
|
-
* The two entry barriers fire OUTSIDE the held section, which is what lets a schedule complete a
|
|
3154
|
-
* real takeover there and then observe the resumed writer's refusal. `beforeIndexProjection` fires
|
|
3155
|
-
* INSIDE it, so its schedule observes a contender blocked behind the tail instead.
|
|
3156
|
-
*/
|
|
3157
2090
|
interface CanaryAuthorityHooks {
|
|
3158
2091
|
/** Immediately before the negative arm enters its held section. */
|
|
3159
2092
|
beforeNegativeAppend?: () => void;
|
|
@@ -3167,24 +2100,12 @@ interface CreateLocalKnowledgeStoreConfig {
|
|
|
3167
2100
|
executionContext: ExecutionContext;
|
|
3168
2101
|
/** The holder's fresh lease epoch. Defaults to a fresh disk read for composition roots. */
|
|
3169
2102
|
epoch?: number;
|
|
3170
|
-
/**
|
|
3171
|
-
* The caller's real writer-lease id, paired with `epoch`.
|
|
3172
|
-
*
|
|
3173
|
-
* CR-02: every canonical append, promotion, and index projection this store performs carries
|
|
3174
|
-
* this identity into `withCurrentWriterAuthority`, so a store constructed by someone who is not
|
|
3175
|
-
* the published holder is refused at its first canonical mutation instead of laundering a
|
|
3176
|
-
* fabricated id. It is required precisely so no code path can omit it and fall back to one.
|
|
3177
|
-
*/
|
|
3178
2103
|
writerLeaseId: string;
|
|
3179
2104
|
/** Port calls lack a run ordinal; callers with run context should supply it. */
|
|
3180
2105
|
sourceBuildOrdinal?: number;
|
|
3181
2106
|
sourceRunId?: string;
|
|
3182
|
-
/** 2026-09-07, 418 D-07: queue entry identity stamped as producedBy.jobId. */
|
|
3183
2107
|
sourceJobId?: string;
|
|
3184
2108
|
screenStates?: readonly ScreenState[];
|
|
3185
|
-
resolvePromotionPosture?: ResolvePromotionPosture;
|
|
3186
|
-
/** Resolved once at construction; only neutral immutable data reaches folds and projections. */
|
|
3187
|
-
resolveTrustPriors?: () => TrustPriorTable | undefined;
|
|
3188
2109
|
onPromotionOutcome?: (report: PromotionOutcomeReport) => void;
|
|
3189
2110
|
/** Fault-injection seam; production callers must omit it. */
|
|
3190
2111
|
canaryAuthorityHooks?: CanaryAuthorityHooks;
|
|
@@ -3204,13 +2125,10 @@ interface PromotionOutcomeReport {
|
|
|
3204
2125
|
promotionPath?: PromotionPath;
|
|
3205
2126
|
promotionHoldReason?: PromotionGateHoldReason;
|
|
3206
2127
|
}
|
|
3207
|
-
/**
|
|
3208
|
-
* @deprecated `recordCanaryOutcome` is implemented. The exported class remains only so code
|
|
3209
|
-
* compiled against the pre-380 package surface does not lose its named import.
|
|
3210
|
-
*/
|
|
2128
|
+
/** @deprecated `recordCanaryOutcome` is implemented; kept so older named imports resolve. */
|
|
3211
2129
|
declare class KnowledgeStoreNotImplementedError extends Error {
|
|
3212
2130
|
readonly operation: 'recordCanaryOutcome';
|
|
3213
|
-
constructor(operation: 'recordCanaryOutcome'
|
|
2131
|
+
constructor(operation: 'recordCanaryOutcome');
|
|
3214
2132
|
}
|
|
3215
2133
|
type KnowledgePromotionErrorReason = PromotionGateHoldReason | 'propose-only' | 'not-found';
|
|
3216
2134
|
/** Typed refusal for the evidence-gated promote port; callers never receive a force path. */
|
|
@@ -3223,18 +2141,11 @@ declare class KnowledgeCommitError extends Error {
|
|
|
3223
2141
|
readonly outcome: CommitCurationOutcome;
|
|
3224
2142
|
constructor(outcome: CommitCurationOutcome);
|
|
3225
2143
|
}
|
|
3226
|
-
/** Typed WR-02 refusal for procedure drafts that require evidence this port cannot carry. */
|
|
3227
2144
|
declare class KnowledgeUnsupportedDeltaError extends Error {
|
|
3228
2145
|
readonly deltaKind: Delta['kind'];
|
|
3229
2146
|
readonly reason: 'procedure-evidence-unsupported';
|
|
3230
2147
|
constructor(deltaKind: Delta['kind']);
|
|
3231
2148
|
}
|
|
3232
|
-
/**
|
|
3233
|
-
* Realizes the agent write port over the canonical mutation path. D-08 propose-only is a
|
|
3234
|
-
* disposition profile inside commitCurationDelta, never a second mutation path. Because the port
|
|
3235
|
-
* carries bare deltas, this bridge materializes the smallest queue/checkpoint envelope and resolves
|
|
3236
|
-
* cited neighbor truth from canonical bundles before entering disposition.
|
|
3237
|
-
*/
|
|
3238
2149
|
declare function createLocalKnowledgeStore(config: CreateLocalKnowledgeStoreConfig): KnowledgePort;
|
|
3239
2150
|
|
|
3240
2151
|
type MaintenanceSkipReason = 'lease-held' | 'budget-exhausted' | 'aborted' | 'daemon-cadence';
|
|
@@ -3259,7 +2170,6 @@ type GcPassReport = {
|
|
|
3259
2170
|
} | {
|
|
3260
2171
|
kind: 'completed';
|
|
3261
2172
|
summary: GcSummary;
|
|
3262
|
-
/** WR-01: projection rows removed by the same-tail scoped cleanup; absent on zero-trim. */
|
|
3263
2173
|
projectionRowsRemoved?: number;
|
|
3264
2174
|
} | {
|
|
3265
2175
|
kind: 'failed';
|
|
@@ -3281,8 +2191,6 @@ interface MaintenanceBudget {
|
|
|
3281
2191
|
}
|
|
3282
2192
|
interface RunMaintenanceTailOptions {
|
|
3283
2193
|
knowledgeRoot: string;
|
|
3284
|
-
/** Same host-resolved data supplied to drains and review stores. */
|
|
3285
|
-
priors?: TrustPriorTable;
|
|
3286
2194
|
lease: {
|
|
3287
2195
|
leaseId: string;
|
|
3288
2196
|
epoch: number;
|
|
@@ -3313,11 +2221,10 @@ interface MaintenanceTailResult {
|
|
|
3313
2221
|
*/
|
|
3314
2222
|
declare function runMaintenanceTail(options: RunMaintenanceTailOptions): Promise<MaintenanceTailResult>;
|
|
3315
2223
|
|
|
3316
|
-
/**
|
|
2224
|
+
/** One-shot budget; a run's tail aborts an author request in flight at its end. */
|
|
3317
2225
|
declare const DRAIN_BUDGET_MS = 60000;
|
|
3318
2226
|
/** Provisional §7.4 cap over distinct search-before-create query targets. */
|
|
3319
2227
|
declare const SEARCH_BEFORE_CREATE_MAX_QUERIES = 5;
|
|
3320
|
-
/** Provisional 376 D-14 per-job breaker before a vector-deferred commit is forced. */
|
|
3321
2228
|
declare const EMBED_CRASH_VECTORLESS_THRESHOLD = 2;
|
|
3322
2229
|
type DrainFailureStage = 'lease' | 'reconcile' | 'claim' | 'heartbeat' | 'job-state' | 'search' | 'author' | 'checkpoint' | 'commit' | 'quarantine' | 'requeue' | 'release' | 'writer-pass' | 'gc';
|
|
3323
2230
|
interface DrainFailure {
|
|
@@ -3325,18 +2232,9 @@ interface DrainFailure {
|
|
|
3325
2232
|
message: string;
|
|
3326
2233
|
candidateId?: string;
|
|
3327
2234
|
}
|
|
3328
|
-
/**
|
|
3329
|
-
* A commit that decided there was nothing to apply. Legitimate reasons exist (evidence-token
|
|
3330
|
-
* dedup), so a noop is never a failure — but dropping it on the floor made live procedure
|
|
3331
|
-
* extraction die silently for 13 UAT runs (G-381-1). Visibility, never a gate.
|
|
3332
|
-
*/
|
|
3333
2235
|
interface DrainNoop {
|
|
3334
2236
|
candidateId: string;
|
|
3335
2237
|
reason: string;
|
|
3336
|
-
/**
|
|
3337
|
-
* 381-47: present only on delta-noop entries — distinguishes a defeated extraction
|
|
3338
|
-
* (`fallback-*`) from a deliberate authored Noop; benign dedup carries no cause.
|
|
3339
|
-
*/
|
|
3340
2238
|
emptyDeltaCause?: EmptyDeltaCause;
|
|
3341
2239
|
}
|
|
3342
2240
|
interface DrainPromotionOutcome {
|
|
@@ -3357,16 +2255,6 @@ interface DrainReportBase {
|
|
|
3357
2255
|
jobsProcessed: number;
|
|
3358
2256
|
committed: number;
|
|
3359
2257
|
evidenceCommitted?: number;
|
|
3360
|
-
/**
|
|
3361
|
-
* Committed deltas whose kind was `Deprecate` (388-02).
|
|
3362
|
-
*
|
|
3363
|
-
* OPTIONAL because the drain report is constructed by fault-injection fakes across four
|
|
3364
|
-
* packages and a required field would make every one of them a compile error over a number
|
|
3365
|
-
* they have no opinion about. The real drain always sets it, so a production report saying
|
|
3366
|
-
* `deprecated: 0` is a measurement rather than an absence — which is what the post-run
|
|
3367
|
-
* chain's notification (D-11) needs in order to tell a drain that deprecated nothing apart
|
|
3368
|
-
* from a drain that never ran at all.
|
|
3369
|
-
*/
|
|
3370
2258
|
deprecated?: number;
|
|
3371
2259
|
/** Optional for fault-injection fakes; the real drain always sets this measurement. */
|
|
3372
2260
|
promotions?: readonly DrainPromotionOutcome[];
|
|
@@ -3424,7 +2312,6 @@ interface DrainOperations extends MaintenanceOperations {
|
|
|
3424
2312
|
hasIndexRow(knowledgeRoot: string, bundleId: string): boolean;
|
|
3425
2313
|
applyIndexDeltaForBundle: typeof applyIndexDeltaForBundle;
|
|
3426
2314
|
deriveIndexRowFromBundle: typeof deriveIndexRowFromBundle;
|
|
3427
|
-
/** CR-02 takeover barriers for the canary branch; production omits them. */
|
|
3428
2315
|
canaryAuthorityHooks?: CanaryAuthorityHooks;
|
|
3429
2316
|
}
|
|
3430
2317
|
interface DrainOptions {
|
|
@@ -3443,16 +2330,11 @@ interface DrainOptions {
|
|
|
3443
2330
|
executionContext: ExecutionContext;
|
|
3444
2331
|
/** Host-resolved posture; daemon sessions pass worker-required capability here. */
|
|
3445
2332
|
embeddingCapability?: AcquireEmbedderOutcome;
|
|
3446
|
-
/** Built once per drain on the host; synchronous per candidate inside the gate. */
|
|
3447
|
-
resolvePromotionPosture?: ResolvePromotionPosture;
|
|
3448
|
-
/** Already-resolved host snapshot; the host retains this data across queue retries. */
|
|
3449
|
-
priors?: TrustPriorTable;
|
|
3450
2333
|
/** Default inline preserves one-shot behavior; daemon sessions skip for their own cadence. */
|
|
3451
2334
|
maintenance?: 'inline' | 'skip';
|
|
3452
2335
|
signal?: AbortSignal;
|
|
3453
2336
|
/** Synchronous durable-boundary observer; daemon hosts append these facts before proceeding. */
|
|
3454
2337
|
onJobLifecycle?: (event: CurationDrainLifecycleEvent) => void;
|
|
3455
|
-
/** D-06 test seam. Production uses the one wall clock only at drain boundaries. */
|
|
3456
2338
|
now?: () => number;
|
|
3457
2339
|
/** Fault-injection seam; production callers must omit it. */
|
|
3458
2340
|
operations?: Partial<DrainOperations>;
|
|
@@ -3519,7 +2401,6 @@ interface PurgeAffectedSet {
|
|
|
3519
2401
|
interface PurgeRecordInput {
|
|
3520
2402
|
knowledgeRoot: string;
|
|
3521
2403
|
recordId: RecordId;
|
|
3522
|
-
/** Caller-owned sovereign identity; Phase 382 supplies the confirmed user identity. */
|
|
3523
2404
|
initiator: string;
|
|
3524
2405
|
/** Runtime-counter reservation used for a fresh destruction receipt; resumes reuse intent. */
|
|
3525
2406
|
purgedAtOrdinal?: number;
|
|
@@ -3582,19 +2463,6 @@ declare function resolvePurgeAffectedSet(input: {
|
|
|
3582
2463
|
recordId: RecordId;
|
|
3583
2464
|
}): PurgeAffectedSet;
|
|
3584
2465
|
declare function purgeAffectedSetFingerprint(affectedSet: PurgeAffectedSet): string;
|
|
3585
|
-
/**
|
|
3586
|
-
* Hard-remove one confirmed-sensitive record from every recoverable local-store surface.
|
|
3587
|
-
*
|
|
3588
|
-
* Recovery invariant (CR-04): nothing irreversible ever precedes a durable intent, so a retry
|
|
3589
|
-
* either re-resolves intact state (crash before the intent) or replays the intent's persisted
|
|
3590
|
-
* identities to the identical completion receipt (crash at any later boundary).
|
|
3591
|
-
*
|
|
3592
|
-
* Revival ratification (SC-4/DCAY-05, option a): bundle ids are deterministic content addresses,
|
|
3593
|
-
* so purged-then-re-learned content re-mints the SAME record id. Receipt-exists-but-live-surfaces
|
|
3594
|
-
* therefore runs a FRESH destruction cycle publishing the next append-only versioned receipt in
|
|
3595
|
-
* the series; original audit receipts are never rewritten, and already-purged is attested only
|
|
3596
|
-
* over verified-dead surfaces (live resolution always precedes any receipt-based attestation).
|
|
3597
|
-
*/
|
|
3598
2466
|
declare function purgeRecord(input: PurgeRecordInput): PurgeRecordOutcome;
|
|
3599
2467
|
|
|
3600
2468
|
/**
|
|
@@ -3614,7 +2482,7 @@ declare function purgeRecord(input: PurgeRecordInput): PurgeRecordOutcome;
|
|
|
3614
2482
|
* fact is recorded, and the receipt widens with it.
|
|
3615
2483
|
*/
|
|
3616
2484
|
declare const FORGET_SCRUBBED_PROJECTIONS: readonly KnowledgeProjection[];
|
|
3617
|
-
/** Resolves a `MEM-` short-ID to the machine id it addresses, or `undefined
|
|
2485
|
+
/** Resolves a `MEM-` short-ID to the machine id it addresses, or `undefined`. */
|
|
3618
2486
|
type ResolveBundleShortId = (shortId: string) => string | undefined;
|
|
3619
2487
|
/** A validated mark, accept, reject or forget, in the shape the review verbs take. */
|
|
3620
2488
|
interface ReviewChangeRequest {
|
|
@@ -3626,15 +2494,6 @@ declare class MarkPlanIntegrityError extends Error {
|
|
|
3626
2494
|
constructor(recordId: string);
|
|
3627
2495
|
}
|
|
3628
2496
|
|
|
3629
|
-
/**
|
|
3630
|
-
* How long a delegating process waits for the leaseholder to finish an apply (D-18).
|
|
3631
|
-
*
|
|
3632
|
-
* PINNED, not configured, on the `LEASE_HEARTBEAT_TTL_MS` idiom. 30s is chosen as "longer than any
|
|
3633
|
-
* commit this store performs, shorter than a person's patience": a commit is a handful of file
|
|
3634
|
-
* appends plus one bundle re-projection, all local. RETUNE from an observed apply that legitimately
|
|
3635
|
-
* exceeded it — never from a flaky test, which is a symptom of a wedged holder rather than a slow
|
|
3636
|
-
* one, and the wedged holder is exactly what this bound exists to refuse rather than wait out.
|
|
3637
|
-
*/
|
|
3638
2497
|
declare const APPLY_DELEGATE_TIMEOUT_MS = 30000;
|
|
3639
2498
|
/** The typed refusal a bounded wait produces. Never a generic timeout, never a takeover. */
|
|
3640
2499
|
declare class ApplyDelegateTimeoutError extends Error {
|
|
@@ -3664,12 +2523,6 @@ interface ExplicitReviewDelegation {
|
|
|
3664
2523
|
readonly request: ExplicitReviewRequest;
|
|
3665
2524
|
readonly operationId: string;
|
|
3666
2525
|
}
|
|
3667
|
-
/**
|
|
3668
|
-
* Hand the direct request to the leaseholder and wait bounded for its answer (D-18). Injected as
|
|
3669
|
-
* an optional operation rather than built here: `knowledge-local` neither knows nor may know that a
|
|
3670
|
-
* unix socket exists. A host supplies its transport; the leaseholder's own composition supplies
|
|
3671
|
-
* nothing, which makes delegation recursion impossible by construction.
|
|
3672
|
-
*/
|
|
3673
2526
|
type ExplicitReviewDelegate = (delegation: ExplicitReviewDelegation) => Promise<ExplicitReviewResult>;
|
|
3674
2527
|
interface ApplyExplicitReviewInput {
|
|
3675
2528
|
readonly agentQaRoot: string;
|
|
@@ -3687,8 +2540,6 @@ interface ApplyExplicitReviewInput {
|
|
|
3687
2540
|
readonly resolveBundleShortId?: ResolveBundleShortId;
|
|
3688
2541
|
readonly delegate?: ExplicitReviewDelegate;
|
|
3689
2542
|
readonly writerAuthority?: WriterAuthority;
|
|
3690
|
-
readonly resolvePromotionPosture?: ResolvePromotionPosture;
|
|
3691
|
-
readonly resolveTrustPriors?: () => TrustPriorTable | undefined;
|
|
3692
2543
|
readonly now?: () => number;
|
|
3693
2544
|
readonly delegateTimeoutMs?: number;
|
|
3694
2545
|
}
|
|
@@ -3710,13 +2561,6 @@ type ExplicitReviewResult = {
|
|
|
3710
2561
|
readonly verb: KnowledgeReviewVerb;
|
|
3711
2562
|
readonly changeId: string;
|
|
3712
2563
|
};
|
|
3713
|
-
/**
|
|
3714
|
-
* Apply an explicit knowledge change in the call (432-06, D-04/D-05/D-09/D-11).
|
|
3715
|
-
*
|
|
3716
|
-
* No envelope is written, claimed or reloaded. A holder commits with its own authority, a free lease is acquired and released, and a live holder is
|
|
3717
|
-
* handed the same validated request and identity, bounded, and is never stolen from. Retrying
|
|
3718
|
-
* the same `operationId` lands nothing twice and answers the same record ids.
|
|
3719
|
-
*/
|
|
3720
2564
|
declare function applyExplicitReview(input: ApplyExplicitReviewInput): Promise<ExplicitReviewResult>;
|
|
3721
2565
|
|
|
3722
2566
|
/** The one directory name receipts live under, beneath the agent-qa runtime root. */
|
|
@@ -3827,12 +2671,6 @@ interface RollbackCampaignInput extends RollbackBaseInput {
|
|
|
3827
2671
|
originClass?: OriginClass;
|
|
3828
2672
|
}
|
|
3829
2673
|
type ResolveRollbackAffectedSetInput = RollbackCurationJobInput | RollbackCampaignInput;
|
|
3830
|
-
/**
|
|
3831
|
-
* CR-02: a rollback must never attest success at a resolution ordinal that is powerless to
|
|
3832
|
-
* change lifecycle status. At equal buildOrdinal the trust fold's fixed STATUS_PRECEDENCE keeps
|
|
3833
|
-
* active above deprecated, and an older event can never replace a newer status, so a
|
|
3834
|
-
* non-strictly-later resolvedAtOrdinal cannot causally invert a minted bundle.
|
|
3835
|
-
*/
|
|
3836
2674
|
declare class RollbackCausalityError extends Error {
|
|
3837
2675
|
readonly offendingRecordIds: RecordId[];
|
|
3838
2676
|
readonly minimumRequiredOrdinal: number;
|
|
@@ -3854,10 +2692,6 @@ declare function rollbackCurationJob(input: RollbackCurationJobInput): RollbackR
|
|
|
3854
2692
|
/** Resolve and append the inverse map for an AND-composed provenance campaign. */
|
|
3855
2693
|
declare function rollbackCampaign(input: RollbackCampaignInput): RollbackReport;
|
|
3856
2694
|
|
|
3857
|
-
/**
|
|
3858
|
-
* 378-17 canonical mutable-target order, additively extended by 379 D-03:
|
|
3859
|
-
* record, provenance, outcomes, measurements, relations, then manifest.
|
|
3860
|
-
*/
|
|
3861
2695
|
declare const MUTABLE_BUNDLE_TARGETS: readonly ["record.md", "provenance.json", "evidence/outcomes.jsonl", "evidence/measurements.json", "evidence/gates.jsonl", "relations.json", "manifest.json"];
|
|
3862
2696
|
|
|
3863
2697
|
type MarkTriage = {
|
|
@@ -3969,15 +2803,9 @@ type MaterializeOutcome = {
|
|
|
3969
2803
|
relPath: string;
|
|
3970
2804
|
sectionBytes: number;
|
|
3971
2805
|
};
|
|
3972
|
-
/**
|
|
3973
|
-
* The authored shelf is append-only under the caller's writer lease. An existing section ID
|
|
3974
|
-
* always wins, including when its human-edited body differs. Never rewrite that body.
|
|
3975
|
-
* commitArtifacts governs binary bundle artifacts, not policy text or git commits.
|
|
3976
|
-
* The authored text is written as given; no detector scans it (Phase 441, D-15).
|
|
3977
|
-
*/
|
|
3978
2806
|
declare function materializePolicy(input: MaterializePolicyInput): MaterializeOutcome;
|
|
3979
2807
|
|
|
3980
2808
|
type LocalKnowledgeStore = KnowledgePort;
|
|
3981
2809
|
type LocalKnowledgeReader = KnowledgeHintReader;
|
|
3982
2810
|
|
|
3983
|
-
export { ADDRESSING_LEDGER_BUSY_TIMEOUT_MS, ADDRESSING_LEDGER_DB_FILE, ADDRESSING_LEDGER_USER_VERSION, APPLY_DELEGATE_TIMEOUT_MS, ARTIFACT_RUN_CAP_BYTES, ARTIFACT_STEP_CAP_BYTES, AUTHORED_CHECKPOINT_SCHEMA_VERSION, type AcquireEmbedderOptions, type AcquireEmbedderOutcome, type AcquireWriterLeaseOptions, type AcquireWriterLeaseOutcome, type AddressingLedger, AddressingLedgerSchemaVersionError, type AppendMarkEvidenceInput, AppendMarkEvidenceOutcome, type AppendOutcome, ApplyDelegateTimeoutError, ApplyDelegateUnavailableError, type ApplyExplicitReviewInput, type ApplyFeedbackInput, type ApplyIndexDeltaForBundleInput, type ApplyRunOutcomesResult, type ArtifactCopyInput, type ArtifactCopyResult, type AuthorOutcome, type AuthoredCheckpoint, type AuthoredDeltaCheckpoint, BLAST_RADIUS_MAX_SUPERSEDES_PER_ANCHOR_PER_DRAIN, type BuildCurationCandidateAddressFieldsInput, type BundleProvenanceInput, type BundleStoreConfig, CHANNEL_1_SERVING_LEG, CHANNEL_3_CAUTION_LEG, CITED_ID_INTEGRITY_CONDITIONS, CLAIMED_SUBDIR, COMMIT_INTENT_SCHEMA_VERSION, CURATION_JOB_STATE_SCHEMA_VERSION, CURATION_QUEUE_SCHEMA_VERSION, type CanonicalBundleStateDigests, type CitedIdIntegrityCondition, type ClaimNextJobOptions, type ClaimNextJobOutcome, type ClaimedCurationJob, type CommitCurationDependencies, type CommitCurationJob, type CommitCurationOutcome, type CopiedArtifact, CorruptEpochStateError, type CorruptEpochStateReason, type CountRemainingCurationWorkOptions, type CreateLocalKnowledgeStoreConfig, type CurationArtifactDescriptor, type CurationArtifactRole, type CurationCandidateAddressFields, type CurationCandidateArtifact, type CurationCandidatePayload, type CurationCandidateProjection, type CurationDrainLifecycleEvent, type CurationEnqueueRefusalReason, type CurationJobLifecycle, type CurationJobState, type CurationJobView, type CurationProjectionArtifactSource, type CurationQuarantineReason, type CurationRemainingWork, type CuratorAuthor, type CurrentWriterAuthority, type CurrentWriterAuthorityHooks, DRAFT_RECEIPTS_DIR_NAME, DRAIN_BUDGET_MS, type DeferReason, type DiscoverEmbedderWorkerOptions, type DisposeDeltaInput, type DispositionCandidateContext, type DispositionDrainState, type DispositionOutcome, type DispositionProfile, DraftReceiptDigestError, DraftReceiptSchemaVersionError, type DraftReceiptsStore, type DraftReceiptsStoreOptions, type DrainFailure, type DrainFailureStage, type DrainNoop, type DrainOptions, type DrainPromotionOutcome, type DrainReport, type DrainableCurationWork, EMBED_CRASH_VECTORLESS_THRESHOLD, ENTITY_INDEX_DB_FILE, ENTITY_INDEX_SWEEP_INTERVAL_MS, ENTITY_INDEX_USER_VERSION, EPOCH_FILE, type EmbedCacheLeg, type EmbedCacheLookup, type EmbedCacheMode, type EmbedCachePut, type EmbedCacheWrapperOptions, type EmbedderAxis, EmbedderPort, type EmbedderProbes, type EmbedderRung, EmbedderWorkerIncarnationVerdict, type EmbedderWorkerPolicy, EmbedderWorkerRegistration, type EmptyDeltaCause, type EnqueueCurationCandidateProjectionOptions, type EnqueueCurationCandidateProjectionOutcome, type EntityAddress, type EntityIndexHandle, EntityIndexSchemaVersionError, type EntityIndexSweepReport, type EntitySighting, type EntitySightingSource, type ExplicitReviewDelegate, type ExplicitReviewDelegation, type ExplicitReviewRequest, type ExplicitReviewResult, type ExtractStepAnchors, FORGET_SCRUBBED_PROJECTIONS, type FailureRecurrence, type FingerprintRecurrence, type FingerprintWindowIdentity, type FingerprintWindowRow, type FixSelection, FloorAssetLoadError, type FloorAssetLoadErrorCode, type FloorAssetLoadOptions, type FloorAssets, FloorEmbeddingError, type FloorEmbeddingErrorCode, type FloorProseInput, type FoldRunOutcomesOptions, type FoldRunOutcomesReport, type FoldSuiteFingerprintsOptions, GC_SUPERSEDED_RETAIN_K, type GateHorizon, type GcPassReport, type GcSummary, type HeartbeatLeaseOutcome, type IndexAxis, IndexFace, IndexReaderConnection, type InspectDrainableCurationWorkOptions, JOBS_SUBDIR, KnowledgeCommitError, KnowledgePromotionError, type KnowledgePromotionErrorReason, KnowledgeReader, KnowledgeStoreNotImplementedError, KnowledgeUnsupportedDeltaError, LAST_OUTCOMES_LIMIT, LEASE_FILE, LEASE_GUARD_DIR, LEASE_HEARTBEAT_TTL_MS, type LeaseOperationOptions, LoadedBundle, type LocalKnowledgeReader, type LocalKnowledgeStore, MEASUREMENTS_REL_PATH, MODEL_CACHE_DIR_ENV_VAR, MUTABLE_BUNDLE_TARGETS, MUTATION_LOCK_BUSY_TIMEOUT_MS, MUTATION_LOCK_TAKEOVER_MS, type MaintenanceBudget, type MaintenanceOperations, type MaintenanceSkipReason, type MaintenanceTailFailure, type MaintenanceTailResult, type MalformedClaimedCurationJob, MarkPlanIntegrityError, type MarkTriage, type MaterializeOutcome, type MaterializePolicyInput, type MigrationOutcome, NativeEmbeddingDimensionError, NativeEmbeddingModuleLoadError, type NeighborRecord, type OpenAddressingLedgerOptions, type OpenEntityIndexOptions, PAYLOAD_BENEFITS, PAYLOAD_STATE_VALIDITIES, PURGE_RECEIPT_SCHEMA_VERSION, type PersistAuthoredCheckpointOptions, type PersistAuthoredCheckpointOutcome, PolicyTextRefusedError, type ProcedureDispositionEvidence, type ProjectRunOutcomesOptions, type PromotionOutcomeReport, type PublishBundleInput, type PublishBundleOutcome, type PurgeAffectedSet, PurgeChronologyRequiredError, PurgeCompletionVerificationError, PurgeQueueIdentityError, type PurgeReceipt, PurgeReceiptSchema, type PurgeRecordInput, type PurgeRecordOutcome, PurgeTargetChangedError, PurgeTargetIntegrityError, QUARANTINE_MANUAL_ENTRY_CLASS, QUARANTINE_MANUAL_ENTRY_FINGERPRINT, QUARANTINE_WINDOW_ORDINALS, QUEUED_SUBDIR, QUEUE_DIR, QUEUE_MAX_EMITS_PER_RUN, QUEUE_MAX_JOBS_PER_SCOPE, QuarantineAppendOutcome, type QuarantineClaimedOptions, type QuarantineDetectionOptions, QuarantineDetectionSighting, type QuarantineFoldOutcome, QuarantineIdentityRefusedError, type QuarantineOperationsOptions, type QueuedCanaryPayloadRead, RESOLVER_CANDIDATE_K, RESOLVER_FUSED_SCORE_NORMALIZER, RESOLVER_LEG_WEIGHT_DENSE, RESOLVER_LEG_WEIGHT_LEXICAL, RESOLVER_LEXICAL_MIN_BM25, RESOLVER_STRONG_HIT_MARGIN, RESOLVER_STRONG_HIT_MIN_SCORE, RUN_OUTCOMES_PROJECTION_VERSION, type ReadCurationCandidatePayloadOutcome, type ReadCurationEffectsOptions, type ReadJobStateOutcome, type ReadWriterLeaseOutcome, type RebuildIndexHooks, type RebuildIndexOptions, type RebuildMutationFamily, type RebuildReport, RebuildRequest, type RebuildRunOutcomesOptions, type RebuildRunOutcomesReport, type ReconcileRunOutcomesProjectionOptions, type ReconcileRunOutcomesProjectionResult, RefusedQuarantineLine, type RelationIntent, type ReleaseLeaseOutcome, type RenderBundlePartsInput, type RenderedBundlePart, type RequeueClaimedOptions, type ResolveBundleShortId, type ResolveEmbedderCapabilityOptions, type ResolveEntityRefDeps, type ResolveRetrievalRungOptions, type ResolveRollbackAffectedSetInput, type RetrievalQuery, type RetrievalQueryInput, type RetrieveOptions, type RetrieveResult, type ReviewChangeRequest, ReviewTargetVanishedError, type RollbackAffectedSet, type RollbackCampaignInput, RollbackCausalityError, type RollbackCounterEvent, type RollbackCurationJobInput, type RollbackKind, RollbackPlanChangedError, type RollbackPlannedEffect, type RollbackReport, type RunKnowledgeGcHooks, type RunKnowledgeGcInput, type RunMaintenanceTailOptions, type RunOutcomeFailureKey, type RunOutcomeTestDelta, type RunOutcomesProjection, SEARCH_BEFORE_CREATE_MAX_QUERIES, SERVING_TRACE_LEGS, SUITE_FINGERPRINTS_TABLE, type ServedRecordFacts, type SetActiveEmbeddingProfileOptions, type SkippedArtifact, type SuiteFingerprintIndex, type SuiteFingerprintIndexOptions, type SuiteFingerprintTestDelta, type SuiteFingerprintsProjection, type TargetRename, type TestOutcomeEntry, type TestOutcomeHistory, type TestOutcomeIdentity, type UnreclaimableMutationLockOwner, UserDeltaCitationIntegrityError, VecCapability, WRITER_AUTHORITY_DB_FILE, type WorkerDiscoveryResult, type WriteJobStateOptions, WriterAuthorityLostError, type WriterAuthorityLostReason, type WriterLease, type WriterLeaseAuthority, type WriterLeaseFreshness, type WriterPassReport, acquireEmbedder, acquireWriterLease, appendGateReceipt, appendMarkEvidence, appendMeasurementObservation, appendOutcomeEvent, appendPromotionReceipt, appendRelation, applyExplicitReview, applyFeedback, applyIndexDeltaForBundle, applyRunOutcomes, applySuiteFingerprints, assertionDrift, authoredCheckpointSchema, buildCurationCandidateAddressFields, buildRetrievalQuery, candidateContentAddress, claimNextJob, claimedCandidateDir, claimedLeaseDir, claimedRoot, commitCurationDelta, copyArtifacts, countPendingCurationJobs, countRemainingCurationWork, createDraftReceiptsStore, createFloorEmbedder, createLocalKnowledgeStore, createMemorySightingSource, createNativeEmbedder, createQuarantineOperations, createSuiteFingerprintIndex, curationArtifactDescriptorSchema, curationArtifactRoleSchema, curationCandidatePayloadSchema, curationCandidateProjectionSchema, curationJobStateSchema, deriveIndexRowFromBundle, deriveWriterLeaseFreshness, describeAllEntities, discoverEmbedderWorker, disposeDelta, draftReceiptsDir, drainQueue, dropEmbedCacheForModel, embedPendingEntities, enqueueCurationCandidate, enqueueCurationCandidateProjection, ensureEmbedCacheTable, entityIndexDbPath, failureRecurrence, fingerprintRecurrence, floorProse, foldCurationSnapshot, foldRetrievalRung, foldRunOutcomes, foldSuiteFingerprints, getCachedEmbedding, getEntityDescriptor, guardPurgeReceipt, heartbeatLease, inspectDrainableCurationWork, isLeaseStale, jobStatePath, jobsRoot, listClaimedLeases, listQueuedCandidates, listTestsInFile, loadFloorAssets, materializePolicy, openAddressingLedger, openEntityIndex, parseAuthoredCheckpoint, persistAuthoredCheckpoint, policySectionMarkers, policyShelfPath, priorBuildOutcome, procedureReadOn, projectRunOutcomes, publishBundle as publishBundleForTest, purgeAffectedSetFingerprint, purgeReceiptSchema, purgeRecord, putCachedEmbedding, quarantineClaimed, queueRoot, queueStagingRoot, queuedCandidateDir, queuedRoot, readCanonicalBundleStateDigests, readCurationCandidatePayload, readCurationEffects, readFingerprintWindow, readJobState, readLatestBuildOrdinal, readQueuedCanaryPayload, readRebuildRequest, readTestOutcomeHistory, readWriterLease, rebuildEntityIndex, rebuildIndex, rebuildRunOutcomes, reconcileRunOutcomesProjection, refreshEntity, refreshWriterLeaseAuthority, releaseLease, renderBundleParts, requeueClaimed, resetEmbedderCapability, resolveDispositionProfile, resolveEmbedderCapability, resolveEntityRef, resolveModelCacheDir, resolveProcessIncarnation, resolvePurgeAffectedSet, resolveRetrievalRung, resolveRollbackAffectedSet, retrieve, rollbackAffectedSetFingerprint, rollbackCampaign, rollbackCurationJob, rollbackReceiptId, runKnowledgeGc, runMaintenanceTail, selectFixKind, servedIdsOn, setActiveEmbeddingProfile, sightEntity, sliceAuthoredCheckpoint, suiteFingerprintDeltas, sweepEntityIndex, triageMark, verifyEmbedderWorkerIncarnation, widenAuthoredDeltaCheckpoint, withCurrentWriterAuthority, wrapEmbedderWithCache, writeJobState, writeMeasurementBaseline };
|
|
2811
|
+
export { ADDRESSING_LEDGER_BUSY_TIMEOUT_MS, ADDRESSING_LEDGER_DB_FILE, ADDRESSING_LEDGER_USER_VERSION, APPLY_DELEGATE_TIMEOUT_MS, ARTIFACT_RUN_CAP_BYTES, ARTIFACT_STEP_CAP_BYTES, AUTHORED_CHECKPOINT_SCHEMA_VERSION, type AcquireEmbedderOptions, type AcquireEmbedderOutcome, type AcquireWriterLeaseOptions, type AcquireWriterLeaseOutcome, type AddressingLedger, AddressingLedgerSchemaVersionError, type AppendMarkEvidenceInput, AppendMarkEvidenceOutcome, type AppendOutcome, ApplyDelegateTimeoutError, ApplyDelegateUnavailableError, type ApplyExplicitReviewInput, type ApplyFeedbackInput, type ApplyIndexDeltaForBundleInput, type ApplyRunOutcomesResult, type ArtifactCopyInput, type ArtifactCopyResult, type AuthorOutcome, type AuthoredCheckpoint, type AuthoredDeltaCheckpoint, BLAST_RADIUS_MAX_SUPERSEDES_PER_ANCHOR_PER_DRAIN, type BuildCurationCandidateAddressFieldsInput, type BundleProvenanceInput, type BundleStoreConfig, CHANNEL_1_SERVING_LEG, CHANNEL_3_CAUTION_LEG, CITED_ID_INTEGRITY_CONDITIONS, CLAIMED_SUBDIR, COMMIT_INTENT_SCHEMA_VERSION, CURATION_JOB_STATE_SCHEMA_VERSION, CURATION_QUEUE_SCHEMA_VERSION, type CitedIdIntegrityCondition, type ClaimNextJobOptions, type ClaimNextJobOutcome, type ClaimedCurationJob, type CommitCurationDependencies, type CommitCurationJob, type CommitCurationOutcome, type CopiedArtifact, CorruptEpochStateError, type CorruptEpochStateReason, type CountRemainingCurationWorkOptions, type CreateLocalKnowledgeStoreConfig, type CurationArtifactDescriptor, type CurationArtifactRole, type CurationCandidateAddressFields, type CurationCandidateArtifact, type CurationCandidatePayload, type CurationCandidateProjection, type CurationDrainLifecycleEvent, type CurationEnqueueRefusalReason, type CurationJobLifecycle, type CurationJobState, type CurationJobView, type CurationProjectionArtifactSource, type CurationQuarantineReason, type CurationRemainingWork, type CuratorAuthor, type CurrentWriterAuthority, type CurrentWriterAuthorityHooks, DRAFT_RECEIPTS_DIR_NAME, DRAIN_BUDGET_MS, type DeferReason, type DiscoverEmbedderWorkerOptions, type DisposeDeltaInput, type DispositionCandidateContext, type DispositionDrainState, type DispositionOutcome, type DispositionProfile, DraftReceiptDigestError, DraftReceiptSchemaVersionError, type DraftReceiptsStore, type DraftReceiptsStoreOptions, type DrainFailure, type DrainFailureStage, type DrainNoop, type DrainOptions, type DrainPromotionOutcome, type DrainReport, type DrainableCurationWork, EMBED_CRASH_VECTORLESS_THRESHOLD, ENTITY_INDEX_DB_FILE, ENTITY_INDEX_SWEEP_INTERVAL_MS, ENTITY_INDEX_USER_VERSION, EPOCH_FILE, type EmbedCacheLeg, type EmbedCacheLookup, type EmbedCacheMode, type EmbedCachePut, type EmbedCacheWrapperOptions, type EmbedderAxis, EmbedderPort, type EmbedderProbes, type EmbedderRung, EmbedderWorkerIncarnationVerdict, type EmbedderWorkerPolicy, EmbedderWorkerRegistration, type EmptyDeltaCause, type EnqueueCurationCandidateProjectionOptions, type EnqueueCurationCandidateProjectionOutcome, type EntityAddress, type EntityIndexHandle, EntityIndexSchemaVersionError, type EntityIndexSweepReport, type EntitySighting, type EntitySightingSource, type ExplicitReviewDelegate, type ExplicitReviewDelegation, type ExplicitReviewRequest, type ExplicitReviewResult, type ExtractStepAnchors, FORGET_SCRUBBED_PROJECTIONS, type FailureRecurrence, type FingerprintRecurrence, type FingerprintWindowIdentity, type FingerprintWindowRow, type FixSelection, FloorAssetLoadError, type FloorAssetLoadErrorCode, type FloorAssetLoadOptions, type FloorAssets, FloorEmbeddingError, type FloorEmbeddingErrorCode, type FloorProseInput, type FoldRunOutcomesOptions, type FoldRunOutcomesReport, type FoldSuiteFingerprintsOptions, GC_SUPERSEDED_RETAIN_K, type GateHorizon, type GcPassReport, type GcSummary, type HeartbeatLeaseOutcome, type IndexAxis, IndexFace, IndexReaderConnection, type InspectDrainableCurationWorkOptions, JOBS_SUBDIR, KnowledgeCommitError, KnowledgePromotionError, type KnowledgePromotionErrorReason, KnowledgeReader, KnowledgeStoreNotImplementedError, KnowledgeUnsupportedDeltaError, LAST_OUTCOMES_LIMIT, LEASE_FILE, LEASE_GUARD_DIR, LEASE_HEARTBEAT_TTL_MS, type LeaseOperationOptions, LoadedBundle, type LocalKnowledgeReader, type LocalKnowledgeStore, MEASUREMENTS_REL_PATH, MODEL_CACHE_DIR_ENV_VAR, MUTABLE_BUNDLE_TARGETS, MUTATION_LOCK_BUSY_TIMEOUT_MS, MUTATION_LOCK_TAKEOVER_MS, type MaintenanceBudget, type MaintenanceOperations, type MaintenanceSkipReason, type MaintenanceTailFailure, type MaintenanceTailResult, type MalformedClaimedCurationJob, MarkPlanIntegrityError, type MarkTriage, type MaterializeOutcome, type MaterializePolicyInput, type MigrationOutcome, NativeEmbeddingDimensionError, NativeEmbeddingModuleLoadError, type NeighborRecord, type OpenAddressingLedgerOptions, type OpenEntityIndexOptions, PAYLOAD_BENEFITS, PURGE_RECEIPT_SCHEMA_VERSION, type PersistAuthoredCheckpointOptions, type PersistAuthoredCheckpointOutcome, PolicyTextRefusedError, type ProcedureDispositionEvidence, type ProjectRunOutcomesOptions, type PromotionOutcomeReport, type PublishBundleInput, type PublishBundleOutcome, type PurgeAffectedSet, PurgeChronologyRequiredError, PurgeCompletionVerificationError, PurgeQueueIdentityError, type PurgeReceipt, PurgeReceiptSchema, type PurgeRecordInput, type PurgeRecordOutcome, PurgeTargetChangedError, PurgeTargetIntegrityError, QUARANTINE_MANUAL_ENTRY_CLASS, QUARANTINE_MANUAL_ENTRY_FINGERPRINT, QUARANTINE_WINDOW_ORDINALS, QUEUED_SUBDIR, QUEUE_DIR, QUEUE_MAX_EMITS_PER_RUN, QUEUE_MAX_JOBS_PER_SCOPE, QuarantineAppendOutcome, type QuarantineClaimedOptions, type QuarantineDetectionOptions, QuarantineDetectionSighting, type QuarantineFoldOutcome, QuarantineIdentityRefusedError, type QuarantineOperationsOptions, type QueuedCanaryPayloadRead, RESOLVER_CANDIDATE_K, RESOLVER_FUSED_SCORE_NORMALIZER, RESOLVER_LEG_WEIGHT_DENSE, RESOLVER_LEG_WEIGHT_LEXICAL, RESOLVER_LEXICAL_MIN_BM25, RESOLVER_STRONG_HIT_MARGIN, RESOLVER_STRONG_HIT_MIN_SCORE, RUN_OUTCOMES_PROJECTION_VERSION, type ReadCurationCandidatePayloadOutcome, type ReadCurationEffectsOptions, type ReadJobStateOutcome, type ReadWriterLeaseOutcome, type RebuildIndexHooks, type RebuildIndexOptions, type RebuildMutationFamily, type RebuildReport, RebuildRequest, type RebuildRunOutcomesOptions, type RebuildRunOutcomesReport, type ReconcileRunOutcomesProjectionOptions, type ReconcileRunOutcomesProjectionResult, RefusedQuarantineLine, type RelationIntent, type ReleaseLeaseOutcome, type RenderBundlePartsInput, type RenderedBundlePart, type RequeueClaimedOptions, type ResolveBundleShortId, type ResolveEmbedderCapabilityOptions, type ResolveEntityRefDeps, type ResolveRetrievalRungOptions, type ResolveRollbackAffectedSetInput, type RetrievalQuery, type RetrievalQueryInput, type RetrieveOptions, type RetrieveResult, type ReviewChangeRequest, ReviewTargetVanishedError, type RollbackAffectedSet, type RollbackCampaignInput, RollbackCausalityError, type RollbackCounterEvent, type RollbackCurationJobInput, type RollbackKind, RollbackPlanChangedError, type RollbackPlannedEffect, type RollbackReport, type RunKnowledgeGcHooks, type RunKnowledgeGcInput, type RunMaintenanceTailOptions, type RunOutcomeFailureKey, type RunOutcomeTestDelta, type RunOutcomesProjection, SEARCH_BEFORE_CREATE_MAX_QUERIES, SERVING_TRACE_LEGS, SUITE_FINGERPRINTS_TABLE, type ServedRecordFacts, type SetActiveEmbeddingProfileOptions, type SkippedArtifact, type SuiteFingerprintIndex, type SuiteFingerprintIndexOptions, type SuiteFingerprintTestDelta, type SuiteFingerprintsProjection, type TargetRename, type TestOutcomeEntry, type TestOutcomeHistory, type TestOutcomeIdentity, type UnreclaimableMutationLockOwner, UserDeltaCitationIntegrityError, VecCapability, WRITER_AUTHORITY_DB_FILE, type WorkerDiscoveryResult, type WriteJobStateOptions, WriterAuthorityLostError, type WriterAuthorityLostReason, type WriterLease, type WriterLeaseAuthority, type WriterLeaseFreshness, type WriterPassReport, acquireEmbedder, acquireWriterLease, appendGateReceipt, appendMarkEvidence, appendMeasurementObservation, appendOutcomeEvent, appendPromotionReceipt, appendRelation, applyExplicitReview, applyFeedback, applyIndexDeltaForBundle, applyRunOutcomes, applySuiteFingerprints, assertionDrift, authoredCheckpointSchema, buildCurationCandidateAddressFields, buildRetrievalQuery, candidateContentAddress, claimNextJob, claimedCandidateDir, claimedLeaseDir, claimedRoot, commitCurationDelta, copyArtifacts, countPendingCurationJobs, countRemainingCurationWork, createDraftReceiptsStore, createFloorEmbedder, createLocalKnowledgeStore, createMemorySightingSource, createNativeEmbedder, createQuarantineOperations, createSuiteFingerprintIndex, curationArtifactDescriptorSchema, curationArtifactRoleSchema, curationCandidatePayloadSchema, curationCandidateProjectionSchema, curationJobStateSchema, deriveIndexRowFromBundle, deriveWriterLeaseFreshness, describeAllEntities, discoverEmbedderWorker, disposeDelta, draftReceiptsDir, drainQueue, dropEmbedCacheForModel, embedPendingEntities, enqueueCurationCandidate, enqueueCurationCandidateProjection, ensureEmbedCacheTable, entityIndexDbPath, failureRecurrence, fingerprintRecurrence, floorProse, foldCurationSnapshot, foldRetrievalRung, foldRunOutcomes, foldSuiteFingerprints, getCachedEmbedding, getEntityDescriptor, guardPurgeReceipt, heartbeatLease, inspectDrainableCurationWork, isLeaseStale, jobStatePath, jobsRoot, listClaimedLeases, listQueuedCandidates, listTestsInFile, loadFloorAssets, materializePolicy, openAddressingLedger, openEntityIndex, parseAuthoredCheckpoint, persistAuthoredCheckpoint, policySectionMarkers, policyShelfPath, priorBuildOutcome, procedureReadOn, projectRunOutcomes, publishBundle as publishBundleForTest, purgeAffectedSetFingerprint, purgeReceiptSchema, purgeRecord, putCachedEmbedding, quarantineClaimed, queueRoot, queueStagingRoot, queuedCandidateDir, queuedRoot, readCurationCandidatePayload, readCurationEffects, readFingerprintWindow, readJobState, readLatestBuildOrdinal, readQueuedCanaryPayload, readRebuildRequest, readTestOutcomeHistory, readWriterLease, rebuildEntityIndex, rebuildIndex, rebuildRunOutcomes, reconcileRunOutcomesProjection, refreshEntity, refreshWriterLeaseAuthority, releaseLease, renderBundleParts, requeueClaimed, resetEmbedderCapability, resolveDispositionProfile, resolveEmbedderCapability, resolveEntityRef, resolveModelCacheDir, resolveProcessIncarnation, resolvePurgeAffectedSet, resolveRetrievalRung, resolveRollbackAffectedSet, retrieve, rollbackAffectedSetFingerprint, rollbackCampaign, rollbackCurationJob, rollbackReceiptId, runKnowledgeGc, runMaintenanceTail, selectFixKind, servedIdsOn, setActiveEmbeddingProfile, sightEntity, sliceAuthoredCheckpoint, suiteFingerprintDeltas, sweepEntityIndex, triageMark, verifyEmbedderWorkerIncarnation, widenAuthoredDeltaCheckpoint, withCurrentWriterAuthority, wrapEmbedderWithCache, writeJobState, writeMeasurementBaseline };
|