@tangle-network/agent-knowledge 22.0.1 → 22.0.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.
@@ -3950,25 +3950,36 @@ function extractSourceRefs(text) {
3950
3950
  //#endregion
3951
3951
  //#region src/validate.ts
3952
3952
  function validateKnowledgeIndex(index, options = {}) {
3953
- const findings = [...lintKnowledgeIndex(index)];
3953
+ return prepareKnowledgeValidation(index).validate(options);
3954
+ }
3955
+ /** One observation's lint/schema findings; strictness is a caller-owned policy. */
3956
+ function prepareKnowledgeValidation(index) {
3957
+ const lintFindings = lintKnowledgeIndex(index);
3958
+ const findings = [...lintFindings];
3954
3959
  const parsed = KnowledgeIndexSchema.safeParse(index);
3955
3960
  if (!parsed.success) findings.push({
3956
3961
  type: "missing-frontmatter",
3957
3962
  severity: "error",
3958
3963
  message: parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")
3959
3964
  });
3960
- if (options.strict) for (const page of index.pages) {
3961
- if (isScaffoldPath(page.path)) continue;
3962
- if (!page.frontmatter.id || !page.frontmatter.title) findings.push({
3963
- type: "missing-frontmatter",
3964
- severity: "error",
3965
- page: page.path,
3966
- message: "Strict mode requires id and title frontmatter."
3967
- });
3968
- }
3969
3965
  return {
3970
- ok: !findings.some((finding) => finding.severity === "error"),
3971
- findings
3966
+ lintFindings,
3967
+ validate(options = {}) {
3968
+ const result = [...findings];
3969
+ if (options.strict) for (const page of index.pages) {
3970
+ if (isScaffoldPath(page.path)) continue;
3971
+ if (!page.frontmatter.id || !page.frontmatter.title) result.push({
3972
+ type: "missing-frontmatter",
3973
+ severity: "error",
3974
+ page: page.path,
3975
+ message: "Strict mode requires id and title frontmatter."
3976
+ });
3977
+ }
3978
+ return {
3979
+ ok: !result.some((finding) => finding.severity === "error"),
3980
+ findings: result
3981
+ };
3982
+ }
3972
3983
  };
3973
3984
  }
3974
3985
  //#endregion
@@ -4994,6 +5005,6 @@ function explainKnowledgeTarget(index, target) {
4994
5005
  };
4995
5006
  }
4996
5007
  //#endregion
4997
- export { snapshotSourceTextInput as $, textSourceAdapter as $n, ClaimLedgerGoalConflictError as $t, validateKnowledgePage as A, knowledgeFileTransactionPlanHash as An, knowledgePageFromMarkdown as At, DEADLINE_EXIT_CODE as B, readRegularFileNoFollow as Bn, KnowledgeGraphEdgeSchema as Bt, immutablePageDigest as C, withKnowledgeMutation as Cn, resolveKnowledgeCitations as Ct, normalizeVisibilityArtifact as D, assertKnowledgeMutationPath as Dn, initKnowledgeBase as Dt, nonEmpty as E, applyKnowledgeFileTransaction as En, SCAFFOLD_PAGE_BASENAMES as Et, detectNearDuplicatePages as F, canonicalPathsEqual as Fn, extractWikilinks as Ft, gradeFor as G, syncDirectory as Gn, KnowledgeRelationSchema as Gt, assertGradeableEvidence as H, relativeWithinRoot as Hn, KnowledgeIndexSchema as Ht, normalizePageText as I, canonicalRelativeWithinRoot as In, normalizeLinkTarget as It, buildKnowledgeIndex as J, writeFileDurable as Jn, ResearchClaimRecordSchema as Jt, verdictFor as K, withSafeDescendant as Kn, ResearchClaimEvidenceSchema as Kt, validateKnowledgeIndex as L, isKernelAnchoredPath as Ln, DeepQuestionSchema as Lt, verifyKnowledgeVisibilitySnapshot as M, rollbackKnowledgeFileTransaction as Mn, loadKnowledgePages as Mt, visibilityIdentity as N, DEFAULT_PAGES_DIRECTORY as Nn, writeJson as Nt, normalizeVisibilityRef as O, commitKnowledgeFileMutations as On, isKnowledgePagePath as Ot, visibilityIndexOf as P, normalizePagesDirectory as Pn, WIKILINK_REGEX as Pt, loadSourceRegistry as Q, mediaTypeFor$1 as Qn, KNOWLEDGE_EVENT_TYPES as Qt, lintKnowledgeIndex as R, isMissingFile as Rn, KnowledgeBaseCandidateSchema as Rt, encodeKnowledgeVisibilitySnapshot as S, runInKnowledgeMutationScope as Sn, resolveKnowledgeCitation as St, knowledgeVisibilityArtifactRef as T, withKnowledgeRead as Tn, resolveRunScopedCitations as Tt, claimCheckKey as U, removeDurable as Un, KnowledgePageInvalidationSchema as Ut, UncheckableClaimError as V, readRegularFileWithinRoot as Vn, KnowledgeGraphNodeSchema as Vt, gradeClaims as W, renameDurable as Wn, KnowledgePageSchema as Wt, addSourcePath as X, writeJsonDurable as Xn, SourceAnchorSchema as Xt, writeKnowledgeIndex as Y, writeFileDurableWithinRoot as Yn, ResearchSourceVersionSchema as Yt, addSourceText as Z, writeJsonDurableWithinRoot as Zn, SourceRecordSchema as Zt, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION as _, acquireDurableFileLock as _n, assertRunScopedCitationsResolved as _t, applyKnowledgeWriteBlocksFile as a, claimId as an, KB_EVENTS_PATH as at, decodeKnowledgeVisibilitySnapshot as b, measureKnowledgeMutation as bn, formatKnowledgeCitationReference as bt, KnowledgeDuplicateIntakeError as c, emptyClaimLedger as cn, MemoryKbStore as ct, createFileRunLineageAuthority as d, mergeClaimLedgers as dn, knowledgePageRelations as dt, assertDeepQuestionIntegrity as en, sourceRegistryPath as et, createRunScopedStores as f, mergeTrackedClaims as fn, KnowledgeCitationAuditError as ft, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM as g, parseFrontmatter as gn, assertKnowledgeCitationsResolved as gt, originatedPages as h, formatFrontmatter as hn, assertKnowledgeCitationAudit as ht, applyKnowledgeWriteBlocks as i, claimEvidenceId as in, KB_CLAIM_LEDGER_DIR as it, validateOrigin as j, prepareKnowledgeFileTransaction as jn, layoutFor as jt, snapshotImmutableVisibility as k, finishKnowledgeFileTransaction as kn, isScaffoldPath as kt, assertKnowledgeWriteIntake as l, linkClaimContradictions as ln, assertClaimLedgerId as lt, loadKnowledgeToolChain as m, researchSourceVersionKey as mn, assertCurrentRunCitationsResolved as mt, inspectKnowledgeIndex as n, assertResearchClaimLedgerIntegrity as nn, ClaimLedgerMigrationRequiredError as nt, isSafeKnowledgePath as o, claimSourceHost as on, KB_INDEX_PATH as ot, isKnowledgeToolChain as p, normalizeClaimText as pn, KnowledgeCitationResolutionError as pt, verifyGradeableEvidence as q, withSafeDirectory as qn, ResearchClaimLedgerSchema as qt, stringMetadata as r, assertTrackedClaimIntegrity as rn, FileSystemKbStore as rt, parseKnowledgeWriteBlocks as s, deepQuestionId as sn, KB_STORE_DIR as st, explainKnowledgeTarget as t, assertResearchClaimEvidenceIntegrity as tn, writeSourceRegistry as tt, RUN_LINEAGE_BASENAME as u, materializeRegisteredClaimEvidence as un, buildKnowledgeGraph as ut, assertSchemaVersion as v, inspectPendingKnowledgeMutation as vn, auditCurrentRunCitations as vt, knowledgePageDigest as w, withKnowledgeMutationLabel as wn, resolveRunScopedCitation as wt, digest as x, recoverPendingKnowledgeMutation as xn, parseKnowledgeCitationReference as xt, createKnowledgeVisibilitySnapshot as y, isKnowledgeMutationHeld as yn, auditKnowledgeCitations as yt, CHECKABLE_RUNG_THRESHOLD as z, listRegularFilesWithinRoot as zn, KnowledgeEventSchema as zt };
5008
+ export { loadSourceRegistry as $, mediaTypeFor$1 as $n, KNOWLEDGE_EVENT_TYPES as $t, validateKnowledgePage as A, finishKnowledgeFileTransaction as An, isScaffoldPath as At, CHECKABLE_RUNG_THRESHOLD as B, listRegularFilesWithinRoot as Bn, KnowledgeEventSchema as Bt, immutablePageDigest as C, runInKnowledgeMutationScope as Cn, resolveKnowledgeCitation as Ct, normalizeVisibilityArtifact as D, applyKnowledgeFileTransaction as Dn, SCAFFOLD_PAGE_BASENAMES as Dt, nonEmpty as E, withKnowledgeRead as En, resolveRunScopedCitations as Et, detectNearDuplicatePages as F, normalizePagesDirectory as Fn, WIKILINK_REGEX as Ft, gradeClaims as G, renameDurable as Gn, KnowledgePageSchema as Gt, UncheckableClaimError as H, readRegularFileWithinRoot as Hn, KnowledgeGraphNodeSchema as Ht, normalizePageText as I, canonicalPathsEqual as In, extractWikilinks as It, verifyGradeableEvidence as J, withSafeDirectory as Jn, ResearchClaimLedgerSchema as Jt, gradeFor as K, syncDirectory as Kn, KnowledgeRelationSchema as Kt, prepareKnowledgeValidation as L, canonicalRelativeWithinRoot as Ln, normalizeLinkTarget as Lt, verifyKnowledgeVisibilitySnapshot as M, prepareKnowledgeFileTransaction as Mn, layoutFor as Mt, visibilityIdentity as N, rollbackKnowledgeFileTransaction as Nn, loadKnowledgePages as Nt, normalizeVisibilityRef as O, assertKnowledgeMutationPath as On, initKnowledgeBase as Ot, visibilityIndexOf as P, DEFAULT_PAGES_DIRECTORY as Pn, writeJson as Pt, addSourceText as Q, writeJsonDurableWithinRoot as Qn, SourceRecordSchema as Qt, validateKnowledgeIndex as R, isKernelAnchoredPath as Rn, DeepQuestionSchema as Rt, encodeKnowledgeVisibilitySnapshot as S, recoverPendingKnowledgeMutation as Sn, parseKnowledgeCitationReference as St, knowledgeVisibilityArtifactRef as T, withKnowledgeMutationLabel as Tn, resolveRunScopedCitation as Tt, assertGradeableEvidence as U, relativeWithinRoot as Un, KnowledgeIndexSchema as Ut, DEADLINE_EXIT_CODE as V, readRegularFileNoFollow as Vn, KnowledgeGraphEdgeSchema as Vt, claimCheckKey as W, removeDurable as Wn, KnowledgePageInvalidationSchema as Wt, writeKnowledgeIndex as X, writeFileDurableWithinRoot as Xn, ResearchSourceVersionSchema as Xt, buildKnowledgeIndex as Y, writeFileDurable as Yn, ResearchClaimRecordSchema as Yt, addSourcePath as Z, writeJsonDurable as Zn, SourceAnchorSchema as Zt, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION as _, parseFrontmatter as _n, assertKnowledgeCitationsResolved as _t, applyKnowledgeWriteBlocksFile as a, claimEvidenceId as an, KB_CLAIM_LEDGER_DIR as at, decodeKnowledgeVisibilitySnapshot as b, isKnowledgeMutationHeld as bn, auditKnowledgeCitations as bt, KnowledgeDuplicateIntakeError as c, deepQuestionId as cn, KB_STORE_DIR as ct, createFileRunLineageAuthority as d, materializeRegisteredClaimEvidence as dn, buildKnowledgeGraph as dt, ClaimLedgerGoalConflictError as en, textSourceAdapter as er, snapshotSourceTextInput as et, createRunScopedStores as f, mergeClaimLedgers as fn, knowledgePageRelations as ft, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM as g, formatFrontmatter as gn, assertKnowledgeCitationAudit as gt, originatedPages as h, researchSourceVersionKey as hn, assertCurrentRunCitationsResolved as ht, applyKnowledgeWriteBlocks as i, assertTrackedClaimIntegrity as in, FileSystemKbStore as it, validateOrigin as j, knowledgeFileTransactionPlanHash as jn, knowledgePageFromMarkdown as jt, snapshotImmutableVisibility as k, commitKnowledgeFileMutations as kn, isKnowledgePagePath as kt, assertKnowledgeWriteIntake as l, emptyClaimLedger as ln, MemoryKbStore as lt, loadKnowledgeToolChain as m, normalizeClaimText as mn, KnowledgeCitationResolutionError as mt, inspectKnowledgeIndex as n, assertResearchClaimEvidenceIntegrity as nn, writeSourceRegistry as nt, isSafeKnowledgePath as o, claimId as on, KB_EVENTS_PATH as ot, isKnowledgeToolChain as p, mergeTrackedClaims as pn, KnowledgeCitationAuditError as pt, verdictFor as q, withSafeDescendant as qn, ResearchClaimEvidenceSchema as qt, stringMetadata as r, assertResearchClaimLedgerIntegrity as rn, ClaimLedgerMigrationRequiredError as rt, parseKnowledgeWriteBlocks as s, claimSourceHost as sn, KB_INDEX_PATH as st, explainKnowledgeTarget as t, assertDeepQuestionIntegrity as tn, sourceRegistryPath as tt, RUN_LINEAGE_BASENAME as u, linkClaimContradictions as un, assertClaimLedgerId as ut, assertSchemaVersion as v, acquireDurableFileLock as vn, assertRunScopedCitationsResolved as vt, knowledgePageDigest as w, withKnowledgeMutation as wn, resolveKnowledgeCitations as wt, digest as x, measureKnowledgeMutation as xn, formatKnowledgeCitationReference as xt, createKnowledgeVisibilitySnapshot as y, inspectPendingKnowledgeMutation as yn, auditCurrentRunCitations as yt, lintKnowledgeIndex as z, isMissingFile as zn, KnowledgeBaseCandidateSchema as zt };
4998
5009
 
4999
- //# sourceMappingURL=inspect-DBxyQSdt.js.map
5010
+ //# sourceMappingURL=inspect-rnlXAb4O.js.map