@tangle-network/agent-knowledge 19.1.5 → 20.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/README.md +17 -91
  3. package/dist/benchmarks/index.d.ts +2 -2
  4. package/dist/benchmarks/index.js +2 -2
  5. package/dist/benchmarks-jir3ZP-M.js +162 -0
  6. package/dist/benchmarks-jir3ZP-M.js.map +1 -0
  7. package/dist/cli.js +2 -3
  8. package/dist/cli.js.map +1 -1
  9. package/dist/index-BhvSH4E4.d.ts +512 -0
  10. package/dist/index-BhvSH4E4.d.ts.map +1 -0
  11. package/dist/index-OAxtm6is.d.ts +9 -0
  12. package/dist/index-OAxtm6is.d.ts.map +1 -0
  13. package/dist/index.d.ts +197 -1332
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +561 -3653
  16. package/dist/index.js.map +1 -1
  17. package/dist/{inspect-C6c4zuKp.js → inspect-CMigdsD5.js} +282 -24
  18. package/dist/inspect-CMigdsD5.js.map +1 -0
  19. package/dist/memory/index.d.ts +3 -3
  20. package/dist/memory/index.js +3 -3
  21. package/dist/memory-BH6oT1Qe.js +2728 -0
  22. package/dist/memory-BH6oT1Qe.js.map +1 -0
  23. package/dist/source-record-CdWvzvO6.js +39 -0
  24. package/dist/source-record-CdWvzvO6.js.map +1 -0
  25. package/dist/types-BWV_Fvp7.d.ts +224 -0
  26. package/dist/types-BWV_Fvp7.d.ts.map +1 -0
  27. package/dist/{types-m2QB86fF.d.ts → types-BekdNwGD.d.ts} +4 -19
  28. package/dist/types-BekdNwGD.d.ts.map +1 -0
  29. package/dist/viz/index.d.ts +1 -1
  30. package/docs/architecture.md +2 -30
  31. package/docs/eval/investment-material-facts.md +2 -0
  32. package/docs/results/research-driving.md +8 -8
  33. package/docs/verified-research-ab.md +12 -10
  34. package/package.json +6 -12
  35. package/skills/build-with-agent-knowledge/SKILL.md +2 -15
  36. package/dist/benchmarks-BjXxjAke.js +0 -2824
  37. package/dist/benchmarks-BjXxjAke.js.map +0 -1
  38. package/dist/index-Bh9wLd0_.d.ts +0 -1097
  39. package/dist/index-Bh9wLd0_.d.ts.map +0 -1
  40. package/dist/index-DZeFm-BP.d.ts +0 -680
  41. package/dist/index-DZeFm-BP.d.ts.map +0 -1
  42. package/dist/inspect-C6c4zuKp.js.map +0 -1
  43. package/dist/memory-CUk1mgPY.js +0 -5778
  44. package/dist/memory-CUk1mgPY.js.map +0 -1
  45. package/dist/search-BBr5eUyT.js +0 -275
  46. package/dist/search-BBr5eUyT.js.map +0 -1
  47. package/dist/sources/index.d.ts +0 -376
  48. package/dist/sources/index.d.ts.map +0 -1
  49. package/dist/sources/index.js +0 -615
  50. package/dist/sources/index.js.map +0 -1
  51. package/dist/types-m2QB86fF.d.ts.map +0 -1
  52. package/docs/eval/rag-eval-roadmap.md +0 -123
@@ -1,12 +1,11 @@
1
1
  import { i as textSourceId, n as slugify, r as stableId, t as sha256 } from "./ids-Bevz_pXV.js";
2
- import { r as searchKnowledge } from "./search-BBr5eUyT.js";
3
- import { createHash, randomUUID } from "node:crypto";
4
- import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm } from "node:fs/promises";
5
- import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
6
2
  import { canonicalCandidateBytes, canonicalCandidateDigest, sha256Bytes, sha256DigestSchema } from "@tangle-network/agent-interface";
7
3
  import { contentHash } from "@tangle-network/agent-eval";
8
4
  import { z } from "zod";
5
+ import { createHash, randomUUID } from "node:crypto";
9
6
  import { constants, lstatSync } from "node:fs";
7
+ import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm } from "node:fs/promises";
8
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
10
9
  import { AsyncLocalStorage } from "node:async_hooks";
11
10
  //#region src/adapters.ts
12
11
  const textSourceAdapter = {
@@ -1390,9 +1389,8 @@ function unquote(value) {
1390
1389
  * The algebra of a research claim ledger: claim identity, and how two ledgers
1391
1390
  * that accumulated evidence for the same goal combine into one.
1392
1391
  *
1393
- * This lives apart from `research-driving-driver.ts` because it is no longer
1394
- * that driver's private business. A ledger is a durable record now, and a
1395
- * durable record addressed by id is a record two writers can reach: two rounds
1392
+ * A ledger is a durable record, and a durable record addressed by id is a
1393
+ * record two writers can reach: two rounds
1396
1394
  * of one run resuming from disk, or two workers researching one goal in
1397
1395
  * parallel. `putClaimLedger` writes the whole record, so the second writer's
1398
1396
  * write erases the first writer's claims — the ledger persists and the
@@ -1722,9 +1720,8 @@ function mergeSourceVersions(base, incoming) {
1722
1720
  * of it: the worker that found the refuting source records "X contradicts Y" and
1723
1721
  * knows nothing about Y's record. Left one-sided, Y reads as an uncontested
1724
1722
  * claim, and the completion oracle would settle a question two sources disagree
1725
- * about. `createResearchDrivingDriver` does this pairwise as it records; this is
1726
- * the same rule stated over a whole ledger, for writers that assemble one from
1727
- * events rather than from a live loop.
1723
+ * about. This rule applies over a whole ledger, for writers that assemble one
1724
+ * from events.
1728
1725
  *
1729
1726
  * One-sided observations stay in `claimEvidence` until both claims are backed
1730
1727
  * by registered source versions. The materialized claim projection contains
@@ -1776,8 +1773,7 @@ function sameStrings(left, right) {
1776
1773
  /**
1777
1774
  * The event vocabulary, as a value so the runtime schema is DERIVED from it
1778
1775
  * rather than restated. A restated copy in `schemas.ts` drifted: it omitted
1779
- * `research.iteration`, which is the only event `runVerifiedResearchLoop`
1780
- * produces, so every attempt to store one would have been rejected. Nothing
1776
+ * `research.iteration`, which the research loop produces, so every attempt to store one would have been rejected. Nothing
1781
1777
  * caught it because nothing ever stored an event. Add a type here and the
1782
1778
  * schema accepts it in the same edit.
1783
1779
  */
@@ -1861,16 +1857,6 @@ const KnowledgeRelationSchema = z.object({
1861
1857
  weight: z.number().optional(),
1862
1858
  metadata: z.record(z.string(), z.unknown()).optional()
1863
1859
  });
1864
- const KnowledgeRelationNodeSchema = z.object({
1865
- id: z.string(),
1866
- kind: z.string(),
1867
- label: z.string().optional(),
1868
- metadata: z.record(z.string(), z.unknown()).optional()
1869
- });
1870
- const KnowledgeRelationGraphSchema = z.object({
1871
- nodes: z.array(KnowledgeRelationNodeSchema),
1872
- edges: z.array(KnowledgeRelationSchema)
1873
- });
1874
1860
  const KnowledgeIndexSchema = z.object({
1875
1861
  root: z.string(),
1876
1862
  generatedAt: z.string(),
@@ -4570,6 +4556,278 @@ function stringMetadata(metadata, key) {
4570
4556
  return typeof value === "string" ? value : void 0;
4571
4557
  }
4572
4558
  //#endregion
4559
+ //#region src/lexical-postings.ts
4560
+ const DEFAULT_FIELD_BOOSTS = Object.freeze({
4561
+ title: 3,
4562
+ path: 2,
4563
+ text: 1
4564
+ });
4565
+ function lexicalPageTerms(page, tokenize, fieldBoosts) {
4566
+ const frequencies = /* @__PURE__ */ new Map();
4567
+ let length = 0;
4568
+ for (const [text, boost] of [
4569
+ [page.title, fieldBoosts.title],
4570
+ [page.path.replace(/\.md$/, ""), fieldBoosts.path],
4571
+ [page.text, fieldBoosts.text]
4572
+ ]) {
4573
+ if (boost === 0) continue;
4574
+ for (const token of tokenize(text)) {
4575
+ frequencies.set(token, (frequencies.get(token) ?? 0) + boost);
4576
+ length += boost;
4577
+ }
4578
+ }
4579
+ return {
4580
+ frequencies,
4581
+ length
4582
+ };
4583
+ }
4584
+ /** Inverted index from per-page terms already computed with `tokenize` and `fieldBoosts`. */
4585
+ function assembleLexicalIndex(pages, terms, tokenize, fieldBoosts) {
4586
+ const postings = /* @__PURE__ */ new Map();
4587
+ const documentLengths = [];
4588
+ let totalLength = 0;
4589
+ terms.forEach(({ frequencies, length }, ordinal) => {
4590
+ documentLengths.push(length);
4591
+ totalLength += length;
4592
+ for (const [term, tf] of frequencies) {
4593
+ let list = postings.get(term);
4594
+ if (!list) {
4595
+ list = [];
4596
+ postings.set(term, list);
4597
+ }
4598
+ list.push({
4599
+ ordinal,
4600
+ tf
4601
+ });
4602
+ }
4603
+ });
4604
+ return {
4605
+ pages,
4606
+ postings,
4607
+ documentLengths,
4608
+ averageDocumentLength: pages.length > 0 ? totalLength / pages.length : 0,
4609
+ documentCount: pages.length,
4610
+ tokenize,
4611
+ fieldBoosts
4612
+ };
4613
+ }
4614
+ //#endregion
4615
+ //#region src/lexical-index.ts
4616
+ const STOP_WORDS = /* @__PURE__ */ new Set([
4617
+ "the",
4618
+ "is",
4619
+ "a",
4620
+ "an",
4621
+ "what",
4622
+ "how",
4623
+ "are",
4624
+ "was",
4625
+ "were",
4626
+ "to",
4627
+ "for",
4628
+ "of",
4629
+ "with",
4630
+ "by",
4631
+ "in",
4632
+ "on",
4633
+ "and"
4634
+ ]);
4635
+ /**
4636
+ * The token stream of one text: lower-cased, split on whitespace and
4637
+ * punctuation, single characters and stop words removed, and a CJK run
4638
+ * expanded into its bigrams and characters. Repeats are kept so a term
4639
+ * frequency can be counted. Indexing and querying share this function, so the
4640
+ * two vocabularies cannot drift.
4641
+ */
4642
+ function tokenizeText(text) {
4643
+ const raw = text.toLowerCase().split(/[\s,,。!?、;:""''()()\-_/\\·~~…]+/).filter((token) => token.length > 1 && !STOP_WORDS.has(token));
4644
+ const tokens = [];
4645
+ for (const token of raw) {
4646
+ if (/[\u4e00-\u9fff\u3400-\u4dbf]/.test(token) && token.length > 2) {
4647
+ const chars = [...token];
4648
+ for (let i = 0; i < chars.length - 1; i++) tokens.push(chars[i] + chars[i + 1]);
4649
+ tokens.push(...chars);
4650
+ }
4651
+ tokens.push(token);
4652
+ }
4653
+ return tokens;
4654
+ }
4655
+ /** The distinct query terms, in first-occurrence order. */
4656
+ function tokenizeQuery(query) {
4657
+ return [...new Set(tokenizeText(query))];
4658
+ }
4659
+ function buildKnowledgeLexicalIndex(pages, options = {}) {
4660
+ const tokenize = options.tokenize ?? tokenizeText;
4661
+ const fieldBoosts = resolveFieldBoosts(options.fieldBoosts);
4662
+ return assembleLexicalIndex(pages, pages.map((page) => lexicalPageTerms(page, tokenize, fieldBoosts)), tokenize, fieldBoosts);
4663
+ }
4664
+ /**
4665
+ * Okapi BM25 over the distinct query terms, with the Lucene inverse document
4666
+ * frequency `ln(1 + (N - df + 0.5) / (df + 0.5))`, which is positive for every
4667
+ * indexed term. Pages with no matching term are absent. The result is ordered
4668
+ * by score, then by path, so it does not depend on page order.
4669
+ */
4670
+ function scoreBm25(index, tokens, options = {}) {
4671
+ const k1 = options.k1 ?? 1.2;
4672
+ const b = options.b ?? .75;
4673
+ if (!Number.isFinite(k1) || k1 < 0) throw new Error(`bm25 k1 must be >= 0, got ${String(k1)}`);
4674
+ if (!Number.isFinite(b) || b < 0 || b > 1) throw new Error(`bm25 b must lie in [0, 1], got ${String(b)}`);
4675
+ const scores = /* @__PURE__ */ new Map();
4676
+ const { documentCount, averageDocumentLength, documentLengths } = index;
4677
+ for (const term of new Set(tokens)) {
4678
+ const list = index.postings.get(term);
4679
+ if (!list) continue;
4680
+ const df = list.length;
4681
+ const idf = Math.log(1 + (documentCount - df + .5) / (df + .5));
4682
+ for (const { ordinal, tf } of list) {
4683
+ const lengthRatio = averageDocumentLength > 0 ? documentLengths[ordinal] / averageDocumentLength : 1;
4684
+ const saturated = tf * (k1 + 1) / (tf + k1 * (1 - b + b * lengthRatio));
4685
+ scores.set(ordinal, (scores.get(ordinal) ?? 0) + idf * saturated);
4686
+ }
4687
+ }
4688
+ return [...scores.entries()].map(([ordinal, score]) => ({
4689
+ page: index.pages[ordinal],
4690
+ score
4691
+ })).sort((left, right) => right.score - left.score || left.page.path.localeCompare(right.page.path));
4692
+ }
4693
+ function resolveFieldBoosts(boosts) {
4694
+ const resolved = {
4695
+ ...DEFAULT_FIELD_BOOSTS,
4696
+ ...boosts
4697
+ };
4698
+ for (const [field, boost] of Object.entries(resolved)) if (!Number.isFinite(boost) || boost < 0) throw new Error(`lexical field boost ${field} must be >= 0, got ${String(boost)}`);
4699
+ return Object.freeze(resolved);
4700
+ }
4701
+ //#endregion
4702
+ //#region src/search.ts
4703
+ const RRF_K = 60;
4704
+ /**
4705
+ * Identity of the ranking `searchKnowledge` performs: BM25 over title, path,
4706
+ * and body, exact-title and phrase matches ahead of bag-of-words matches, and
4707
+ * reciprocal rank fusion with link and shared-source structure. Declare it as
4708
+ * the retriever id of a retrieval receipt minted from these results.
4709
+ */
4710
+ const KNOWLEDGE_SEARCH_RETRIEVER_ID = "bm25-rrf-v1";
4711
+ function searchKnowledge(index, query, limitOrOptions = 10) {
4712
+ return searchKnowledgePages(index.pages, query, limitOrOptions);
4713
+ }
4714
+ /**
4715
+ * Rank a page set that is not a built index, such as the chain a run can see.
4716
+ *
4717
+ * `searchKnowledge` is this function over `index.pages`, so both entry points
4718
+ * rank identically and neither can drift from the other.
4719
+ */
4720
+ function searchKnowledgePages(pages, query, limitOrOptions = 10) {
4721
+ const trimmed = query.trim();
4722
+ if (trimmed === "") return [];
4723
+ const options = typeof limitOrOptions === "number" ? { limit: limitOrOptions } : { ...limitOrOptions };
4724
+ const limit = options.limit ?? 10;
4725
+ if (!Number.isInteger(limit) || limit < 0) throw new Error(`search limit must be a non-negative integer, got ${String(limit)}`);
4726
+ const matched = filterPages(pages, options);
4727
+ const lexicalRanked = rankLexical(matched, trimmed, options.lexicalIndex ? assertLexicalIndexMatches(options.lexicalIndex, pages) : buildKnowledgeLexicalIndex(pages));
4728
+ const ranked = [...fuseRanks([lexicalRanked, rankByGraph(matched, lexicalRanked, pages)]).entries()].map(([page, score]) => ({
4729
+ page,
4730
+ score
4731
+ })).sort((a, b) => b.score - a.score || comparePages(a.page, b.page)).slice(0, limit);
4732
+ const topScore = ranked[0]?.score ?? 0;
4733
+ return ranked.map((item, i) => ({
4734
+ citationId: item.page.id,
4735
+ page: item.page,
4736
+ score: item.score,
4737
+ rrfScore: item.score,
4738
+ normalizedScore: topScore > 0 ? item.score / topScore : 0,
4739
+ rank: i + 1,
4740
+ snippet: buildSnippet(item.page.text, trimmed),
4741
+ reasons: reasonsFor(item.page, trimmed)
4742
+ }));
4743
+ }
4744
+ function reciprocalRankFusion(rankLists, k = RRF_K) {
4745
+ return fuseRanks(rankLists, k);
4746
+ }
4747
+ function fuseRanks(rankLists, k = RRF_K) {
4748
+ const scores = /* @__PURE__ */ new Map();
4749
+ for (const list of rankLists) list.forEach((id, idx) => {
4750
+ scores.set(id, (scores.get(id) ?? 0) + 1 / (k + idx + 1));
4751
+ });
4752
+ return scores;
4753
+ }
4754
+ function filterPages(pages, options) {
4755
+ const pageIds = options.pageIds ? new Set(options.pageIds) : null;
4756
+ const tags = options.tags ? new Set(options.tags) : null;
4757
+ const kinds = options.kinds ? new Set(options.kinds) : null;
4758
+ return pages.filter((page) => {
4759
+ if (options.excludeInvalidated && page.invalidation !== void 0) return false;
4760
+ if (pageIds && !pageIds.has(page.id)) return false;
4761
+ if (tags && !page.tags.some((tag) => tags.has(tag))) return false;
4762
+ if (kinds) {
4763
+ const kind = page.frontmatter.kind;
4764
+ if (typeof kind !== "string" || !kinds.has(kind)) return false;
4765
+ }
4766
+ return options.predicate?.(page) ?? true;
4767
+ });
4768
+ }
4769
+ function assertLexicalIndexMatches(lexicalIndex, pages) {
4770
+ if (lexicalIndex.pages.length !== pages.length || lexicalIndex.pages.some((page, ordinal) => page !== pages[ordinal])) throw new Error("lexical index was not built from the searched pages");
4771
+ return lexicalIndex;
4772
+ }
4773
+ /**
4774
+ * The lexical rank list. An exact title or path match outranks a title that
4775
+ * contains the query, which outranks a body that contains the query, which
4776
+ * outranks a bag-of-words match; BM25 orders pages inside each of those tiers.
4777
+ * The tiers are an ordering, not a score, so a strong bag-of-words page cannot
4778
+ * overtake an exact match by term repetition alone.
4779
+ */
4780
+ function rankLexical(pages, query, lexicalIndex) {
4781
+ const tokens = [...new Set(lexicalIndex.tokenize(query))];
4782
+ const bm25 = new Map(scoreBm25(lexicalIndex, tokens).map((hit) => [hit.page, hit.score]));
4783
+ const phrase = query.toLowerCase();
4784
+ return pages.flatMap((page) => {
4785
+ const score = bm25.get(page) ?? 0;
4786
+ if (score === 0 && tokens.length > 0) return [];
4787
+ const tier = phraseTier(page, phrase);
4788
+ if (score === 0 && tier === 0) return [];
4789
+ return [{
4790
+ page,
4791
+ tier,
4792
+ score
4793
+ }];
4794
+ }).sort((a, b) => b.tier - a.tier || b.score - a.score || comparePages(a.page, b.page)).map((item) => item.page);
4795
+ }
4796
+ function phraseTier(page, phrase) {
4797
+ const title = page.title.toLowerCase();
4798
+ if (title === phrase || page.path.toLowerCase().endsWith(`${phrase}.md`)) return 3;
4799
+ if (title.includes(phrase)) return 2;
4800
+ if (page.text.toLowerCase().includes(phrase)) return 1;
4801
+ return 0;
4802
+ }
4803
+ function rankByGraph(pages, lexicalRanked, visiblePages) {
4804
+ if (lexicalRanked.length === 0) return [];
4805
+ const counts = /* @__PURE__ */ new Map();
4806
+ for (const page of visiblePages) counts.set(page.id, (counts.get(page.id) ?? 0) + 1);
4807
+ const seeds = new Set(lexicalRanked.slice(0, 5).filter((page) => counts.get(page.id) === 1).map((page) => page.id));
4808
+ return pages.map((page) => ({
4809
+ page,
4810
+ score: page.outLinks.filter((link) => seeds.has(link)).length + page.sourceIds.filter((source) => lexicalRanked.some((seed) => seed.sourceIds.includes(source))).length
4811
+ })).filter((item) => item.score > 0).sort((a, b) => b.score - a.score || comparePages(a.page, b.page)).map((item) => item.page);
4812
+ }
4813
+ function comparePages(a, b) {
4814
+ return a.path.localeCompare(b.path) || a.id.localeCompare(b.id);
4815
+ }
4816
+ function buildSnippet(text, query) {
4817
+ const compact = text.replace(/\s+/g, " ").trim();
4818
+ const idx = compact.toLowerCase().indexOf(query.toLowerCase());
4819
+ if (idx < 0) return compact.slice(0, 180);
4820
+ return compact.slice(Math.max(0, idx - 80), Math.min(compact.length, idx + query.length + 100));
4821
+ }
4822
+ function reasonsFor(page, query) {
4823
+ const lower = `${page.title}\n${page.text}`.toLowerCase();
4824
+ const reasons = [];
4825
+ if (lower.includes(query.toLowerCase())) reasons.push("phrase");
4826
+ if (page.sourceIds.length > 0) reasons.push("sourced");
4827
+ if (page.outLinks.length > 0) reasons.push("linked");
4828
+ return reasons;
4829
+ }
4830
+ //#endregion
4573
4831
  //#region src/inspect.ts
4574
4832
  function inspectKnowledgeIndex(index, options = {}) {
4575
4833
  const now = options.now ?? /* @__PURE__ */ new Date();
@@ -4633,6 +4891,6 @@ function explainKnowledgeTarget(index, target) {
4633
4891
  };
4634
4892
  }
4635
4893
  //#endregion
4636
- export { snapshotSourceTextInput as $, mediaTypeFor$1 as $n, SourceRecordSchema as $t, validateKnowledgePage as A, finishKnowledgeFileTransaction as An, knowledgePageFromMarkdown as At, DEADLINE_EXIT_CODE as B, listRegularFilesWithinRoot as Bn, KnowledgeGraphEdgeSchema as Bt, immutablePageDigest as C, recoverPendingKnowledgeMutation as Cn, resolveKnowledgeCitations as Ct, normalizeVisibilityArtifact as D, applyKnowledgeFileTransaction as Dn, initKnowledgeBase as Dt, nonEmpty as E, withKnowledgeRead as En, SCAFFOLD_PAGE_BASENAMES as Et, detectNearDuplicatePages as F, normalizePagesDirectory as Fn, extractWikilinks as Ft, gradeFor as G, renameDurable as Gn, KnowledgeRelationGraphSchema as Gt, assertGradeableEvidence as H, readRegularFileWithinRoot as Hn, KnowledgeIndexSchema as Ht, normalizePageText as I, canonicalPathsEqual as In, normalizeLinkTarget as It, buildKnowledgeIndex as J, withSafeDirectory as Jn, ResearchClaimEvidenceSchema as Jt, verdictFor as K, syncDirectory as Kn, KnowledgeRelationNodeSchema as Kt, validateKnowledgeIndex as L, canonicalRelativeWithinRoot as Ln, DeepQuestionSchema as Lt, verifyKnowledgeVisibilitySnapshot as M, prepareKnowledgeFileTransaction as Mn, loadKnowledgePages as Mt, visibilityIdentity as N, rollbackKnowledgeFileTransaction as Nn, writeJson as Nt, normalizeVisibilityRef as O, assertKnowledgeMutationPath as On, isKnowledgePagePath as Ot, visibilityIndexOf as P, DEFAULT_PAGES_DIRECTORY as Pn, WIKILINK_REGEX as Pt, loadSourceRegistry as Q, writeJsonDurableWithinRoot as Qn, SourceAnchorSchema as Qt, lintKnowledgeIndex as R, isKernelAnchoredPath as Rn, KnowledgeBaseCandidateSchema as Rt, encodeKnowledgeVisibilitySnapshot as S, measureKnowledgeMutation as Sn, resolveKnowledgeCitation as St, knowledgeVisibilityArtifactRef as T, withKnowledgeMutation as Tn, resolveRunScopedCitations as Tt, claimCheckKey as U, relativeWithinRoot as Un, KnowledgePageInvalidationSchema as Ut, UncheckableClaimError as V, readRegularFileNoFollow as Vn, KnowledgeGraphNodeSchema as Vt, gradeClaims as W, removeDurable as Wn, KnowledgePageSchema as Wt, addSourcePath as X, writeFileDurableWithinRoot as Xn, ResearchClaimRecordSchema as Xt, writeKnowledgeIndex as Y, writeFileDurable as Yn, ResearchClaimLedgerSchema as Yt, addSourceText as Z, writeJsonDurable as Zn, ResearchSourceVersionSchema as Zt, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION as _, formatFrontmatter as _n, assertRunScopedCitationsResolved as _t, applyKnowledgeWriteBlocksFile as a, assertTrackedClaimIntegrity as an, KB_EVENTS_PATH as at, decodeKnowledgeVisibilitySnapshot as b, inspectPendingKnowledgeMutation as bn, formatKnowledgeCitationReference as bt, KnowledgeDuplicateIntakeError as c, claimSourceHost as cn, MemoryKbStore as ct, createFileRunLineageAuthority as d, linkClaimContradictions as dn, knowledgePageRelations as dt, KNOWLEDGE_EVENT_TYPES as en, textSourceAdapter as er, sourceRegistryPath as et, createRunScopedStores as f, materializeRegisteredClaimEvidence as fn, KnowledgeCitationAuditError as ft, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM as g, researchSourceVersionKey as gn, assertKnowledgeCitationsResolved as gt, originatedPages as h, normalizeClaimText as hn, assertKnowledgeCitationAudit as ht, applyKnowledgeWriteBlocks as i, assertResearchClaimLedgerIntegrity as in, KB_CLAIM_LEDGER_DIR as it, validateOrigin as j, knowledgeFileTransactionPlanHash as jn, layoutFor as jt, snapshotImmutableVisibility as k, commitKnowledgeFileMutations as kn, isScaffoldPath as kt, assertKnowledgeWriteIntake as l, deepQuestionId as ln, assertClaimLedgerId as lt, loadKnowledgeToolChain as m, mergeTrackedClaims as mn, assertCurrentRunCitationsResolved as mt, inspectKnowledgeIndex as n, assertDeepQuestionIntegrity as nn, ClaimLedgerMigrationRequiredError as nt, isSafeKnowledgePath as o, claimEvidenceId as on, KB_INDEX_PATH as ot, isKnowledgeToolChain as p, mergeClaimLedgers as pn, KnowledgeCitationResolutionError as pt, verifyGradeableEvidence as q, withSafeDescendant as qn, KnowledgeRelationSchema as qt, stringMetadata as r, assertResearchClaimEvidenceIntegrity as rn, FileSystemKbStore as rt, parseKnowledgeWriteBlocks as s, claimId as sn, KB_STORE_DIR as st, explainKnowledgeTarget as t, ClaimLedgerGoalConflictError as tn, writeSourceRegistry as tt, RUN_LINEAGE_BASENAME as u, emptyClaimLedger as un, buildKnowledgeGraph as ut, assertSchemaVersion as v, parseFrontmatter as vn, auditCurrentRunCitations as vt, knowledgePageDigest as w, runInKnowledgeMutationScope as wn, resolveRunScopedCitation as wt, digest as x, isKnowledgeMutationHeld as xn, parseKnowledgeCitationReference as xt, createKnowledgeVisibilitySnapshot as y, acquireDurableFileLock as yn, auditKnowledgeCitations as yt, CHECKABLE_RUNG_THRESHOLD as z, isMissingFile as zn, KnowledgeEventSchema as zt };
4894
+ export { assertGradeableEvidence as $, removeDurable as $n, KnowledgeIndexSchema as $t, createKnowledgeVisibilitySnapshot as A, isKnowledgeMutationHeld as An, auditKnowledgeCitations as At, snapshotImmutableVisibility as B, knowledgeFileTransactionPlanHash as Bn, isScaffoldPath as Bt, createRunScopedStores as C, mergeTrackedClaims as Cn, KnowledgeCitationAuditError as Ct, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM as D, parseFrontmatter as Dn, assertKnowledgeCitationsResolved as Dt, originatedPages as E, formatFrontmatter as En, assertKnowledgeCitationAudit as Et, knowledgePageDigest as F, withKnowledgeRead as Fn, resolveRunScopedCitation as Ft, visibilityIndexOf as G, canonicalPathsEqual as Gn, WIKILINK_REGEX as Gt, validateOrigin as H, rollbackKnowledgeFileTransaction as Hn, layoutFor as Ht, knowledgeVisibilityArtifactRef as I, applyKnowledgeFileTransaction as In, resolveRunScopedCitations as It, validateKnowledgeIndex as J, isMissingFile as Jn, DeepQuestionSchema as Jt, detectNearDuplicatePages as K, canonicalRelativeWithinRoot as Kn, extractWikilinks as Kt, nonEmpty as L, assertKnowledgeMutationPath as Ln, SCAFFOLD_PAGE_BASENAMES as Lt, digest as M, recoverPendingKnowledgeMutation as Mn, parseKnowledgeCitationReference as Mt, encodeKnowledgeVisibilitySnapshot as N, runInKnowledgeMutationScope as Nn, resolveKnowledgeCitation as Nt, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION as O, acquireDurableFileLock as On, assertRunScopedCitationsResolved as Ot, immutablePageDigest as P, withKnowledgeMutation as Pn, resolveKnowledgeCitations as Pt, UncheckableClaimError as Q, relativeWithinRoot as Qn, KnowledgeGraphNodeSchema as Qt, normalizeVisibilityArtifact as R, commitKnowledgeFileMutations as Rn, initKnowledgeBase as Rt, createFileRunLineageAuthority as S, mergeClaimLedgers as Sn, knowledgePageRelations as St, loadKnowledgeToolChain as T, researchSourceVersionKey as Tn, assertCurrentRunCitationsResolved as Tt, verifyKnowledgeVisibilitySnapshot as U, DEFAULT_PAGES_DIRECTORY as Un, loadKnowledgePages as Ut, validateKnowledgePage as V, prepareKnowledgeFileTransaction as Vn, knowledgePageFromMarkdown as Vt, visibilityIdentity as W, normalizePagesDirectory as Wn, writeJson as Wt, CHECKABLE_RUNG_THRESHOLD as X, readRegularFileNoFollow as Xn, KnowledgeEventSchema as Xt, lintKnowledgeIndex as Y, listRegularFilesWithinRoot as Yn, KnowledgeBaseCandidateSchema as Yt, DEADLINE_EXIT_CODE as Z, readRegularFileWithinRoot as Zn, KnowledgeGraphEdgeSchema as Zt, isSafeKnowledgePath as _, claimSourceHost as _n, KB_INDEX_PATH as _t, searchKnowledge as a, ResearchClaimRecordSchema as an, writeFileDurableWithinRoot as ar, buildKnowledgeIndex as at, assertKnowledgeWriteIntake as b, linkClaimContradictions as bn, assertClaimLedgerId as bt, scoreBm25 as c, SourceRecordSchema as cn, mediaTypeFor$1 as cr, addSourceText as ct, DEFAULT_FIELD_BOOSTS as d, assertDeepQuestionIntegrity as dn, sourceRegistryPath as dt, KnowledgePageInvalidationSchema as en, renameDurable as er, claimCheckKey as et, assembleLexicalIndex as f, assertResearchClaimEvidenceIntegrity as fn, writeSourceRegistry as ft, applyKnowledgeWriteBlocksFile as g, claimId as gn, KB_EVENTS_PATH as gt, applyKnowledgeWriteBlocks as h, claimEvidenceId as hn, KB_CLAIM_LEDGER_DIR as ht, reciprocalRankFusion as i, ResearchClaimLedgerSchema as in, writeFileDurable as ir, verifyGradeableEvidence as it, decodeKnowledgeVisibilitySnapshot as j, measureKnowledgeMutation as jn, formatKnowledgeCitationReference as jt, assertSchemaVersion as k, inspectPendingKnowledgeMutation as kn, auditCurrentRunCitations as kt, tokenizeQuery as l, KNOWLEDGE_EVENT_TYPES as ln, textSourceAdapter as lr, loadSourceRegistry as lt, stringMetadata as m, assertTrackedClaimIntegrity as mn, FileSystemKbStore as mt, inspectKnowledgeIndex as n, KnowledgeRelationSchema as nn, withSafeDescendant as nr, gradeFor as nt, searchKnowledgePages as o, ResearchSourceVersionSchema as on, writeJsonDurable as or, writeKnowledgeIndex as ot, lexicalPageTerms as p, assertResearchClaimLedgerIntegrity as pn, ClaimLedgerMigrationRequiredError as pt, normalizePageText as q, isKernelAnchoredPath as qn, normalizeLinkTarget as qt, KNOWLEDGE_SEARCH_RETRIEVER_ID as r, ResearchClaimEvidenceSchema as rn, withSafeDirectory as rr, verdictFor as rt, buildKnowledgeLexicalIndex as s, SourceAnchorSchema as sn, writeJsonDurableWithinRoot as sr, addSourcePath as st, explainKnowledgeTarget as t, KnowledgePageSchema as tn, syncDirectory as tr, gradeClaims as tt, tokenizeText as u, ClaimLedgerGoalConflictError as un, snapshotSourceTextInput as ut, parseKnowledgeWriteBlocks as v, deepQuestionId as vn, KB_STORE_DIR as vt, isKnowledgeToolChain as w, normalizeClaimText as wn, KnowledgeCitationResolutionError as wt, RUN_LINEAGE_BASENAME as x, materializeRegisteredClaimEvidence as xn, buildKnowledgeGraph as xt, KnowledgeDuplicateIntakeError as y, emptyClaimLedger as yn, MemoryKbStore as yt, normalizeVisibilityRef as z, finishKnowledgeFileTransaction as zn, isKnowledgePagePath as zt };
4637
4895
 
4638
- //# sourceMappingURL=inspect-C6c4zuKp.js.map
4896
+ //# sourceMappingURL=inspect-CMigdsD5.js.map