kibi-cli 0.16.1 → 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 (229) 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/check.d.ts.map +1 -1
  12. package/dist/commands/check.js +1 -1
  13. package/dist/commands/coverage.d.ts +5 -0
  14. package/dist/commands/coverage.d.ts.map +1 -1
  15. package/dist/commands/coverage.js +5 -0
  16. package/dist/commands/discovery-table.d.ts.map +1 -1
  17. package/dist/commands/discovery-table.js +96 -5
  18. package/dist/commands/sync/cache.d.ts +2 -0
  19. package/dist/commands/sync/cache.d.ts.map +1 -1
  20. package/dist/commands/sync/cache.js +8 -0
  21. package/dist/commands/sync/manifest.d.ts +12 -1
  22. package/dist/commands/sync/manifest.d.ts.map +1 -1
  23. package/dist/commands/sync/manifest.js +22 -5
  24. package/dist/commands/sync/persistence.d.ts.map +1 -1
  25. package/dist/commands/sync/persistence.js +76 -2
  26. package/dist/commands/sync.d.ts.map +1 -1
  27. package/dist/commands/sync.js +72 -15
  28. package/dist/commands/usage-metrics.d.ts +66 -2
  29. package/dist/commands/usage-metrics.d.ts.map +1 -1
  30. package/dist/commands/usage-metrics.js +34 -24
  31. package/dist/commands/usage-remediation.d.ts +9 -0
  32. package/dist/commands/usage-remediation.d.ts.map +1 -0
  33. package/dist/commands/usage-remediation.js +52 -0
  34. package/dist/extractors/markdown.d.ts +17 -1
  35. package/dist/extractors/markdown.d.ts.map +1 -1
  36. package/dist/extractors/markdown.js +81 -2
  37. package/dist/logic/ir.d.ts +112 -0
  38. package/dist/logic/ir.d.ts.map +1 -0
  39. package/dist/logic/ir.js +729 -0
  40. package/dist/operations/modeling/logic-modeling.d.ts +22 -0
  41. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -0
  42. package/dist/operations/modeling/logic-modeling.js +120 -0
  43. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  44. package/dist/operations/modeling/model-requirement.js +83 -2
  45. package/dist/operations/modeling/predicate-applyplan.d.ts +1 -1
  46. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  47. package/dist/operations/modeling/predicate-applyplan.js +29 -4
  48. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
  49. package/dist/operations/modeling/predicate-inference.js +3 -0
  50. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  51. package/dist/operations/modeling/predicate-loader.js +7 -1
  52. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
  53. package/dist/operations/modeling/predicate-ranker.js +40 -2
  54. package/dist/operations/modeling/predicate-types.d.ts +12 -1
  55. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  56. package/dist/operations/modeling/requirement-types.d.ts +12 -0
  57. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  58. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  59. package/dist/operations/modeling/suggest-predicates.js +35 -11
  60. package/dist/operations/mutation/audit.js +1 -1
  61. package/dist/operations/mutation/contradictions.d.ts +1 -1
  62. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  63. package/dist/operations/mutation/contradictions.js +23 -18
  64. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  65. package/dist/operations/mutation/relationships.js +8 -0
  66. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  67. package/dist/operations/mutation/serialization.js +6 -0
  68. package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
  69. package/dist/operations/mutation/strict-fact.js +68 -3
  70. package/dist/operations/mutation/upsert.d.ts +3 -1
  71. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  72. package/dist/operations/mutation/upsert.js +51 -12
  73. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  74. package/dist/operations/mutation/validate-upsert.js +18 -2
  75. package/dist/operations/mutation/validation.d.ts.map +1 -1
  76. package/dist/operations/mutation/validation.js +8 -0
  77. package/dist/operations/semantic-advisor/analysis-receipt.d.ts +2 -2
  78. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  79. package/dist/operations/semantic-advisor/analysis-receipt.js +30 -16
  80. package/dist/operations/semantic-advisor/analyze-prose.d.ts +1 -1
  81. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  82. package/dist/operations/semantic-advisor/analyze-prose.js +464 -27
  83. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  84. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  85. package/dist/operations/semantic-advisor/clauses.js +7 -7
  86. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +18 -0
  87. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -0
  88. package/dist/operations/semantic-advisor/ingestion-boundary.js +167 -0
  89. package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -1
  90. package/dist/operations/semantic-advisor/observation-plan.js +15 -3
  91. package/dist/operations/semantic-advisor/shared.d.ts +9 -0
  92. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
  93. package/dist/operations/semantic-advisor/shared.js +38 -4
  94. package/dist/operations/semantic-advisor/types.d.ts +66 -1
  95. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  96. package/dist/prolog/codec.d.ts.map +1 -1
  97. package/dist/prolog/codec.js +19 -2
  98. package/dist/prolog.d.ts +6 -0
  99. package/dist/prolog.d.ts.map +1 -1
  100. package/dist/prolog.js +247 -63
  101. package/dist/public/diagnostic-usage.d.ts +17 -0
  102. package/dist/public/diagnostic-usage.d.ts.map +1 -0
  103. package/dist/public/diagnostic-usage.js +152 -0
  104. package/dist/public/distribution-parity.d.ts +90 -0
  105. package/dist/public/distribution-parity.d.ts.map +1 -0
  106. package/dist/public/distribution-parity.js +367 -0
  107. package/dist/public/impact/full-kb-quality.d.ts +2 -0
  108. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  109. package/dist/public/impact/full-kb-quality.js +53 -1
  110. package/dist/public/impact-diagnostics.d.ts +2 -0
  111. package/dist/public/impact-diagnostics.d.ts.map +1 -1
  112. package/dist/public/impact-diagnostics.js +1 -0
  113. package/dist/public/operations/catalog.d.ts +235 -11
  114. package/dist/public/operations/catalog.d.ts.map +1 -1
  115. package/dist/public/operations/check-executor.d.ts.map +1 -1
  116. package/dist/public/operations/check-executor.js +4 -0
  117. package/dist/public/operations/discovery-executors.d.ts +6 -0
  118. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  119. package/dist/public/operations/discovery-executors.js +18 -2
  120. package/dist/public/operations/index.d.ts +5 -0
  121. package/dist/public/operations/index.d.ts.map +1 -1
  122. package/dist/public/operations/index.js +5 -0
  123. package/dist/public/operations/legacy-migration-plan.d.ts +113 -0
  124. package/dist/public/operations/legacy-migration-plan.d.ts.map +1 -0
  125. package/dist/public/operations/legacy-migration-plan.js +409 -0
  126. package/dist/public/operations/node-ports.d.ts.map +1 -1
  127. package/dist/public/operations/node-ports.js +90 -0
  128. package/dist/public/operations/repair-plan.d.ts +184 -0
  129. package/dist/public/operations/repair-plan.d.ts.map +1 -0
  130. package/dist/public/operations/repair-plan.js +397 -0
  131. package/dist/public/operations/runtime-types.d.ts +7 -0
  132. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  133. package/dist/public/operations/specs/check.d.ts +3 -3
  134. package/dist/public/operations/specs/check.d.ts.map +1 -1
  135. package/dist/public/operations/specs/check.js +5 -2
  136. package/dist/public/operations/specs/discovery.d.ts +1 -1
  137. package/dist/public/operations/specs/discovery.js +1 -1
  138. package/dist/public/operations/specs/modeling.d.ts +35 -1
  139. package/dist/public/operations/specs/modeling.d.ts.map +1 -1
  140. package/dist/public/operations/specs/modeling.js +32 -1
  141. package/dist/public/operations/specs/mutation-schemas.d.ts +133 -3
  142. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  143. package/dist/public/operations/specs/mutation-schemas.js +67 -1
  144. package/dist/public/operations/specs/reporting.d.ts +42 -1
  145. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  146. package/dist/public/operations/specs/reporting.js +70 -6
  147. package/dist/public/operations/specs/semantic.d.ts +30 -2
  148. package/dist/public/operations/specs/semantic.d.ts.map +1 -1
  149. package/dist/public/operations/specs/semantic.js +35 -3
  150. package/dist/public/operations/specs/upsert.d.ts +133 -3
  151. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  152. package/dist/public/operations/workspace-snapshot.d.ts +10 -0
  153. package/dist/public/operations/workspace-snapshot.d.ts.map +1 -0
  154. package/dist/public/operations/workspace-snapshot.js +20 -0
  155. package/dist/public/schemas/entity.d.ts.map +1 -1
  156. package/dist/public/schemas/entity.js +332 -0
  157. package/dist/public/schemas/relationship.d.ts.map +1 -1
  158. package/dist/public/schemas/relationship.js +1 -0
  159. package/dist/public/skills/kibi-traceability/SKILL.md +7 -1
  160. package/dist/public/skills/kibi-usage/SKILL.md +44 -12
  161. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +12 -2
  162. package/dist/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  163. package/dist/public/skills/kibi-usage/resources/operation-access.md +19 -19
  164. package/dist/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  165. package/dist/public/skills/kibi-usage/resources/workflows.md +40 -8
  166. package/dist/public/symbol-granularity.d.ts +9 -0
  167. package/dist/public/symbol-granularity.d.ts.map +1 -1
  168. package/dist/public/symbol-granularity.js +16 -0
  169. package/dist/public/telemetry-acceptance.d.ts +89 -0
  170. package/dist/public/telemetry-acceptance.d.ts.map +1 -0
  171. package/dist/public/telemetry-acceptance.js +597 -0
  172. package/dist/public/telemetry-remediation.d.ts +33 -0
  173. package/dist/public/telemetry-remediation.d.ts.map +1 -0
  174. package/dist/public/telemetry-remediation.js +257 -0
  175. package/dist/public/verification-receipt.d.ts +75 -0
  176. package/dist/public/verification-receipt.d.ts.map +1 -0
  177. package/dist/public/verification-receipt.js +129 -0
  178. package/dist/schemas/entity.schema.json +401 -4
  179. package/dist/traceability/staged-diagnostics.d.ts +1 -1
  180. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  181. package/dist/traceability/staged-diagnostics.js +17 -10
  182. package/dist/traceability/staged-impact-contract.js +1 -1
  183. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  184. package/dist/traceability/staged-symbols-manifest.js +28 -10
  185. package/dist/traceability/temp-kb.d.ts.map +1 -1
  186. package/dist/traceability/temp-kb.js +49 -3
  187. package/dist/types/entities.d.ts +1 -0
  188. package/dist/types/entities.d.ts.map +1 -1
  189. package/dist/types/relationships.d.ts +1 -1
  190. package/dist/types/relationships.d.ts.map +1 -1
  191. package/dist/utils/rule-registry.d.ts +2 -0
  192. package/dist/utils/rule-registry.d.ts.map +1 -1
  193. package/dist/utils/rule-registry.js +18 -0
  194. package/dist/utils/schema-version.d.ts +1 -1
  195. package/dist/utils/schema-version.js +1 -1
  196. package/package.json +34 -2
  197. package/src/public/diagnostic-usage.ts +206 -0
  198. package/src/public/distribution-parity.ts +580 -0
  199. package/src/public/impact/full-kb-quality.ts +74 -1
  200. package/src/public/impact-diagnostics.ts +16 -0
  201. package/src/public/operations/check-executor.ts +4 -0
  202. package/src/public/operations/discovery-executors.ts +24 -2
  203. package/src/public/operations/index.ts +5 -0
  204. package/src/public/operations/legacy-migration-plan.ts +688 -0
  205. package/src/public/operations/node-ports.ts +109 -0
  206. package/src/public/operations/repair-plan.ts +562 -0
  207. package/src/public/operations/runtime-types.ts +8 -0
  208. package/src/public/operations/specs/check.ts +5 -2
  209. package/src/public/operations/specs/discovery.ts +1 -1
  210. package/src/public/operations/specs/modeling.ts +39 -1
  211. package/src/public/operations/specs/mutation-schemas.ts +77 -1
  212. package/src/public/operations/specs/reporting.ts +91 -6
  213. package/src/public/operations/specs/semantic.ts +42 -3
  214. package/src/public/operations/workspace-snapshot.ts +28 -0
  215. package/src/public/schemas/entity.ts +340 -1
  216. package/src/public/schemas/relationship.ts +1 -0
  217. package/src/public/skills/kibi-traceability/SKILL.md +7 -1
  218. package/src/public/skills/kibi-usage/SKILL.md +44 -12
  219. package/src/public/skills/kibi-usage/resources/fact-lanes.md +12 -2
  220. package/src/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  221. package/src/public/skills/kibi-usage/resources/operation-access.md +19 -19
  222. package/src/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  223. package/src/public/skills/kibi-usage/resources/workflows.md +40 -8
  224. package/src/public/symbol-granularity.ts +25 -0
  225. package/src/public/telemetry-acceptance.ts +859 -0
  226. package/src/public/telemetry-remediation.ts +462 -0
  227. package/src/public/verification-receipt.ts +170 -0
  228. package/src/schemas/entity.schema.json +401 -4
  229. package/src/schemas/relationship.schema.json +1 -0
@@ -1,4 +1,8 @@
1
+ import { VERIFICATION_RECEIPT_MAX_AGE_SECONDS } from "../../verification-receipt.js";
2
+ import { buildLegacyMigrationPlanFromContext, } from "../legacy-migration-plan.js";
1
3
  import { runOperationJsonQuery, toPrologAtom, toPrologList, } from "../prolog-json.js";
4
+ import { buildRepairPlan } from "../repair-plan.js";
5
+ import { readWorkspaceSnapshot } from "../workspace-snapshot.js";
2
6
  const ENTITY_TYPES = [
3
7
  "req",
4
8
  "scenario",
@@ -68,17 +72,45 @@ export const findGapsSpec = {
68
72
  };
69
73
  export async function executeCoverage(input, context) {
70
74
  try {
71
- const payload = await runOperationJsonQuery(requireProlog(context), "discovery.pl", `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, JsonString)`, "Coverage execution");
72
- const fullyCovered = Number(payload.summary?.fullyCovered ?? 0);
73
- const total = Number(payload.summary?.total ?? 0);
75
+ const snapshotEvidence = await readWorkspaceSnapshot(context);
76
+ const codeSnapshot = snapshotEvidence.available
77
+ ? snapshotEvidence.snapshot.hash
78
+ : "unknown";
79
+ const checkedAt = context.clock().toISOString();
80
+ const payload = await runOperationJsonQuery(requireProlog(context), "discovery.pl", `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${VERIFICATION_RECEIPT_MAX_AGE_SECONDS}, JsonString)`, "Coverage execution");
81
+ const repairPlan = buildRepairPlan(payload, input, codeSnapshot);
82
+ const legacyMigrationPlan = input.includeMigrationPreview === true && repairPlan !== undefined
83
+ ? await buildLegacyMigrationPlanFromContext(repairPlan, input, codeSnapshot, context)
84
+ : undefined;
85
+ const enrichedPayload = {
86
+ ...payload,
87
+ ...(repairPlan !== undefined ? { repairPlan } : {}),
88
+ ...(legacyMigrationPlan !== undefined ? { legacyMigrationPlan } : {}),
89
+ meta: {
90
+ ...(payload.meta ?? {}),
91
+ verificationReceiptMaxAgeSeconds: VERIFICATION_RECEIPT_MAX_AGE_SECONDS,
92
+ verificationSnapshot: codeSnapshot,
93
+ verificationSnapshotAvailable: snapshotEvidence.available,
94
+ ...(snapshotEvidence.available
95
+ ? {
96
+ verificationSnapshotDirty: snapshotEvidence.snapshot.dirty,
97
+ verificationSnapshotFileCount: snapshotEvidence.snapshot.fileCount,
98
+ verificationSnapshotVersion: snapshotEvidence.snapshot.version,
99
+ }
100
+ : { verificationSnapshotError: snapshotEvidence.error }),
101
+ },
102
+ };
103
+ const fullyCovered = Number(enrichedPayload.summary?.fullyCovered ?? 0);
104
+ const proofProven = Number(enrichedPayload.summary?.proofProven ?? 0);
105
+ const total = Number(enrichedPayload.summary?.total ?? 0);
74
106
  return {
75
107
  content: [
76
108
  {
77
109
  type: "text",
78
- text: `Coverage summary: ${fullyCovered} fully covered out of ${total}.`,
110
+ text: `Coverage summary: ${fullyCovered} structurally covered and ${proofProven} proven out of ${total}.`,
79
111
  },
80
112
  ],
81
- structuredContent: payload,
113
+ structuredContent: enrichedPayload,
82
114
  };
83
115
  }
84
116
  catch (error) {
@@ -89,7 +121,7 @@ export async function executeCoverage(input, context) {
89
121
  export const coverageSpec = {
90
122
  name: "kb_coverage",
91
123
  cliName: "coverage",
92
- description: "Generate curated coverage reports for requirements, symbols, or grouped types. Read-only reporting with no mutation side effects.",
124
+ description: "Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Requirement reports include a deterministic, dependency-ordered, read-only repair plan; optional legacy migration previews reconstruct authored proposition inventories and rank exact schema candidates without producing executable writes. Paginated plans identify incomplete scope. Requirement rows keep coverageStatus separate from proofStatus and require fresh snapshot-bound E2E receipts before proof. No mutation side effects.",
93
125
  businessInputSchema: {
94
126
  type: "object",
95
127
  properties: {
@@ -99,6 +131,38 @@ export const coverageSpec = {
99
131
  includeTransitive: { type: "boolean", default: true },
100
132
  limit: { type: "integer", default: 100 },
101
133
  offset: { type: "integer", default: 0 },
134
+ includeMigrationPreview: {
135
+ type: "boolean",
136
+ default: false,
137
+ description: "Opt in to a deterministic, read-only kibi.legacy-migration-plan.v1 preview for ready semantic-inventory repair batches.",
138
+ },
139
+ migrationLimit: {
140
+ type: "integer",
141
+ minimum: 1,
142
+ maximum: 10,
143
+ default: 1,
144
+ description: "Maximum requirement migration batches to preview. Defaults to one review batch.",
145
+ },
146
+ migrationOffset: {
147
+ type: "integer",
148
+ minimum: 0,
149
+ default: 0,
150
+ description: "Zero-based offset into ready semantic-inventory batches.",
151
+ },
152
+ migrationPredicateLimit: {
153
+ type: "integer",
154
+ minimum: 1,
155
+ maximum: 20,
156
+ default: 5,
157
+ description: "Maximum exact predicate-schema candidates retained per assertive proposition.",
158
+ },
159
+ migrationPredicateMinScore: {
160
+ type: "number",
161
+ minimum: 0,
162
+ maximum: 1,
163
+ default: 0.35,
164
+ description: "Minimum deterministic predicate-schema rank score retained in migration previews.",
165
+ },
102
166
  },
103
167
  },
104
168
  requiresProlog: true,
@@ -21,11 +21,39 @@ export declare const semanticAdvisorSpec: {
21
21
  };
22
22
  readonly description: "Optional complete list of atomic requirement clauses supplied by the caller. Use this for compound prose so every normative clause receives a stable claim key and independent grounding review.";
23
23
  };
24
+ readonly interpretations: {
25
+ readonly type: "array";
26
+ readonly maxItems: 3;
27
+ readonly description: "Optional host-LLM typed kibi.logic.v1 interpretations. Kibi validates and canonicalizes them; raw Prolog is not accepted.";
28
+ readonly items: {
29
+ readonly type: "object";
30
+ readonly required: readonly ["claim_key", "claim_text", "ir"];
31
+ readonly properties: {
32
+ readonly claim_key: {
33
+ readonly type: "string";
34
+ };
35
+ readonly claim_text: {
36
+ readonly type: "string";
37
+ };
38
+ readonly confidence: {
39
+ readonly type: "number";
40
+ readonly minimum: 0;
41
+ readonly maximum: 1;
42
+ };
43
+ readonly span: {
44
+ readonly type: "object";
45
+ };
46
+ readonly ir: {
47
+ readonly type: "object";
48
+ };
49
+ };
50
+ };
51
+ };
24
52
  readonly type: {
25
53
  readonly type: "string";
26
- readonly enum: readonly ["req"];
54
+ readonly enum: readonly ["req", "scenario", "test", "adr", "flag", "event", "symbol", "fact"];
27
55
  readonly default: "req";
28
- readonly description: "Entity type context for analysis. Currently requirement prose is supported.";
56
+ readonly description: "Entity type context for analysis. Requirement, domain-fact, and supporting prose all receive a proposition ledger; only requirements receive deterministic modeling suggestions.";
29
57
  };
30
58
  readonly id: {
31
59
  readonly type: "string";
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/semantic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,8BAA8B,EAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmB5D,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,mBAAmB,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,8BAA8B,CAAC,CA2BzC;AAED,iBAAe,2BAA2B,CACxC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,8BAA8B,CAAC,CAuBzC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDE,CAAC"}
1
+ {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/semantic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,8BAA8B,EAC/B,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmB5D,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,mBAAmB,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,8BAA8B,CAAC,CA8BzC;AAED,iBAAe,2BAA2B,CACxC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,8BAA8B,CAAC,CAiCzC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EE,CAAC"}
@@ -24,10 +24,13 @@ export async function executeSemanticAdvisor(args, _context) {
24
24
  title,
25
25
  status: optionalString(args.status) ?? "open",
26
26
  source,
27
- text_ref: text,
27
+ semantic_text: text,
28
28
  },
29
29
  },
30
30
  ...(args.clauses !== undefined ? { clauses: args.clauses } : {}),
31
+ ...(args.interpretations !== undefined
32
+ ? { interpretations: args.interpretations }
33
+ : {}),
31
34
  });
32
35
  return {
33
36
  content: [
@@ -48,6 +51,9 @@ async function executeSemanticAdvisorInput(input, context) {
48
51
  const clauses = Array.isArray(input.clauses)
49
52
  ? input.clauses.filter((value) => typeof value === "string")
50
53
  : undefined;
54
+ const interpretations = Array.isArray(input.interpretations)
55
+ ? input.interpretations.filter((value) => typeof value === "object" && value !== null)
56
+ : undefined;
51
57
  return executeSemanticAdvisor({
52
58
  text: requiredText(input.text),
53
59
  ...(type ? { type } : {}),
@@ -56,6 +62,7 @@ async function executeSemanticAdvisorInput(input, context) {
56
62
  ...(source ? { source } : {}),
57
63
  ...(status ? { status } : {}),
58
64
  ...(clauses !== undefined ? { clauses } : {}),
65
+ ...(interpretations !== undefined ? { interpretations } : {}),
59
66
  }, context);
60
67
  }
61
68
  export const semanticAdvisorSpec = {
@@ -75,11 +82,36 @@ export const semanticAdvisorSpec = {
75
82
  items: { type: "string" },
76
83
  description: "Optional complete list of atomic requirement clauses supplied by the caller. Use this for compound prose so every normative clause receives a stable claim key and independent grounding review.",
77
84
  },
85
+ interpretations: {
86
+ type: "array",
87
+ maxItems: 3,
88
+ description: "Optional host-LLM typed kibi.logic.v1 interpretations. Kibi validates and canonicalizes them; raw Prolog is not accepted.",
89
+ items: {
90
+ type: "object",
91
+ required: ["claim_key", "claim_text", "ir"],
92
+ properties: {
93
+ claim_key: { type: "string" },
94
+ claim_text: { type: "string" },
95
+ confidence: { type: "number", minimum: 0, maximum: 1 },
96
+ span: { type: "object" },
97
+ ir: { type: "object" },
98
+ },
99
+ },
100
+ },
78
101
  type: {
79
102
  type: "string",
80
- enum: ["req"],
103
+ enum: [
104
+ "req",
105
+ "scenario",
106
+ "test",
107
+ "adr",
108
+ "flag",
109
+ "event",
110
+ "symbol",
111
+ "fact",
112
+ ],
81
113
  default: "req",
82
- description: "Entity type context for analysis. Currently requirement prose is supported.",
114
+ description: "Entity type context for analysis. Requirement, domain-fact, and supporting prose all receive a proposition ledger; only requirements receive deterministic modeling suggestions.",
83
115
  },
84
116
  id: {
85
117
  type: "string",
@@ -62,6 +62,10 @@ export declare const upsertSpec: {
62
62
  readonly type: "string";
63
63
  readonly description: "Optional text anchor/reference. Example: 'requirements.md#L40'.";
64
64
  };
65
+ readonly semantic_text: {
66
+ readonly type: "string";
67
+ readonly description: "Requirement-only authored prose used for semantic inventory hashes and UTF-8 spans. Keep text_ref available for independent document or code evidence.";
68
+ };
65
69
  readonly logic_claims: {
66
70
  readonly type: "array";
67
71
  readonly minItems: 1;
@@ -72,6 +76,30 @@ export declare const upsertSpec: {
72
76
  };
73
77
  readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_semantic_advisor. A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
74
78
  };
79
+ readonly semantic_clauses: {
80
+ readonly type: "array";
81
+ readonly minItems: 1;
82
+ readonly items: {
83
+ readonly type: "string";
84
+ readonly minLength: 1;
85
+ };
86
+ readonly description: "Optional complete atomic decomposition used by kb_semantic_advisor and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.";
87
+ };
88
+ readonly semantic_inventory_version: {
89
+ readonly type: "string";
90
+ readonly const: "kibi.semantic-inventory.v1";
91
+ readonly description: "Requirement-only proposition ledger contract version returned by kb_semantic_advisor.";
92
+ };
93
+ readonly semantic_source_field: {
94
+ readonly type: "string";
95
+ readonly enum: readonly ["semantic_text", "text_ref", "title"];
96
+ readonly description: "Requirement field whose exact UTF-8 bytes anchor semantic_inventory spans.";
97
+ };
98
+ readonly semantic_source_hash: {
99
+ readonly type: "string";
100
+ readonly pattern: "^[a-f0-9]{64}$";
101
+ readonly description: "SHA-256 of the exact semantic source text returned in the advisor inventory contract.";
102
+ };
75
103
  readonly sourceFile: {
76
104
  readonly type: "string";
77
105
  readonly description: "Optional code source file for symbol entities. Example: 'src/auth/login.ts'.";
@@ -96,9 +124,69 @@ export declare const upsertSpec: {
96
124
  readonly enum: readonly ["internal", "consumer"];
97
125
  readonly description: "Optional typed verification perspective for test entities. Example: 'consumer'.";
98
126
  };
127
+ readonly verification_receipts: {
128
+ readonly type: "array";
129
+ readonly maxItems: 50;
130
+ readonly items: {
131
+ readonly type: "object";
132
+ readonly required: readonly ["version", "receipt_id", "test_id", "runner", "command", "scope", "outcome", "code_snapshot", "environment_hash", "started_at", "finished_at", "artifact_digest"];
133
+ readonly properties: {
134
+ readonly version: {
135
+ readonly type: "string";
136
+ readonly const: "kibi.verification-receipt.v1";
137
+ };
138
+ readonly receipt_id: {
139
+ readonly type: "string";
140
+ readonly pattern: "^VR-[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$";
141
+ };
142
+ readonly test_id: {
143
+ readonly type: "string";
144
+ readonly minLength: 1;
145
+ };
146
+ readonly runner: {
147
+ readonly type: "string";
148
+ readonly minLength: 1;
149
+ };
150
+ readonly command: {
151
+ readonly type: "string";
152
+ readonly minLength: 1;
153
+ };
154
+ readonly scope: {
155
+ readonly type: "string";
156
+ readonly enum: readonly ["unit", "integration", "end_to_end"];
157
+ };
158
+ readonly outcome: {
159
+ readonly type: "string";
160
+ readonly enum: readonly ["passed", "failed", "errored", "cancelled", "skipped"];
161
+ };
162
+ readonly code_snapshot: {
163
+ readonly type: "string";
164
+ readonly pattern: "^[a-f0-9]{64}$";
165
+ };
166
+ readonly environment_hash: {
167
+ readonly type: "string";
168
+ readonly pattern: "^[a-f0-9]{64}$";
169
+ };
170
+ readonly started_at: {
171
+ readonly type: "string";
172
+ readonly minLength: 1;
173
+ };
174
+ readonly finished_at: {
175
+ readonly type: "string";
176
+ readonly minLength: 1;
177
+ };
178
+ readonly artifact_digest: {
179
+ readonly type: "string";
180
+ readonly pattern: "^[a-f0-9]{64}$";
181
+ };
182
+ };
183
+ readonly additionalProperties: false;
184
+ };
185
+ readonly description: "Append-only test execution evidence. Proof accepts only the newest valid passed receipt bound to the current code snapshot and within the seven-day freshness window.";
186
+ };
99
187
  readonly fact_kind: {
100
188
  readonly type: "string";
101
- readonly enum: readonly ["subject", "property_value", "observation", "meta", "predicate_schema", "predicate"];
189
+ readonly enum: readonly ["subject", "property_value", "observation", "meta", "predicate_schema", "predicate", "rule_schema", "rule"];
102
190
  readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.";
103
191
  };
104
192
  readonly subject_key: {
@@ -220,8 +308,50 @@ export declare const upsertSpec: {
220
308
  };
221
309
  readonly description: "Optional ground-term examples for a predicate schema.";
222
310
  };
311
+ readonly semantic_inventory: {
312
+ readonly type: "array";
313
+ readonly description: "Requirement proposition ledger returned by kb_semantic_advisor; preserve entries while modeling each assertive span.";
314
+ readonly items: {
315
+ readonly type: "object";
316
+ };
317
+ };
318
+ readonly rule_ir: {
319
+ readonly type: "object";
320
+ readonly description: "Schema-validated kibi.logic.v1 rule IR. It is persisted as data and never executed as caller-supplied Prolog.";
321
+ };
322
+ readonly rule_hash: {
323
+ readonly type: "string";
324
+ readonly description: "Deterministic hash of canonical rule_ir.";
325
+ };
326
+ readonly rule_schema_id: {
327
+ readonly type: "string";
328
+ readonly description: "Rule schema fact ID used to validate this rule.";
329
+ };
330
+ readonly rule_name: {
331
+ readonly type: "string";
332
+ readonly description: "Stable rule schema name.";
333
+ };
334
+ readonly semantic_key: {
335
+ readonly type: "string";
336
+ readonly description: "Canonical semantic identity of the normalized logical model.";
337
+ };
338
+ readonly claim_span_start: {
339
+ readonly type: "integer";
340
+ readonly minimum: 0;
341
+ };
342
+ readonly claim_span_end: {
343
+ readonly type: "integer";
344
+ readonly minimum: 0;
345
+ };
223
346
  };
224
- readonly allOf: readonly [Record<string, unknown>];
347
+ readonly allOf: readonly [Record<string, unknown>, {
348
+ readonly if: {
349
+ readonly required: readonly ["verification_receipts"];
350
+ };
351
+ readonly then: {
352
+ readonly required: readonly ["verification_scope"];
353
+ };
354
+ }];
225
355
  readonly required: readonly ["title", "status"];
226
356
  };
227
357
  readonly relationships: {
@@ -233,7 +363,7 @@ export declare const upsertSpec: {
233
363
  readonly properties: {
234
364
  readonly type: {
235
365
  readonly type: "string";
236
- readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "guards", "publishes", "consumes", "supersedes", "relates_to"];
366
+ readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "relates_to"];
237
367
  readonly description: "Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test).";
238
368
  };
239
369
  readonly from: {
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BuC,CAAC"}
1
+ {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BuC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { OperationContext, WorkspaceSnapshot } from "./runtime-types.js";
2
+ export type WorkspaceSnapshotEvidence = Readonly<{
3
+ available: true;
4
+ snapshot: WorkspaceSnapshot;
5
+ }> | Readonly<{
6
+ available: false;
7
+ error: string;
8
+ }>;
9
+ export declare function readWorkspaceSnapshot(context: OperationContext): Promise<WorkspaceSnapshotEvidence>;
10
+ //# sourceMappingURL=workspace-snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-snapshot.d.ts","sourceRoot":"","sources":["../../../src/public/operations/workspace-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GACjC,QAAQ,CAAC;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC,GAC1D,QAAQ,CAAC;IAAE,SAAS,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,yBAAyB,CAAC,CAmBpC"}
@@ -0,0 +1,20 @@
1
+ export async function readWorkspaceSnapshot(context) {
2
+ if (!context.git?.workspaceSnapshot) {
3
+ return {
4
+ available: false,
5
+ error: "The active operation runtime does not expose workspace snapshots.",
6
+ };
7
+ }
8
+ try {
9
+ return {
10
+ available: true,
11
+ snapshot: await context.git.workspaceSnapshot(context.workspaceRoot),
12
+ };
13
+ }
14
+ catch (error) {
15
+ return {
16
+ available: false,
17
+ error: error instanceof Error ? error.message : String(error),
18
+ };
19
+ }
20
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AA4FA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAsMzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AAwTA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA6TzC,CAAC;AAEF,eAAe,YAAY,CAAC"}