@vostride/agent-qa-knowledge-local 0.0.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +105 -0
- package/NOTICE.md +15 -0
- package/assets/potion-retrieval-32m/LICENSE +29 -0
- package/assets/potion-retrieval-32m/golden-vectors.json +4144 -0
- package/assets/potion-retrieval-32m/manifest.json +37 -0
- package/assets/potion-retrieval-32m/potion-retrieval-32m.i8bin +0 -0
- package/assets/potion-retrieval-32m/tokenizer.json +63241 -0
- package/dist/embedder-worker/worker-entry.cjs +1424 -0
- package/dist/embedder-worker/worker-entry.cjs.map +1 -0
- package/dist/embedder-worker/worker-entry.d.cts +18 -0
- package/dist/embedder-worker/worker-entry.d.ts +18 -0
- package/dist/embedder-worker/worker-entry.js +1426 -0
- package/dist/embedder-worker/worker-entry.js.map +1 -0
- package/dist/index.cjs +21491 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3983 -0
- package/dist/index.d.ts +3983 -0
- package/dist/index.js +21612 -0
- package/dist/index.js.map +1 -0
- package/dist/mark-evidence-plan-BCkYN07i.d.cts +1014 -0
- package/dist/mark-evidence-plan-BCkYN07i.d.ts +1014 -0
- package/dist/reader.cjs +5829 -0
- package/dist/reader.cjs.map +1 -0
- package/dist/reader.d.cts +107 -0
- package/dist/reader.d.ts +107 -0
- package/dist/reader.js +5951 -0
- package/dist/reader.js.map +1 -0
- package/dist/worker-registration-C-9spEsf.d.cts +78 -0
- package/dist/worker-registration-C-9spEsf.d.ts +78 -0
- package/package.json +69 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export { e as AUTHORING_BRIEF_DEFAULT_BUDGET, f as AUTHORING_DENSE_K, p as AuthoringReaderDependencies, s as CanaryPostureFacts, v as DiffSinceOptions, b0 as HydratedEntry, b1 as IndexRow, J as InspectRecordsOptions, O as KnowledgeMaintenanceScanError, P as KnowledgeMaintenanceScanIssue, S as KnowledgeRecordNotFoundError, W as LowerTrustShare, X as MARK_EVIDENCE_TOKEN_PREFIX, Y as MarkEvidenceEffect, Z as MarkEvidencePlan, _ as MarkEvidenceTarget, a1 as OpenServingKnowledgeReaderConfig, a2 as PlanMarkEvidenceInput, a4 as QUARANTINE_CLASS_DISPOSITIONS, b2 as QUARANTINE_FLOOR_ELIGIBILITY, a8 as QUARANTINE_LEDGER_FILENAME, ac as QuarantineDisposition, b3 as QuarantineFloorEligibility, ad as QuarantineLedgerRead, R as RefusedQuarantineLine, an as ShowRecordOptions, ao as StandingReceiptDigest, ar as canaryPostureFactsFor, au as createAuthoringReader, aw as diffSince, aA as foldQuarantineLedgerState, b4 as hydrateRows, aC as inspectRecords, aF as lowerTrustSharesFor, aG as markEvidenceEvent, aJ as openKnowledgeReader, aK as planMarkEvidence, aM as projectMarkEvidenceOutcome, aN as quarantineLedgerPath, b5 as readIndexRows, aR as readQuarantineLedger, aX as showRecord, aY as standingReceiptDigestsFor } from './mark-evidence-plan-BCkYN07i.cjs';
|
|
2
|
+
import { CanaryOutcome, TrustPriorTable, KnowledgeBundleSummary, KnowledgeRecordShowResult, ResolvePromotionPosture, KnowledgeGatesListResult, KnowledgeCandidateInjectionResult } from '@vostride/agent-qa-schema';
|
|
3
|
+
export { BuildRange, ReadOptions, SearchOptions } from '@vostride/agent-qa-schema';
|
|
4
|
+
import '@vostride/agent-qa-agent';
|
|
5
|
+
import '@vostride/agent-qa-runner';
|
|
6
|
+
import 'node:sqlite';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* D-22: bind one canary observation to the served candidate and attributed step. The schema
|
|
10
|
+
* evidence-token recipe adds the exercised anchor and build ordinal; together those fields are
|
|
11
|
+
* the complete replay identity required by §7.5.1.
|
|
12
|
+
*/
|
|
13
|
+
declare function canaryOutcomeObservationId(outcome: Pick<CanaryOutcome, 'candidateId' | 'runId' | 'testId' | 'testIndex' | 'stepIndex'>): string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* List every committed bundle under a knowledge root, newest lifecycle state first-class.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately UNFILTERED by serving lifecycle: unlike `scanBundles`, a listing is a review
|
|
19
|
+
* surface, and a superseded or withdrawn record is exactly what a reviewer needs to see. The
|
|
20
|
+
* serving firewall (`isServable`) belongs on retrieval paths, not on a catalog.
|
|
21
|
+
*
|
|
22
|
+
* A bundle whose canonical files do not strictly parse is SKIPPED rather than thrown on, so
|
|
23
|
+
* one damaged bundle never hides every other bundle from the listing. A missing knowledge
|
|
24
|
+
* root is an ordinary empty result — `enumerateBundleDirs` already treats an unreadable
|
|
25
|
+
* directory as empty.
|
|
26
|
+
*
|
|
27
|
+
* Order is total and stable: product, then bundle directory name (which is the record id).
|
|
28
|
+
* `enumerateBundleDirs` already sorts on exactly those two keys.
|
|
29
|
+
*/
|
|
30
|
+
declare function listBundles(knowledgeRoot: string, priors?: TrustPriorTable): KnowledgeBundleSummary[];
|
|
31
|
+
|
|
32
|
+
interface ShowRecordsOptions {
|
|
33
|
+
knowledgeRoot: string;
|
|
34
|
+
recordIds: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve exact identities in first-request order with one maintenance enumeration.
|
|
38
|
+
* Missing records are data; incomplete scans retain KnowledgeMaintenanceScanError so
|
|
39
|
+
* callers can report scanIncomplete instead of presenting a partial set as clean misses.
|
|
40
|
+
* Like the single-record read, this bypasses serving filters and never opens an index.
|
|
41
|
+
*/
|
|
42
|
+
declare function showRecords(options: ShowRecordsOptions): readonly KnowledgeRecordShowResult[];
|
|
43
|
+
|
|
44
|
+
/** The four observation words. A lifecycle event carrying the same id attributes nothing. */
|
|
45
|
+
declare const ATTRIBUTING_EVENT_TYPES: readonly ["confirmed", "contradicted", "helpful", "harmful"];
|
|
46
|
+
type CanaryAttributionOutcome = (typeof ATTRIBUTING_EVENT_TYPES)[number];
|
|
47
|
+
/** One served canary line, addressed the way the run recorded it. */
|
|
48
|
+
interface CanaryAttributionTuple {
|
|
49
|
+
candidateId: string;
|
|
50
|
+
testId: string;
|
|
51
|
+
testIndex: number;
|
|
52
|
+
stepIndex: number;
|
|
53
|
+
}
|
|
54
|
+
interface CanaryAttributionRow {
|
|
55
|
+
candidateId: string;
|
|
56
|
+
testIndex: number;
|
|
57
|
+
stepIndex: number;
|
|
58
|
+
observationId: string;
|
|
59
|
+
outcome?: CanaryAttributionOutcome;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The attribution answer, with the partiality of the walk that produced it.
|
|
63
|
+
*
|
|
64
|
+
* `skippedBundles > 0` means the answer is PARTIAL — some bundle in the store failed
|
|
65
|
+
* `loadMaintenanceBundle` (load or integrity) and was skipped. A caller that renders
|
|
66
|
+
* `not attributed` from an absent `outcome` must consult this first: on a partial walk the
|
|
67
|
+
* absence means "not found in the part of the store I could read", which is not the same claim
|
|
68
|
+
* (REVIEW WR-03; the T-407-11 hazard class is the integrity arm).
|
|
69
|
+
*/
|
|
70
|
+
interface CanaryAttributionsResult {
|
|
71
|
+
rows: CanaryAttributionRow[];
|
|
72
|
+
skippedBundles: number;
|
|
73
|
+
}
|
|
74
|
+
interface CanaryAttributionsForOptions {
|
|
75
|
+
knowledgeRoot: string;
|
|
76
|
+
runId: string;
|
|
77
|
+
tuples: readonly CanaryAttributionTuple[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Answer, per served canary tuple, the observation id it would have been attributed under and the
|
|
81
|
+
* committed outcome carrying that id — when one survives.
|
|
82
|
+
*
|
|
83
|
+
* The answer carries `skippedBundles` beside the rows so the caller never has to infer the
|
|
84
|
+
* partiality of this walk from some other read (REVIEW WR-03).
|
|
85
|
+
*
|
|
86
|
+
* An empty tuple list answers no rows and no skips without touching the store: there is nothing to
|
|
87
|
+
* look up, and a walk that could fail on an unrelated bundle would turn "you asked about nothing"
|
|
88
|
+
* into an error.
|
|
89
|
+
*/
|
|
90
|
+
declare function canaryAttributionsFor(options: CanaryAttributionsForOptions): CanaryAttributionsResult;
|
|
91
|
+
|
|
92
|
+
interface GateReceiptsForOptions {
|
|
93
|
+
knowledgeRoot: string;
|
|
94
|
+
candidateId: string;
|
|
95
|
+
/** Resolved per candidate by the same assembly used by the promotion doors. */
|
|
96
|
+
resolvePromotionPosture?: ResolvePromotionPosture;
|
|
97
|
+
}
|
|
98
|
+
declare function gateReceiptsFor(options: GateReceiptsForOptions): KnowledgeGatesListResult;
|
|
99
|
+
|
|
100
|
+
interface CandidateInjectionForOptions {
|
|
101
|
+
knowledgeRoot: string;
|
|
102
|
+
candidateId: string;
|
|
103
|
+
priors?: TrustPriorTable;
|
|
104
|
+
}
|
|
105
|
+
declare function candidateInjectionFor(options: CandidateInjectionForOptions): KnowledgeCandidateInjectionResult;
|
|
106
|
+
|
|
107
|
+
export { type CanaryAttributionOutcome, type CanaryAttributionRow, type CanaryAttributionTuple, type CanaryAttributionsForOptions, type CanaryAttributionsResult, type CandidateInjectionForOptions, type GateReceiptsForOptions, type ShowRecordsOptions, canaryAttributionsFor, canaryOutcomeObservationId, candidateInjectionFor, gateReceiptsFor, listBundles, showRecords };
|
package/dist/reader.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export { e as AUTHORING_BRIEF_DEFAULT_BUDGET, f as AUTHORING_DENSE_K, p as AuthoringReaderDependencies, s as CanaryPostureFacts, v as DiffSinceOptions, b0 as HydratedEntry, b1 as IndexRow, J as InspectRecordsOptions, O as KnowledgeMaintenanceScanError, P as KnowledgeMaintenanceScanIssue, S as KnowledgeRecordNotFoundError, W as LowerTrustShare, X as MARK_EVIDENCE_TOKEN_PREFIX, Y as MarkEvidenceEffect, Z as MarkEvidencePlan, _ as MarkEvidenceTarget, a1 as OpenServingKnowledgeReaderConfig, a2 as PlanMarkEvidenceInput, a4 as QUARANTINE_CLASS_DISPOSITIONS, b2 as QUARANTINE_FLOOR_ELIGIBILITY, a8 as QUARANTINE_LEDGER_FILENAME, ac as QuarantineDisposition, b3 as QuarantineFloorEligibility, ad as QuarantineLedgerRead, R as RefusedQuarantineLine, an as ShowRecordOptions, ao as StandingReceiptDigest, ar as canaryPostureFactsFor, au as createAuthoringReader, aw as diffSince, aA as foldQuarantineLedgerState, b4 as hydrateRows, aC as inspectRecords, aF as lowerTrustSharesFor, aG as markEvidenceEvent, aJ as openKnowledgeReader, aK as planMarkEvidence, aM as projectMarkEvidenceOutcome, aN as quarantineLedgerPath, b5 as readIndexRows, aR as readQuarantineLedger, aX as showRecord, aY as standingReceiptDigestsFor } from './mark-evidence-plan-BCkYN07i.js';
|
|
2
|
+
import { CanaryOutcome, TrustPriorTable, KnowledgeBundleSummary, KnowledgeRecordShowResult, ResolvePromotionPosture, KnowledgeGatesListResult, KnowledgeCandidateInjectionResult } from '@vostride/agent-qa-schema';
|
|
3
|
+
export { BuildRange, ReadOptions, SearchOptions } from '@vostride/agent-qa-schema';
|
|
4
|
+
import '@vostride/agent-qa-agent';
|
|
5
|
+
import '@vostride/agent-qa-runner';
|
|
6
|
+
import 'node:sqlite';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* D-22: bind one canary observation to the served candidate and attributed step. The schema
|
|
10
|
+
* evidence-token recipe adds the exercised anchor and build ordinal; together those fields are
|
|
11
|
+
* the complete replay identity required by §7.5.1.
|
|
12
|
+
*/
|
|
13
|
+
declare function canaryOutcomeObservationId(outcome: Pick<CanaryOutcome, 'candidateId' | 'runId' | 'testId' | 'testIndex' | 'stepIndex'>): string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* List every committed bundle under a knowledge root, newest lifecycle state first-class.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately UNFILTERED by serving lifecycle: unlike `scanBundles`, a listing is a review
|
|
19
|
+
* surface, and a superseded or withdrawn record is exactly what a reviewer needs to see. The
|
|
20
|
+
* serving firewall (`isServable`) belongs on retrieval paths, not on a catalog.
|
|
21
|
+
*
|
|
22
|
+
* A bundle whose canonical files do not strictly parse is SKIPPED rather than thrown on, so
|
|
23
|
+
* one damaged bundle never hides every other bundle from the listing. A missing knowledge
|
|
24
|
+
* root is an ordinary empty result — `enumerateBundleDirs` already treats an unreadable
|
|
25
|
+
* directory as empty.
|
|
26
|
+
*
|
|
27
|
+
* Order is total and stable: product, then bundle directory name (which is the record id).
|
|
28
|
+
* `enumerateBundleDirs` already sorts on exactly those two keys.
|
|
29
|
+
*/
|
|
30
|
+
declare function listBundles(knowledgeRoot: string, priors?: TrustPriorTable): KnowledgeBundleSummary[];
|
|
31
|
+
|
|
32
|
+
interface ShowRecordsOptions {
|
|
33
|
+
knowledgeRoot: string;
|
|
34
|
+
recordIds: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolve exact identities in first-request order with one maintenance enumeration.
|
|
38
|
+
* Missing records are data; incomplete scans retain KnowledgeMaintenanceScanError so
|
|
39
|
+
* callers can report scanIncomplete instead of presenting a partial set as clean misses.
|
|
40
|
+
* Like the single-record read, this bypasses serving filters and never opens an index.
|
|
41
|
+
*/
|
|
42
|
+
declare function showRecords(options: ShowRecordsOptions): readonly KnowledgeRecordShowResult[];
|
|
43
|
+
|
|
44
|
+
/** The four observation words. A lifecycle event carrying the same id attributes nothing. */
|
|
45
|
+
declare const ATTRIBUTING_EVENT_TYPES: readonly ["confirmed", "contradicted", "helpful", "harmful"];
|
|
46
|
+
type CanaryAttributionOutcome = (typeof ATTRIBUTING_EVENT_TYPES)[number];
|
|
47
|
+
/** One served canary line, addressed the way the run recorded it. */
|
|
48
|
+
interface CanaryAttributionTuple {
|
|
49
|
+
candidateId: string;
|
|
50
|
+
testId: string;
|
|
51
|
+
testIndex: number;
|
|
52
|
+
stepIndex: number;
|
|
53
|
+
}
|
|
54
|
+
interface CanaryAttributionRow {
|
|
55
|
+
candidateId: string;
|
|
56
|
+
testIndex: number;
|
|
57
|
+
stepIndex: number;
|
|
58
|
+
observationId: string;
|
|
59
|
+
outcome?: CanaryAttributionOutcome;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The attribution answer, with the partiality of the walk that produced it.
|
|
63
|
+
*
|
|
64
|
+
* `skippedBundles > 0` means the answer is PARTIAL — some bundle in the store failed
|
|
65
|
+
* `loadMaintenanceBundle` (load or integrity) and was skipped. A caller that renders
|
|
66
|
+
* `not attributed` from an absent `outcome` must consult this first: on a partial walk the
|
|
67
|
+
* absence means "not found in the part of the store I could read", which is not the same claim
|
|
68
|
+
* (REVIEW WR-03; the T-407-11 hazard class is the integrity arm).
|
|
69
|
+
*/
|
|
70
|
+
interface CanaryAttributionsResult {
|
|
71
|
+
rows: CanaryAttributionRow[];
|
|
72
|
+
skippedBundles: number;
|
|
73
|
+
}
|
|
74
|
+
interface CanaryAttributionsForOptions {
|
|
75
|
+
knowledgeRoot: string;
|
|
76
|
+
runId: string;
|
|
77
|
+
tuples: readonly CanaryAttributionTuple[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Answer, per served canary tuple, the observation id it would have been attributed under and the
|
|
81
|
+
* committed outcome carrying that id — when one survives.
|
|
82
|
+
*
|
|
83
|
+
* The answer carries `skippedBundles` beside the rows so the caller never has to infer the
|
|
84
|
+
* partiality of this walk from some other read (REVIEW WR-03).
|
|
85
|
+
*
|
|
86
|
+
* An empty tuple list answers no rows and no skips without touching the store: there is nothing to
|
|
87
|
+
* look up, and a walk that could fail on an unrelated bundle would turn "you asked about nothing"
|
|
88
|
+
* into an error.
|
|
89
|
+
*/
|
|
90
|
+
declare function canaryAttributionsFor(options: CanaryAttributionsForOptions): CanaryAttributionsResult;
|
|
91
|
+
|
|
92
|
+
interface GateReceiptsForOptions {
|
|
93
|
+
knowledgeRoot: string;
|
|
94
|
+
candidateId: string;
|
|
95
|
+
/** Resolved per candidate by the same assembly used by the promotion doors. */
|
|
96
|
+
resolvePromotionPosture?: ResolvePromotionPosture;
|
|
97
|
+
}
|
|
98
|
+
declare function gateReceiptsFor(options: GateReceiptsForOptions): KnowledgeGatesListResult;
|
|
99
|
+
|
|
100
|
+
interface CandidateInjectionForOptions {
|
|
101
|
+
knowledgeRoot: string;
|
|
102
|
+
candidateId: string;
|
|
103
|
+
priors?: TrustPriorTable;
|
|
104
|
+
}
|
|
105
|
+
declare function candidateInjectionFor(options: CandidateInjectionForOptions): KnowledgeCandidateInjectionResult;
|
|
106
|
+
|
|
107
|
+
export { type CanaryAttributionOutcome, type CanaryAttributionRow, type CanaryAttributionTuple, type CanaryAttributionsForOptions, type CanaryAttributionsResult, type CandidateInjectionForOptions, type GateReceiptsForOptions, type ShowRecordsOptions, canaryAttributionsFor, canaryOutcomeObservationId, candidateInjectionFor, gateReceiptsFor, listBundles, showRecords };
|