kibi-cli 0.14.0 → 0.17.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.
- package/bin/kibi +3 -1
- package/dist/cli-command.d.ts +5 -0
- package/dist/cli-command.d.ts.map +1 -0
- package/dist/cli-command.js +9 -0
- package/dist/cli-errors.d.ts +13 -0
- package/dist/cli-errors.d.ts.map +1 -0
- package/dist/cli-errors.js +26 -0
- package/dist/cli-input.d.ts +6 -0
- package/dist/cli-input.d.ts.map +1 -0
- package/dist/cli-input.js +54 -0
- package/dist/cli-json-command.d.ts +14 -0
- package/dist/cli-json-command.d.ts.map +1 -0
- package/dist/cli-json-command.js +96 -0
- package/dist/cli-protocol.d.ts +12 -0
- package/dist/cli-protocol.d.ts.map +1 -0
- package/dist/cli-protocol.js +37 -0
- package/dist/cli-register-foundation.d.ts +3 -0
- package/dist/cli-register-foundation.d.ts.map +1 -0
- package/dist/cli-register-foundation.js +90 -0
- package/dist/cli-register-maintenance.d.ts +3 -0
- package/dist/cli-register-maintenance.d.ts.map +1 -0
- package/dist/cli-register-maintenance.js +36 -0
- package/dist/cli-register-reporting.d.ts +3 -0
- package/dist/cli-register-reporting.d.ts.map +1 -0
- package/dist/cli-register-reporting.js +101 -0
- package/dist/cli-register-skills.d.ts +3 -0
- package/dist/cli-register-skills.d.ts.map +1 -0
- package/dist/cli-register-skills.js +71 -0
- package/dist/cli-validate.d.ts +18 -0
- package/dist/cli-validate.d.ts.map +1 -0
- package/dist/cli-validate.js +45 -0
- package/dist/cli.d.ts +4 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -211
- package/dist/commands/aggregated-checks.d.ts +1 -1
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +28 -34
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +53 -95
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +12 -17
- package/dist/commands/discovery-shared.d.ts +2 -1
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +6 -18
- package/dist/commands/gaps.d.ts.map +1 -1
- package/dist/commands/gaps.js +15 -19
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/graph.js +15 -21
- package/dist/commands/query.d.ts +7 -7
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +98 -204
- package/dist/commands/search.d.ts +4 -4
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +14 -27
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +6 -7
- package/dist/commands/sync/manifest.d.ts +13 -2
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +31 -22
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +39 -1
- package/dist/extractors/markdown.d.ts +22 -2
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +50 -1
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +11 -1
- package/dist/logic/ir.d.ts +112 -0
- package/dist/logic/ir.d.ts.map +1 -0
- package/dist/logic/ir.js +729 -0
- package/dist/operations/autopilot/activation.d.ts +4 -0
- package/dist/operations/autopilot/activation.d.ts.map +1 -0
- package/dist/operations/autopilot/activation.js +130 -0
- package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
- package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
- package/dist/operations/autopilot/candidate-helpers.js +55 -0
- package/dist/operations/autopilot/candidates.d.ts +4 -0
- package/dist/operations/autopilot/candidates.d.ts.map +1 -0
- package/dist/operations/autopilot/candidates.js +114 -0
- package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
- package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
- package/dist/operations/autopilot/discovery-evidence.js +158 -0
- package/dist/operations/autopilot/discovery.d.ts +4 -0
- package/dist/operations/autopilot/discovery.d.ts.map +1 -0
- package/dist/operations/autopilot/discovery.js +100 -0
- package/dist/operations/autopilot/generate.d.ts +8 -0
- package/dist/operations/autopilot/generate.d.ts.map +1 -0
- package/dist/operations/autopilot/generate.js +112 -0
- package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
- package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
- package/dist/operations/autopilot/guidance-actions.js +79 -0
- package/dist/operations/autopilot/guidance.d.ts +14 -0
- package/dist/operations/autopilot/guidance.d.ts.map +1 -0
- package/dist/operations/autopilot/guidance.js +124 -0
- package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
- package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
- package/dist/operations/autopilot/markdown-candidates.js +134 -0
- package/dist/operations/autopilot/presentation.d.ts +13 -0
- package/dist/operations/autopilot/presentation.d.ts.map +1 -0
- package/dist/operations/autopilot/presentation.js +91 -0
- package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
- package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
- package/dist/operations/autopilot/requirement-claims.js +48 -0
- package/dist/operations/autopilot/types.d.ts +117 -0
- package/dist/operations/autopilot/types.d.ts.map +1 -0
- package/dist/operations/autopilot/types.js +8 -0
- package/dist/operations/modeling/logic-modeling.d.ts +22 -0
- package/dist/operations/modeling/logic-modeling.d.ts.map +1 -0
- package/dist/operations/modeling/logic-modeling.js +111 -0
- package/dist/operations/modeling/model-requirement.d.ts +10 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
- package/dist/operations/modeling/model-requirement.js +164 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-applyplan.js +117 -0
- package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-1.js +200 -0
- package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-2.js +197 -0
- package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-3.js +193 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
- package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-4.js +149 -0
- package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog.js +29 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
- package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-1.js +161 -0
- package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
- package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-2.js +169 -0
- package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
- package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference-3.js +163 -0
- package/dist/operations/modeling/predicate-inference.d.ts +5 -0
- package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-inference.js +163 -0
- package/dist/operations/modeling/predicate-loader.d.ts +10 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-loader.js +94 -0
- package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-ranker.js +62 -0
- package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-1.js +121 -0
- package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-2.js +122 -0
- package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-score-3.js +54 -0
- package/dist/operations/modeling/predicate-types.d.ts +64 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-types.js +1 -0
- package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
- package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
- package/dist/operations/modeling/predicate-utils.d.ts +23 -0
- package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-utils.js +187 -0
- package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
- package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-applyplan.js +44 -0
- package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
- package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-heuristics.js +114 -0
- package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
- package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-modeler.js +70 -0
- package/dist/operations/modeling/requirement-types.d.ts +61 -0
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-types.js +1 -0
- package/dist/operations/modeling/requirement-utils.d.ts +10 -0
- package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
- package/dist/operations/modeling/requirement-utils.js +65 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
- package/dist/operations/modeling/suggest-predicates.js +64 -0
- package/dist/operations/mutation/audit.d.ts +6 -0
- package/dist/operations/mutation/audit.d.ts.map +1 -0
- package/dist/operations/mutation/audit.js +22 -0
- package/dist/operations/mutation/contradictions.d.ts +10 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -0
- package/dist/operations/mutation/contradictions.js +40 -0
- package/dist/operations/mutation/delete.d.ts +5 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -0
- package/dist/operations/mutation/delete.js +67 -0
- package/dist/operations/mutation/relationships.d.ts +17 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -0
- package/dist/operations/mutation/relationships.js +142 -0
- package/dist/operations/mutation/save.d.ts +4 -0
- package/dist/operations/mutation/save.d.ts.map +1 -0
- package/dist/operations/mutation/save.js +14 -0
- package/dist/operations/mutation/serialization.d.ts +5 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -0
- package/dist/operations/mutation/serialization.js +88 -0
- package/dist/operations/mutation/strict-fact.d.ts +4 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
- package/dist/operations/mutation/strict-fact.js +132 -0
- package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-granularity.js +109 -0
- package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
- package/dist/operations/mutation/symbol-refresh.js +105 -0
- package/dist/operations/mutation/types.d.ts +43 -0
- package/dist/operations/mutation/types.d.ts.map +1 -0
- package/dist/operations/mutation/types.js +1 -0
- package/dist/operations/mutation/upsert.d.ts +5 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -0
- package/dist/operations/mutation/upsert.js +103 -0
- package/dist/operations/mutation/validate-upsert.d.ts +5 -0
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
- package/dist/operations/mutation/validate-upsert.js +50 -0
- package/dist/operations/mutation/validation.d.ts +5 -0
- package/dist/operations/mutation/validation.d.ts.map +1 -0
- package/dist/operations/mutation/validation.js +107 -0
- package/dist/operations/mutation/warnings.d.ts +4 -0
- package/dist/operations/mutation/warnings.d.ts.map +1 -0
- package/dist/operations/mutation/warnings.js +17 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/analysis-receipt.js +120 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/analyze-prose.js +693 -0
- package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/clauses.js +43 -0
- package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
- package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/observation-plan.js +31 -0
- package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
- package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
- package/dist/operations/semantic-advisor/shared.d.ts +19 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/shared.js +209 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/strict-rules.js +106 -0
- package/dist/operations/semantic-advisor/types.d.ts +195 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/types.js +1 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +20 -3
- package/dist/prolog.d.ts +5 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +89 -32
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +8 -4
- package/dist/public/impact/full-kb-quality.d.ts +1 -1
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +34 -1
- package/dist/public/impact/requirement-quality.d.ts.map +1 -1
- package/dist/public/impact/requirement-quality.js +6 -23
- package/dist/public/operations/catalog.d.ts +986 -0
- package/dist/public/operations/catalog.d.ts.map +1 -0
- package/dist/public/operations/catalog.js +42 -0
- package/dist/public/operations/check-executor.d.ts +21 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -0
- package/dist/public/operations/check-executor.js +111 -0
- package/dist/public/operations/check-format-shared.d.ts +36 -0
- package/dist/public/operations/check-format-shared.d.ts.map +1 -0
- package/dist/public/operations/check-format-shared.js +107 -0
- package/dist/public/operations/check-helpers.d.ts +10 -0
- package/dist/public/operations/check-helpers.d.ts.map +1 -0
- package/dist/public/operations/check-helpers.js +107 -0
- package/dist/public/operations/discovery-entities.d.ts +14 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -0
- package/dist/public/operations/discovery-entities.js +91 -0
- package/dist/public/operations/discovery-executors.d.ts +39 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -0
- package/dist/public/operations/discovery-executors.js +101 -0
- package/dist/public/operations/index.d.ts +21 -0
- package/dist/public/operations/index.d.ts.map +1 -0
- package/dist/public/operations/index.js +19 -0
- package/dist/public/operations/node-ports.d.ts +15 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -0
- package/dist/public/operations/node-ports.js +57 -0
- package/dist/public/operations/prolog-json.d.ts +5 -0
- package/dist/public/operations/prolog-json.d.ts.map +1 -0
- package/dist/public/operations/prolog-json.js +44 -0
- package/dist/public/operations/runtime-types.d.ts +69 -0
- package/dist/public/operations/runtime-types.d.ts.map +1 -0
- package/dist/public/operations/runtime-types.js +17 -0
- package/dist/public/operations/specs/autopilot.d.ts +82 -0
- package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
- package/dist/public/operations/specs/autopilot.js +72 -0
- package/dist/public/operations/specs/check.d.ts +51 -0
- package/dist/public/operations/specs/check.d.ts.map +1 -0
- package/dist/public/operations/specs/check.js +65 -0
- package/dist/public/operations/specs/discovery.d.ts +94 -0
- package/dist/public/operations/specs/discovery.d.ts.map +1 -0
- package/dist/public/operations/specs/discovery.js +98 -0
- package/dist/public/operations/specs/modeling.d.ts +142 -0
- package/dist/public/operations/specs/modeling.d.ts.map +1 -0
- package/dist/public/operations/specs/modeling.js +133 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +268 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
- package/dist/public/operations/specs/mutation-schemas.js +294 -0
- package/dist/public/operations/specs/mutation.d.ts +56 -0
- package/dist/public/operations/specs/mutation.d.ts.map +1 -0
- package/dist/public/operations/specs/mutation.js +44 -0
- package/dist/public/operations/specs/reporting.d.ts +185 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -0
- package/dist/public/operations/specs/reporting.js +158 -0
- package/dist/public/operations/specs/semantic.d.ts +81 -0
- package/dist/public/operations/specs/semantic.d.ts.map +1 -0
- package/dist/public/operations/specs/semantic.js +137 -0
- package/dist/public/operations/specs/skills.d.ts +70 -0
- package/dist/public/operations/specs/skills.d.ts.map +1 -0
- package/dist/public/operations/specs/skills.js +107 -0
- package/dist/public/operations/specs/sparql.d.ts +39 -0
- package/dist/public/operations/specs/sparql.d.ts.map +1 -0
- package/dist/public/operations/specs/sparql.js +121 -0
- package/dist/public/operations/specs/upsert.d.ts +291 -0
- package/dist/public/operations/specs/upsert.d.ts.map +1 -0
- package/dist/public/operations/specs/upsert.js +27 -0
- package/dist/public/operations/types.d.ts +24 -0
- package/dist/public/operations/types.d.ts.map +1 -0
- package/dist/public/operations/types.js +1 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +317 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/public/skill-system/errors.d.ts +19 -0
- package/dist/public/skill-system/errors.d.ts.map +1 -0
- package/dist/public/skill-system/errors.js +36 -0
- package/dist/public/skill-system/loader.d.ts +9 -0
- package/dist/public/skill-system/loader.d.ts.map +1 -0
- package/dist/public/skill-system/loader.js +76 -0
- package/dist/public/skill-system/paths.d.ts +6 -0
- package/dist/public/skill-system/paths.d.ts.map +1 -0
- package/dist/public/skill-system/paths.js +25 -0
- package/dist/public/skill-system/types.d.ts +15 -0
- package/dist/public/skill-system/types.d.ts.map +1 -0
- package/dist/public/skill-system/types.js +1 -0
- package/dist/public/skill-system/validation.d.ts +10 -0
- package/dist/public/skill-system/validation.d.ts.map +1 -0
- package/dist/public/skill-system/validation.js +119 -0
- package/dist/public/skills/init-kibi/SKILL.md +62 -0
- package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
- package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
- package/dist/public/skills/kibi-usage/SKILL.md +145 -99
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
- package/dist/public/skills/kibi-usage/resources/logic-ir.md +43 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +41 -3
- package/dist/public/skills.d.ts +4 -41
- package/dist/public/skills.d.ts.map +1 -1
- package/dist/public/skills.js +3 -270
- package/dist/public/symbol-granularity.d.ts +9 -0
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +16 -0
- package/dist/runtime/cli-runtime.d.ts +3 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -0
- package/dist/runtime/cli-runtime.js +96 -0
- package/dist/schemas/entity.schema.json +329 -3
- package/dist/traceability/staged-diagnostics.d.ts +2 -2
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +17 -10
- package/dist/traceability/staged-impact-contract.js +1 -1
- package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +53 -24
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +17 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +47 -1
- package/dist/types/entities.d.ts +3 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +24 -0
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.js +1 -1
- package/package.json +60 -2
- package/src/public/impact/diagnostics.ts +18 -11
- package/src/public/impact/full-kb-quality.ts +30 -3
- package/src/public/impact/requirement-quality.ts +6 -26
- package/src/public/operations/catalog.ts +60 -0
- package/src/public/operations/check-executor.ts +185 -0
- package/src/public/operations/check-format-shared.ts +178 -0
- package/src/public/operations/check-helpers.ts +141 -0
- package/src/public/operations/discovery-entities.ts +122 -0
- package/src/public/operations/discovery-executors.ts +176 -0
- package/src/public/operations/index.ts +20 -0
- package/src/public/operations/node-ports.ts +78 -0
- package/src/public/operations/prolog-json.ts +71 -0
- package/src/public/operations/runtime-types.ts +106 -0
- package/src/public/operations/specs/autopilot.ts +98 -0
- package/src/public/operations/specs/check.ts +75 -0
- package/src/public/operations/specs/discovery.ts +126 -0
- package/src/public/operations/specs/modeling.ts +174 -0
- package/src/public/operations/specs/mutation-schemas.ts +326 -0
- package/src/public/operations/specs/mutation.ts +58 -0
- package/src/public/operations/specs/reporting.ts +249 -0
- package/src/public/operations/specs/semantic.ts +174 -0
- package/src/public/operations/specs/skills.ts +142 -0
- package/src/public/operations/specs/sparql.ts +149 -0
- package/src/public/operations/specs/upsert.ts +40 -0
- package/src/public/operations/types.ts +57 -0
- package/src/public/schemas/entity.ts +324 -1
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skill-system/errors.ts +38 -0
- package/src/public/skill-system/loader.ts +108 -0
- package/src/public/skill-system/paths.ts +27 -0
- package/src/public/skill-system/types.ts +14 -0
- package/src/public/skill-system/validation.ts +175 -0
- package/src/public/skills/init-kibi/SKILL.md +62 -0
- package/src/public/skills/kibi-freshness/SKILL.md +44 -0
- package/src/public/skills/kibi-traceability/SKILL.md +54 -0
- package/src/public/skills/kibi-usage/SKILL.md +145 -99
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
- package/src/public/skills/kibi-usage/resources/logic-ir.md +43 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +41 -3
- package/src/public/skills.ts +18 -427
- package/src/public/symbol-granularity.ts +25 -0
- package/src/schemas/entity.schema.json +329 -3
- package/src/schemas/relationship.schema.json +1 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { OperationContext } from "../runtime-types.js";
|
|
2
|
+
import type { OperationResult, OperationSpec } from "../types.js";
|
|
3
|
+
|
|
4
|
+
// implements REQ-kibi-operation-interface-parity
|
|
5
|
+
export type SparqlRemoteInput = {
|
|
6
|
+
readonly endpoint: string;
|
|
7
|
+
readonly query: string;
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// implements REQ-kibi-operation-interface-parity
|
|
12
|
+
export type SparqlRemoteOutput = {
|
|
13
|
+
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function validateInput(input: SparqlRemoteInput): URL {
|
|
17
|
+
if (typeof input.endpoint !== "string" || input.endpoint.trim() === "") {
|
|
18
|
+
throw new Error("SPARQL endpoint is required");
|
|
19
|
+
}
|
|
20
|
+
if (typeof input.query !== "string" || input.query.trim() === "") {
|
|
21
|
+
throw new Error("SPARQL query is required");
|
|
22
|
+
}
|
|
23
|
+
let endpoint: URL;
|
|
24
|
+
try {
|
|
25
|
+
endpoint = new URL(input.endpoint);
|
|
26
|
+
} catch {
|
|
27
|
+
throw new Error("SPARQL endpoint must be an http:// or https:// URL");
|
|
28
|
+
}
|
|
29
|
+
if (endpoint.protocol !== "http:" && endpoint.protocol !== "https:") {
|
|
30
|
+
throw new Error("SPARQL endpoint must be an http:// or https:// URL");
|
|
31
|
+
}
|
|
32
|
+
if (!/^\s*select\b/i.test(input.query)) {
|
|
33
|
+
throw new Error("SPARQL query must be a SELECT query");
|
|
34
|
+
}
|
|
35
|
+
if (
|
|
36
|
+
input.timeoutMs !== undefined &&
|
|
37
|
+
(!Number.isFinite(input.timeoutMs) || input.timeoutMs <= 0)
|
|
38
|
+
) {
|
|
39
|
+
throw new Error("SPARQL timeoutMs must be a positive number when provided");
|
|
40
|
+
}
|
|
41
|
+
return endpoint;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
45
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function decodeRows(payload: unknown): SparqlRemoteOutput {
|
|
49
|
+
if (!isRecord(payload) || !isRecord(payload.results)) {
|
|
50
|
+
throw new Error("SPARQL endpoint returned an invalid result document");
|
|
51
|
+
}
|
|
52
|
+
const bindings = payload.results.bindings;
|
|
53
|
+
if (!Array.isArray(bindings)) {
|
|
54
|
+
throw new Error("SPARQL endpoint returned an invalid bindings array");
|
|
55
|
+
}
|
|
56
|
+
const rows = bindings.map((binding) => {
|
|
57
|
+
if (!isRecord(binding)) {
|
|
58
|
+
throw new Error("SPARQL endpoint returned an invalid binding");
|
|
59
|
+
}
|
|
60
|
+
const row: Record<string, unknown> = {};
|
|
61
|
+
for (const [variable, term] of Object.entries(binding)) {
|
|
62
|
+
if (!isRecord(term) || typeof term.value !== "string") {
|
|
63
|
+
throw new Error(`SPARQL endpoint returned an invalid ${variable} term`);
|
|
64
|
+
}
|
|
65
|
+
row[variable] = term.value;
|
|
66
|
+
}
|
|
67
|
+
return row;
|
|
68
|
+
});
|
|
69
|
+
return { rows };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// implements REQ-kibi-operation-interface-parity, REQ-002, REQ-013
|
|
73
|
+
async function executeSparqlRemote(
|
|
74
|
+
input: SparqlRemoteInput,
|
|
75
|
+
context: OperationContext,
|
|
76
|
+
): Promise<OperationResult<SparqlRemoteOutput>> {
|
|
77
|
+
const endpoint = validateInput(input);
|
|
78
|
+
if (context.net === undefined) {
|
|
79
|
+
throw new Error("SPARQL remote query requires a network port");
|
|
80
|
+
}
|
|
81
|
+
const signal =
|
|
82
|
+
input.timeoutMs === undefined
|
|
83
|
+
? context.signal
|
|
84
|
+
: AbortSignal.any([
|
|
85
|
+
context.signal,
|
|
86
|
+
AbortSignal.timeout(
|
|
87
|
+
Math.max(1, Math.ceil(input.timeoutMs / 1_000)) * 1_000,
|
|
88
|
+
),
|
|
89
|
+
]);
|
|
90
|
+
try {
|
|
91
|
+
const response = await context.net.fetch(endpoint, {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: {
|
|
94
|
+
accept: "application/sparql-results+json",
|
|
95
|
+
"content-type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
96
|
+
},
|
|
97
|
+
body: new URLSearchParams({ query: input.query }),
|
|
98
|
+
signal,
|
|
99
|
+
});
|
|
100
|
+
if (!response.ok) {
|
|
101
|
+
throw new Error(`SPARQL endpoint returned HTTP ${response.status}`);
|
|
102
|
+
}
|
|
103
|
+
const payload: unknown = await response.json();
|
|
104
|
+
const structuredContent = decodeRows(payload);
|
|
105
|
+
const rowCount = structuredContent.rows.length;
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: `Remote SPARQL query returned ${rowCount} row${rowCount === 1 ? "" : "s"}.`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
structuredContent,
|
|
114
|
+
};
|
|
115
|
+
} catch (error) {
|
|
116
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117
|
+
throw new Error(`SPARQL remote query failed: ${message}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const sparqlRemoteSpec = {
|
|
122
|
+
name: "kb_sparql_remote",
|
|
123
|
+
cliName: "sparql-remote",
|
|
124
|
+
description:
|
|
125
|
+
"Opt-in remote SPARQL query tool for external HTTP(S) RDF endpoints. This does not query Kibi's local RDF store directly, stores no credentials, and depends on network availability.",
|
|
126
|
+
businessInputSchema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
required: ["endpoint", "query"],
|
|
129
|
+
properties: {
|
|
130
|
+
endpoint: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description:
|
|
133
|
+
"Remote SPARQL endpoint URL. Must start with http:// or https://.",
|
|
134
|
+
},
|
|
135
|
+
query: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "SPARQL SELECT query to send to the remote endpoint.",
|
|
138
|
+
},
|
|
139
|
+
timeoutMs: {
|
|
140
|
+
type: "number",
|
|
141
|
+
description:
|
|
142
|
+
"Optional positive timeout in milliseconds for the remote query.",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
requiresProlog: false,
|
|
147
|
+
effects: ["network-read"],
|
|
148
|
+
execute: executeSparqlRemote,
|
|
149
|
+
} as const satisfies OperationSpec<SparqlRemoteInput, SparqlRemoteOutput>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UpsertInput,
|
|
3
|
+
UpsertPayload,
|
|
4
|
+
} from "../../../operations/mutation/types.js";
|
|
5
|
+
import { executeUpsert } from "../../../operations/mutation/upsert.js";
|
|
6
|
+
import type { OperationSpec } from "../types.js";
|
|
7
|
+
import {
|
|
8
|
+
ENTITY_PROPERTIES_SCHEMA,
|
|
9
|
+
ENTITY_TYPES,
|
|
10
|
+
RELATIONSHIPS_SCHEMA,
|
|
11
|
+
} from "./mutation-schemas.js";
|
|
12
|
+
|
|
13
|
+
export const upsertSpec = {
|
|
14
|
+
name: "kb_upsert",
|
|
15
|
+
cliName: "upsert",
|
|
16
|
+
description:
|
|
17
|
+
"Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer kb_validate_upsert first because it returns semantic advisor receipts for prose-heavy requirements. Use kb_model_requirement before hand-writing strict property facts from prose, and kb_suggest_predicates before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request. Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.",
|
|
18
|
+
businessInputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
required: ["type", "id", "properties"],
|
|
21
|
+
properties: {
|
|
22
|
+
type: {
|
|
23
|
+
type: "string",
|
|
24
|
+
enum: ENTITY_TYPES,
|
|
25
|
+
description:
|
|
26
|
+
"Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'.",
|
|
27
|
+
},
|
|
28
|
+
id: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description:
|
|
31
|
+
"Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.",
|
|
32
|
+
},
|
|
33
|
+
properties: ENTITY_PROPERTIES_SCHEMA,
|
|
34
|
+
relationships: RELATIONSHIPS_SCHEMA,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
requiresProlog: true,
|
|
38
|
+
effects: ["kb-write", "workspace-write"],
|
|
39
|
+
execute: executeUpsert,
|
|
40
|
+
} as const satisfies OperationSpec<UpsertInput, UpsertPayload>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { OperationContext } from "./runtime-types.js";
|
|
2
|
+
export type { OperationContext };
|
|
3
|
+
export type OperationName =
|
|
4
|
+
| "kb_query"
|
|
5
|
+
| "kb_search"
|
|
6
|
+
| "kb_status"
|
|
7
|
+
| "kb_skills_list"
|
|
8
|
+
| "kb_skills_load"
|
|
9
|
+
| "kb_skills_read"
|
|
10
|
+
| "kb_find_gaps"
|
|
11
|
+
| "kb_coverage"
|
|
12
|
+
| "kb_graph"
|
|
13
|
+
| "kb_sparql_remote"
|
|
14
|
+
| "kb_semantic_advisor"
|
|
15
|
+
| "kb_upsert"
|
|
16
|
+
| "kb_validate_upsert"
|
|
17
|
+
| "kb_delete"
|
|
18
|
+
| "kb_check"
|
|
19
|
+
| "kb_model_requirement"
|
|
20
|
+
| "kb_suggest_predicates"
|
|
21
|
+
| "kb_autopilot_generate";
|
|
22
|
+
|
|
23
|
+
export type OperationEffect =
|
|
24
|
+
| "local-read"
|
|
25
|
+
| "kb-read"
|
|
26
|
+
| "workspace-read"
|
|
27
|
+
| "network-read"
|
|
28
|
+
| "kb-write"
|
|
29
|
+
| "workspace-write";
|
|
30
|
+
|
|
31
|
+
export interface OperationContent {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly text?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface OperationResult<O = unknown> {
|
|
37
|
+
readonly content: readonly OperationContent[];
|
|
38
|
+
readonly structuredContent?: O;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface OperationSpec<
|
|
42
|
+
I = Readonly<Record<string, unknown>>,
|
|
43
|
+
O = unknown,
|
|
44
|
+
> {
|
|
45
|
+
readonly name: OperationName;
|
|
46
|
+
readonly cliName: string;
|
|
47
|
+
readonly description: string;
|
|
48
|
+
readonly businessInputSchema: Readonly<Record<string, unknown>>;
|
|
49
|
+
readonly requiresProlog: boolean;
|
|
50
|
+
readonly effects: readonly OperationEffect[];
|
|
51
|
+
readonly execute: {
|
|
52
|
+
bivarianceHack(
|
|
53
|
+
input: I,
|
|
54
|
+
context: OperationContext,
|
|
55
|
+
): Promise<OperationResult<O>>;
|
|
56
|
+
}["bivarianceHack"];
|
|
57
|
+
}
|
|
@@ -25,7 +25,9 @@ type FactKind =
|
|
|
25
25
|
| "observation"
|
|
26
26
|
| "meta"
|
|
27
27
|
| "predicate_schema"
|
|
28
|
-
| "predicate"
|
|
28
|
+
| "predicate"
|
|
29
|
+
| "rule_schema"
|
|
30
|
+
| "rule";
|
|
29
31
|
type Operator = "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
30
32
|
type ValueType = "string" | "int" | "number" | "bool";
|
|
31
33
|
type Polarity = "require" | "forbid" | "assert" | "deny";
|
|
@@ -33,6 +35,15 @@ type VerificationScope = "unit" | "integration" | "end_to_end";
|
|
|
33
35
|
type VerificationPerspective = "internal" | "consumer";
|
|
34
36
|
|
|
35
37
|
const factConditionals = JSON.parse(`[
|
|
38
|
+
{
|
|
39
|
+
"if": {
|
|
40
|
+
"anyOf": [
|
|
41
|
+
{ "required": ["claim_key"] },
|
|
42
|
+
{ "required": ["claim_text"] }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"then": { "required": ["claim_key", "claim_text"] }
|
|
46
|
+
},
|
|
36
47
|
{
|
|
37
48
|
"if": {
|
|
38
49
|
"properties": {
|
|
@@ -65,6 +76,30 @@ const factConditionals = JSON.parse(`[
|
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"if": {
|
|
81
|
+
"properties": {
|
|
82
|
+
"type": { "const": "fact" },
|
|
83
|
+
"fact_kind": { "const": "rule_schema" }
|
|
84
|
+
},
|
|
85
|
+
"required": ["type", "fact_kind"]
|
|
86
|
+
},
|
|
87
|
+
"then": {
|
|
88
|
+
"required": ["rule_name", "argument_names", "argument_types"]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"if": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"type": { "const": "fact" },
|
|
95
|
+
"fact_kind": { "const": "rule" }
|
|
96
|
+
},
|
|
97
|
+
"required": ["type", "fact_kind"]
|
|
98
|
+
},
|
|
99
|
+
"then": {
|
|
100
|
+
"required": ["rule_ir", "rule_hash", "rule_schema_id", "rule_name", "semantic_key"]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
68
103
|
{
|
|
69
104
|
"if": {
|
|
70
105
|
"properties": {
|
|
@@ -81,10 +116,209 @@ const factConditionals = JSON.parse(`[
|
|
|
81
116
|
}
|
|
82
117
|
]`) as Array<Record<string, unknown>>;
|
|
83
118
|
|
|
119
|
+
// The persisted rule payload is still data, but its shape is constrained at
|
|
120
|
+
// the JSON boundary as well as by validateLogicIr. Keeping this vocabulary
|
|
121
|
+
// closed prevents a raw_goal/raw Prolog field from entering an upsert payload.
|
|
122
|
+
const logicTermSchema = {
|
|
123
|
+
oneOf: [
|
|
124
|
+
{
|
|
125
|
+
type: "object",
|
|
126
|
+
required: ["kind", "name", "type"],
|
|
127
|
+
properties: {
|
|
128
|
+
kind: { const: "var" },
|
|
129
|
+
name: { type: "string", pattern: "^[A-Z][A-Za-z0-9_]*$" },
|
|
130
|
+
type: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
131
|
+
},
|
|
132
|
+
additionalProperties: false,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "object",
|
|
136
|
+
required: ["kind", "value"],
|
|
137
|
+
properties: {
|
|
138
|
+
kind: { const: "const" },
|
|
139
|
+
value: { type: "string", minLength: 1 },
|
|
140
|
+
type: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
141
|
+
},
|
|
142
|
+
additionalProperties: false,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: "object",
|
|
146
|
+
required: ["kind", "value"],
|
|
147
|
+
properties: {
|
|
148
|
+
kind: { const: "number" },
|
|
149
|
+
value: { type: "number" },
|
|
150
|
+
unit: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
151
|
+
},
|
|
152
|
+
additionalProperties: false,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: "object",
|
|
156
|
+
required: ["kind", "value", "unit"],
|
|
157
|
+
properties: {
|
|
158
|
+
kind: { const: "duration" },
|
|
159
|
+
value: { type: "number", minimum: 0 },
|
|
160
|
+
unit: { type: "string", enum: ["ms", "s", "m", "h", "d", "w"] },
|
|
161
|
+
},
|
|
162
|
+
additionalProperties: false,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: "object",
|
|
166
|
+
required: ["kind", "value"],
|
|
167
|
+
properties: {
|
|
168
|
+
kind: { const: "timestamp" },
|
|
169
|
+
value: { type: "string" },
|
|
170
|
+
},
|
|
171
|
+
additionalProperties: false,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: "object",
|
|
175
|
+
required: ["kind", "start", "end"],
|
|
176
|
+
properties: {
|
|
177
|
+
kind: { const: "interval" },
|
|
178
|
+
start: { type: "string" },
|
|
179
|
+
end: { type: "string" },
|
|
180
|
+
},
|
|
181
|
+
additionalProperties: false,
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const logicAtomSchema = {
|
|
187
|
+
type: "object",
|
|
188
|
+
required: ["kind", "name", "args"],
|
|
189
|
+
properties: {
|
|
190
|
+
kind: { const: "atom" },
|
|
191
|
+
namespace: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
192
|
+
name: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
193
|
+
args: {
|
|
194
|
+
type: "array",
|
|
195
|
+
maxItems: 8,
|
|
196
|
+
items: { $ref: "#/$defs/logicTerm" },
|
|
197
|
+
},
|
|
198
|
+
polarity: { enum: ["positive", "negative"] },
|
|
199
|
+
closedWorld: { type: "boolean" },
|
|
200
|
+
},
|
|
201
|
+
additionalProperties: false,
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const logicExpressionSchema = {
|
|
205
|
+
oneOf: [
|
|
206
|
+
{ $ref: "#/$defs/logicAtom" },
|
|
207
|
+
{
|
|
208
|
+
type: "object",
|
|
209
|
+
required: ["kind", "items"],
|
|
210
|
+
properties: {
|
|
211
|
+
kind: { enum: ["all", "any"] },
|
|
212
|
+
items: {
|
|
213
|
+
type: "array",
|
|
214
|
+
minItems: 1,
|
|
215
|
+
maxItems: 32,
|
|
216
|
+
items: { $ref: "#/$defs/logicExpression" },
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
additionalProperties: false,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: "object",
|
|
223
|
+
required: ["kind", "item"],
|
|
224
|
+
properties: {
|
|
225
|
+
kind: { const: "not" },
|
|
226
|
+
item: { $ref: "#/$defs/logicAtom" },
|
|
227
|
+
},
|
|
228
|
+
additionalProperties: false,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: "object",
|
|
232
|
+
required: ["kind", "operator", "left", "right"],
|
|
233
|
+
properties: {
|
|
234
|
+
kind: { const: "compare" },
|
|
235
|
+
operator: { enum: ["eq", "neq", "lt", "lte", "gt", "gte"] },
|
|
236
|
+
left: { $ref: "#/$defs/logicTerm" },
|
|
237
|
+
right: { $ref: "#/$defs/logicTerm" },
|
|
238
|
+
},
|
|
239
|
+
additionalProperties: false,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
type: "object",
|
|
243
|
+
required: ["kind", "atom", "operator", "value"],
|
|
244
|
+
properties: {
|
|
245
|
+
kind: { const: "count" },
|
|
246
|
+
atom: { $ref: "#/$defs/logicAtom" },
|
|
247
|
+
operator: { enum: ["eq", "neq", "lt", "lte", "gt", "gte"] },
|
|
248
|
+
value: { type: "integer", minimum: 0 },
|
|
249
|
+
},
|
|
250
|
+
additionalProperties: false,
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
type: "object",
|
|
254
|
+
required: ["kind", "relation", "left", "right"],
|
|
255
|
+
properties: {
|
|
256
|
+
kind: { const: "temporal" },
|
|
257
|
+
relation: {
|
|
258
|
+
enum: ["before", "after", "during", "overlaps", "starts", "finishes"],
|
|
259
|
+
},
|
|
260
|
+
left: { $ref: "#/$defs/logicTerm" },
|
|
261
|
+
right: { $ref: "#/$defs/logicTerm" },
|
|
262
|
+
},
|
|
263
|
+
additionalProperties: false,
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const logicRuleSchema = {
|
|
269
|
+
type: "object",
|
|
270
|
+
required: ["version", "kind", "modality"],
|
|
271
|
+
properties: {
|
|
272
|
+
version: { const: "kibi.logic.v1" },
|
|
273
|
+
kind: { enum: ["atom", "rule", "constraint"] },
|
|
274
|
+
modality: { enum: ["assert", "deny", "oblige", "permit", "forbid"] },
|
|
275
|
+
head: { $ref: "#/$defs/logicAtom" },
|
|
276
|
+
body: { $ref: "#/$defs/logicExpression" },
|
|
277
|
+
variables: {
|
|
278
|
+
type: "array",
|
|
279
|
+
maxItems: 32,
|
|
280
|
+
items: {
|
|
281
|
+
type: "object",
|
|
282
|
+
required: ["name", "type"],
|
|
283
|
+
properties: {
|
|
284
|
+
name: { type: "string", pattern: "^[A-Z][A-Za-z0-9_]*$" },
|
|
285
|
+
type: { type: "string", pattern: "^[a-z][a-z0-9_:.\\/-]*$" },
|
|
286
|
+
quantifier: { enum: ["forall", "exists"] },
|
|
287
|
+
},
|
|
288
|
+
additionalProperties: false,
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
exceptions: {
|
|
292
|
+
type: "array",
|
|
293
|
+
maxItems: 16,
|
|
294
|
+
items: { $ref: "#/$defs/logicExpression" },
|
|
295
|
+
},
|
|
296
|
+
scope: {
|
|
297
|
+
type: "object",
|
|
298
|
+
properties: {
|
|
299
|
+
authority: { type: "string" },
|
|
300
|
+
name: { type: "string" },
|
|
301
|
+
tags: { type: "array", items: { type: "string" } },
|
|
302
|
+
},
|
|
303
|
+
additionalProperties: false,
|
|
304
|
+
},
|
|
305
|
+
validFrom: { type: "string" },
|
|
306
|
+
validTo: { type: "string" },
|
|
307
|
+
ruleSchemaId: { type: "string", minLength: 1 },
|
|
308
|
+
},
|
|
309
|
+
additionalProperties: false,
|
|
310
|
+
};
|
|
311
|
+
|
|
84
312
|
const entitySchema: Record<string, unknown> = {
|
|
85
313
|
$id: "entity.schema.json",
|
|
86
314
|
title: "Entity",
|
|
87
315
|
type: "object",
|
|
316
|
+
$defs: {
|
|
317
|
+
logicTerm: logicTermSchema,
|
|
318
|
+
logicAtom: logicAtomSchema,
|
|
319
|
+
logicExpression: logicExpressionSchema,
|
|
320
|
+
logicRule: logicRuleSchema,
|
|
321
|
+
},
|
|
88
322
|
properties: {
|
|
89
323
|
id: { type: "string" },
|
|
90
324
|
title: { type: "string" },
|
|
@@ -121,6 +355,59 @@ const entitySchema: Record<string, unknown> = {
|
|
|
121
355
|
severity: { type: "string" },
|
|
122
356
|
links: { type: "array", items: { type: "string" } },
|
|
123
357
|
text_ref: { type: "string" },
|
|
358
|
+
logic_claims: {
|
|
359
|
+
type: "array",
|
|
360
|
+
minItems: 1,
|
|
361
|
+
uniqueItems: true,
|
|
362
|
+
items: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
|
|
363
|
+
},
|
|
364
|
+
semantic_inventory: {
|
|
365
|
+
type: "array",
|
|
366
|
+
items: {
|
|
367
|
+
type: "object",
|
|
368
|
+
required: ["claim_key", "claim_text", "role", "status", "span"],
|
|
369
|
+
properties: {
|
|
370
|
+
claim_key: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
|
|
371
|
+
claim_text: { type: "string", minLength: 1 },
|
|
372
|
+
role: {
|
|
373
|
+
type: "string",
|
|
374
|
+
enum: [
|
|
375
|
+
"normative",
|
|
376
|
+
"definition",
|
|
377
|
+
"descriptive",
|
|
378
|
+
"condition",
|
|
379
|
+
"exception",
|
|
380
|
+
"rationale",
|
|
381
|
+
"example",
|
|
382
|
+
"subjective",
|
|
383
|
+
],
|
|
384
|
+
},
|
|
385
|
+
status: {
|
|
386
|
+
type: "string",
|
|
387
|
+
enum: [
|
|
388
|
+
"modeled",
|
|
389
|
+
"ambiguous",
|
|
390
|
+
"ontology_gap",
|
|
391
|
+
"nonlogical",
|
|
392
|
+
"missing",
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
span: {
|
|
396
|
+
type: "object",
|
|
397
|
+
required: ["start", "end"],
|
|
398
|
+
properties: {
|
|
399
|
+
start: { type: "integer", minimum: 0 },
|
|
400
|
+
end: { type: "integer", minimum: 0 },
|
|
401
|
+
},
|
|
402
|
+
additionalProperties: false,
|
|
403
|
+
},
|
|
404
|
+
semantic_key: { type: "string" },
|
|
405
|
+
payload_hash: { type: "string" },
|
|
406
|
+
reason: { type: "string" },
|
|
407
|
+
},
|
|
408
|
+
additionalProperties: false,
|
|
409
|
+
},
|
|
410
|
+
},
|
|
124
411
|
sourceFile: { type: "string" },
|
|
125
412
|
granularity_reason: {
|
|
126
413
|
type: "string",
|
|
@@ -166,6 +453,8 @@ const entitySchema: Record<string, unknown> = {
|
|
|
166
453
|
"meta",
|
|
167
454
|
"predicate_schema",
|
|
168
455
|
"predicate",
|
|
456
|
+
"rule_schema",
|
|
457
|
+
"rule",
|
|
169
458
|
] satisfies FactKind[],
|
|
170
459
|
},
|
|
171
460
|
subject_key: { type: "string" },
|
|
@@ -186,6 +475,8 @@ const entitySchema: Record<string, unknown> = {
|
|
|
186
475
|
valid_from: { type: "string" },
|
|
187
476
|
valid_to: { type: "string" },
|
|
188
477
|
canonical_key: { type: "string" },
|
|
478
|
+
claim_key: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
|
|
479
|
+
claim_text: { type: "string" },
|
|
189
480
|
predicate_name: { type: "string" },
|
|
190
481
|
predicate_namespace: { type: "string" },
|
|
191
482
|
predicate_arity: { type: "integer", minimum: 1 },
|
|
@@ -195,6 +486,13 @@ const entitySchema: Record<string, unknown> = {
|
|
|
195
486
|
aliases: { type: "array", items: { type: "string" } },
|
|
196
487
|
examples: { type: "array", items: { type: "string" } },
|
|
197
488
|
predicate_args: { type: "array", items: { type: "string" } },
|
|
489
|
+
rule_ir: { $ref: "#/$defs/logicRule" },
|
|
490
|
+
rule_hash: { type: "string", pattern: "^[a-f0-9]{64}$" },
|
|
491
|
+
rule_schema_id: { type: "string", minLength: 1 },
|
|
492
|
+
rule_name: { type: "string", minLength: 1 },
|
|
493
|
+
semantic_key: { type: "string", pattern: "^SEM-[A-F0-9]{24}$" },
|
|
494
|
+
claim_span_start: { type: "integer", minimum: 0 },
|
|
495
|
+
claim_span_end: { type: "integer", minimum: 0 },
|
|
198
496
|
},
|
|
199
497
|
required: [
|
|
200
498
|
"id",
|
|
@@ -206,6 +504,14 @@ const entitySchema: Record<string, unknown> = {
|
|
|
206
504
|
"type",
|
|
207
505
|
],
|
|
208
506
|
allOf: [
|
|
507
|
+
{
|
|
508
|
+
if: {
|
|
509
|
+
properties: { type: { const: "req" } },
|
|
510
|
+
},
|
|
511
|
+
else: {
|
|
512
|
+
not: { required: ["logic_claims"] },
|
|
513
|
+
},
|
|
514
|
+
},
|
|
209
515
|
// Forbid fact-only fields on non-fact entities
|
|
210
516
|
{
|
|
211
517
|
if: {
|
|
@@ -232,6 +538,8 @@ const entitySchema: Record<string, unknown> = {
|
|
|
232
538
|
{ required: ["valid_from"] },
|
|
233
539
|
{ required: ["valid_to"] },
|
|
234
540
|
{ required: ["canonical_key"] },
|
|
541
|
+
{ required: ["claim_key"] },
|
|
542
|
+
{ required: ["claim_text"] },
|
|
235
543
|
{ required: ["predicate_name"] },
|
|
236
544
|
{ required: ["predicate_namespace"] },
|
|
237
545
|
{ required: ["predicate_arity"] },
|
|
@@ -241,6 +549,13 @@ const entitySchema: Record<string, unknown> = {
|
|
|
241
549
|
{ required: ["aliases"] },
|
|
242
550
|
{ required: ["examples"] },
|
|
243
551
|
{ required: ["predicate_args"] },
|
|
552
|
+
{ required: ["rule_ir"] },
|
|
553
|
+
{ required: ["rule_hash"] },
|
|
554
|
+
{ required: ["rule_schema_id"] },
|
|
555
|
+
{ required: ["rule_name"] },
|
|
556
|
+
{ required: ["semantic_key"] },
|
|
557
|
+
{ required: ["claim_span_start"] },
|
|
558
|
+
{ required: ["claim_span_end"] },
|
|
244
559
|
],
|
|
245
560
|
},
|
|
246
561
|
},
|
|
@@ -258,6 +573,14 @@ const entitySchema: Record<string, unknown> = {
|
|
|
258
573
|
},
|
|
259
574
|
},
|
|
260
575
|
},
|
|
576
|
+
{
|
|
577
|
+
if: {
|
|
578
|
+
properties: { type: { const: "req" } },
|
|
579
|
+
},
|
|
580
|
+
else: {
|
|
581
|
+
not: { required: ["semantic_inventory"] },
|
|
582
|
+
},
|
|
583
|
+
},
|
|
261
584
|
...factConditionals,
|
|
262
585
|
],
|
|
263
586
|
additionalProperties: false,
|