kibi-cli 0.17.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/cli-json-command.d.ts.map +1 -1
  2. package/dist/cli-json-command.js +87 -11
  3. package/dist/cli-register-maintenance.d.ts.map +1 -1
  4. package/dist/cli-register-maintenance.js +8 -0
  5. package/dist/cli-register-reporting.d.ts.map +1 -1
  6. package/dist/cli-register-reporting.js +5 -0
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +2 -1
  9. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  10. package/dist/commands/aggregated-checks.js +1 -0
  11. package/dist/commands/coverage.d.ts +5 -0
  12. package/dist/commands/coverage.d.ts.map +1 -1
  13. package/dist/commands/coverage.js +5 -0
  14. package/dist/commands/discovery-table.d.ts.map +1 -1
  15. package/dist/commands/discovery-table.js +96 -5
  16. package/dist/commands/sync/cache.d.ts +2 -0
  17. package/dist/commands/sync/cache.d.ts.map +1 -1
  18. package/dist/commands/sync/cache.js +8 -0
  19. package/dist/commands/sync/persistence.d.ts.map +1 -1
  20. package/dist/commands/sync/persistence.js +58 -1
  21. package/dist/commands/sync.d.ts.map +1 -1
  22. package/dist/commands/sync.js +72 -15
  23. package/dist/commands/usage-metrics.d.ts +66 -2
  24. package/dist/commands/usage-metrics.d.ts.map +1 -1
  25. package/dist/commands/usage-metrics.js +34 -24
  26. package/dist/commands/usage-remediation.d.ts +9 -0
  27. package/dist/commands/usage-remediation.d.ts.map +1 -0
  28. package/dist/commands/usage-remediation.js +52 -0
  29. package/dist/extractors/markdown.d.ts +8 -0
  30. package/dist/extractors/markdown.d.ts.map +1 -1
  31. package/dist/extractors/markdown.js +69 -2
  32. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
  33. package/dist/operations/modeling/logic-modeling.js +14 -5
  34. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  35. package/dist/operations/modeling/model-requirement.js +27 -2
  36. package/dist/operations/modeling/predicate-applyplan.d.ts +1 -1
  37. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  38. package/dist/operations/modeling/predicate-applyplan.js +18 -6
  39. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
  40. package/dist/operations/modeling/predicate-inference.js +5 -17
  41. package/dist/operations/modeling/predicate-loader.js +1 -1
  42. package/dist/operations/modeling/predicate-types.d.ts +9 -1
  43. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  44. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  45. package/dist/operations/modeling/suggest-predicates.js +35 -11
  46. package/dist/operations/mutation/audit.js +1 -1
  47. package/dist/operations/mutation/contradictions.d.ts +1 -1
  48. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  49. package/dist/operations/mutation/contradictions.js +23 -18
  50. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  51. package/dist/operations/mutation/serialization.js +6 -3
  52. package/dist/operations/mutation/upsert.d.ts +3 -1
  53. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  54. package/dist/operations/mutation/upsert.js +51 -12
  55. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  56. package/dist/operations/mutation/validate-upsert.js +18 -2
  57. package/dist/operations/mutation/validation.d.ts.map +1 -1
  58. package/dist/operations/mutation/validation.js +8 -0
  59. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  60. package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
  61. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  62. package/dist/operations/semantic-advisor/analyze-prose.js +76 -61
  63. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  64. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  65. package/dist/operations/semantic-advisor/clauses.js +7 -7
  66. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +18 -0
  67. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -0
  68. package/dist/operations/semantic-advisor/ingestion-boundary.js +167 -0
  69. package/dist/operations/semantic-advisor/shared.d.ts +8 -0
  70. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
  71. package/dist/operations/semantic-advisor/shared.js +37 -3
  72. package/dist/operations/semantic-advisor/types.d.ts +5 -0
  73. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  74. package/dist/prolog/codec.d.ts.map +1 -1
  75. package/dist/prolog/codec.js +9 -2
  76. package/dist/prolog.d.ts +6 -0
  77. package/dist/prolog.d.ts.map +1 -1
  78. package/dist/prolog.js +240 -61
  79. package/dist/public/diagnostic-usage.d.ts +17 -0
  80. package/dist/public/diagnostic-usage.d.ts.map +1 -0
  81. package/dist/public/diagnostic-usage.js +152 -0
  82. package/dist/public/distribution-parity.d.ts +90 -0
  83. package/dist/public/distribution-parity.d.ts.map +1 -0
  84. package/dist/public/distribution-parity.js +367 -0
  85. package/dist/public/impact/full-kb-quality.d.ts +2 -0
  86. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  87. package/dist/public/impact/full-kb-quality.js +53 -1
  88. package/dist/public/impact-diagnostics.d.ts +2 -0
  89. package/dist/public/impact-diagnostics.d.ts.map +1 -1
  90. package/dist/public/impact-diagnostics.js +1 -0
  91. package/dist/public/operations/catalog.d.ts +151 -6
  92. package/dist/public/operations/catalog.d.ts.map +1 -1
  93. package/dist/public/operations/check-executor.d.ts.map +1 -1
  94. package/dist/public/operations/check-executor.js +4 -0
  95. package/dist/public/operations/discovery-executors.d.ts +6 -0
  96. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  97. package/dist/public/operations/discovery-executors.js +18 -2
  98. package/dist/public/operations/index.d.ts +4 -0
  99. package/dist/public/operations/index.d.ts.map +1 -1
  100. package/dist/public/operations/index.js +4 -0
  101. package/dist/public/operations/legacy-migration-plan.d.ts +113 -0
  102. package/dist/public/operations/legacy-migration-plan.d.ts.map +1 -0
  103. package/dist/public/operations/legacy-migration-plan.js +409 -0
  104. package/dist/public/operations/node-ports.d.ts.map +1 -1
  105. package/dist/public/operations/node-ports.js +90 -0
  106. package/dist/public/operations/repair-plan.d.ts +184 -0
  107. package/dist/public/operations/repair-plan.d.ts.map +1 -0
  108. package/dist/public/operations/repair-plan.js +397 -0
  109. package/dist/public/operations/runtime-types.d.ts +7 -0
  110. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  111. package/dist/public/operations/specs/check.d.ts +2 -2
  112. package/dist/public/operations/specs/check.js +2 -2
  113. package/dist/public/operations/specs/discovery.d.ts +1 -1
  114. package/dist/public/operations/specs/discovery.js +1 -1
  115. package/dist/public/operations/specs/modeling.d.ts +19 -1
  116. package/dist/public/operations/specs/modeling.d.ts.map +1 -1
  117. package/dist/public/operations/specs/modeling.js +16 -1
  118. package/dist/public/operations/specs/mutation-schemas.d.ts +96 -1
  119. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  120. package/dist/public/operations/specs/mutation-schemas.js +40 -1
  121. package/dist/public/operations/specs/reporting.d.ts +42 -1
  122. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  123. package/dist/public/operations/specs/reporting.js +70 -6
  124. package/dist/public/operations/specs/semantic.js +1 -1
  125. package/dist/public/operations/specs/upsert.d.ts +96 -1
  126. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  127. package/dist/public/operations/workspace-snapshot.d.ts +10 -0
  128. package/dist/public/operations/workspace-snapshot.d.ts.map +1 -0
  129. package/dist/public/operations/workspace-snapshot.js +20 -0
  130. package/dist/public/schemas/entity.d.ts.map +1 -1
  131. package/dist/public/schemas/entity.js +43 -1
  132. package/dist/public/skills/kibi-traceability/SKILL.md +7 -1
  133. package/dist/public/skills/kibi-usage/SKILL.md +10 -4
  134. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +1 -1
  135. package/dist/public/skills/kibi-usage/resources/logic-ir.md +1 -1
  136. package/dist/public/skills/kibi-usage/resources/workflows.md +19 -2
  137. package/dist/public/telemetry-acceptance.d.ts +89 -0
  138. package/dist/public/telemetry-acceptance.d.ts.map +1 -0
  139. package/dist/public/telemetry-acceptance.js +597 -0
  140. package/dist/public/telemetry-remediation.d.ts +33 -0
  141. package/dist/public/telemetry-remediation.d.ts.map +1 -0
  142. package/dist/public/telemetry-remediation.js +257 -0
  143. package/dist/public/verification-receipt.d.ts +75 -0
  144. package/dist/public/verification-receipt.d.ts.map +1 -0
  145. package/dist/public/verification-receipt.js +129 -0
  146. package/dist/schemas/entity.schema.json +96 -2
  147. package/dist/traceability/temp-kb.d.ts.map +1 -1
  148. package/dist/traceability/temp-kb.js +36 -3
  149. package/dist/types/entities.d.ts +1 -0
  150. package/dist/types/entities.d.ts.map +1 -1
  151. package/dist/utils/rule-registry.d.ts +2 -0
  152. package/dist/utils/rule-registry.d.ts.map +1 -1
  153. package/package.json +30 -2
  154. package/src/public/diagnostic-usage.ts +206 -0
  155. package/src/public/distribution-parity.ts +580 -0
  156. package/src/public/impact/full-kb-quality.ts +74 -1
  157. package/src/public/impact-diagnostics.ts +16 -0
  158. package/src/public/operations/check-executor.ts +4 -0
  159. package/src/public/operations/discovery-executors.ts +24 -2
  160. package/src/public/operations/index.ts +4 -0
  161. package/src/public/operations/legacy-migration-plan.ts +688 -0
  162. package/src/public/operations/node-ports.ts +109 -0
  163. package/src/public/operations/repair-plan.ts +562 -0
  164. package/src/public/operations/runtime-types.ts +8 -0
  165. package/src/public/operations/specs/check.ts +2 -2
  166. package/src/public/operations/specs/discovery.ts +1 -1
  167. package/src/public/operations/specs/modeling.ts +19 -1
  168. package/src/public/operations/specs/mutation-schemas.ts +47 -1
  169. package/src/public/operations/specs/reporting.ts +91 -6
  170. package/src/public/operations/specs/semantic.ts +1 -1
  171. package/src/public/operations/workspace-snapshot.ts +28 -0
  172. package/src/public/schemas/entity.ts +44 -1
  173. package/src/public/skills/kibi-traceability/SKILL.md +7 -1
  174. package/src/public/skills/kibi-usage/SKILL.md +10 -4
  175. package/src/public/skills/kibi-usage/resources/fact-lanes.md +1 -1
  176. package/src/public/skills/kibi-usage/resources/logic-ir.md +1 -1
  177. package/src/public/skills/kibi-usage/resources/workflows.md +19 -2
  178. package/src/public/telemetry-acceptance.ts +859 -0
  179. package/src/public/telemetry-remediation.ts +462 -0
  180. package/src/public/verification-receipt.ts +170 -0
  181. package/src/schemas/entity.schema.json +96 -2
@@ -0,0 +1,184 @@
1
+ export declare const REPAIR_PLAN_VERSION: "kibi.repair-plan.v1";
2
+ type RepairPhaseDefinition = {
3
+ readonly order: number;
4
+ readonly objective: string;
5
+ readonly workflowSteps: readonly string[];
6
+ readonly validationRules: readonly string[];
7
+ readonly writePolicy: "analysis_then_sequential_upsert" | "review_then_sequential_upsert" | "sequential_upsert" | "execute_then_append_receipt" | "refresh_then_sync" | "runtime_recovery";
8
+ };
9
+ declare const REPAIR_PHASES: {
10
+ readonly requirement_source: {
11
+ readonly order: 5;
12
+ readonly objective: "Bind the requirement to its current authored source before semantic analysis.";
13
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
14
+ readonly validationRules: readonly ["required-fields", "no-dangling-refs"];
15
+ readonly writePolicy: "sequential_upsert";
16
+ };
17
+ readonly semantic_inventory: {
18
+ readonly order: 10;
19
+ readonly objective: "Produce and persist a complete source-bound proposition inventory.";
20
+ readonly workflowSteps: readonly ["kb_semantic_advisor", "kb_validate_upsert", "kb_upsert", "kb_check"];
21
+ readonly validationRules: readonly ["semantic-completeness", "logic-coverage"];
22
+ readonly writePolicy: "analysis_then_sequential_upsert";
23
+ };
24
+ readonly semantic_resolution: {
25
+ readonly order: 20;
26
+ readonly objective: "Resolve ambiguity or ontology gaps without treating unresolved prose as modeled.";
27
+ readonly workflowSteps: readonly ["kb_semantic_advisor", "kb_suggest_predicates", "kb_model_requirement", "kb_validate_upsert", "kb_upsert", "kb_check"];
28
+ readonly validationRules: readonly ["semantic-completeness", "logic-coverage", "predicate-verifiability", "rule-safety", "rule-verifiability"];
29
+ readonly writePolicy: "review_then_sequential_upsert";
30
+ };
31
+ readonly ground_endpoints: {
32
+ readonly order: 30;
33
+ readonly objective: "Create or repair exactly one validated logical endpoint for each modeled proposition.";
34
+ readonly workflowSteps: readonly ["kb_suggest_predicates", "kb_model_requirement", "kb_validate_upsert", "kb_upsert", "kb_check"];
35
+ readonly validationRules: readonly ["strict-fact-shape", "predicate-verifiability", "rule-safety", "rule-verifiability", "logic-coverage"];
36
+ readonly writePolicy: "review_then_sequential_upsert";
37
+ };
38
+ readonly manifest_links: {
39
+ readonly order: 40;
40
+ readonly objective: "Persist the exact claim manifest and link it one-to-one to existing logical endpoints.";
41
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
42
+ readonly validationRules: readonly ["semantic-completeness", "logic-coverage", "predicate-verifiability", "rule-safety", "rule-verifiability", "no-dangling-refs"];
43
+ readonly writePolicy: "sequential_upsert";
44
+ };
45
+ readonly contradiction_resolution: {
46
+ readonly order: 50;
47
+ readonly objective: "Inspect exact contradiction witnesses and supersede or reconcile conflicting requirements.";
48
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
49
+ readonly validationRules: readonly ["domain-contradictions", "logic-coverage"];
50
+ readonly writePolicy: "review_then_sequential_upsert";
51
+ };
52
+ readonly scenario_endpoints: {
53
+ readonly order: 60;
54
+ readonly objective: "Create a scenario endpoint and link the requirement through specified_by.";
55
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
56
+ readonly validationRules: readonly ["must-priority-coverage", "no-dangling-refs"];
57
+ readonly writePolicy: "sequential_upsert";
58
+ };
59
+ readonly scenario_tests: {
60
+ readonly order: 70;
61
+ readonly objective: "Create or select a test endpoint and link it through the requirement scenario.";
62
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
63
+ readonly validationRules: readonly ["must-priority-coverage", "no-dangling-refs"];
64
+ readonly writePolicy: "sequential_upsert";
65
+ };
66
+ readonly snapshot_runtime: {
67
+ readonly order: 75;
68
+ readonly objective: "Use a runtime that exposes a deterministic workspace verification snapshot.";
69
+ readonly workflowSteps: readonly ["kb_status", "kb_coverage"];
70
+ readonly validationRules: readonly [];
71
+ readonly writePolicy: "runtime_recovery";
72
+ };
73
+ readonly verification_evidence: {
74
+ readonly order: 80;
75
+ readonly objective: "Run the scenario-backed E2E test and append a fresh snapshot-bound passing receipt.";
76
+ readonly workflowSteps: readonly ["kb_status", "execute_e2e", "kb_validate_upsert", "kb_upsert", "kb_coverage"];
77
+ readonly validationRules: readonly ["required-fields", "no-dangling-refs"];
78
+ readonly writePolicy: "execute_then_append_receipt";
79
+ };
80
+ readonly executable_symbols: {
81
+ readonly order: 90;
82
+ readonly objective: "Link executable test symbols to every qualifying E2E test through executable_for.";
83
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
84
+ readonly validationRules: readonly ["symbol-traceability", "no-dangling-refs"];
85
+ readonly writePolicy: "sequential_upsert";
86
+ };
87
+ readonly production_ownership: {
88
+ readonly order: 100;
89
+ readonly objective: "Link production symbols to the requirement through implements.";
90
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
91
+ readonly validationRules: readonly ["symbol-traceability", "no-dangling-refs"];
92
+ readonly writePolicy: "sequential_upsert";
93
+ };
94
+ readonly production_coverage: {
95
+ readonly order: 110;
96
+ readonly objective: "Link every implementing production symbol to a qualifying E2E test through covered_by.";
97
+ readonly workflowSteps: readonly ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"];
98
+ readonly validationRules: readonly ["symbol-coverage", "symbol-traceability", "no-dangling-refs"];
99
+ readonly writePolicy: "sequential_upsert";
100
+ };
101
+ readonly source_coordinates: {
102
+ readonly order: 120;
103
+ readonly objective: "Refresh symbol extraction and persist exact current source coordinates.";
104
+ readonly workflowSteps: readonly ["kibi sync --refresh-symbol-coordinates", "kibi sync", "kb_check", "kb_coverage"];
105
+ readonly validationRules: readonly ["symbol-coverage", "symbol-traceability"];
106
+ readonly writePolicy: "refresh_then_sync";
107
+ };
108
+ readonly manual_review: {
109
+ readonly order: 900;
110
+ readonly objective: "Review the unclassified proof gap and choose a conservative repair workflow.";
111
+ readonly workflowSteps: readonly ["kb_query", "kb_check", "kb_coverage"];
112
+ readonly validationRules: readonly [];
113
+ readonly writePolicy: "review_then_sequential_upsert";
114
+ };
115
+ };
116
+ type RepairPhase = keyof typeof REPAIR_PHASES;
117
+ export type RepairPlanRepair = {
118
+ readonly requirementId: string;
119
+ readonly gap: string;
120
+ readonly proofPriority: number;
121
+ readonly proofStage: string;
122
+ readonly action: string;
123
+ readonly evidence: Readonly<Record<string, unknown>>;
124
+ };
125
+ export type RepairPlanBatch = {
126
+ readonly id: string;
127
+ readonly order: number;
128
+ readonly phase: RepairPhase;
129
+ readonly requirementId: string;
130
+ readonly state: "ready" | "blocked";
131
+ readonly dependsOn: readonly string[];
132
+ readonly objective: string;
133
+ readonly workflowSteps: readonly string[];
134
+ readonly validationRules: readonly string[];
135
+ readonly writePolicy: RepairPhaseDefinition["writePolicy"];
136
+ readonly autoApplicable: false;
137
+ readonly repairs: readonly RepairPlanRepair[];
138
+ };
139
+ export type RepairPlan = {
140
+ readonly version: typeof REPAIR_PLAN_VERSION;
141
+ readonly planId: string;
142
+ readonly readOnly: true;
143
+ readonly status: "no_repairs" | "ready" | "partial";
144
+ readonly codeSnapshot: string;
145
+ readonly scope: {
146
+ readonly by: string;
147
+ readonly tags: readonly string[];
148
+ readonly offset: number;
149
+ readonly limit: number;
150
+ readonly complete: boolean;
151
+ readonly actionableRequirements: number;
152
+ readonly returnedActionableRequirements: number;
153
+ readonly excludedByPagination: number;
154
+ };
155
+ readonly applicationPolicy: {
156
+ readonly queryBeforeMutation: true;
157
+ readonly createEndpointsBeforeRelationships: true;
158
+ readonly validateBeforeEachWrite: true;
159
+ readonly sequentialUpsertsOnly: true;
160
+ readonly recheckCoverageAfterEachBatch: true;
161
+ };
162
+ readonly summary: {
163
+ readonly requirementCount: number;
164
+ readonly repairCount: number;
165
+ readonly batchCount: number;
166
+ readonly readyBatchCount: number;
167
+ readonly blockedBatchCount: number;
168
+ };
169
+ readonly batches: readonly RepairPlanBatch[];
170
+ readonly diagnostics: readonly string[];
171
+ };
172
+ export type RepairPlanInput = {
173
+ readonly by?: "req" | "symbol" | "type";
174
+ readonly tags?: readonly string[];
175
+ readonly limit?: number;
176
+ readonly offset?: number;
177
+ };
178
+ type CoverageForRepairPlan = {
179
+ readonly summary?: Readonly<Record<string, number>>;
180
+ readonly rows?: readonly Readonly<Record<string, unknown>>[];
181
+ };
182
+ export declare function buildRepairPlan(payload: CoverageForRepairPlan, input: RepairPlanInput, codeSnapshot: string): RepairPlan | undefined;
183
+ export {};
184
+ //# sourceMappingURL=repair-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/repair-plan.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,EAAG,qBAA8B,CAAC;AAElE,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAChB,iCAAiC,GACjC,+BAA+B,GAC/B,mBAAmB,GACnB,6BAA6B,GAC7B,mBAAmB,GACnB,kBAAkB,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4KiD,CAAC;AAErE,KAAK,WAAW,GAAG,MAAM,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AK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC9D,CAAC;AA2IF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,qBAAqB,EAC9B,KAAK,EAAE,eAAe,EACtB,YAAY,EAAE,MAAM,GACnB,UAAU,GAAG,SAAS,CA4FxB"}
@@ -0,0 +1,397 @@
1
+ import { createHash } from "node:crypto";
2
+ export const REPAIR_PLAN_VERSION = "kibi.repair-plan.v1";
3
+ const REPAIR_PHASES = {
4
+ requirement_source: {
5
+ order: 5,
6
+ objective: "Bind the requirement to its current authored source before semantic analysis.",
7
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
8
+ validationRules: ["required-fields", "no-dangling-refs"],
9
+ writePolicy: "sequential_upsert",
10
+ },
11
+ semantic_inventory: {
12
+ order: 10,
13
+ objective: "Produce and persist a complete source-bound proposition inventory.",
14
+ workflowSteps: [
15
+ "kb_semantic_advisor",
16
+ "kb_validate_upsert",
17
+ "kb_upsert",
18
+ "kb_check",
19
+ ],
20
+ validationRules: ["semantic-completeness", "logic-coverage"],
21
+ writePolicy: "analysis_then_sequential_upsert",
22
+ },
23
+ semantic_resolution: {
24
+ order: 20,
25
+ objective: "Resolve ambiguity or ontology gaps without treating unresolved prose as modeled.",
26
+ workflowSteps: [
27
+ "kb_semantic_advisor",
28
+ "kb_suggest_predicates",
29
+ "kb_model_requirement",
30
+ "kb_validate_upsert",
31
+ "kb_upsert",
32
+ "kb_check",
33
+ ],
34
+ validationRules: [
35
+ "semantic-completeness",
36
+ "logic-coverage",
37
+ "predicate-verifiability",
38
+ "rule-safety",
39
+ "rule-verifiability",
40
+ ],
41
+ writePolicy: "review_then_sequential_upsert",
42
+ },
43
+ ground_endpoints: {
44
+ order: 30,
45
+ objective: "Create or repair exactly one validated logical endpoint for each modeled proposition.",
46
+ workflowSteps: [
47
+ "kb_suggest_predicates",
48
+ "kb_model_requirement",
49
+ "kb_validate_upsert",
50
+ "kb_upsert",
51
+ "kb_check",
52
+ ],
53
+ validationRules: [
54
+ "strict-fact-shape",
55
+ "predicate-verifiability",
56
+ "rule-safety",
57
+ "rule-verifiability",
58
+ "logic-coverage",
59
+ ],
60
+ writePolicy: "review_then_sequential_upsert",
61
+ },
62
+ manifest_links: {
63
+ order: 40,
64
+ objective: "Persist the exact claim manifest and link it one-to-one to existing logical endpoints.",
65
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
66
+ validationRules: [
67
+ "semantic-completeness",
68
+ "logic-coverage",
69
+ "predicate-verifiability",
70
+ "rule-safety",
71
+ "rule-verifiability",
72
+ "no-dangling-refs",
73
+ ],
74
+ writePolicy: "sequential_upsert",
75
+ },
76
+ contradiction_resolution: {
77
+ order: 50,
78
+ objective: "Inspect exact contradiction witnesses and supersede or reconcile conflicting requirements.",
79
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
80
+ validationRules: ["domain-contradictions", "logic-coverage"],
81
+ writePolicy: "review_then_sequential_upsert",
82
+ },
83
+ scenario_endpoints: {
84
+ order: 60,
85
+ objective: "Create a scenario endpoint and link the requirement through specified_by.",
86
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
87
+ validationRules: ["must-priority-coverage", "no-dangling-refs"],
88
+ writePolicy: "sequential_upsert",
89
+ },
90
+ scenario_tests: {
91
+ order: 70,
92
+ objective: "Create or select a test endpoint and link it through the requirement scenario.",
93
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
94
+ validationRules: ["must-priority-coverage", "no-dangling-refs"],
95
+ writePolicy: "sequential_upsert",
96
+ },
97
+ snapshot_runtime: {
98
+ order: 75,
99
+ objective: "Use a runtime that exposes a deterministic workspace verification snapshot.",
100
+ workflowSteps: ["kb_status", "kb_coverage"],
101
+ validationRules: [],
102
+ writePolicy: "runtime_recovery",
103
+ },
104
+ verification_evidence: {
105
+ order: 80,
106
+ objective: "Run the scenario-backed E2E test and append a fresh snapshot-bound passing receipt.",
107
+ workflowSteps: [
108
+ "kb_status",
109
+ "execute_e2e",
110
+ "kb_validate_upsert",
111
+ "kb_upsert",
112
+ "kb_coverage",
113
+ ],
114
+ validationRules: ["required-fields", "no-dangling-refs"],
115
+ writePolicy: "execute_then_append_receipt",
116
+ },
117
+ executable_symbols: {
118
+ order: 90,
119
+ objective: "Link executable test symbols to every qualifying E2E test through executable_for.",
120
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
121
+ validationRules: ["symbol-traceability", "no-dangling-refs"],
122
+ writePolicy: "sequential_upsert",
123
+ },
124
+ production_ownership: {
125
+ order: 100,
126
+ objective: "Link production symbols to the requirement through implements.",
127
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
128
+ validationRules: ["symbol-traceability", "no-dangling-refs"],
129
+ writePolicy: "sequential_upsert",
130
+ },
131
+ production_coverage: {
132
+ order: 110,
133
+ objective: "Link every implementing production symbol to a qualifying E2E test through covered_by.",
134
+ workflowSteps: ["kb_query", "kb_validate_upsert", "kb_upsert", "kb_check"],
135
+ validationRules: [
136
+ "symbol-coverage",
137
+ "symbol-traceability",
138
+ "no-dangling-refs",
139
+ ],
140
+ writePolicy: "sequential_upsert",
141
+ },
142
+ source_coordinates: {
143
+ order: 120,
144
+ objective: "Refresh symbol extraction and persist exact current source coordinates.",
145
+ workflowSteps: [
146
+ "kibi sync --refresh-symbol-coordinates",
147
+ "kibi sync",
148
+ "kb_check",
149
+ "kb_coverage",
150
+ ],
151
+ validationRules: ["symbol-coverage", "symbol-traceability"],
152
+ writePolicy: "refresh_then_sync",
153
+ },
154
+ manual_review: {
155
+ order: 900,
156
+ objective: "Review the unclassified proof gap and choose a conservative repair workflow.",
157
+ workflowSteps: ["kb_query", "kb_check", "kb_coverage"],
158
+ validationRules: [],
159
+ writePolicy: "review_then_sequential_upsert",
160
+ },
161
+ };
162
+ const GAP_PHASE = {
163
+ missing_requirement_source: "requirement_source",
164
+ missing_semantic_inventory: "semantic_inventory",
165
+ incomplete_semantic_inventory: "semantic_inventory",
166
+ malformed_semantic_inventory: "semantic_inventory",
167
+ unresolved_semantic_proposition: "semantic_resolution",
168
+ missing_logic_grounding: "ground_endpoints",
169
+ ambiguous_logic_grounding: "ground_endpoints",
170
+ contradiction_check_incomplete: "ground_endpoints",
171
+ missing_logic_claims: "manifest_links",
172
+ logic_manifest_mismatch: "manifest_links",
173
+ blocking_contradiction: "contradiction_resolution",
174
+ missing_scenario: "scenario_endpoints",
175
+ missing_scenario_test: "scenario_tests",
176
+ verification_snapshot_unavailable: "snapshot_runtime",
177
+ missing_passing_e2e: "verification_evidence",
178
+ missing_verification_receipt: "verification_evidence",
179
+ stale_verification_receipt: "verification_evidence",
180
+ failed_verification_receipt: "verification_evidence",
181
+ invalid_verification_receipt: "verification_evidence",
182
+ missing_executable_test_symbol: "executable_symbols",
183
+ missing_production_symbol: "production_ownership",
184
+ missing_production_symbol_coverage: "production_coverage",
185
+ missing_symbol_coordinates: "source_coordinates",
186
+ };
187
+ const GAP_STAGE = {
188
+ missing_requirement_source: "source_coordinates",
189
+ missing_semantic_inventory: "semantic_inventory",
190
+ incomplete_semantic_inventory: "semantic_inventory",
191
+ malformed_semantic_inventory: "semantic_inventory",
192
+ unresolved_semantic_proposition: "semantic_inventory",
193
+ missing_logic_claims: "logic_grounding",
194
+ logic_manifest_mismatch: "logic_grounding",
195
+ missing_logic_grounding: "logic_grounding",
196
+ ambiguous_logic_grounding: "logic_grounding",
197
+ blocking_contradiction: "contradictions",
198
+ contradiction_check_incomplete: "contradictions",
199
+ missing_scenario: "scenarios",
200
+ missing_scenario_test: "scenario_tests",
201
+ missing_passing_e2e: "passing_e2e",
202
+ missing_verification_receipt: "passing_e2e",
203
+ stale_verification_receipt: "passing_e2e",
204
+ failed_verification_receipt: "passing_e2e",
205
+ invalid_verification_receipt: "passing_e2e",
206
+ verification_snapshot_unavailable: "passing_e2e",
207
+ missing_executable_test_symbol: "executable_symbols",
208
+ missing_production_symbol: "production_symbols",
209
+ missing_production_symbol_coverage: "production_symbols",
210
+ missing_symbol_coordinates: "source_coordinates",
211
+ };
212
+ const PROOF_STAGE_KEY = {
213
+ semantic_inventory: "semanticInventory",
214
+ logic_grounding: "logicGrounding",
215
+ contradictions: "contradictions",
216
+ scenarios: "scenarios",
217
+ scenario_tests: "scenarioTests",
218
+ passing_e2e: "passingE2e",
219
+ executable_symbols: "executableSymbols",
220
+ production_symbols: "productionSymbols",
221
+ source_coordinates: "sourceCoordinates",
222
+ };
223
+ function isRecord(value) {
224
+ return value !== null && typeof value === "object" && !Array.isArray(value);
225
+ }
226
+ function stringList(value) {
227
+ if (!Array.isArray(value))
228
+ return [];
229
+ return value.filter((item) => typeof item === "string");
230
+ }
231
+ function stableValue(value) {
232
+ if (Array.isArray(value))
233
+ return value.map(stableValue);
234
+ if (!isRecord(value))
235
+ return value;
236
+ return Object.fromEntries(Object.entries(value)
237
+ .filter(([key]) => key !== "checkedAt" && key !== "ageSeconds")
238
+ .sort(([left], [right]) => left.localeCompare(right))
239
+ .map(([key, item]) => [key, stableValue(item)]));
240
+ }
241
+ function stableStringify(value) {
242
+ return JSON.stringify(stableValue(value));
243
+ }
244
+ function numberField(value, fallback) {
245
+ return typeof value === "number" && Number.isFinite(value) ? value : fallback;
246
+ }
247
+ function actionForRepair(repair, phase) {
248
+ return typeof repair?.action === "string"
249
+ ? repair.action
250
+ : REPAIR_PHASES[phase].objective;
251
+ }
252
+ function stageEvidence(row, proofStage) {
253
+ const stages = isRecord(row.proofStages) ? row.proofStages : {};
254
+ const key = PROOF_STAGE_KEY[proofStage];
255
+ const evidence = key === undefined ? undefined : stages[key];
256
+ const stable = stableValue(evidence);
257
+ return isRecord(stable) ? stable : {};
258
+ }
259
+ function batchId(requirementId, phase) {
260
+ const order = String(REPAIR_PHASES[phase].order).padStart(3, "0");
261
+ const safeRequirementId = requirementId.replace(/[^A-Za-z0-9_-]/g, "-");
262
+ return `repair-${order}-${safeRequirementId}-${phase}`;
263
+ }
264
+ function buildRequirementBatches(row) {
265
+ const requirementId = typeof row.id === "string" ? row.id : "unknown-requirement";
266
+ const gaps = [...new Set(stringList(row.proofGaps))].sort();
267
+ const repairs = Array.isArray(row.proofRepairs)
268
+ ? row.proofRepairs.filter(isRecord)
269
+ : [];
270
+ const repairByGap = new Map(repairs.flatMap((repair) => typeof repair.gap === "string" ? [[repair.gap, repair]] : []));
271
+ const byPhase = new Map();
272
+ for (const gap of gaps) {
273
+ const phase = GAP_PHASE[gap] ?? "manual_review";
274
+ const sourceRepair = repairByGap.get(gap);
275
+ const proofStage = typeof sourceRepair?.stage === "string"
276
+ ? sourceRepair.stage
277
+ : (GAP_STAGE[gap] ?? "manual_review");
278
+ const repair = {
279
+ requirementId,
280
+ gap,
281
+ proofPriority: numberField(sourceRepair?.priority, REPAIR_PHASES[phase].order),
282
+ proofStage,
283
+ action: actionForRepair(sourceRepair, phase),
284
+ evidence: stageEvidence(row, proofStage),
285
+ };
286
+ const phaseRepairs = byPhase.get(phase) ?? [];
287
+ phaseRepairs.push(repair);
288
+ byPhase.set(phase, phaseRepairs);
289
+ }
290
+ const phases = [...byPhase.keys()].sort((left, right) => REPAIR_PHASES[left].order - REPAIR_PHASES[right].order ||
291
+ left.localeCompare(right));
292
+ const priorBatchIds = [];
293
+ return phases.map((phase) => {
294
+ const definition = REPAIR_PHASES[phase];
295
+ const id = batchId(requirementId, phase);
296
+ const batch = {
297
+ id,
298
+ order: definition.order,
299
+ phase,
300
+ requirementId,
301
+ state: priorBatchIds.length === 0 ? "ready" : "blocked",
302
+ dependsOn: [...priorBatchIds],
303
+ objective: definition.objective,
304
+ workflowSteps: definition.workflowSteps,
305
+ validationRules: definition.validationRules,
306
+ writePolicy: definition.writePolicy,
307
+ autoApplicable: false,
308
+ repairs: (byPhase.get(phase) ?? []).sort((left, right) => left.proofPriority - right.proofPriority ||
309
+ left.gap.localeCompare(right.gap)),
310
+ };
311
+ priorBatchIds.push(id);
312
+ return batch;
313
+ });
314
+ }
315
+ function actionableRequirementTotal(summary, fallback) {
316
+ const missing = summary.proofMissing;
317
+ const unresolved = summary.proofUnresolved;
318
+ if (typeof missing === "number" && typeof unresolved === "number") {
319
+ return Math.max(0, missing + unresolved);
320
+ }
321
+ return fallback;
322
+ }
323
+ export function buildRepairPlan(payload, input, codeSnapshot) {
324
+ const by = input.by ?? "req";
325
+ if (by !== "req")
326
+ return undefined;
327
+ const rows = payload.rows ?? [];
328
+ const requirementRows = rows.filter((row) => typeof row.id === "string" && stringList(row.proofGaps).length > 0);
329
+ const batches = requirementRows
330
+ .flatMap(buildRequirementBatches)
331
+ .sort((left, right) => left.order - right.order ||
332
+ left.requirementId.localeCompare(right.requirementId) ||
333
+ left.id.localeCompare(right.id));
334
+ const requirementCount = new Set(batches.map((batch) => batch.requirementId))
335
+ .size;
336
+ const summary = payload.summary ?? {};
337
+ const actionableRequirements = actionableRequirementTotal(summary, requirementCount);
338
+ const offset = input.offset ?? 0;
339
+ const limit = input.limit ?? 100;
340
+ const complete = offset === 0 && requirementCount >= actionableRequirements;
341
+ const excludedByPagination = Math.max(0, actionableRequirements - requirementCount);
342
+ const repairCount = batches.reduce((count, batch) => count + batch.repairs.length, 0);
343
+ const readyBatchCount = batches.filter((batch) => batch.state === "ready").length;
344
+ const blockedBatchCount = batches.length - readyBatchCount;
345
+ const diagnostics = complete
346
+ ? []
347
+ : [
348
+ `Repair plan is partial: ${excludedByPagination} actionable requirement(s) were excluded by coverage pagination; rerun with offset 0 and a larger limit.`,
349
+ ];
350
+ const planCore = {
351
+ version: REPAIR_PLAN_VERSION,
352
+ codeSnapshot,
353
+ scope: {
354
+ by,
355
+ tags: [...(input.tags ?? [])].sort(),
356
+ offset,
357
+ limit,
358
+ complete,
359
+ actionableRequirements,
360
+ returnedActionableRequirements: requirementCount,
361
+ excludedByPagination,
362
+ },
363
+ batches,
364
+ };
365
+ const planId = `repair-plan-${createHash("sha256")
366
+ .update(stableStringify(planCore))
367
+ .digest("hex")
368
+ .slice(0, 24)}`;
369
+ return {
370
+ version: REPAIR_PLAN_VERSION,
371
+ planId,
372
+ readOnly: true,
373
+ status: repairCount === 0 && complete
374
+ ? "no_repairs"
375
+ : complete
376
+ ? "ready"
377
+ : "partial",
378
+ codeSnapshot,
379
+ scope: planCore.scope,
380
+ applicationPolicy: {
381
+ queryBeforeMutation: true,
382
+ createEndpointsBeforeRelationships: true,
383
+ validateBeforeEachWrite: true,
384
+ sequentialUpsertsOnly: true,
385
+ recheckCoverageAfterEachBatch: true,
386
+ },
387
+ summary: {
388
+ requirementCount,
389
+ repairCount,
390
+ batchCount: batches.length,
391
+ readyBatchCount,
392
+ blockedBatchCount,
393
+ },
394
+ batches,
395
+ diagnostics,
396
+ };
397
+ }
@@ -24,7 +24,14 @@ export interface FilesystemPort {
24
24
  export interface GitPort {
25
25
  revParse(...args: readonly string[]): Promise<string>;
26
26
  showToplevel(): Promise<string>;
27
+ workspaceSnapshot?(workspaceRoot: string): Promise<WorkspaceSnapshot>;
27
28
  }
29
+ export type WorkspaceSnapshot = Readonly<{
30
+ version: "kibi.workspace-snapshot.v1";
31
+ hash: string;
32
+ dirty: boolean;
33
+ fileCount: number;
34
+ }>;
28
35
  export interface NetworkPort {
29
36
  fetch(input: string | URL, init?: RequestInit): Promise<Response>;
30
37
  }
@@ -1 +1 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ACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrE;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAG1D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CACF,IAAI,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EAC5C,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,YAAY,CACV,IAAI,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EAC5C,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5E;AAGD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,OAAO,EACpD,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3C,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,OAAO,CAAC,CAclB"}
@@ -2,7 +2,7 @@ import { executeCheck } from "../check-executor.js";
2
2
  export declare const checkSpec: {
3
3
  readonly name: "kb_check";
4
4
  readonly cliName: "check";
5
- readonly description: "Run KB validation rules and return violations. Use before or after mutations, and after meaningful source edits with impact options to surface symbol granularity and semantic-review diagnostics. Do not use for point lookups. No write side effects. Prefer explicit rules for faster iteration; omit rules for final full validation plus full-KB qualityDiagnostics review.";
5
+ readonly description: "Run KB validation rules and return violations. Use before or after mutations, and after meaningful source edits with impact options to surface symbol granularity and semantic-review diagnostics. Do not use for point lookups. No write side effects. Prefer explicit rules for faster iteration; omit rules for final full validation plus full-KB qualityDiagnostics review, including telemetry acceptance when .kb/usage.log exists.";
6
6
  readonly businessInputSchema: {
7
7
  readonly type: "object";
8
8
  readonly properties: {
@@ -12,7 +12,7 @@ export declare const checkSpec: {
12
12
  readonly type: "string";
13
13
  readonly enum: readonly ["must-priority-coverage", "symbol-coverage", "symbol-traceability", "no-dangling-refs", "no-cycles", "required-fields", "deprecated-adr-no-successor", "domain-contradictions", "strict-fact-shape", "strict-req-fact-pairing", "predicate-verifiability", "logic-coverage", "rule-safety", "rule-verifiability", "semantic-completeness", "query-plan-safety"];
14
14
  };
15
- readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, rule-safety, rule-verifiability, semantic-completeness, query-plan-safety. If omitted, server runs all rules plus the full-KB qualityDiagnostics audit scan; if supplied, server preserves scoped validation and skips the full-KB advisory scan.";
15
+ readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, rule-safety, rule-verifiability, semantic-completeness, query-plan-safety. If omitted, server runs all rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; if supplied, server preserves scoped validation and skips the full-KB advisory scan.";
16
16
  };
17
17
  readonly sourceFiles: {
18
18
  readonly type: "array";
@@ -2,7 +2,7 @@ import { executeCheck } from "../check-executor.js";
2
2
  export const checkSpec = {
3
3
  name: "kb_check",
4
4
  cliName: "check",
5
- description: "Run KB validation rules and return violations. Use before or after mutations, and after meaningful source edits with impact options to surface symbol granularity and semantic-review diagnostics. Do not use for point lookups. No write side effects. Prefer explicit rules for faster iteration; omit rules for final full validation plus full-KB qualityDiagnostics review.",
5
+ description: "Run KB validation rules and return violations. Use before or after mutations, and after meaningful source edits with impact options to surface symbol granularity and semantic-review diagnostics. Do not use for point lookups. No write side effects. Prefer explicit rules for faster iteration; omit rules for final full validation plus full-KB qualityDiagnostics review, including telemetry acceptance when .kb/usage.log exists.",
6
6
  businessInputSchema: {
7
7
  type: "object",
8
8
  properties: {
@@ -29,7 +29,7 @@ export const checkSpec = {
29
29
  "query-plan-safety",
30
30
  ],
31
31
  },
32
- description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, rule-safety, rule-verifiability, semantic-completeness, query-plan-safety. If omitted, server runs all rules plus the full-KB qualityDiagnostics audit scan; if supplied, server preserves scoped validation and skips the full-KB advisory scan.",
32
+ description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, rule-safety, rule-verifiability, semantic-completeness, query-plan-safety. If omitted, server runs all rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; if supplied, server preserves scoped validation and skips the full-KB advisory scan.",
33
33
  },
34
34
  sourceFiles: {
35
35
  type: "array",