kibi-cli 2.21.0 → 2.22.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 (164) 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 +1 -0
  5. package/dist/commands/check.d.ts +0 -1
  6. package/dist/commands/check.d.ts.map +1 -1
  7. package/dist/commands/check.js +47 -111
  8. package/dist/commands/doctor.d.ts.map +1 -1
  9. package/dist/commands/doctor.js +107 -5
  10. package/dist/commands/init-helpers.d.ts +14 -1
  11. package/dist/commands/init-helpers.d.ts.map +1 -1
  12. package/dist/commands/init-helpers.js +49 -10
  13. package/dist/commands/init.d.ts +1 -0
  14. package/dist/commands/init.d.ts.map +1 -1
  15. package/dist/commands/init.js +27 -4
  16. package/dist/commands/legacy-storage-migration.d.ts +46 -1
  17. package/dist/commands/legacy-storage-migration.d.ts.map +1 -1
  18. package/dist/commands/legacy-storage-migration.js +244 -9
  19. package/dist/commands/migrate.d.ts.map +1 -1
  20. package/dist/commands/migrate.js +150 -166
  21. package/dist/commands/sync/manifest.d.ts.map +1 -1
  22. package/dist/commands/sync/manifest.js +9 -0
  23. package/dist/commands/sync/persistence.d.ts.map +1 -1
  24. package/dist/commands/sync/persistence.js +4 -0
  25. package/dist/decision-firmness.d.ts +39 -0
  26. package/dist/decision-firmness.d.ts.map +1 -0
  27. package/dist/decision-firmness.js +115 -0
  28. package/dist/extractors/markdown.d.ts +2 -0
  29. package/dist/extractors/markdown.d.ts.map +1 -1
  30. package/dist/extractors/markdown.js +14 -0
  31. package/dist/extractors/symbols-coordinator.js +1 -0
  32. package/dist/intent-search.d.ts.map +1 -1
  33. package/dist/intent-search.js +28 -6
  34. package/dist/operations/migration/inventory-rederive.d.ts +40 -1
  35. package/dist/operations/migration/inventory-rederive.d.ts.map +1 -1
  36. package/dist/operations/migration/inventory-rederive.js +99 -8
  37. package/dist/operations/migration/requirement-status.d.ts +25 -0
  38. package/dist/operations/migration/requirement-status.d.ts.map +1 -0
  39. package/dist/operations/migration/requirement-status.js +105 -0
  40. package/dist/operations/migration/schema6.d.ts +27 -0
  41. package/dist/operations/migration/schema6.d.ts.map +1 -1
  42. package/dist/operations/migration/schema6.js +308 -7
  43. package/dist/operations/migration/supersedes-reason.d.ts +26 -0
  44. package/dist/operations/migration/supersedes-reason.d.ts.map +1 -0
  45. package/dist/operations/migration/supersedes-reason.js +69 -0
  46. package/dist/operations/migration/symbol-legacy-links.d.ts +51 -0
  47. package/dist/operations/migration/symbol-legacy-links.d.ts.map +1 -0
  48. package/dist/operations/migration/symbol-legacy-links.js +319 -0
  49. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  50. package/dist/operations/modeling/predicate-applyplan.js +10 -2
  51. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  52. package/dist/operations/modeling/predicate-loader.js +11 -0
  53. package/dist/operations/modeling/predicate-types.d.ts +32 -1
  54. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  55. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  56. package/dist/operations/modeling/suggest-predicates.js +175 -35
  57. package/dist/operations/mutation/context-warning.d.ts +12 -2
  58. package/dist/operations/mutation/context-warning.d.ts.map +1 -1
  59. package/dist/operations/mutation/context-warning.js +6 -6
  60. package/dist/operations/mutation/delete.d.ts +5 -1
  61. package/dist/operations/mutation/delete.d.ts.map +1 -1
  62. package/dist/operations/mutation/delete.js +223 -17
  63. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  64. package/dist/operations/mutation/serialization.js +1 -0
  65. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  66. package/dist/operations/mutation/source-authoring.js +130 -35
  67. package/dist/operations/mutation/types.d.ts +39 -1
  68. package/dist/operations/mutation/types.d.ts.map +1 -1
  69. package/dist/operations/mutation/upsert.d.ts +17 -2
  70. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  71. package/dist/operations/mutation/upsert.js +82 -13
  72. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  73. package/dist/operations/mutation/validate-upsert.js +40 -8
  74. package/dist/operations/planning/apply-plan.d.ts +6 -1
  75. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  76. package/dist/operations/planning/apply-plan.js +26 -5
  77. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  78. package/dist/public/impact/diagnostics.js +24 -14
  79. package/dist/public/operations/catalog.d.ts +14 -5
  80. package/dist/public/operations/catalog.d.ts.map +1 -1
  81. package/dist/public/operations/check-executor.d.ts.map +1 -1
  82. package/dist/public/operations/check-executor.js +6 -0
  83. package/dist/public/operations/contracts.d.ts.map +1 -1
  84. package/dist/public/operations/contracts.js +35 -2
  85. package/dist/public/operations/decision-firmness.d.ts +34 -0
  86. package/dist/public/operations/decision-firmness.d.ts.map +1 -0
  87. package/dist/public/operations/decision-firmness.js +216 -0
  88. package/dist/public/operations/discovery-executors.d.ts +2 -0
  89. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  90. package/dist/public/operations/discovery-executors.js +25 -4
  91. package/dist/public/operations/migration-plan.d.ts +2 -0
  92. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  93. package/dist/public/operations/migration-plan.js +101 -16
  94. package/dist/public/operations/result-envelope.d.ts.map +1 -1
  95. package/dist/public/operations/result-envelope.js +27 -1
  96. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  97. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  98. package/dist/public/operations/specs/check-rules.generated.js +6 -1
  99. package/dist/public/operations/specs/check.d.ts +1 -1
  100. package/dist/public/operations/specs/mutation-schemas.d.ts +5 -0
  101. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  102. package/dist/public/operations/specs/mutation-schemas.js +5 -0
  103. package/dist/public/operations/specs/mutation.d.ts +6 -2
  104. package/dist/public/operations/specs/mutation.d.ts.map +1 -1
  105. package/dist/public/operations/specs/mutation.js +6 -2
  106. package/dist/public/operations/specs/planning.d.ts +2 -2
  107. package/dist/public/operations/specs/planning.js +2 -2
  108. package/dist/public/operations/specs/upsert.d.ts +5 -0
  109. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  110. package/dist/public/operations/symbol-granularity-check.d.ts +18 -0
  111. package/dist/public/operations/symbol-granularity-check.d.ts.map +1 -0
  112. package/dist/public/operations/symbol-granularity-check.js +175 -0
  113. package/dist/public/schemas/entity.d.ts.map +1 -1
  114. package/dist/public/schemas/entity.js +11 -0
  115. package/dist/public/skills/kibi-traceability/SKILL.md +6 -4
  116. package/dist/public/skills/kibi-usage/SKILL.md +50 -10
  117. package/dist/public/skills/kibi-usage/resources/source-authoring.md +4 -2
  118. package/dist/public/symbol-granularity.d.ts +17 -0
  119. package/dist/public/symbol-granularity.d.ts.map +1 -1
  120. package/dist/public/symbol-granularity.js +21 -0
  121. package/dist/relationships/shards.d.ts +10 -0
  122. package/dist/relationships/shards.d.ts.map +1 -1
  123. package/dist/relationships/shards.js +27 -11
  124. package/dist/schemas/entity.schema.json +28 -0
  125. package/dist/search-answer.d.ts +31 -2
  126. package/dist/search-answer.d.ts.map +1 -1
  127. package/dist/search-answer.js +115 -17
  128. package/dist/traceability/evidence-model.d.ts +7 -3
  129. package/dist/traceability/evidence-model.d.ts.map +1 -1
  130. package/dist/traceability/staged-symbols-manifest.js +6 -5
  131. package/dist/traceability/validate.d.ts +14 -1
  132. package/dist/traceability/validate.d.ts.map +1 -1
  133. package/dist/traceability/validate.js +41 -0
  134. package/dist/types/entities.d.ts +4 -0
  135. package/dist/types/entities.d.ts.map +1 -1
  136. package/dist/utils/kb-manifest.d.ts +6 -0
  137. package/dist/utils/kb-manifest.d.ts.map +1 -1
  138. package/dist/utils/kb-manifest.js +6 -0
  139. package/dist/utils/rule-registry.generated.d.ts +26 -0
  140. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  141. package/dist/utils/rule-registry.generated.js +31 -0
  142. package/dist/utils/schema-version.d.ts +1 -1
  143. package/dist/utils/schema-version.d.ts.map +1 -1
  144. package/dist/utils/schema-version.js +3 -1
  145. package/package.json +3 -3
  146. package/schema/entities.pl +6 -0
  147. package/src/public/impact/diagnostics.ts +29 -17
  148. package/src/public/operations/check-executor.ts +13 -0
  149. package/src/public/operations/contracts.ts +39 -2
  150. package/src/public/operations/decision-firmness.ts +280 -0
  151. package/src/public/operations/discovery-executors.ts +29 -4
  152. package/src/public/operations/migration-plan.ts +100 -19
  153. package/src/public/operations/result-envelope.ts +34 -1
  154. package/src/public/operations/specs/check-rules.generated.ts +6 -1
  155. package/src/public/operations/specs/mutation-schemas.ts +6 -0
  156. package/src/public/operations/specs/mutation.ts +7 -2
  157. package/src/public/operations/specs/planning.ts +2 -2
  158. package/src/public/operations/symbol-granularity-check.ts +233 -0
  159. package/src/public/schemas/entity.ts +12 -0
  160. package/src/public/skills/kibi-traceability/SKILL.md +6 -4
  161. package/src/public/skills/kibi-usage/SKILL.md +50 -10
  162. package/src/public/skills/kibi-usage/resources/source-authoring.md +4 -2
  163. package/src/public/symbol-granularity.ts +37 -0
  164. package/src/schemas/entity.schema.json +28 -0
@@ -67,6 +67,8 @@ export type Requirement = BaseEntity & {
67
67
  approval_ref?: string;
68
68
  /** Why the requirement exists; explanation, not checked meaning. */
69
69
  rationale?: string;
70
+ /** How firmly it was decided; absent reads as default. */
71
+ firmness?: "firm" | "default" | "exploratory";
70
72
  /** Exception requirements only: claim keys of the exempted requirement it waives. */
71
73
  exempts_claims?: string[];
72
74
  };
@@ -78,6 +80,8 @@ export type TestEntity = BaseEntity & TestVerificationFields & {
78
80
  };
79
81
  export type ADR = BaseEntity & {
80
82
  type: "adr";
83
+ /** How firmly it was decided; absent reads as default. */
84
+ firmness?: "firm" | "default" | "exploratory";
81
85
  };
82
86
  export type Flag = BaseEntity & {
83
87
  type: "flag";
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","s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face KbManifest {
20
20
  * Only these ids may carry `review:context-missing` without a violation.
21
21
  */
22
22
  contextAcknowledged?: string[];
23
+ /**
24
+ * Supersede edges (`FROM -> TO`) the schema 9 migration acknowledged as
25
+ * lacking a "Why this changed" section. An entity is exempt from
26
+ * supersedes-reason-missing only while every edge it has is listed here.
27
+ */
28
+ supersedesReasonAcknowledged?: string[];
23
29
  }
24
30
  export declare function defaultKbManifest(): KbManifest;
25
31
  export type KbManifestStatus = {
@@ -1 +1 @@
1
- {"version":3,"file":"kb-manifest.d.ts","sourceRoot":"","sources":["../../src/utils/kb-manifest.ts"],"names":[],"mappings":"AA8BA;;;;;;;GAOG;AAEH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,MAAM,uBAAuB,GAC/B,SAAS,GACT,WAAW,GACX,gBAAgB,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,eAAe,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,wBAAgB,iBAAiB,IAAI,UAAU,CAM9C;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAClE;IACE,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC,QAAQ,EAAE,IAAI,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAuDN,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,gBAAgB,CAyD5E;AAED,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,I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,EAAE,MAAM,GAAG,UAAU,CAEzE;AASD,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,UAAU,GACnB,MAAM,CAIR"}
@@ -71,6 +71,7 @@ function validateManifest(parsed) {
71
71
  return null;
72
72
  }
73
73
  const acknowledged = parsed.contextAcknowledged;
74
+ const supersedesAcknowledged = parsed.supersedesReasonAcknowledged;
74
75
  return {
75
76
  manifestVersion,
76
77
  schemaVersion,
@@ -80,6 +81,11 @@ function validateManifest(parsed) {
80
81
  contextAcknowledged: acknowledged.filter((id) => typeof id === "string"),
81
82
  }
82
83
  : {}),
84
+ ...(Array.isArray(supersedesAcknowledged)
85
+ ? {
86
+ supersedesReasonAcknowledged: supersedesAcknowledged.filter((id) => typeof id === "string"),
87
+ }
88
+ : {}),
83
89
  };
84
90
  }
85
91
  export function readKbManifestStatus(workspaceRoot) {
@@ -13,6 +13,11 @@ export declare const GENERATED_RULES: readonly [{
13
13
  readonly description: "Production symbols must directly implement requirements for ownership; covered_by is coverage only and executable_for is test identity only";
14
14
  readonly enforcementClass: "canonical";
15
15
  readonly category: "traceability";
16
+ }, {
17
+ readonly name: "symbol-granularity";
18
+ readonly description: "A symbol with traceability relationships must not link its source file coarsely while narrower behavioral symbols are available, unless it carries an allowed granularity_reason; the staged gate's symbol_granularity_violation evaluated KB-wide";
19
+ readonly enforcementClass: "canonical";
20
+ readonly category: "traceability";
16
21
  }, {
17
22
  readonly name: "no-dangling-refs";
18
23
  readonly description: "All relationship targets must exist in the KB";
@@ -228,6 +233,27 @@ export declare const GENERATED_RULES: readonly [{
228
233
  readonly enforcementClass: "advisory";
229
234
  readonly category: "lifecycle";
230
235
  readonly diagnosticSeverity: "info";
236
+ }, {
237
+ readonly name: "decision-firm-unreferenced";
238
+ readonly description: "A requirement or ADR marked firmness: firm must name the human words it rests on: origin.ref (or approval_ref on a requirement); Kibi checks that the reference is present, not that it is genuine";
239
+ readonly enforcementClass: "canonical";
240
+ readonly category: "integrity";
241
+ }, {
242
+ readonly name: "decision-firm-superseded";
243
+ readonly description: "A requirement or ADR that supersedes a firm decision, retired or not, must itself be firm (and so carry a ref to the human who changed the rule); a default or exploratory replacement cannot overrule a firm decision";
244
+ readonly enforcementClass: "canonical";
245
+ readonly category: "lifecycle";
246
+ }, {
247
+ readonly name: "supersedes-reason-missing";
248
+ readonly description: "A current requirement or ADR that supersedes another must explain why under a 'Why this changed' heading (at least 12 words of prose naming the evidence and answering the old decision's reasoning); supersede edges recorded before schema 9 are acknowledged in the manifest and exempt";
249
+ readonly enforcementClass: "canonical";
250
+ readonly category: "lifecycle";
251
+ }, {
252
+ readonly name: "supersedes-reason-acknowledged";
253
+ readonly description: "Informational: how many current superseding requirements and ADRs have only supersede edges the schema 9 migration acknowledged without a 'Why this changed' section; one summary finding per check";
254
+ readonly enforcementClass: "advisory";
255
+ readonly category: "lifecycle";
256
+ readonly diagnosticSeverity: "info";
231
257
  }, {
232
258
  readonly name: "policy-ownership";
233
259
  readonly description: "When a plugin activated for kibi.check-policy.v1 declares ownership rules, every production symbol in a rule's file set must implement a current requirement grounded (requires_predicate) in one of the rule's predicates; projects without an activated check policy are unaffected";
@@ -1 +1 @@
1
- {"version":3,"file":"rule-registry.generated.d.ts","sourceRoot":"","sources":["../../src/utils/rule-registry.generated.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4UlB,CAAC"}
1
+ {"version":3,"file":"rule-registry.generated.d.ts","sourceRoot":"","sources":["../../src/utils/rule-registry.generated.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgXlB,CAAC"}
@@ -26,6 +26,12 @@ export const GENERATED_RULES = [
26
26
  enforcementClass: "canonical",
27
27
  category: "traceability",
28
28
  },
29
+ {
30
+ name: "symbol-granularity",
31
+ description: "A symbol with traceability relationships must not link its source file coarsely while narrower behavioral symbols are available, unless it carries an allowed granularity_reason; the staged gate's symbol_granularity_violation evaluated KB-wide",
32
+ enforcementClass: "canonical",
33
+ category: "traceability",
34
+ },
29
35
  {
30
36
  name: "no-dangling-refs",
31
37
  description: "All relationship targets must exist in the KB",
@@ -283,6 +289,31 @@ export const GENERATED_RULES = [
283
289
  category: "lifecycle",
284
290
  diagnosticSeverity: "info",
285
291
  },
292
+ {
293
+ name: "decision-firm-unreferenced",
294
+ description: "A requirement or ADR marked firmness: firm must name the human words it rests on: origin.ref (or approval_ref on a requirement); Kibi checks that the reference is present, not that it is genuine",
295
+ enforcementClass: "canonical",
296
+ category: "integrity",
297
+ },
298
+ {
299
+ name: "decision-firm-superseded",
300
+ description: "A requirement or ADR that supersedes a firm decision, retired or not, must itself be firm (and so carry a ref to the human who changed the rule); a default or exploratory replacement cannot overrule a firm decision",
301
+ enforcementClass: "canonical",
302
+ category: "lifecycle",
303
+ },
304
+ {
305
+ name: "supersedes-reason-missing",
306
+ description: "A current requirement or ADR that supersedes another must explain why under a 'Why this changed' heading (at least 12 words of prose naming the evidence and answering the old decision's reasoning); supersede edges recorded before schema 9 are acknowledged in the manifest and exempt",
307
+ enforcementClass: "canonical",
308
+ category: "lifecycle",
309
+ },
310
+ {
311
+ name: "supersedes-reason-acknowledged",
312
+ description: "Informational: how many current superseding requirements and ADRs have only supersede edges the schema 9 migration acknowledged without a 'Why this changed' section; one summary finding per check",
313
+ enforcementClass: "advisory",
314
+ category: "lifecycle",
315
+ diagnosticSeverity: "info",
316
+ },
286
317
  {
287
318
  name: "policy-ownership",
288
319
  description: "When a plugin activated for kibi.check-policy.v1 declares ownership rules, every production symbol in a rule's file set must implement a current requirement grounded (requires_predicate) in one of the rule's predicates; projects without an activated check policy are unaffected",
@@ -1,4 +1,4 @@
1
- export declare const LATEST_KB_SCHEMA_VERSION = 8;
1
+ export declare const LATEST_KB_SCHEMA_VERSION = 9;
2
2
  export interface SchemaVersionStatus {
3
3
  status: "missing" | "invalid" | "older" | "current" | "newer";
4
4
  currentVersion: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/utils/schema-version.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GACrD,IAAI,GACJ,SAAS,CAAC;AAGd,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,GAAG,IAAI,CAgBf;AAGD,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,mBAAmB,GAC3B,mBAAmB,CAgDrB"}
1
+ {"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/utils/schema-version.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GACrD,IAAI,GACJ,SAAS,CAAC;AAGd,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,GAAG,IAAI,CAgBf;AAGD,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,mBAAmB,GAC3B,mBAAmB,CAgDrB"}
@@ -18,7 +18,9 @@
18
18
  // implements REQ-003
19
19
  // Schema 8 requires body context on current entities and pins requirement
20
20
  // semantic_text so context sections never change a requirement's meaning.
21
- export const LATEST_KB_SCHEMA_VERSION = 8;
21
+ // Schema 9 adds decision firmness on requirements and ADRs and requires a
22
+ // "Why this changed" section on new supersedes.
23
+ export const LATEST_KB_SCHEMA_VERSION = 9;
22
24
  // implements REQ-003
23
25
  export function normalizeSchemaVersion(schemaVersion) {
24
26
  if (schemaVersion === undefined || schemaVersion === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-cli",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "type": "module",
5
5
  "description": "Kibi CLI for knowledge base management",
6
6
  "engines": {
@@ -235,8 +235,8 @@
235
235
  "fast-glob": "^3.2.12",
236
236
  "gray-matter": "^4.0.3",
237
237
  "js-yaml": "^4.1.0",
238
- "kibi-core": "^0.21.0",
239
- "kibi-plugin-builtin": "^0.5.1",
238
+ "kibi-core": "^0.22.0",
239
+ "kibi-plugin-builtin": "^0.5.2",
240
240
  "kibi-plugin-sdk": "^0.5.0",
241
241
  "kibi-swipl": "^1.0.1",
242
242
  "saxes": "^6.0.0",
@@ -51,6 +51,10 @@ entity_property(req, approval_ref, string).
51
51
  entity_property(req, rationale, string).
52
52
  % Claim keys of the exempted requirement an exception waives (all when absent).
53
53
  entity_property(req, exempts_claims, list).
54
+ % How firmly a requirement or ADR was decided: firm, default or exploratory.
55
+ % Absent reads as default.
56
+ entity_property(req, firmness, atom).
57
+ entity_property(adr, firmness, atom).
54
58
  % Intended outcome of a scenario: success, rejection or error.
55
59
  entity_property(scenario, expects, atom).
56
60
 
@@ -143,6 +147,8 @@ optional_property(req, approved_by).
143
147
  optional_property(req, approval_ref).
144
148
  optional_property(req, rationale).
145
149
  optional_property(req, exempts_claims).
150
+ optional_property(req, firmness).
151
+ optional_property(adr, firmness).
146
152
  optional_property(test, verification_scope).
147
153
  optional_property(test, verification_perspective).
148
154
  optional_property(test, proof_contract).
@@ -12,6 +12,7 @@ import {
12
12
  getNonBehavioralSymbolNames,
13
13
  isAllowedGranularityReason,
14
14
  isTraceabilityRelationshipType,
15
+ narrowerSymbols,
15
16
  } from "../symbol-granularity.js";
16
17
  import type {
17
18
  QualityDiagnostic,
@@ -19,16 +20,6 @@ import type {
19
20
  SymbolGranularityDiagnosticsOptions,
20
21
  } from "./types.js";
21
22
 
22
- function isNarrowerSymbol(
23
- manifestSymbolName: string,
24
- candidate: ExtractedSymbol,
25
- sourceSymbols: readonly ExtractedSymbol[],
26
- ): boolean {
27
- if (candidate.name === manifestSymbolName) return false;
28
- if (candidate.name.startsWith(`${manifestSymbolName}.`)) return true;
29
- return !sourceSymbols.some((symbol) => symbol.name === manifestSymbolName);
30
- }
31
-
32
23
  function hasTraceabilityRelationship(result: ExtractionResult): boolean {
33
24
  return result.relationships.some((relationship) =>
34
25
  isTraceabilityRelationshipType(relationship.type),
@@ -110,6 +101,7 @@ function isChangedBehavioralReviewCandidate(symbol: ExtractedSymbol): boolean {
110
101
  return symbol.hunkRanges.length > 0;
111
102
  }
112
103
 
104
+ // implements REQ-cli-staged-impact-enforcement, REQ-cli-check
113
105
  export function createSymbolGranularityDiagnostics(
114
106
  options: SymbolGranularityDiagnosticsOptions,
115
107
  ): KibiImpactDiagnostic[] {
@@ -130,15 +122,17 @@ export function createSymbolGranularityDiagnostics(
130
122
  result.sourceFile,
131
123
  options,
132
124
  );
133
- const narrowerSymbols = candidateSymbols.filter((symbol) =>
134
- isNarrowerSymbol(result.entity.title, symbol, sourceSymbols),
125
+ const narrower = narrowerSymbols(
126
+ result.entity.title,
127
+ candidateSymbols,
128
+ sourceSymbols,
135
129
  );
136
- if (narrowerSymbols.length === 0) continue;
130
+ if (narrower.length === 0) continue;
137
131
 
138
- const behavioralNames = getBehavioralSymbolNames(narrowerSymbols);
132
+ const behavioralNames = getBehavioralSymbolNames(narrower);
139
133
  if (behavioralNames.length === 0) continue;
140
134
 
141
- const nonBehavioralNames = getNonBehavioralSymbolNames(narrowerSymbols);
135
+ const nonBehavioralNames = getNonBehavioralSymbolNames(narrower);
142
136
  const ignoredSymbolsSuggestion =
143
137
  nonBehavioralNames.length > 0
144
138
  ? ` Non-behavioral symbols ignored for this decision: ${nonBehavioralNames.join(
@@ -146,15 +140,33 @@ export function createSymbolGranularityDiagnostics(
146
140
  )}.`
147
141
  : "";
148
142
 
143
+ // A title the extractor does not produce (a private class member, a
144
+ // renamed or removed declaration) can never become granular by refresh:
145
+ // say so instead of only calling the link coarse.
146
+ const titleExtracted = sourceSymbols.some(
147
+ (symbol) => symbol.name === result.entity.title,
148
+ );
149
149
  diagnostics.push({
150
150
  id: "symbol_granularity_violation",
151
151
  severity: "error",
152
152
  blocking: true,
153
153
  category: "symbol",
154
+ entityId: result.entity.id,
155
+ ...(result.entity.source ? { source: result.entity.source } : {}),
154
156
  files: [result.entity.source, result.sourceFile],
155
157
  docs: ["docs/symbol-traceability-taxonomy.md"],
156
- message: `Symbol ${result.entity.id} links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`,
157
- suggestion: `Move ownership/coverage/test relationships to the narrow behavioral symbol, add a manifest behavioral anchor, or add granularity_reason with ${ALLOWED_GRANULARITY_REASONS_PROSE} when the coarse symbol is intentional.${ignoredSymbolsSuggestion}`,
158
+ message: titleExtracted
159
+ ? `Symbol ${result.entity.id} links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`
160
+ : `Symbol ${result.entity.id} names '${result.entity.title}', which the source extractor does not produce for ${result.sourceFile} (private class members and removed or renamed declarations are not tracked), so it links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`,
161
+ suggestion: titleExtracted
162
+ ? `Move ownership/coverage/test relationships to the narrow behavioral symbol, add a manifest behavioral anchor, or add granularity_reason with ${ALLOWED_GRANULARITY_REASONS_PROSE} when the coarse symbol is intentional.${ignoredSymbolsSuggestion}`
163
+ : `Re-point this symbol's relationships to the public declaration that owns the behavior (one of: ${behavioralNames.join(", ")}) or remove the symbol; add granularity_reason with ${ALLOWED_GRANULARITY_REASONS_PROSE} only when coarse ownership is intentional.${ignoredSymbolsSuggestion}`,
164
+ evidence: {
165
+ sourceFile: result.sourceFile,
166
+ title: result.entity.title,
167
+ titleExtracted,
168
+ granularSymbols: behavioralNames,
169
+ },
158
170
  });
159
171
  }
160
172
 
@@ -41,6 +41,7 @@ import {
41
41
  stagedEntityIdStyleDiagnostics,
42
42
  } from "./check-helpers.js";
43
43
  import { collectCheckPolicyViolations } from "./check-policy-rules.js";
44
+ import { collectDecisionFirmnessViolations } from "./decision-firmness.js";
44
45
  import { executeStatus } from "./discovery-executors.js";
45
46
  import { collectEntityContextViolations } from "./entity-context.js";
46
47
  import {
@@ -56,6 +57,7 @@ import {
56
57
  collectSourcePathDanglingViolations,
57
58
  } from "./source-path-dangling.js";
58
59
  import { collectSourceRelationshipParityViolations } from "./source-relationship-parity.js";
60
+ import { collectSymbolGranularityViolations } from "./symbol-granularity-check.js";
59
61
  import type { OperationResult } from "./types.js";
60
62
  import { readWorkspaceSnapshot } from "./workspace-snapshot.js";
61
63
 
@@ -366,6 +368,11 @@ export async function executeCheck(
366
368
  const sourcePathFindings = rulesAllowlist.has(SOURCE_PATH_DANGLING_RULE)
367
369
  ? collectSourcePathDanglingViolations(workspaceRoot)
368
370
  : [];
371
+ const symbolGranularityFindings = await collectSymbolGranularityViolations(
372
+ prolog,
373
+ workspaceRoot,
374
+ rulesAllowlist,
375
+ );
369
376
  const originReviewFindings = await collectOriginReviewViolations(
370
377
  prolog,
371
378
  rulesAllowlist,
@@ -375,6 +382,10 @@ export async function executeCheck(
375
382
  rulesAllowlist,
376
383
  workspaceRoot,
377
384
  );
385
+ const decisionFirmnessFindings = collectDecisionFirmnessViolations(
386
+ rulesAllowlist,
387
+ workspaceRoot,
388
+ );
378
389
  const checkPolicyFindings = await collectCheckPolicyViolations(
379
390
  prolog,
380
391
  rulesAllowlist,
@@ -385,9 +396,11 @@ export async function executeCheck(
385
396
  ...queryPlanViolations,
386
397
  ...sourceRelationshipParityViolations,
387
398
  ...sourcePathFindings,
399
+ ...symbolGranularityFindings,
388
400
  ...predicateConformanceFindings,
389
401
  ...originReviewFindings,
390
402
  ...entityContextFindings,
403
+ ...decisionFirmnessFindings,
391
404
  ...checkPolicyFindings,
392
405
  ]);
393
406
  const violations: Violation[] = partitioned.violations;
@@ -442,7 +442,12 @@ const BASE_DATA_SCHEMAS: Readonly<
442
442
  }),
443
443
  kb_skills_read: objectData({ content: stringValue }, ["content"]),
444
444
  kb_query: objectData(
445
- { entities: recordArray, count: integerValue, factQuery: recordValue },
445
+ {
446
+ entities: recordArray,
447
+ count: integerValue,
448
+ factQuery: recordValue,
449
+ branchStore: recordValue,
450
+ },
446
451
  ["entities", "count"],
447
452
  ),
448
453
  kb_search: objectData(
@@ -569,6 +574,8 @@ const BASE_DATA_SCHEMAS: Readonly<
569
574
  "record_ontology_gap",
570
575
  "review_nonlogical",
571
576
  "replace_grounding",
577
+ "extend_requirement",
578
+ "keep_existing_grounding",
572
579
  ],
573
580
  },
574
581
  recommendedPredicateSchema: { type: ["object", "null"] },
@@ -584,7 +591,16 @@ const BASE_DATA_SCHEMAS: Readonly<
584
591
  description:
585
592
  "The planned predicate fact id (FACT-PRED-...) that a requires_predicate link must target. Candidate ids (SUGGEST-...) are never relationship targets.",
586
593
  },
587
- existingGrounding: recordArray,
594
+ existingGrounding: {
595
+ ...recordArray,
596
+ description:
597
+ "The grounding links requirementId already has for this claim: matched by claim_key (the same proposition text) or, for a predicate fact, by the recommended candidate's canonical_key (the same predicate tuple in other words; matchedBy says which).",
598
+ },
599
+ decisionConflicts: {
600
+ ...recordArray,
601
+ description:
602
+ "When no hash-bound plan ran the contradiction analysis: stored decision facts of current requirements that agree with the complete candidate on its key arguments and decide the opposite (requirementId, factId, effect, proposedEffect, canonicalKey). A warning repeats each one.",
603
+ },
588
604
  replacementPlan: { type: ["object", "null"] },
589
605
  bindingHints: {
590
606
  ...recordArray,
@@ -648,6 +664,11 @@ const BASE_DATA_SCHEMAS: Readonly<
648
664
  relationships_created: integerValue,
649
665
  warnings: valueArray,
650
666
  semanticAdvisor: recordValue,
667
+ claimKey: {
668
+ ...stringValue,
669
+ description:
670
+ "For a fact with claim_text: the stored claim_key, derived from claim_text when the payload did not supply it.",
671
+ },
651
672
  status: stringValue,
652
673
  effectFailures: recordArray,
653
674
  nextActions: recordArray,
@@ -685,6 +706,22 @@ const BASE_DATA_SCHEMAS: Readonly<
685
706
  status: stringValue,
686
707
  effectFailures: recordArray,
687
708
  nextActions: recordArray,
709
+ outcome: {
710
+ type: "string",
711
+ enum: [
712
+ "plan_returned",
713
+ "supersession_required",
714
+ "plan_applied",
715
+ "dry_run",
716
+ ],
717
+ description:
718
+ "Absent on a direct delete. plan_returned: deletionPlan was returned and nothing was written; nextActions[0].input is the exact kb_apply_plan input. supersession_required: an authored requirement must be superseded with kb_upsert instead. plan_applied: approvedPlanHash matched and the plan was applied. dry_run: dryRun:true previewed the delete and nothing was written.",
719
+ },
720
+ dryRun: { const: true },
721
+ wouldDelete: recordValue,
722
+ planHash: stringValue,
723
+ sourcePaths: stringArray,
724
+ recoveryJournalId: stringValue,
688
725
  }),
689
726
  kb_check: {
690
727
  description: