kibi-cli 2.2.0 → 2.4.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 (230) hide show
  1. package/dist/cli-json-command.d.ts.map +1 -1
  2. package/dist/cli-json-command.js +2 -2
  3. package/dist/cli-operation-loader.d.ts.map +1 -1
  4. package/dist/cli-operation-loader.js +3 -0
  5. package/dist/cli-operation-metadata.d.ts +5 -1
  6. package/dist/cli-operation-metadata.d.ts.map +1 -1
  7. package/dist/cli-operation-metadata.js +6 -1
  8. package/dist/cli-register-maintenance.d.ts.map +1 -1
  9. package/dist/cli-register-maintenance.js +7 -0
  10. package/dist/cli-register-reporting.d.ts.map +1 -1
  11. package/dist/cli-register-reporting.js +4 -0
  12. package/dist/commands/check-diff.d.ts +5 -0
  13. package/dist/commands/check-diff.d.ts.map +1 -0
  14. package/dist/commands/check-diff.js +62 -0
  15. package/dist/commands/check-generated.d.ts.map +1 -1
  16. package/dist/commands/check-generated.js +41 -18
  17. package/dist/commands/check.d.ts.map +1 -1
  18. package/dist/commands/check.js +210 -73
  19. package/dist/commands/doctor.d.ts.map +1 -1
  20. package/dist/commands/doctor.js +63 -29
  21. package/dist/commands/github-init.d.ts.map +1 -1
  22. package/dist/commands/github-init.js +9 -2
  23. package/dist/commands/merge-driver.d.ts +31 -0
  24. package/dist/commands/merge-driver.d.ts.map +1 -0
  25. package/dist/commands/merge-driver.js +268 -0
  26. package/dist/commands/sync/manifest.d.ts.map +1 -1
  27. package/dist/commands/sync/manifest.js +3 -1
  28. package/dist/engine.d.ts +15 -1
  29. package/dist/engine.d.ts.map +1 -1
  30. package/dist/engine.js +252 -52
  31. package/dist/extractors/symbols-coordinator.d.ts +7 -0
  32. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  33. package/dist/extractors/symbols-coordinator.js +75 -39
  34. package/dist/operations/bootstrap/candidates.js +1 -1
  35. package/dist/operations/bootstrap/discovery.js +1 -1
  36. package/dist/operations/bootstrap/generate.d.ts.map +1 -1
  37. package/dist/operations/bootstrap/generate.js +21 -5
  38. package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
  39. package/dist/operations/bootstrap/guidance-actions.js +3 -0
  40. package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
  41. package/dist/operations/bootstrap/guidance.js +7 -1
  42. package/dist/operations/bootstrap/intent-claims.d.ts +17 -0
  43. package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -0
  44. package/dist/operations/bootstrap/intent-claims.js +95 -0
  45. package/dist/operations/bootstrap/presentation.d.ts +2 -0
  46. package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
  47. package/dist/operations/bootstrap/presentation.js +60 -1
  48. package/dist/operations/bootstrap/types.d.ts +28 -0
  49. package/dist/operations/bootstrap/types.d.ts.map +1 -1
  50. package/dist/operations/bootstrap/types.js +16 -0
  51. package/dist/operations/modeling/predicate-inference-1.js +1 -1
  52. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  53. package/dist/operations/mutation/source-authoring.js +175 -53
  54. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
  55. package/dist/operations/mutation/symbol-refresh.js +4 -1
  56. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  57. package/dist/operations/mutation/upsert.js +5 -7
  58. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  59. package/dist/operations/planning/apply-plan.js +5 -9
  60. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  61. package/dist/operations/proof/ingest-proof.js +1 -0
  62. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  63. package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
  64. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  65. package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
  66. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  67. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  68. package/dist/operations/semantic-advisor/clauses.js +7 -1
  69. package/dist/performance-trace.d.ts +17 -0
  70. package/dist/performance-trace.d.ts.map +1 -0
  71. package/dist/performance-trace.js +134 -0
  72. package/dist/plugins/approved-source-analyzers.d.ts +13 -0
  73. package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
  74. package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
  75. package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
  76. package/dist/plugins/approved-source-analyzers.generated.js +77 -0
  77. package/dist/plugins/approved-source-analyzers.js +3 -0
  78. package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
  79. package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
  80. package/dist/plugins/maintenance-source-analysis.js +191 -0
  81. package/dist/plugins/registry.d.ts +2 -1
  82. package/dist/plugins/registry.d.ts.map +1 -1
  83. package/dist/plugins/registry.js +6 -1
  84. package/dist/plugins/source-analysis-service.d.ts +36 -1
  85. package/dist/plugins/source-analysis-service.d.ts.map +1 -1
  86. package/dist/plugins/source-analysis-service.js +184 -27
  87. package/dist/plugins/source-change-analysis.d.ts +15 -0
  88. package/dist/plugins/source-change-analysis.d.ts.map +1 -0
  89. package/dist/plugins/source-change-analysis.js +54 -0
  90. package/dist/plugins/source-classification.d.ts +41 -0
  91. package/dist/plugins/source-classification.d.ts.map +1 -0
  92. package/dist/plugins/source-classification.js +490 -0
  93. package/dist/prolog/swipl-resolver.d.ts +88 -0
  94. package/dist/prolog/swipl-resolver.d.ts.map +1 -0
  95. package/dist/prolog/swipl-resolver.js +446 -0
  96. package/dist/prolog.d.ts +15 -1
  97. package/dist/prolog.d.ts.map +1 -1
  98. package/dist/prolog.js +67 -6
  99. package/dist/public/diagnostic-usage.d.ts +14 -0
  100. package/dist/public/diagnostic-usage.d.ts.map +1 -1
  101. package/dist/public/diagnostic-usage.js +55 -1
  102. package/dist/public/impact/analyzer.d.ts.map +1 -1
  103. package/dist/public/impact/analyzer.js +56 -5
  104. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  105. package/dist/public/impact/diagnostics.js +3 -1
  106. package/dist/public/impact/manifest.d.ts.map +1 -1
  107. package/dist/public/impact/manifest.js +15 -1
  108. package/dist/public/impact/source-changes.d.ts.map +1 -1
  109. package/dist/public/impact/source-changes.js +35 -27
  110. package/dist/public/impact/types.d.ts +2 -0
  111. package/dist/public/impact/types.d.ts.map +1 -1
  112. package/dist/public/operations/catalog.d.ts +117 -1
  113. package/dist/public/operations/catalog.d.ts.map +1 -1
  114. package/dist/public/operations/catalog.js +2 -0
  115. package/dist/public/operations/contracts.d.ts.map +1 -1
  116. package/dist/public/operations/contracts.js +309 -8
  117. package/dist/public/operations/impact-review-preparation.d.ts +14 -0
  118. package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
  119. package/dist/public/operations/impact-review-preparation.js +379 -0
  120. package/dist/public/operations/index.d.ts +2 -0
  121. package/dist/public/operations/index.d.ts.map +1 -1
  122. package/dist/public/operations/index.js +2 -0
  123. package/dist/public/operations/node-ports.d.ts.map +1 -1
  124. package/dist/public/operations/node-ports.js +1 -35
  125. package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
  126. package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
  127. package/dist/public/operations/proof-receipt-projection.js +36 -0
  128. package/dist/public/operations/specs/bootstrap.d.ts +73 -1
  129. package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
  130. package/dist/public/operations/specs/bootstrap.js +66 -1
  131. package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
  132. package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
  133. package/dist/public/operations/specs/impact-review-preparation.js +43 -0
  134. package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
  135. package/dist/public/operations/symbol-repair-plan.js +3 -1
  136. package/dist/public/operations/types.d.ts +1 -1
  137. package/dist/public/operations/types.d.ts.map +1 -1
  138. package/dist/public/skills/kibi-bootstrap/SKILL.md +47 -11
  139. package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
  140. package/dist/public/skills/kibi-usage/SKILL.md +14 -0
  141. package/dist/public/skills/kibi-usage/resources/operation-access.md +5 -0
  142. package/dist/public/telemetry-acceptance.d.ts +8 -0
  143. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  144. package/dist/public/telemetry-acceptance.js +10 -0
  145. package/dist/traceability/analysis-gate.d.ts +39 -0
  146. package/dist/traceability/analysis-gate.d.ts.map +1 -0
  147. package/dist/traceability/analysis-gate.js +51 -0
  148. package/dist/traceability/git-change-snapshot.d.ts +27 -0
  149. package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
  150. package/dist/traceability/git-change-snapshot.js +411 -0
  151. package/dist/traceability/git-staged.d.ts +5 -1
  152. package/dist/traceability/git-staged.d.ts.map +1 -1
  153. package/dist/traceability/git-staged.js +16 -11
  154. package/dist/traceability/impact-evaluator.d.ts +54 -0
  155. package/dist/traceability/impact-evaluator.d.ts.map +1 -0
  156. package/dist/traceability/impact-evaluator.js +270 -0
  157. package/dist/traceability/impact-git-tree.d.ts +12 -0
  158. package/dist/traceability/impact-git-tree.d.ts.map +1 -0
  159. package/dist/traceability/impact-git-tree.js +46 -0
  160. package/dist/traceability/impact-knowledge.d.ts +16 -0
  161. package/dist/traceability/impact-knowledge.d.ts.map +1 -0
  162. package/dist/traceability/impact-knowledge.js +165 -0
  163. package/dist/traceability/impact-policy.d.ts +15 -0
  164. package/dist/traceability/impact-policy.d.ts.map +1 -0
  165. package/dist/traceability/impact-policy.js +48 -0
  166. package/dist/traceability/impact-policy.v1.schema.json +48 -0
  167. package/dist/traceability/impact-pr-diff.d.ts +5 -0
  168. package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
  169. package/dist/traceability/impact-pr-diff.js +83 -0
  170. package/dist/traceability/impact-record-validation.d.ts +9 -0
  171. package/dist/traceability/impact-record-validation.d.ts.map +1 -0
  172. package/dist/traceability/impact-record-validation.js +113 -0
  173. package/dist/traceability/impact-review.d.ts +148 -0
  174. package/dist/traceability/impact-review.d.ts.map +1 -0
  175. package/dist/traceability/impact-review.js +494 -0
  176. package/dist/traceability/impact-review.schema.json +365 -0
  177. package/dist/traceability/impact-side-evidence.d.ts +13 -0
  178. package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
  179. package/dist/traceability/impact-side-evidence.js +240 -0
  180. package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
  181. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
  182. package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
  183. package/dist/traceability/snapshot-knowledge.d.ts +4 -0
  184. package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
  185. package/dist/traceability/snapshot-knowledge.js +98 -0
  186. package/dist/traceability/staged-file-coverage.d.ts +23 -0
  187. package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
  188. package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
  189. package/dist/traceability/staged-impact-contract.js +2 -16
  190. package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
  191. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  192. package/dist/traceability/staged-symbols-manifest.js +17 -6
  193. package/dist/traceability/symbol-extract.d.ts +3 -5
  194. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  195. package/dist/traceability/symbol-extract.js +49 -34
  196. package/dist/traceability/temp-kb.d.ts +1 -1
  197. package/dist/traceability/temp-kb.d.ts.map +1 -1
  198. package/dist/traceability/temp-kb.js +49 -13
  199. package/dist/traceability/trusted-pr-event.d.ts +13 -0
  200. package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
  201. package/dist/traceability/trusted-pr-event.js +105 -0
  202. package/dist/utils/canonical-path.d.ts +3 -0
  203. package/dist/utils/canonical-path.d.ts.map +1 -0
  204. package/dist/utils/canonical-path.js +33 -0
  205. package/package.json +14 -5
  206. package/src/public/diagnostic-usage.ts +59 -1
  207. package/src/public/impact/analyzer.ts +88 -5
  208. package/src/public/impact/diagnostics.ts +7 -5
  209. package/src/public/impact/manifest.ts +14 -1
  210. package/src/public/impact/source-changes.ts +39 -34
  211. package/src/public/impact/types.ts +5 -0
  212. package/src/public/operations/catalog.ts +2 -0
  213. package/src/public/operations/contracts.ts +385 -9
  214. package/src/public/operations/impact-review-preparation.ts +548 -0
  215. package/src/public/operations/index.ts +2 -0
  216. package/src/public/operations/node-ports.ts +1 -39
  217. package/src/public/operations/proof-receipt-projection.ts +39 -0
  218. package/src/public/operations/specs/bootstrap.ts +78 -4
  219. package/src/public/operations/specs/impact-review-preparation.ts +46 -0
  220. package/src/public/operations/symbol-repair-plan.ts +3 -1
  221. package/src/public/operations/types.ts +1 -0
  222. package/src/public/skills/kibi-bootstrap/SKILL.md +47 -11
  223. package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
  224. package/src/public/skills/kibi-usage/SKILL.md +14 -0
  225. package/src/public/skills/kibi-usage/resources/operation-access.md +5 -0
  226. package/src/public/telemetry-acceptance.ts +9 -0
  227. package/src/traceability/impact-policy.v1.schema.json +48 -0
  228. package/src/traceability/impact-review.schema.json +365 -0
  229. package/templates/github/kibi-badge.yml +0 -4
  230. package/templates/github/kibi-report.yml +0 -4
@@ -0,0 +1,379 @@
1
+ import { execFileSync } from "node:child_process";
2
+ import { createMaintenanceSourceAnalysisService, fingerprintMaintenanceSourceSet, readSnapshotSourceConfig, } from "../../plugins/maintenance-source-analysis.js";
3
+ import { analyzeSourceChanges } from "../../plugins/source-change-analysis.js";
4
+ import { analysisObligation } from "../../traceability/analysis-gate.js";
5
+ import { captureDiffSnapshot, captureStagedSnapshot, } from "../../traceability/git-change-snapshot.js";
6
+ import { fingerprintImpactEvaluator, prepareImpactReview, } from "../../traceability/impact-evaluator.js";
7
+ import { IMPACT_EVALUATOR_VERSION, IMPACT_REVIEW_VERSION, canonicalJson, } from "../../traceability/impact-review.js";
8
+ import impactReviewRecordSchema from "../../traceability/impact-review.schema.json" with {
9
+ type: "json"
10
+ };
11
+ import { readSnapshotKnowledge } from "../../traceability/snapshot-knowledge.js";
12
+ const FULL_COMMIT_OID = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
13
+ const SEMANTIC_RELATIONSHIPS = new Set([
14
+ "constrains",
15
+ "depends_on",
16
+ "requires_predicate",
17
+ "requires_property",
18
+ "requires_rule",
19
+ "specified_by",
20
+ "supersedes",
21
+ "validates",
22
+ "verified_by",
23
+ ]);
24
+ function compareText(left, right) {
25
+ return left < right ? -1 : left > right ? 1 : 0;
26
+ }
27
+ function gitText(root, args) {
28
+ return execFileSync("git", [...args], {
29
+ cwd: root,
30
+ encoding: "utf8",
31
+ maxBuffer: 64 * 1024 * 1024,
32
+ stdio: ["ignore", "pipe", "pipe"],
33
+ }).trim();
34
+ }
35
+ function resolveCommit(root, oid) {
36
+ return gitText(root, [
37
+ "rev-parse",
38
+ "--verify",
39
+ "--end-of-options",
40
+ `${oid}^{commit}`,
41
+ ]);
42
+ }
43
+ function treeForCommit(root, oid) {
44
+ return gitText(root, [
45
+ "rev-parse",
46
+ "--verify",
47
+ "--end-of-options",
48
+ `${oid}^{tree}`,
49
+ ]);
50
+ }
51
+ function assertExplicitDiffUnchanged(root, input, snapshot) {
52
+ const baseCommit = resolveCommit(root, input.baseCommit);
53
+ const headCommit = resolveCommit(root, input.headCommit);
54
+ if (baseCommit !== input.baseCommit ||
55
+ headCommit !== input.headCommit ||
56
+ snapshot.headCommit !== baseCommit ||
57
+ treeForCommit(root, baseCommit) !== snapshot.baseTree ||
58
+ treeForCommit(root, headCommit) !== snapshot.headTree)
59
+ throw new Error("Selected diff commit or tree identity changed during impact review preparation");
60
+ }
61
+ function snapshotIdentity(scope, snapshot) {
62
+ return {
63
+ kind: scope.kind,
64
+ baseCommit: scope.kind === "diff" ? scope.baseCommit : snapshot.headCommit,
65
+ baseTree: snapshot.baseTree,
66
+ headCommit: scope.kind === "diff" ? scope.headCommit : null,
67
+ headTree: snapshot.headTree,
68
+ headTreeSource: scope.kind === "diff" ? "commit" : "index",
69
+ };
70
+ }
71
+ function plainEntity(entity) {
72
+ return Object.fromEntries(Object.entries(entity)
73
+ .filter(([key]) => !["created_at", "updated_at", "proof_receipts"].includes(key))
74
+ .sort(([left], [right]) => compareText(left, right)));
75
+ }
76
+ function entityMap(snapshot, tree) {
77
+ return new Map(readSnapshotKnowledge(snapshot.readGit, tree, snapshot.readBlobs).map((row) => [
78
+ row.entity.id,
79
+ {
80
+ entity: row.entity,
81
+ relationships: row.relationships.map(({ type, from, to }) => ({
82
+ type,
83
+ from,
84
+ to,
85
+ })),
86
+ ...(row.sourceFile ? { sourceFile: row.sourceFile } : {}),
87
+ },
88
+ ]));
89
+ }
90
+ function requirementContext(id, rows, entities, allRows) {
91
+ const row = rows.get(id);
92
+ const binding = entities.get(id);
93
+ if (!row || !binding) {
94
+ return {
95
+ id,
96
+ state: "absent",
97
+ entityFingerprint: null,
98
+ artifactPath: null,
99
+ sourcePath: null,
100
+ relationships: [],
101
+ relatedEntities: [],
102
+ };
103
+ }
104
+ const relationships = [...allRows.entries()]
105
+ .flatMap(([ownerId, candidate]) => candidate.relationships
106
+ .filter((relationship) => SEMANTIC_RELATIONSHIPS.has(relationship.type) &&
107
+ (relationship.from === id || relationship.to === id))
108
+ .map((relationship) => ({ ownerId, ...relationship })))
109
+ .sort((left, right) => compareText(canonicalJson(left), canonicalJson(right)));
110
+ const relatedIds = [
111
+ ...new Set(relationships
112
+ .flatMap(({ from, to }) => [from, to])
113
+ .filter((relatedId) => relatedId !== id)),
114
+ ].sort();
115
+ return {
116
+ id,
117
+ state: "present",
118
+ entityFingerprint: binding.fingerprint,
119
+ artifactPath: binding.artifactPath,
120
+ sourcePath: binding.sourcePath ?? row.sourceFile ?? null,
121
+ entity: plainEntity(row.entity),
122
+ relationships: relationships.map(({ ownerId: _ownerId, ...edge }) => edge),
123
+ relatedEntities: relatedIds.flatMap((relatedId) => {
124
+ const related = allRows.get(relatedId);
125
+ if (!related)
126
+ return [];
127
+ const relatedBinding = entities.get(relatedId);
128
+ return [
129
+ {
130
+ id: relatedId,
131
+ type: related.entity.type ?? null,
132
+ entityFingerprint: relatedBinding?.fingerprint ?? null,
133
+ artifactPath: relatedBinding?.artifactPath ?? null,
134
+ sourcePath: relatedBinding?.sourcePath ?? related.sourceFile ?? null,
135
+ entity: plainEntity(related.entity),
136
+ },
137
+ ];
138
+ }),
139
+ };
140
+ }
141
+ function requirementScopes(prepared, snapshot) {
142
+ const before = entityMap(snapshot, snapshot.baseTree);
143
+ const after = entityMap(snapshot, snapshot.headTree);
144
+ return [...prepared.scopedRequirementIdsByPath.entries()]
145
+ .sort(([left], [right]) => compareText(left, right))
146
+ .map(([path, requirementIds]) => ({
147
+ path,
148
+ requirementIds: [...requirementIds].sort(),
149
+ before: [...requirementIds]
150
+ .sort()
151
+ .map((id) => requirementContext(id, before, prepared.baseEntities, before)),
152
+ after: [...requirementIds]
153
+ .sort()
154
+ .map((id) => requirementContext(id, after, prepared.headEntities, after)),
155
+ }));
156
+ }
157
+ function residualReviewObligations(prepared) {
158
+ const obligations = [];
159
+ for (const file of prepared.files) {
160
+ for (const side of ["before", "after"]) {
161
+ const analysis = file[side]?.analysis;
162
+ if (!analysis)
163
+ continue;
164
+ const obligation = analysisObligation(side, analysis, file.newHunkRanges);
165
+ if (obligation.kind === "unsupported_review") {
166
+ obligations.push({
167
+ path: file.path,
168
+ side,
169
+ status: analysis.status,
170
+ diagnosticCodes: [...analysis.diagnosticCodes].sort(),
171
+ kind: "unsupported_review",
172
+ wholeFile: true,
173
+ pending: true,
174
+ });
175
+ continue;
176
+ }
177
+ if (obligation.kind !== "partial_review")
178
+ continue;
179
+ const limitationClasses = new Set();
180
+ for (const code of analysis.diagnosticCodes) {
181
+ const allowed = prepared.policy.allowedPartial.find((entry) => entry.providerId === analysis.providerId &&
182
+ entry.providerFingerprint === analysis.providerFingerprint &&
183
+ entry.diagnosticCode === code);
184
+ if (allowed)
185
+ limitationClasses.add(allowed.limitationClass);
186
+ }
187
+ const limitationClass = [...limitationClasses][0];
188
+ if (limitationClasses.size !== 1 || limitationClass === undefined)
189
+ throw new Error(`Partial review obligation is not covered by the trusted policy: ${file.path} (${side})`);
190
+ obligations.push({
191
+ path: file.path,
192
+ side,
193
+ status: analysis.status,
194
+ diagnosticCodes: [...analysis.diagnosticCodes].sort(),
195
+ kind: "partial_review",
196
+ limitationClass,
197
+ ranges: obligation.ranges.map((range) => ({ ...range })),
198
+ pending: true,
199
+ });
200
+ }
201
+ }
202
+ return obligations.sort((left, right) => compareText(`${left.path}\0${left.side}`, `${right.path}\0${right.side}`));
203
+ }
204
+ function cloneRecordSchema() {
205
+ return JSON.parse(JSON.stringify(impactReviewRecordSchema));
206
+ }
207
+ function cloneRecordTemplateSchema() {
208
+ const schema = cloneRecordSchema();
209
+ schema.$id = "urn:kibi:impact-review-authoring-record-template:v1";
210
+ const properties = schema.properties;
211
+ properties.reviewedAt = { type: "null" };
212
+ const definitions = schema.$defs;
213
+ const reviewer = definitions.reviewer;
214
+ reviewer.properties.id = { type: "null" };
215
+ const file = definitions.file;
216
+ file.properties.analysisReviews = {
217
+ anyOf: [file.properties.analysisReviews, { type: "null" }],
218
+ };
219
+ file.properties.decision = {
220
+ anyOf: [file.properties.decision, { type: "null" }],
221
+ };
222
+ return schema;
223
+ }
224
+ function authoringContract(prepared) {
225
+ const recordHeaders = {
226
+ contractVersion: IMPACT_REVIEW_VERSION,
227
+ policy: {
228
+ id: prepared.policy.id,
229
+ version: prepared.policy.version,
230
+ fingerprint: prepared.policyFingerprint,
231
+ },
232
+ evaluator: {
233
+ contractVersion: IMPACT_EVALUATOR_VERSION,
234
+ fingerprint: prepared.evaluatorFingerprint,
235
+ },
236
+ scope: {
237
+ fingerprint: prepared.scopeFingerprint,
238
+ knowledgeFingerprint: prepared.knowledgeFingerprint,
239
+ providerSetFingerprint: prepared.providerSetFingerprint,
240
+ },
241
+ };
242
+ return {
243
+ templateVersion: "kibi.impact-review-authoring-template.v1",
244
+ isValidImpactReviewRecord: false,
245
+ instructions: "This template is reviewer input only. Author every decision, required analysis review, rationale, reviewer id, and reviewedAt before strict record validation. It is not an approval, signature, or proof receipt.",
246
+ authoredFields: [
247
+ "files[].decision",
248
+ "files[].analysisReviews",
249
+ "reviewer.id",
250
+ "reviewedAt",
251
+ ],
252
+ recordSchema: cloneRecordSchema(),
253
+ decisionSchema: { $ref: "urn:kibi:impact-review:v1#/$defs/decision" },
254
+ analysisReviewSchema: {
255
+ oneOf: [
256
+ { $ref: "urn:kibi:impact-review:v1#/$defs/unsupportedReview" },
257
+ { $ref: "urn:kibi:impact-review:v1#/$defs/partialReview" },
258
+ ],
259
+ },
260
+ templateSchema: {
261
+ $schema: "https://json-schema.org/draft/2020-12/schema",
262
+ $id: "urn:kibi:impact-review-authoring-template:v1",
263
+ type: "object",
264
+ additionalProperties: false,
265
+ required: ["templateVersion", "isValidImpactReviewRecord", "record"],
266
+ properties: {
267
+ templateVersion: {
268
+ const: "kibi.impact-review-authoring-template.v1",
269
+ },
270
+ isValidImpactReviewRecord: { const: false },
271
+ record: cloneRecordTemplateSchema(),
272
+ },
273
+ },
274
+ recordTemplate: {
275
+ templateVersion: "kibi.impact-review-authoring-template.v1",
276
+ isValidImpactReviewRecord: false,
277
+ record: {
278
+ ...recordHeaders,
279
+ reviewer: { id: null, source: "self-claimed-local" },
280
+ reviewedAt: null,
281
+ files: prepared.files
282
+ .slice()
283
+ .sort((left, right) => compareText(left.path, right.path))
284
+ .map((file) => ({
285
+ ...withoutAnalysisReviews(file),
286
+ analysisReviews: null,
287
+ decision: null,
288
+ })),
289
+ },
290
+ },
291
+ };
292
+ }
293
+ function withoutAnalysisReviews(file) {
294
+ const { analysisReviews: _analysisReviews, ...evidence } = file;
295
+ return evidence;
296
+ }
297
+ function completeFileEvidence(prepared) {
298
+ return prepared.files
299
+ .slice()
300
+ .sort((left, right) => compareText(left.path, right.path))
301
+ .map((file) => withoutAnalysisReviews(file));
302
+ }
303
+ function buildPreparation(scope, snapshot, prepared) {
304
+ return {
305
+ preparationVersion: "kibi.impact-review-preparation.v1",
306
+ status: "ready_for_authoring",
307
+ snapshot: snapshotIdentity(scope, snapshot),
308
+ recordHeaders: {
309
+ contractVersion: IMPACT_REVIEW_VERSION,
310
+ policy: {
311
+ id: prepared.policy.id,
312
+ version: prepared.policy.version,
313
+ fingerprint: prepared.policyFingerprint,
314
+ },
315
+ evaluator: {
316
+ contractVersion: IMPACT_EVALUATOR_VERSION,
317
+ fingerprint: prepared.evaluatorFingerprint,
318
+ },
319
+ scope: {
320
+ fingerprint: prepared.scopeFingerprint,
321
+ knowledgeFingerprint: prepared.knowledgeFingerprint,
322
+ providerSetFingerprint: prepared.providerSetFingerprint,
323
+ },
324
+ },
325
+ files: completeFileEvidence(prepared),
326
+ requirementScopes: requirementScopes(prepared, snapshot),
327
+ residualReviewObligations: residualReviewObligations(prepared),
328
+ authorship: authoringContract(prepared),
329
+ };
330
+ }
331
+ function validateDiffInput(scope) {
332
+ if (scope.kind === "diff" &&
333
+ (!FULL_COMMIT_OID.test(scope.baseCommit) ||
334
+ !FULL_COMMIT_OID.test(scope.headCommit)))
335
+ throw new Error("Diff scope requires full lowercase hexadecimal baseCommit and headCommit object IDs");
336
+ }
337
+ export async function executePrepareImpactReview(input, context) {
338
+ validateDiffInput(input.scope);
339
+ const workspaceRoot = context.workspaceRoot;
340
+ const snapshot = input.scope.kind === "staged"
341
+ ? captureStagedSnapshot(workspaceRoot)
342
+ : captureDiffSnapshot(workspaceRoot, input.scope.baseCommit, input.scope.headCommit);
343
+ if (input.scope.kind === "diff")
344
+ assertExplicitDiffUnchanged(workspaceRoot, input.scope, snapshot);
345
+ const trustedConfig = readSnapshotSourceConfig(snapshot, snapshot.baseTree);
346
+ const providerSetFingerprint = fingerprintMaintenanceSourceSet(workspaceRoot, trustedConfig);
347
+ const evaluatorFingerprint = fingerprintImpactEvaluator();
348
+ const service = createMaintenanceSourceAnalysisService(workspaceRoot, trustedConfig);
349
+ const analyses = await analyzeSourceChanges(snapshot.inventory, service);
350
+ const prepared = prepareImpactReview(snapshot, {
351
+ providerSetFingerprint,
352
+ evaluatorFingerprint,
353
+ analyses,
354
+ });
355
+ // Build all KB-derived context before the final snapshot/closure checks.
356
+ // Projection can be substantial, so checking only before it could return
357
+ // evidence for a workspace or evaluator closure that changed mid-projection.
358
+ const data = buildPreparation(input.scope, snapshot, prepared);
359
+ snapshot.assertUnchanged();
360
+ if (input.scope.kind === "diff")
361
+ assertExplicitDiffUnchanged(workspaceRoot, input.scope, snapshot);
362
+ const finalProviderFingerprint = fingerprintMaintenanceSourceSet(workspaceRoot, trustedConfig);
363
+ const finalEvaluatorFingerprint = fingerprintImpactEvaluator();
364
+ if (finalProviderFingerprint !== providerSetFingerprint ||
365
+ finalEvaluatorFingerprint !== evaluatorFingerprint)
366
+ throw new Error("Trusted source-provider or impact-evaluator closure changed during impact review preparation");
367
+ snapshot.assertUnchanged();
368
+ if (input.scope.kind === "diff")
369
+ assertExplicitDiffUnchanged(workspaceRoot, input.scope, snapshot);
370
+ return {
371
+ content: [
372
+ {
373
+ type: "text",
374
+ text: `Prepared complete ${input.scope.kind} impact-review authoring inputs; every review decision remains unauthored.`,
375
+ },
376
+ ],
377
+ structuredContent: data,
378
+ };
379
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./catalog.js";
2
2
  export * from "./check-executor.js";
3
+ export * from "./impact-review-preparation.js";
3
4
  export * from "./discovery-entities.js";
4
5
  export * from "./discovery-executors.js";
5
6
  export * from "./runtime-types.js";
@@ -10,6 +11,7 @@ export * from "./migration-plan.js";
10
11
  export * from "./symbol-repair-plan.js";
11
12
  export * from "./specs/bootstrap.js";
12
13
  export * from "./specs/check.js";
14
+ export * from "./specs/impact-review-preparation.js";
13
15
  export * from "./specs/discovery.js";
14
16
  export * from "./specs/modeling.js";
15
17
  export * from "./specs/planning.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/operations/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,mBAAmB,qCAAqC,CAAC;AACzD,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/operations/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sCAAsC,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,mBAAmB,qCAAqC,CAAC;AACzD,cAAc,mBAAmB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from "./catalog.js";
2
2
  export * from "./check-executor.js";
3
+ export * from "./impact-review-preparation.js";
3
4
  export * from "./discovery-entities.js";
4
5
  export * from "./discovery-executors.js";
5
6
  export * from "./runtime-types.js";
@@ -10,6 +11,7 @@ export * from "./migration-plan.js";
10
11
  export * from "./symbol-repair-plan.js";
11
12
  export * from "./specs/bootstrap.js";
12
13
  export * from "./specs/check.js";
14
+ export * from "./specs/impact-review-preparation.js";
13
15
  export * from "./specs/discovery.js";
14
16
  export * from "./specs/modeling.js";
15
17
  export * from "./specs/planning.js";
@@ -1 +1 @@
1
- {"version":3,"file":"node-ports.d.ts","sourceRoot":"","sources":["../../../src/public/operations/node-ports.ts"],"names":[],"mappings":"AASA,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;AAkMF,eAAO,MAAM,cAAc,EAAE,kBAoB5B,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;AA2JF,eAAO,MAAM,cAAc,EAAE,kBAoB5B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAiBrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAEzB,CAAC"}
@@ -6,6 +6,7 @@ import path from "node:path";
6
6
  import { promisify } from "node:util";
7
7
  import fg from "fast-glob";
8
8
  import { createRepoIgnorePolicy } from "../ignore-policy.js";
9
+ import { snapshotFileContent } from "./proof-receipt-projection.js";
9
10
  const execFileAsync = promisify(execFile);
10
11
  const SNAPSHOT_EXCLUDED_PREFIXES = [
11
12
  ".changeset/",
@@ -36,41 +37,6 @@ const ALWAYS_IGNORED_GLOBS = [
36
37
  function includedSnapshotPath(relativePath) {
37
38
  return !SNAPSHOT_EXCLUDED_PREFIXES.some((prefix) => relativePath === prefix.slice(0, -1) || relativePath.startsWith(prefix));
38
39
  }
39
- function withoutProofReceiptFrontmatter(content) {
40
- const lines = content.match(/[^\n]*\n|[^\n]+$/g) ?? [];
41
- if (lines[0]?.trim() !== "---")
42
- return content;
43
- let inFrontmatter = true;
44
- let skippingReceipts = false;
45
- const retained = [];
46
- for (const [index, line] of lines.entries()) {
47
- const trimmed = line.trim();
48
- if (index > 0 && inFrontmatter && trimmed === "---") {
49
- inFrontmatter = false;
50
- skippingReceipts = false;
51
- retained.push(line);
52
- continue;
53
- }
54
- if (inFrontmatter && /^proof_receipts\s*:/.test(line)) {
55
- skippingReceipts = true;
56
- continue;
57
- }
58
- if (inFrontmatter &&
59
- skippingReceipts &&
60
- /^[A-Za-z_][A-Za-z0-9_-]*\s*:/.test(line)) {
61
- skippingReceipts = false;
62
- }
63
- if (!skippingReceipts)
64
- retained.push(line);
65
- }
66
- return retained.join("");
67
- }
68
- function snapshotFileContent(relativePath, content) {
69
- if (relativePath.endsWith(".md")) {
70
- return Buffer.from(withoutProofReceiptFrontmatter(content.toString("utf8")));
71
- }
72
- return content;
73
- }
74
40
  /**
75
41
  * A tracked markdown file whose only change is proof-receipt frontmatter
76
42
  * cannot alter the snapshot hash (receipts are stripped before hashing), so it
@@ -0,0 +1,5 @@
1
+ /** Remove only the top-level proof-receipt frontmatter block, byte-for-byte otherwise. */
2
+ export declare function withoutProofReceiptFrontmatter(content: string): string;
3
+ /** Match the workspace proof snapshot's markdown receipt projection exactly. */
4
+ export declare function snapshotFileContent(relativePath: string, content: Buffer): Buffer;
5
+ //# sourceMappingURL=proof-receipt-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof-receipt-projection.d.ts","sourceRoot":"","sources":["../../../src/public/operations/proof-receipt-projection.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA4BtE;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAGR"}
@@ -0,0 +1,36 @@
1
+ /** Remove only the top-level proof-receipt frontmatter block, byte-for-byte otherwise. */
2
+ export function withoutProofReceiptFrontmatter(content) {
3
+ const lines = content.match(/[^\n]*\n|[^\n]+$/g) ?? [];
4
+ if (lines[0]?.trim() !== "---")
5
+ return content;
6
+ let inFrontmatter = true;
7
+ let skippingReceipts = false;
8
+ const retained = [];
9
+ for (const [index, line] of lines.entries()) {
10
+ const trimmed = line.trim();
11
+ if (index > 0 && inFrontmatter && trimmed === "---") {
12
+ inFrontmatter = false;
13
+ skippingReceipts = false;
14
+ retained.push(line);
15
+ continue;
16
+ }
17
+ if (inFrontmatter && /^proof_receipts\s*:/.test(line)) {
18
+ skippingReceipts = true;
19
+ continue;
20
+ }
21
+ if (inFrontmatter &&
22
+ skippingReceipts &&
23
+ /^[A-Za-z_][A-Za-z0-9_-]*\s*:/.test(line)) {
24
+ skippingReceipts = false;
25
+ }
26
+ if (!skippingReceipts)
27
+ retained.push(line);
28
+ }
29
+ return retained.join("");
30
+ }
31
+ /** Match the workspace proof snapshot's markdown receipt projection exactly. */
32
+ export function snapshotFileContent(relativePath, content) {
33
+ if (!relativePath.endsWith(".md"))
34
+ return content;
35
+ return Buffer.from(withoutProofReceiptFrontmatter(content.toString("utf8")));
36
+ }
@@ -4,7 +4,7 @@ export { executePlanBootstrap } from "../../../operations/bootstrap/generate.js"
4
4
  export declare const planBootstrapSpec: {
5
5
  readonly name: "kb_plan_bootstrap";
6
6
  readonly cliName: "plan-bootstrap";
7
- readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
7
+ readonly description: "Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.";
8
8
  readonly businessInputSchema: {
9
9
  readonly type: "object";
10
10
  readonly properties: {
@@ -71,6 +71,78 @@ export declare const planBootstrapSpec: {
71
71
  };
72
72
  readonly description: "Optional verification commands, documents, or checkpoints to reference in the output.";
73
73
  };
74
+ readonly knowledgeSources: {
75
+ readonly type: "array";
76
+ readonly maxItems: 50;
77
+ readonly description: "Knowledge sources outside the code that the human confirmed during the bootstrap interview (issue trackers, wikis, specs, decision logs). Kibi never contacts them; the agent reads them through its own connectors and cites them from intentClaims. Bound into the plan hash.";
78
+ readonly items: {
79
+ readonly type: "object";
80
+ readonly required: readonly ["id", "kind", "title", "locator", "authority"];
81
+ readonly additionalProperties: false;
82
+ readonly properties: {
83
+ readonly id: {
84
+ readonly type: "string";
85
+ readonly pattern: "^[a-z0-9][a-z0-9-]*$";
86
+ readonly description: "Stable kebab-case handle that intentClaims cite, for example jira-payments.";
87
+ };
88
+ readonly kind: {
89
+ readonly type: "string";
90
+ readonly enum: readonly ["issue_tracker", "wiki", "specification", "design", "decision_log", "support", "chat", "repository_docs", "other"];
91
+ };
92
+ readonly title: {
93
+ readonly type: "string";
94
+ readonly minLength: 1;
95
+ };
96
+ readonly locator: {
97
+ readonly type: "string";
98
+ readonly minLength: 1;
99
+ readonly description: "Where the source lives: a URL, project key, space name, or repo-relative path.";
100
+ };
101
+ readonly authority: {
102
+ readonly type: "string";
103
+ readonly enum: readonly ["authoritative", "supporting", "stale"];
104
+ readonly description: "The human's call: authoritative claims become higher-confidence candidates, supporting claims lower ones, and stale sources are cited but never produce candidates.";
105
+ };
106
+ readonly connector: {
107
+ readonly type: "string";
108
+ readonly description: "Optional name of the MCP server or tool the agent used to read the source.";
109
+ };
110
+ readonly notes: {
111
+ readonly type: "string";
112
+ };
113
+ };
114
+ };
115
+ };
116
+ readonly intentClaims: {
117
+ readonly type: "array";
118
+ readonly maxItems: 200;
119
+ readonly description: "Statements of product intent the agent harvested from knowledgeSources, each citing its source. Normative claims the strict modeler can ground become cited req candidates; the rest become explicit authoring follow-ups. Bound into the plan hash.";
120
+ readonly items: {
121
+ readonly type: "object";
122
+ readonly required: readonly ["statement", "sourceId", "reference"];
123
+ readonly additionalProperties: false;
124
+ readonly properties: {
125
+ readonly statement: {
126
+ readonly type: "string";
127
+ readonly minLength: 1;
128
+ readonly description: "One normative statement in the source's meaning, for example 'Refunds must not exceed the original charge.'";
129
+ };
130
+ readonly sourceId: {
131
+ readonly type: "string";
132
+ readonly description: "The id of a declared knowledge source.";
133
+ };
134
+ readonly reference: {
135
+ readonly type: "string";
136
+ readonly minLength: 1;
137
+ readonly description: "Exact citation inside the source: a ticket key, page URL, or section anchor.";
138
+ };
139
+ readonly excerpt: {
140
+ readonly type: "string";
141
+ readonly description: "Optional short quote supporting the claim.";
142
+ };
143
+ };
144
+ };
145
+ };
74
146
  };
75
147
  };
76
148
  };
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAOjF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF7B,CAAC"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AASjF,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2J7B,CAAC"}