kibi-cli 2.35.1 → 2.38.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.
Files changed (154) hide show
  1. package/dist/cli-operation-metadata.d.ts +1 -1
  2. package/dist/cli-operation-metadata.js +1 -1
  3. package/dist/cli-register-foundation.d.ts.map +1 -1
  4. package/dist/cli-register-foundation.js +2 -1
  5. package/dist/cli-register-maintenance.d.ts.map +1 -1
  6. package/dist/cli-register-maintenance.js +5 -0
  7. package/dist/cli-validate.d.ts.map +1 -1
  8. package/dist/cli-validate.js +21 -2
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +16 -1
  11. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  12. package/dist/commands/aggregated-checks.js +89 -16
  13. package/dist/commands/doctor.d.ts.map +1 -1
  14. package/dist/commands/doctor.js +56 -35
  15. package/dist/commands/github-init.d.ts.map +1 -1
  16. package/dist/commands/github-init.js +4 -2
  17. package/dist/commands/hook-managers.d.ts +43 -0
  18. package/dist/commands/hook-managers.d.ts.map +1 -0
  19. package/dist/commands/hook-managers.js +426 -0
  20. package/dist/commands/init.d.ts +1 -0
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +40 -5
  23. package/dist/commands/sync/persistence.d.ts.map +1 -1
  24. package/dist/commands/sync/persistence.js +43 -1
  25. package/dist/commands/telemetry.d.ts +7 -0
  26. package/dist/commands/telemetry.d.ts.map +1 -0
  27. package/dist/commands/telemetry.js +23 -0
  28. package/dist/decision-firmness.d.ts.map +1 -1
  29. package/dist/decision-firmness.js +11 -14
  30. package/dist/engine-limits.d.ts.map +1 -1
  31. package/dist/engine-limits.js +8 -10
  32. package/dist/entity-body-context.d.ts.map +1 -1
  33. package/dist/entity-body-context.js +39 -36
  34. package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
  35. package/dist/extractors/symbol-coordinates.js +23 -4
  36. package/dist/firm-decision-edit.d.ts.map +1 -1
  37. package/dist/firm-decision-edit.js +1 -3
  38. package/dist/intent-search.d.ts +5 -1
  39. package/dist/intent-search.d.ts.map +1 -1
  40. package/dist/intent-search.js +118 -33
  41. package/dist/logic/ir.d.ts.map +1 -1
  42. package/dist/logic/ir.js +82 -108
  43. package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
  44. package/dist/operations/bootstrap/guidance-actions.js +2 -1
  45. package/dist/operations/bootstrap/plugin-offers.d.ts +11 -2
  46. package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
  47. package/dist/operations/bootstrap/plugin-offers.js +48 -9
  48. package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
  49. package/dist/operations/proof/claim-bindings.js +1 -0
  50. package/dist/operations/proof/code-certificates.d.ts +2 -0
  51. package/dist/operations/proof/code-certificates.d.ts.map +1 -1
  52. package/dist/operations/proof/code-certificates.js +34 -14
  53. package/dist/operations/proof/code-models.d.ts.map +1 -1
  54. package/dist/operations/proof/code-models.js +19 -5
  55. package/dist/operations/proof/code-runner.d.ts +16 -0
  56. package/dist/operations/proof/code-runner.d.ts.map +1 -1
  57. package/dist/operations/proof/code-runner.js +42 -6
  58. package/dist/plugins/compose-search-hints.d.ts +29 -0
  59. package/dist/plugins/compose-search-hints.d.ts.map +1 -0
  60. package/dist/plugins/compose-search-hints.js +94 -0
  61. package/dist/plugins/external-allowlist.d.ts +7 -0
  62. package/dist/plugins/external-allowlist.d.ts.map +1 -1
  63. package/dist/plugins/external-allowlist.js +11 -0
  64. package/dist/plugins/registry.d.ts +8 -1
  65. package/dist/plugins/registry.d.ts.map +1 -1
  66. package/dist/plugins/registry.js +22 -3
  67. package/dist/prolog/codec.d.ts.map +1 -1
  68. package/dist/prolog/codec.js +10 -20
  69. package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
  70. package/dist/public/impact/coverage-depth-quality.js +32 -16
  71. package/dist/public/impact/full-kb-quality.d.ts +6 -0
  72. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  73. package/dist/public/impact/full-kb-quality.js +8 -3
  74. package/dist/public/impact/requirement-quality.d.ts.map +1 -1
  75. package/dist/public/impact/requirement-quality.js +56 -29
  76. package/dist/public/operations/catalog.d.ts +13 -3
  77. package/dist/public/operations/catalog.d.ts.map +1 -1
  78. package/dist/public/operations/check-executor.d.ts +6 -0
  79. package/dist/public/operations/check-executor.d.ts.map +1 -1
  80. package/dist/public/operations/check-executor.js +34 -2
  81. package/dist/public/operations/discovery-executors.d.ts +5 -1
  82. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  83. package/dist/public/operations/discovery-executors.js +65 -4
  84. package/dist/public/operations/evidence-floor.d.ts +8 -1
  85. package/dist/public/operations/evidence-floor.d.ts.map +1 -1
  86. package/dist/public/operations/evidence-floor.js +3 -4
  87. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  88. package/dist/public/operations/migration-plan.js +41 -10
  89. package/dist/public/operations/node-ports.d.ts.map +1 -1
  90. package/dist/public/operations/node-ports.js +3 -1
  91. package/dist/public/operations/source-analysis-cache.d.ts +22 -0
  92. package/dist/public/operations/source-analysis-cache.d.ts.map +1 -0
  93. package/dist/public/operations/source-analysis-cache.js +157 -0
  94. package/dist/public/operations/specs/discovery.d.ts +7 -2
  95. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  96. package/dist/public/operations/specs/discovery.js +7 -2
  97. package/dist/public/operations/specs/mutation-schemas.d.ts +6 -1
  98. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  99. package/dist/public/operations/specs/upsert.d.ts +6 -1
  100. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  101. package/dist/public/operations/symbol-granularity-check.d.ts +3 -1
  102. package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -1
  103. package/dist/public/operations/symbol-granularity-check.js +21 -7
  104. package/dist/public/proof-protocol.d.ts +6 -1
  105. package/dist/public/proof-protocol.d.ts.map +1 -1
  106. package/dist/public/proof-protocol.js +12 -3
  107. package/dist/public/proof-sources.d.ts +2 -0
  108. package/dist/public/proof-sources.d.ts.map +1 -1
  109. package/dist/public/proof-sources.js +32 -6
  110. package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
  111. package/dist/public/skills/kibi-usage/SKILL.md +42 -3
  112. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
  113. package/dist/public/skills/kibi-usage/resources/proof.md +13 -5
  114. package/dist/public/skills/kibi-usage/resources/workflows.md +10 -0
  115. package/dist/relationships/shards.d.ts +2 -0
  116. package/dist/relationships/shards.d.ts.map +1 -1
  117. package/dist/relationships/shards.js +25 -1
  118. package/dist/schemas/entity.schema.json +6 -1
  119. package/dist/search-answer.js +1 -1
  120. package/dist/search-hints.d.ts +58 -0
  121. package/dist/search-hints.d.ts.map +1 -0
  122. package/dist/search-hints.js +187 -0
  123. package/dist/search-ranking.d.ts +7 -0
  124. package/dist/search-ranking.d.ts.map +1 -1
  125. package/dist/search-ranking.js +54 -56
  126. package/dist/search-token-cache.d.ts +30 -0
  127. package/dist/search-token-cache.d.ts.map +1 -0
  128. package/dist/search-token-cache.js +86 -0
  129. package/dist/usage-telemetry.d.ts +11 -0
  130. package/dist/usage-telemetry.d.ts.map +1 -0
  131. package/dist/usage-telemetry.js +47 -0
  132. package/dist/utils/branch-resolver.d.ts.map +1 -1
  133. package/dist/utils/branch-resolver.js +1 -0
  134. package/package.json +5 -4
  135. package/src/public/impact/coverage-depth-quality.ts +59 -21
  136. package/src/public/impact/full-kb-quality.ts +15 -1
  137. package/src/public/impact/requirement-quality.ts +95 -38
  138. package/src/public/operations/check-executor.ts +41 -1
  139. package/src/public/operations/discovery-executors.ts +92 -4
  140. package/src/public/operations/evidence-floor.ts +15 -3
  141. package/src/public/operations/migration-plan.ts +41 -9
  142. package/src/public/operations/node-ports.ts +3 -1
  143. package/src/public/operations/source-analysis-cache.ts +196 -0
  144. package/src/public/operations/specs/discovery.ts +8 -2
  145. package/src/public/operations/symbol-granularity-check.ts +25 -5
  146. package/src/public/proof-protocol-types.d.ts +1 -1
  147. package/src/public/proof-protocol.ts +18 -4
  148. package/src/public/proof-sources.ts +37 -6
  149. package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
  150. package/src/public/skills/kibi-usage/SKILL.md +42 -3
  151. package/src/public/skills/kibi-usage/resources/fact-lanes.md +34 -0
  152. package/src/public/skills/kibi-usage/resources/proof.md +13 -5
  153. package/src/public/skills/kibi-usage/resources/workflows.md +10 -0
  154. package/src/schemas/entity.schema.json +6 -1
@@ -7,6 +7,7 @@ import { executeIntentSearch, questionPaths, validateIntentSearchInput, } from "
7
7
  import { classifyActivation } from "../../operations/bootstrap/activation.js";
8
8
  import { SwiplResolutionError } from "../../prolog/swipl-resolver.js";
9
9
  import { buildSearchAnswer } from "../../search-answer.js";
10
+ import { buildSearchHints, searchHintsNote, searchHintsTrigger, } from "../../search-hints.js";
10
11
  import { rankEntities } from "../../search-ranking.js";
11
12
  import { resolveBranchAttachment } from "../../utils/branch-resolver.js";
12
13
  import { BRANCH_STORE_NOT_COMPILED, branchStoreReason, inspectBranchStore, storeLockJournalReason, storeLockTakeoverReason, uncompiledBranchStoreReason, } from "../../utils/branch-store.js";
@@ -584,9 +585,49 @@ function questionPathHint(query, locations) {
584
585
  ? ` The question names ${list}; its words were left out of the topic. Pass it as sourceLocations to also see the requirements linked to that file.`
585
586
  : ` The question names ${list}; their words were left out of the topic. Pass them as sourceLocations to also see the requirements linked to those files.`;
586
587
  }
588
+ /**
589
+ * Hints from the workspace's kibi.search-hints.v1 provider. A host without a
590
+ * plugin runtime, or a registry that fails to load, gives no hints rather than
591
+ * failing the search.
592
+ */
593
+ // implements REQ-kibi-search-hints-host
594
+ async function searchHintsFor(context, options) {
595
+ if (!context.ensurePlugins)
596
+ return undefined;
597
+ let resolution;
598
+ try {
599
+ resolution = await (await context.ensurePlugins()).resolveSearchHints();
600
+ }
601
+ catch (error) {
602
+ // A configured provider that cannot load is reported, not thrown: the
603
+ // lexical answer stands on its own.
604
+ const trigger = searchHintsTrigger(options.analysis);
605
+ return trigger === null
606
+ ? undefined
607
+ : {
608
+ trigger,
609
+ provider: null,
610
+ items: [],
611
+ diagnostics: [
612
+ {
613
+ pluginId: "unresolved",
614
+ packageName: null,
615
+ mode: "replace",
616
+ code: "provider_unavailable",
617
+ message: error instanceof Error ? error.message : String(error),
618
+ },
619
+ ],
620
+ };
621
+ }
622
+ return buildSearchHints({
623
+ ...options,
624
+ resolution,
625
+ workspaceRoot: context.workspaceRoot,
626
+ });
627
+ }
587
628
  export async function executeSearch(input, context) {
588
629
  // implements REQ-kibi-operation-interface-parity, REQ-mcp-search-discovery
589
- const { query, type, limit = 10, offset = 0, rankingMode = "intent-v1", semanticFacets, sourceLocations, minScore, fields = "summary", answer, } = input;
630
+ const { query, type, limit = 10, offset = 0, rankingMode = "intent-v1", semanticFacets, sourceLocations, minScore, fields = "summary", answer, hints: hintsWanted = true, } = input;
590
631
  const trimmedQuery = query.trim();
591
632
  if (!trimmedQuery) {
592
633
  throw new Error("Search execution failed: query must be a non-empty string");
@@ -615,7 +656,10 @@ export async function executeSearch(input, context) {
615
656
  ...(minScore !== undefined ? { minScore } : {}),
616
657
  };
617
658
  validateIntentSearchInput(intentInput);
618
- const intentResult = await executeIntentSearch(intentInput, prolog, context.workspaceRoot);
659
+ let corpus;
660
+ const intentResult = await executeIntentSearch(intentInput, prolog, context.workspaceRoot, (entities, bodies) => {
661
+ corpus = { entities, bodies };
662
+ });
619
663
  const paginated = paginateResults(intentResult.matches, limit, offset);
620
664
  // The answer layer summarizes the whole ranking, so it belongs to the
621
665
  // first page only.
@@ -630,12 +674,27 @@ export async function executeSearch(input, context) {
630
674
  // A top match no requirement owns is said in the digest too, so the
631
675
  // governing list is never read as the top match's requirement.
632
676
  const topUngoverned = answerLayer?.ungoverned.find((entry) => entry.rank === 1);
677
+ // Hints come after the lexical answer and never change it; a strong
678
+ // answer never reaches a provider.
679
+ const hints = hintsWanted &&
680
+ offset === 0 &&
681
+ corpus !== undefined &&
682
+ searchHintsTrigger(intentResult.analysis) !== null
683
+ ? await searchHintsFor(context, {
684
+ query: trimmedQuery,
685
+ analysis: intentResult.analysis,
686
+ entities: corpus.entities,
687
+ bodies: corpus.bodies,
688
+ governingIds: (answerLayer?.governing ?? []).map((req) => req.id),
689
+ prolog,
690
+ })
691
+ : undefined;
633
692
  const text = `${intentResult.matches.length === 0
634
693
  ? `No intent search results for '${trimmedQuery}' (abstained). No entity shares enough of the question's words: ask again in the words and language the KB is written in, or pass sourceLocations.`
635
694
  : `Found ${intentResult.matches.length} intent search results for '${trimmedQuery}'${intentResult.analysis.ambiguous ? " (top matches are close; confirm before relying on one)" : ""}. Top: ${paginated
636
695
  .slice(0, 5)
637
696
  .map((match) => String(match.entity.id ?? ""))
638
- .join(", ")}${answerLayer ? `. Governing: ${answerLayer.governing.map((req) => req.id).join(", ") || "none found"}` : ""}${topUngoverned ? ` (the top match ${topUngoverned.id} is linked to no requirement)` : ""}.`}${questionPathHint(trimmedQuery, sourceLocations)}${CONTRADICTION_QUESTION.test(trimmedQuery) ? CONTRADICTION_HINT : ""}${storeNote}`;
697
+ .join(", ")}${answerLayer ? `. Governing: ${answerLayer.governing.map((req) => req.id).join(", ") || "none found"}` : ""}${topUngoverned ? ` (the top match ${topUngoverned.id} is linked to no requirement)` : ""}.`}${searchHintsNote(hints)}${questionPathHint(trimmedQuery, sourceLocations)}${CONTRADICTION_QUESTION.test(trimmedQuery) ? CONTRADICTION_HINT : ""}${storeNote}`;
639
698
  return {
640
699
  content: [{ type: "text", text }],
641
700
  structuredContent: {
@@ -643,7 +702,9 @@ export async function executeSearch(input, context) {
643
702
  count: intentResult.matches.length,
644
703
  returned: paginated.length,
645
704
  truncated: offset + paginated.length < intentResult.matches.length,
646
- queryAnalysis: intentResult.analysis,
705
+ queryAnalysis: hints !== undefined
706
+ ? { ...intentResult.analysis, hints }
707
+ : intentResult.analysis,
647
708
  ...(answerLayer ? { answer: answerLayer } : {}),
648
709
  ...branchFields,
649
710
  },
@@ -27,6 +27,13 @@ export type EvidenceFloorOptions = Readonly<{
27
27
  * `kibi prove --all`.
28
28
  */
29
29
  freshEvidence?: boolean;
30
+ /**
31
+ * The instant and workspace snapshot the whole check judges receipts at,
32
+ * so the floor reads the same requirement proofs the coverage evidence
33
+ * read instead of computing them again.
34
+ */
35
+ checkedAt?: string;
36
+ snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot>>;
30
37
  }>;
31
38
  /** The entities behind the gaps, for a person reading kibi check's text. */
32
39
  export declare function gapDetailLines(row: EvidenceFloorRow): string[];
@@ -39,7 +46,7 @@ export declare function evidenceFloorViolations(rows: readonly EvidenceFloorRow[
39
46
  * ignores the schema version, so a migration can read the floor the ladder
40
47
  * will apply before it records the new schema.
41
48
  */
42
- export declare function readEvidenceFloorRows(context: OperationContext, snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot>>): Promise<readonly EvidenceFloorRow[]>;
49
+ export declare function readEvidenceFloorRows(context: OperationContext, snapshotEvidence?: Awaited<ReturnType<typeof readWorkspaceSnapshot>>, checkedAt?: string): Promise<readonly EvidenceFloorRow[]>;
43
50
  /**
44
51
  * Evaluate the evidence-floor rule against the attached store, with the same
45
52
  * per-contract receipt binding kb_coverage uses.
@@ -1 +1 @@
1
- {"version":3,"file":"evidence-floor.d.ts","sourceRoot":"","sources":["../../../src/public/operations/evidence-floor.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;GAIG;AAEH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,mEAAmE;AAEnE,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAGpD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC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SAAS,GAAE,MAAsC,GAChD,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAetC;AAED;;;GAGG;AAEH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC,CAiCtB"}
@@ -98,7 +98,7 @@ export function evidenceFloorViolations(rows, options = {}) {
98
98
  * will apply before it records the new schema.
99
99
  */
100
100
  // implements REQ-kibi-evidence-floors
101
- export async function readEvidenceFloorRows(context, snapshotEvidence) {
101
+ export async function readEvidenceFloorRows(context, snapshotEvidence, checkedAt = context.clock().toISOString()) {
102
102
  const prolog = context.prolog ?? (await context.ensureProlog?.());
103
103
  if (prolog === undefined)
104
104
  return [];
@@ -106,7 +106,6 @@ export async function readEvidenceFloorRows(context, snapshotEvidence) {
106
106
  const snapshot = evidence.available ? evidence.snapshot.hash : "unknown";
107
107
  const { perContractTestBindings } = await import("./specs/reporting.js");
108
108
  const bindings = await perContractTestBindings({ ...context, prolog });
109
- const checkedAt = context.clock().toISOString();
110
109
  const goal = `discovery:evidence_floor_json(${bindings === null ? "strict_snapshot, _{}" : `per_contract, ${bindings}`}, ${toPrologAtom(snapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`;
111
110
  const payload = await runOperationJsonQuery(prolog, "discovery.pl", goal, "Evidence floor evaluation");
112
111
  return payload.rows ?? [];
@@ -124,8 +123,8 @@ export async function collectEvidenceFloorViolations(context, rules, options = {
124
123
  if (schemaVersion === undefined ||
125
124
  schemaVersion < EVIDENCE_FLOOR_SCHEMA_VERSION)
126
125
  return [];
127
- const snapshotEvidence = await readWorkspaceSnapshot(context);
128
- const rows = await readEvidenceFloorRows(context, snapshotEvidence);
126
+ const snapshotEvidence = options.snapshotEvidence ?? (await readWorkspaceSnapshot(context));
127
+ const rows = await readEvidenceFloorRows(context, snapshotEvidence, options.checkedAt);
129
128
  const violations = evidenceFloorViolations(rows, options);
130
129
  if (options.freshEvidence === true) {
131
130
  const clean = snapshotEvidence.available && snapshotEvidence.snapshot.dirty === false;
@@ -1 +1 @@
1
- {"version":3,"file":"migration-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/migration-plan.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,sBAAsB,EAAG,wBAAiC,CAAC;AAExE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,SAAS,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAErE,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,CAAC;IACP,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1C,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEP,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EACJ,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,WAAW,GACX,cAAc,GACd,QAAQ,GACR,UAAU,GACV,OAAO,GACP,SAAS,CAAC;IACd,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,mBAAmB,CAAC;IAChC,iBAAiB,EAAE,SAAS,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has(dependency))),
56
56
  ]));
57
+ // Dependents of each action in action order, so an emitted action frees
58
+ // its dependents in the order a scan over every action would.
59
+ const dependents = new Map();
60
+ for (const action of actions) {
61
+ for (const dependency of remaining.get(action.id)) {
62
+ const list = dependents.get(dependency);
63
+ if (list === undefined)
64
+ dependents.set(dependency, [action.id]);
65
+ else
66
+ list.push(action.id);
67
+ }
68
+ }
57
69
  const ordered = [];
58
70
  const ready = actions
59
71
  .filter((action) => (remaining.get(action.id)?.size ?? 0) === 0)
60
72
  .sort(actionSort)
61
73
  .map((action) => action.id);
62
74
  const queued = new Set(ready);
63
- while (ready.length > 0) {
64
- const id = ready.shift();
65
- if (id === undefined)
66
- break;
75
+ const compareReady = (left, right) => compareReadyActionIds(left, right, byId);
76
+ // `ready` stays sorted; a freed action is inserted after its equals, where
77
+ // a stable sort of the pushed list would have put it.
78
+ const enqueue = (id, head) => {
79
+ let low = head;
80
+ let high = ready.length;
81
+ while (low < high) {
82
+ const middle = (low + high) >>> 1;
83
+ if (compareReady(ready[middle], id) <= 0)
84
+ low = middle + 1;
85
+ else
86
+ high = middle;
87
+ }
88
+ ready.splice(low, 0, id);
89
+ };
90
+ let head = 0;
91
+ while (head < ready.length) {
92
+ const id = ready[head];
93
+ head += 1;
67
94
  queued.delete(id);
95
+ // Only ids of `actions` are ever queued or listed as dependents.
68
96
  const action = byId.get(id);
69
- if (action === undefined)
70
- continue;
71
97
  ordered.push(action);
72
- for (const [candidateId, dependencies] of remaining) {
98
+ for (const candidateId of dependents.get(id) ?? []) {
99
+ const dependencies = remaining.get(candidateId);
73
100
  if (!dependencies.delete(id) ||
74
101
  dependencies.size !== 0 ||
75
102
  queued.has(candidateId)) {
76
103
  continue;
77
104
  }
78
- ready.push(candidateId);
79
105
  queued.add(candidateId);
80
- ready.sort((left, right) => compareReadyActionIds(left, right, byId));
106
+ enqueue(candidateId, head);
81
107
  }
82
108
  }
83
109
  // Preserve cyclic/missing-dependency actions in canonical order; validation will block them.
@@ -103,7 +129,12 @@ function summarize(actions) {
103
129
  }
104
130
  // implements REQ-agent-guided-migration-orchestration
105
131
  export function buildMigrationPlan(input = {}) {
106
- const actions = dependencyOrder([...(input.actions ?? [])].sort(actionSort));
132
+ // An id names one action, as in a merged plan: a later definition of the
133
+ // same id replaces the earlier one instead of being ordered twice.
134
+ const uniqueActions = [
135
+ ...new Map((input.actions ?? []).map((action) => [action.id, action])).values(),
136
+ ];
137
+ const actions = dependencyOrder(uniqueActions.sort(actionSort));
107
138
  const evaluatedDomains = uniqueSorted(input.evaluatedDomains);
108
139
  const incompleteDomains = uniqueSorted(input.incompleteDomains);
109
140
  const expected = {
@@ -1 +1 @@
1
- {"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/E,KAAK,kBAAkB,GAAG,cAAc,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,QAAQ,CAAC,YAAY,EAAE,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAoKF,eAAO,MAAM,cAAc,EAAE,kBAkC5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAiBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAC"}
1
+ {"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/E,KAAK,kBAAkB,GAAG,cAAc,GAAG;IACzC,QAAQ,CAAC,IAAI,EAAE,CACb,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,GAAG;IAC3B,QAAQ,CAAC,YAAY,EAAE,CACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,KACrB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;CACjC,CAAC;AAsKF,eAAO,MAAM,cAAc,EAAE,kBAkC5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAiBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAC"}
@@ -82,11 +82,13 @@ async function workspaceSnapshot(workspaceRoot) {
82
82
  .sort((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0);
83
83
  const digest = createHash("sha256");
84
84
  digest.update("kibi.workspace-snapshot.v2\0");
85
+ // Synchronous reads: one awaited read per file paid a file-handle round
86
+ // trip each, about eight times the time of reading the same files directly.
85
87
  for (const { raw, key: relativePath } of paths) {
86
88
  digest.update(relativePath);
87
89
  digest.update("\0");
88
90
  try {
89
- const content = await fs.readFile(path.join(workspaceRoot, raw));
91
+ const content = fsSync.readFileSync(path.join(workspaceRoot, raw));
90
92
  digest.update(snapshotFileContent(relativePath, content));
91
93
  }
92
94
  catch (error) {
@@ -0,0 +1,22 @@
1
+ import type { HostSourceAnalysisResultV2 } from "../../plugins/source-analysis-service.js";
2
+ /**
3
+ * Parser-backed source analyses kept across `kibi check` runs. Parsing every
4
+ * symbol's source file was the largest client cost of a warm check, and an
5
+ * analysis is a pure function of the file's path and bytes under one
6
+ * analyzer set, so an entry is keyed by both and the whole cache by the
7
+ * analyzer set. The file lives in the branch store, which is never tracked.
8
+ */
9
+ export declare const SOURCE_ANALYSIS_CACHE_FILE = "source-analysis-cache.json";
10
+ export type SourceAnalysisCache = {
11
+ get(file: string, content: string): HostSourceAnalysisResultV2 | undefined;
12
+ set(file: string, content: string, analysis: HostSourceAnalysisResultV2): void;
13
+ /** Write the entries this run read or added, dropping the rest. */
14
+ save(): void;
15
+ };
16
+ /**
17
+ * The cache in `storeDir`, or null when the analyzer set cannot be
18
+ * fingerprinted or there is no store. Only complete (`ok`) analyses
19
+ * are kept; anything else is computed again.
20
+ */
21
+ export declare function openSourceAnalysisCache(storeDir: string | undefined, workspaceRoot: string): SourceAnalysisCache | null;
22
+ //# sourceMappingURL=source-analysis-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-analysis-cache.d.ts","sourceRoot":"","sources":["../../../src/public/operations/source-analysis-cache.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAE3F;;;;;;GAMG;AAEH,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AASvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,CAAC;IAC3E,GAAG,CACD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,0BAA0B,GACnC,IAAI,CAAC;IACR,mEAAmE;IACnE,IAAI,IAAI,IAAI,CAAC;CACd,CAAC;AAkFF;;;;GAIG;AAEH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,aAAa,EAAE,MAAM,GACpB,mBAAmB,GAAG,IAAI,CA4C5B"}
@@ -0,0 +1,157 @@
1
+ /*
2
+ Kibi — repo-local, per-branch, queryable long-term memory for software projects
3
+ Copyright (C) 2026 Piotr Franczyk
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU Affero General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU Affero General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Affero General Public License
16
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ import { createHash } from "node:crypto";
19
+ import { existsSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
20
+ import { createRequire } from "node:module";
21
+ import * as path from "node:path";
22
+ import { fingerprintMaintenanceSourceSet } from "../../plugins/maintenance-source-analysis.js";
23
+ import { readProjectKibiConfig } from "../../plugins/project-config.js";
24
+ /**
25
+ * Parser-backed source analyses kept across `kibi check` runs. Parsing every
26
+ * symbol's source file was the largest client cost of a warm check, and an
27
+ * analysis is a pure function of the file's path and bytes under one
28
+ * analyzer set, so an entry is keyed by both and the whole cache by the
29
+ * analyzer set. The file lives in the branch store, which is never tracked.
30
+ */
31
+ // implements REQ-cli-check
32
+ export const SOURCE_ANALYSIS_CACHE_FILE = "source-analysis-cache.json";
33
+ const SOURCE_ANALYSIS_CACHE_VERSION = 1;
34
+ function entryKey(file, content) {
35
+ return createHash("sha256")
36
+ .update(file)
37
+ .update("\0")
38
+ .update(content)
39
+ .digest("hex");
40
+ }
41
+ /**
42
+ * The builtin analyzer is identified by its package version, which a local
43
+ * build does not bump; its built files' sizes and times stand in for its
44
+ * code so a rebuilt analyzer starts a fresh cache.
45
+ */
46
+ function builtinBuildStamp() {
47
+ const hash = createHash("sha256");
48
+ try {
49
+ const manifest = createRequire(import.meta.url).resolve("kibi-plugin-builtin/package.json");
50
+ const symbolsDir = path.join(path.dirname(manifest), "dist", "symbols");
51
+ // rationale: readdir lists this directory in name order on the supported
52
+ // filesystems, so the sort only guards odd ones and no test can tell.
53
+ // Stryker disable next-line MethodExpression
54
+ for (const name of readdirSync(symbolsDir).sort()) {
55
+ const stat = statSync(path.join(symbolsDir, name));
56
+ hash.update(`${name}\0${stat.size}\0${stat.mtimeMs}\n`);
57
+ }
58
+ }
59
+ catch {
60
+ // An unavailable builtin package stamps as no built files.
61
+ }
62
+ // rationale: the stamp only feeds the analyzer-set JSON; a Buffer
63
+ // serializes as deterministically as the hex text it replaces.
64
+ // Stryker disable next-line StringLiteral
65
+ return hash.digest("hex");
66
+ }
67
+ function analyzerSetKey(workspaceRoot) {
68
+ try {
69
+ const sourceSet = fingerprintMaintenanceSourceSet(workspaceRoot, readProjectKibiConfig(workspaceRoot));
70
+ return createHash("sha256")
71
+ .update(JSON.stringify({
72
+ version: SOURCE_ANALYSIS_CACHE_VERSION,
73
+ sourceSet,
74
+ builtin: builtinBuildStamp(),
75
+ }))
76
+ .digest("hex");
77
+ }
78
+ catch {
79
+ // An analyzer set Kibi cannot fingerprint is never cached.
80
+ return null;
81
+ }
82
+ }
83
+ function readCacheFile(cachePath, analyzers) {
84
+ const empty = {
85
+ version: SOURCE_ANALYSIS_CACHE_VERSION,
86
+ analyzers,
87
+ entries: {},
88
+ };
89
+ try {
90
+ // A missing or unreadable file, or JSON null, throws and starts empty.
91
+ const parsed = JSON.parse(readFileSync(cachePath, "utf8"));
92
+ if (parsed.version !== SOURCE_ANALYSIS_CACHE_VERSION ||
93
+ parsed.analyzers !== analyzers ||
94
+ parsed.entries === null ||
95
+ typeof parsed.entries !== "object") {
96
+ return empty;
97
+ }
98
+ return parsed;
99
+ }
100
+ catch {
101
+ return empty;
102
+ }
103
+ }
104
+ /**
105
+ * The cache in `storeDir`, or null when the analyzer set cannot be
106
+ * fingerprinted or there is no store. Only complete (`ok`) analyses
107
+ * are kept; anything else is computed again.
108
+ */
109
+ // implements REQ-cli-check
110
+ export function openSourceAnalysisCache(storeDir, workspaceRoot) {
111
+ // rationale: an undefined directory does not exist either, so dropping the
112
+ // first test changes nothing observable.
113
+ // Stryker disable next-line ConditionalExpression
114
+ if (storeDir === undefined || !existsSync(storeDir))
115
+ return null;
116
+ const analyzers = analyzerSetKey(workspaceRoot);
117
+ if (analyzers === null)
118
+ return null;
119
+ const cachePath = path.join(storeDir, SOURCE_ANALYSIS_CACHE_FILE);
120
+ const stored = readCacheFile(cachePath, analyzers);
121
+ const used = {};
122
+ let changed = false;
123
+ return {
124
+ get(file, content) {
125
+ const key = entryKey(file, content);
126
+ const entry = stored.entries[key];
127
+ if (entry === undefined || entry.status !== "ok")
128
+ return undefined;
129
+ used[key] = entry;
130
+ return entry;
131
+ },
132
+ set(file, content, analysis) {
133
+ if (analysis.status !== "ok")
134
+ return;
135
+ used[entryKey(file, content)] = analysis;
136
+ changed = true;
137
+ },
138
+ save() {
139
+ const kept = Object.keys(used).length;
140
+ if (!changed && kept === Object.keys(stored.entries).length)
141
+ return;
142
+ const temporary = `${cachePath}.${process.pid}.tmp`;
143
+ try {
144
+ writeFileSync(temporary, JSON.stringify({
145
+ version: SOURCE_ANALYSIS_CACHE_VERSION,
146
+ analyzers,
147
+ entries: used,
148
+ }));
149
+ renameSync(temporary, cachePath);
150
+ }
151
+ catch {
152
+ // The cache is an optimization; a failed write only costs a reparse.
153
+ rmSync(temporary, { force: true });
154
+ }
155
+ },
156
+ };
157
+ }
@@ -100,7 +100,7 @@ export declare const querySpec: {
100
100
  export declare const searchSpec: {
101
101
  readonly name: "kb_search";
102
102
  readonly cliName: "search";
103
- readonly description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.";
103
+ readonly description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.";
104
104
  readonly businessInputSchema: {
105
105
  readonly type: "object";
106
106
  readonly required: readonly ["query"];
@@ -139,6 +139,11 @@ export declare const searchSpec: {
139
139
  readonly default: true;
140
140
  readonly description: "Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof.";
141
141
  };
142
+ readonly hints: {
143
+ readonly type: "boolean";
144
+ readonly default: true;
145
+ readonly description: "Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer.";
146
+ };
142
147
  readonly semanticFacets: {
143
148
  readonly type: "object";
144
149
  readonly additionalProperties: false;
@@ -179,7 +184,7 @@ export declare const searchSpec: {
179
184
  readonly maxItems: 20;
180
185
  };
181
186
  };
182
- readonly description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; it does not call a model itself.";
187
+ readonly description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model.";
183
188
  };
184
189
  readonly sourceLocations: {
185
190
  readonly type: "array";
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACd,MAAM,2BAA2B,CAAC;AAiCnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GsC,CAAC;AAE7D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GuC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;;;;;;;;;CAWuC,CAAC"}
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,EACd,MAAM,2BAA2B,CAAC;AAiCnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6GsC,CAAC;AAE7D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiHuC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;;;;;;;;;CAWuC,CAAC"}
@@ -114,7 +114,7 @@ export const querySpec = {
114
114
  export const searchSpec = {
115
115
  name: "kb_search",
116
116
  cliName: "search",
117
- description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.",
117
+ description: "Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.",
118
118
  businessInputSchema: {
119
119
  type: "object",
120
120
  required: ["query"],
@@ -153,6 +153,11 @@ export const searchSpec = {
153
153
  default: true,
154
154
  description: "Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof.",
155
155
  },
156
+ hints: {
157
+ type: "boolean",
158
+ default: true,
159
+ description: "Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer.",
160
+ },
156
161
  semanticFacets: {
157
162
  type: "object",
158
163
  additionalProperties: false,
@@ -167,7 +172,7 @@ export const searchSpec = {
167
172
  },
168
173
  aliases: { type: "array", items: { type: "string" }, maxItems: 20 },
169
174
  },
170
- description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; it does not call a model itself.",
175
+ description: "Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model.",
171
176
  },
172
177
  sourceLocations: {
173
178
  type: "array",
@@ -240,6 +240,11 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
240
240
  readonly minLength: 1;
241
241
  readonly description: "The name the domain is exported under in the symbol's source file, when the symbol's title is not that name.";
242
242
  };
243
+ readonly field: {
244
+ readonly type: "string";
245
+ readonly minLength: 1;
246
+ readonly description: "exhaustive: when the export is a list of records, the field of each record that names a domain member (a catalog's name).";
247
+ };
243
248
  };
244
249
  readonly additionalProperties: false;
245
250
  };
@@ -267,7 +272,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
267
272
  };
268
273
  readonly value_source: {
269
274
  readonly type: "array";
270
- readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
275
+ readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. A dotted export (POLICY.eventLimit) reads one field of an object export. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
271
276
  readonly minItems: 1;
272
277
  readonly items: {
273
278
  readonly type: "object";
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-schemas.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation-schemas.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,gFASf,CAAC;AAWX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmZ3B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CA8CvB,CAAC"}
@@ -257,6 +257,11 @@ export declare const upsertSpec: {
257
257
  readonly minLength: 1;
258
258
  readonly description: "The name the domain is exported under in the symbol's source file, when the symbol's title is not that name.";
259
259
  };
260
+ readonly field: {
261
+ readonly type: "string";
262
+ readonly minLength: 1;
263
+ readonly description: "exhaustive: when the export is a list of records, the field of each record that names a domain member (a catalog's name).";
264
+ };
260
265
  };
261
266
  readonly additionalProperties: false;
262
267
  };
@@ -284,7 +289,7 @@ export declare const upsertSpec: {
284
289
  };
285
290
  readonly value_source: {
286
291
  readonly type: "array";
287
- readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
292
+ readonly description: "arithmetic and smt: code constants the assumptions read. Kibi evaluates each export at ingest and requires the certificate to assume the variable equals that value, so the proof is about the code and not only the knowledge base. With measure count the value is the size of a list, set, map or object export, so a count claim reads the collection itself. A dotted export (POLICY.eventLimit) reads one field of an object export. An entry {source, measure: count} counts the members Kibi reads from a project source (routes, tables, environment variables).";
288
293
  readonly minItems: 1;
289
294
  readonly items: {
290
295
  readonly type: "object";
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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