@chunktrace/core 0.16.0 → 0.18.0
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/README.md +1 -1
- package/dist/evidence.d.ts +72 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +72 -0
- package/dist/evidence.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -24,4 +24,4 @@ A diagnosis lists findings, each with a code (for example `TOPK_CUT`, `FILTER_RE
|
|
|
24
24
|
|
|
25
25
|
Questions, ideas and feedback: [GitHub Discussions](https://github.com/chunktrace/community/discussions), or hello@chunktrace.com. There is a [live demo](https://chunktrace.com/demo) of three diagnoses that needs no account.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The library runs on Node.js 22 or later, Bun, Deno 2 and Cloudflare Workers; the CLI needs Node.js. MIT licensed. Copyright © 2026 Hathor Software, LLC.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Trace } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Expected evidence chosen after the fact: chunks a developer picked (from the project's
|
|
4
|
+
* chunk catalog, or by typing an id) as what a right answer needs. It is a human label. A
|
|
5
|
+
* search that helped find a chunk says nothing about whether the chunk is right.
|
|
6
|
+
*
|
|
7
|
+
* The rule engine works on chunk ids, so before a picked chunk is used as a label it is
|
|
8
|
+
* matched against the trace by id, and the match is checked with what both sides recorded.
|
|
9
|
+
* A chunk that cannot be matched with confidence is left out of the label and reported as
|
|
10
|
+
* such, rather than blamed on a stage.
|
|
11
|
+
*/
|
|
12
|
+
export type ExpectedChunk = {
|
|
13
|
+
chunk_id: string;
|
|
14
|
+
/** "catalog": picked from the project's chunk catalog. "manual": an id typed by hand, checked against nothing. */
|
|
15
|
+
source: "catalog" | "manual";
|
|
16
|
+
/** What the catalog held for this chunk when it was picked. Absent on a manual entry. */
|
|
17
|
+
document_id?: string;
|
|
18
|
+
content_hash?: string;
|
|
19
|
+
document_version?: string;
|
|
20
|
+
/** When the catalog's text for this id was last replaced; absent if it never was. */
|
|
21
|
+
content_changed_at?: string;
|
|
22
|
+
};
|
|
23
|
+
export type EvidenceState =
|
|
24
|
+
/** The trace recorded a chunk with this id, and nothing contradicts the match. */
|
|
25
|
+
"observed"
|
|
26
|
+
/** No chunk with this id anywhere in the trace. The engine reports what that means for this trace. */
|
|
27
|
+
| "not_observed"
|
|
28
|
+
/** The trace has this id in another document than the catalog does: not the same chunk. */
|
|
29
|
+
| "identity_mismatch"
|
|
30
|
+
/** The catalog's text for this id was replaced after the trace ran: the trace's chunk held other text. */
|
|
31
|
+
| "version_mismatch"
|
|
32
|
+
/** Not in the trace, and none of the trace's chunks are in the catalog: the two may not share ids. */
|
|
33
|
+
| "unverified";
|
|
34
|
+
/** Where the trace recorded a chunk. */
|
|
35
|
+
export type ChunkSightings = {
|
|
36
|
+
/** In the unfiltered shadow query. */
|
|
37
|
+
shadow: boolean;
|
|
38
|
+
/** Returned by the retrieval. */
|
|
39
|
+
retrieved: boolean;
|
|
40
|
+
/** Kept by the reranker; undefined when the trace has no rerank stage or the chunk never reached it. */
|
|
41
|
+
reranked?: boolean;
|
|
42
|
+
/** In the context the model was given. */
|
|
43
|
+
in_context: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type ResolvedChunk = ExpectedChunk & {
|
|
46
|
+
state: EvidenceState;
|
|
47
|
+
/** True when this id is part of the label the engine diagnoses with. */
|
|
48
|
+
used: boolean;
|
|
49
|
+
seen: ChunkSightings;
|
|
50
|
+
/** The state in a sentence, built only from the values in this object and the trace. */
|
|
51
|
+
detail: string;
|
|
52
|
+
};
|
|
53
|
+
export type CatalogFacts = {
|
|
54
|
+
/** How many of the trace's own chunk ids the catalog has. null: the project has no catalog. */
|
|
55
|
+
trace_chunks_in_catalog: number | null;
|
|
56
|
+
};
|
|
57
|
+
/** Every chunk id the trace mentions, in any stage. */
|
|
58
|
+
export declare function traceChunkIds(trace: Trace): string[];
|
|
59
|
+
/** Where the trace recorded the chunk with this id. */
|
|
60
|
+
export declare function chunkSightings(trace: Trace, chunkId: string): ChunkSightings;
|
|
61
|
+
/**
|
|
62
|
+
* Matches each expected chunk to the trace. Deterministic: ids are compared exactly, and a
|
|
63
|
+
* match is refused only on recorded facts (a different document id, a later change of the
|
|
64
|
+
* catalog's text), never on how alike two texts are.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveExpectedEvidence(trace: Trace, chunks: ExpectedChunk[], catalog?: CatalogFacts): ResolvedChunk[];
|
|
67
|
+
/**
|
|
68
|
+
* The trace as the engine should diagnose it: its label replaced by the expected chunks that
|
|
69
|
+
* could be matched. With none matched it has no label, so no stage is blamed.
|
|
70
|
+
*/
|
|
71
|
+
export declare function withExpectedEvidence(trace: Trace, resolved: Array<Pick<ResolvedChunk, "chunk_id" | "used">>): Trace;
|
|
72
|
+
//# sourceMappingURL=evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;;;;;GASG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,kHAAkH;IAClH,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa;AACvB,kFAAkF;AAChF,UAAU;AACZ,sGAAsG;GACpG,cAAc;AAChB,2FAA2F;GACzF,mBAA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|
+
const ids = new Set();
|
|
4
|
+
for (const c of trace.retrieval.candidates)
|
|
5
|
+
ids.add(c.chunk_id);
|
|
6
|
+
for (const c of trace.retrieval.shadow?.candidates ?? [])
|
|
7
|
+
ids.add(c.chunk_id);
|
|
8
|
+
for (const r of trace.rerank?.results ?? [])
|
|
9
|
+
ids.add(r.chunk_id);
|
|
10
|
+
for (const c of trace.context.included)
|
|
11
|
+
ids.add(c.chunk_id);
|
|
12
|
+
for (const c of trace.context.excluded)
|
|
13
|
+
ids.add(c.chunk_id);
|
|
14
|
+
return [...ids];
|
|
15
|
+
}
|
|
16
|
+
/** Where the trace recorded the chunk with this id. */
|
|
17
|
+
export function chunkSightings(trace, chunkId) {
|
|
18
|
+
const reranked = trace.rerank?.results.find((r) => r.chunk_id === chunkId);
|
|
19
|
+
return {
|
|
20
|
+
shadow: trace.retrieval.shadow?.candidates.some((c) => c.chunk_id === chunkId) ?? false,
|
|
21
|
+
retrieved: trace.retrieval.candidates.some((c) => c.chunk_id === chunkId),
|
|
22
|
+
...(reranked ? { reranked: reranked.kept } : {}),
|
|
23
|
+
in_context: trace.context.included.some((c) => c.chunk_id === chunkId),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Matches each expected chunk to the trace. Deterministic: ids are compared exactly, and a
|
|
28
|
+
* match is refused only on recorded facts (a different document id, a later change of the
|
|
29
|
+
* catalog's text), never on how alike two texts are.
|
|
30
|
+
*/
|
|
31
|
+
export function resolveExpectedEvidence(trace, chunks, catalog = { trace_chunks_in_catalog: null }) {
|
|
32
|
+
const traceIds = traceChunkIds(trace);
|
|
33
|
+
const known = new Set(traceIds);
|
|
34
|
+
const documentOf = new Map();
|
|
35
|
+
for (const c of [...trace.retrieval.candidates, ...(trace.retrieval.shadow?.candidates ?? [])]) {
|
|
36
|
+
if (c.document_id !== undefined && !documentOf.has(c.chunk_id))
|
|
37
|
+
documentOf.set(c.chunk_id, c.document_id);
|
|
38
|
+
}
|
|
39
|
+
const ranAt = Date.parse(trace.timestamp);
|
|
40
|
+
return chunks.map((chunk) => {
|
|
41
|
+
const id = chunk.chunk_id;
|
|
42
|
+
const seen = chunkSightings(trace, id);
|
|
43
|
+
const done = (state, used, detail) => ({ ...chunk, state, used, seen, detail });
|
|
44
|
+
if (chunk.source === "catalog") {
|
|
45
|
+
const changed = chunk.content_changed_at !== undefined ? Date.parse(chunk.content_changed_at) : Number.NaN;
|
|
46
|
+
if (!Number.isNaN(changed) && changed > ranAt) {
|
|
47
|
+
return done("version_mismatch", false, `The catalog's text for ${id} was replaced on ${chunk.content_changed_at}, after this trace ran (${trace.timestamp}). What the trace calls ${id} held the earlier text, so it cannot be matched to what was selected.`);
|
|
48
|
+
}
|
|
49
|
+
const traceDocument = documentOf.get(id);
|
|
50
|
+
if (known.has(id) && traceDocument !== undefined && chunk.document_id !== undefined && traceDocument !== chunk.document_id) {
|
|
51
|
+
return done("identity_mismatch", false, `The trace records ${id} in document ${traceDocument}; the catalog has ${id} in document ${chunk.document_id}. They are not the same chunk.`);
|
|
52
|
+
}
|
|
53
|
+
if (!known.has(id) && traceIds.length > 0 && catalog.trace_chunks_in_catalog === 0) {
|
|
54
|
+
return done("unverified", false, `${id} is not in this trace, and none of the ${traceIds.length} chunks the trace recorded are in the catalog, so the catalog may not use the ids your pipeline does. Its absence cannot be confirmed.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!known.has(id))
|
|
58
|
+
return done("not_observed", true, `No chunk with the id ${id} was recorded at any stage of this trace.`);
|
|
59
|
+
const where = seen.in_context ? "and it is in the final context" : seen.retrieved ? "and the retrieval returned it" : "in the unfiltered shadow query only";
|
|
60
|
+
return done("observed", true, `The trace recorded ${id}, ${where}.`);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The trace as the engine should diagnose it: its label replaced by the expected chunks that
|
|
65
|
+
* could be matched. With none matched it has no label, so no stage is blamed.
|
|
66
|
+
*/
|
|
67
|
+
export function withExpectedEvidence(trace, resolved) {
|
|
68
|
+
const ids = [...new Set(resolved.filter((c) => c.used).map((c) => c.chunk_id))];
|
|
69
|
+
const { label: _replaced, ...rest } = trace;
|
|
70
|
+
return ids.length > 0 ? { ...rest, label: { type: "chunk", chunk_ids: ids } } : rest;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AA+DA,uDAAuD;AACvD,MAAM,UAAU,aAAa,CAAC,KAAY;IACxC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,UAAU;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAChE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9E,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClB,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,OAAe;IAC1D,MAAM,QAAQ,GAAG,KAAK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AAC;IAC5C,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACvF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { diagnose, labeledChunkIds } from "./diagnose.js";
|
|
2
|
+
export { chunkSightings, resolveExpectedEvidence, traceChunkIds, withExpectedEvidence } from "./evidence.js";
|
|
3
|
+
export type { CatalogFacts, ChunkSightings, EvidenceState, ExpectedChunk, ResolvedChunk } from "./evidence.js";
|
|
2
4
|
export { evaluateFilter, describeClause } from "./filter.js";
|
|
3
5
|
export type { FilterFailure, FilterResult } from "./filter.js";
|
|
4
6
|
export { formatReport } from "./format.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7G,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { diagnose, labeledChunkIds } from "./diagnose.js";
|
|
2
|
+
export { chunkSightings, resolveExpectedEvidence, traceChunkIds, withExpectedEvidence } from "./evidence.js";
|
|
2
3
|
export { evaluateFilter, describeClause } from "./filter.js";
|
|
3
4
|
export { formatReport } from "./format.js";
|
|
4
5
|
export { traceSchema, validateTrace } from "./schema.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chunktrace/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Deterministic diagnosis of RAG retrieval failures from a query trace, with no LLM calls: the ChunkTrace trace schema, the diagnostic rule engine, the text report and a CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rag",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"files": [
|
|
43
43
|
"dist"
|
|
44
44
|
],
|
|
45
|
+
"sideEffects": false,
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"zod": "^4.6.7"
|
|
47
48
|
},
|