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,5 @@
|
|
|
1
|
+
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
|
+
import type { OperationResult } from "../../public/operations/types.js";
|
|
3
|
+
import type { UpsertInput, ValidateUpsertPayload } from "./types.js";
|
|
4
|
+
export declare function executeValidateUpsert(input: UpsertInput, context: OperationContext): Promise<OperationResult<ValidateUpsertPayload>>;
|
|
5
|
+
//# sourceMappingURL=validate-upsert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAOxE,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGrE,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAoDjD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { analyzeSemanticAdvisorInput } from "../semantic-advisor/analyze-prose.js";
|
|
2
|
+
import { validateLiveRelationshipTargets, validateRelationshipSources, } from "./relationships.js";
|
|
3
|
+
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
4
|
+
import { validateUpsertInput } from "./validation.js";
|
|
5
|
+
export async function executeValidateUpsert(input, context) {
|
|
6
|
+
try {
|
|
7
|
+
const validated = validateUpsertInput(input, context.clock());
|
|
8
|
+
validateRelationshipSources(input.id, validated.relationships);
|
|
9
|
+
await validateSymbolGranularity(validated.entity, validated.relationships, context);
|
|
10
|
+
if (context.prolog !== undefined) {
|
|
11
|
+
await validateLiveRelationshipTargets(context.prolog, validated.entity, validated.relationships);
|
|
12
|
+
}
|
|
13
|
+
const semantic = analyzeSemanticAdvisorInput({ payload: { ...input } });
|
|
14
|
+
const payload = {
|
|
15
|
+
valid: true,
|
|
16
|
+
errors: [],
|
|
17
|
+
warnings: semantic.warnings,
|
|
18
|
+
semanticAdvisor: semantic.receipt,
|
|
19
|
+
normalizedPreview: validated.entity,
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: "kb_validate_upsert: payload is valid for kb_upsert preflight checks. No mutation was performed.",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
structuredContent: payload,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
33
|
+
const payload = {
|
|
34
|
+
valid: false,
|
|
35
|
+
errors: [message],
|
|
36
|
+
warnings: [],
|
|
37
|
+
semanticAdvisor: null,
|
|
38
|
+
normalizedPreview: null,
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: `kb_validate_upsert: payload is invalid. ${message}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
structuredContent: payload,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { isAllowedGranularityReason } from "../../public/symbol-granularity.js";
|
|
2
|
+
import type { UpsertInput, ValidatedUpsert } from "./types.js";
|
|
3
|
+
export declare function validateUpsertInput(input: UpsertInput, now: Date): ValidatedUpsert;
|
|
4
|
+
export { isAllowedGranularityReason };
|
|
5
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validation.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,0BAA0B,EAC3B,MAAM,oCAAoC,CAAC;AAO5C,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAiF/D,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,IAAI,GACR,eAAe,CA0CjB;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
import entitySchema from "../../public/schemas/entity.js";
|
|
3
|
+
import relationshipSchema from "../../public/schemas/relationship.js";
|
|
4
|
+
// implements REQ-kibi-operation-interface-parity
|
|
5
|
+
import { SYMBOL_ROLES, isAllowedGranularityReason, } from "../../public/symbol-granularity.js";
|
|
6
|
+
import { semanticClaimKey } from "../semantic-advisor/clauses.js";
|
|
7
|
+
import { factKindShapeHints, validateFactModelingShape, valueFieldHint, } from "./strict-fact.js";
|
|
8
|
+
const ajv = new Ajv({ strict: false });
|
|
9
|
+
const schema = entitySchema;
|
|
10
|
+
const properties = schema.properties !== null && typeof schema.properties === "object"
|
|
11
|
+
? schema.properties
|
|
12
|
+
: {};
|
|
13
|
+
const validateEntity = ajv.compile({
|
|
14
|
+
...schema,
|
|
15
|
+
properties: {
|
|
16
|
+
...properties,
|
|
17
|
+
granularity_reason: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: [
|
|
20
|
+
"config-artifact",
|
|
21
|
+
"module-level-behavior",
|
|
22
|
+
"extractor-miss",
|
|
23
|
+
"legacy-link",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
symbol_role: { type: "string", enum: [...SYMBOL_ROLES] },
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const validateRelationship = ajv.compile(relationshipSchema);
|
|
30
|
+
const ALIASES = new Map([
|
|
31
|
+
["subjectKey", "subject_key"],
|
|
32
|
+
["propertyKey", "property_key"],
|
|
33
|
+
["predicateName", "predicate_name"],
|
|
34
|
+
["predicateArgs", "predicate_args"],
|
|
35
|
+
["canonicalKey", "canonical_key"],
|
|
36
|
+
["closedWorld", "closed_world"],
|
|
37
|
+
]);
|
|
38
|
+
function formatEntityErrors(entity, errors) {
|
|
39
|
+
const messages = errors.map((error) => {
|
|
40
|
+
const params = error.params;
|
|
41
|
+
const path = error.instancePath || "root";
|
|
42
|
+
if (error.keyword === "additionalProperties" && params.additionalProperty) {
|
|
43
|
+
const property = params.additionalProperty;
|
|
44
|
+
if (property === "value") {
|
|
45
|
+
return `${path}: unknown property 'value'. ${valueFieldHint(entity.value)} Do not use generic value in kb_upsert.properties.`;
|
|
46
|
+
}
|
|
47
|
+
const canonical = ALIASES.get(property);
|
|
48
|
+
if (canonical) {
|
|
49
|
+
return `${path}: unknown property '${property}'. Did you mean '${canonical}'? kb_upsert.properties uses snake_case typed fact fields.`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (error.keyword === "enum" && params.allowedValues) {
|
|
53
|
+
return `${path}: ${error.message}. Allowed values: ${params.allowedValues.map(String).join(", ")}`;
|
|
54
|
+
}
|
|
55
|
+
return `${path}: ${error.message}`;
|
|
56
|
+
});
|
|
57
|
+
const hints = factKindShapeHints(entity);
|
|
58
|
+
for (const [alias, canonical] of ALIASES) {
|
|
59
|
+
if (Object.hasOwn(entity, alias)) {
|
|
60
|
+
hints.push(`Unknown property '${alias}'. Use '${canonical}' in kb_upsert.properties.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (Object.hasOwn(entity, "value"))
|
|
64
|
+
hints.push(valueFieldHint(entity.value));
|
|
65
|
+
if (hints.length > 0 &&
|
|
66
|
+
(Object.hasOwn(entity, "value") ||
|
|
67
|
+
[...ALIASES.keys()].some((key) => Object.hasOwn(entity, key)))) {
|
|
68
|
+
hints.push("Next action: if starting from prose, call kb_model_requirement and apply its sequential applyPlan instead of guessing field names.");
|
|
69
|
+
}
|
|
70
|
+
return [...messages, ...hints].join("; ");
|
|
71
|
+
}
|
|
72
|
+
export function validateUpsertInput(input, now) {
|
|
73
|
+
if (!input.type || !input.id) {
|
|
74
|
+
throw new Error("'type' and 'id' are required for upsert");
|
|
75
|
+
}
|
|
76
|
+
const entity = {
|
|
77
|
+
id: input.id,
|
|
78
|
+
type: input.type,
|
|
79
|
+
...input.properties,
|
|
80
|
+
};
|
|
81
|
+
entity.created_at ??= now.toISOString();
|
|
82
|
+
entity.updated_at ??= now.toISOString();
|
|
83
|
+
entity.source ??= "mcp://kibi/upsert";
|
|
84
|
+
if (!validateEntity(entity)) {
|
|
85
|
+
throw new Error(`Entity validation failed: ${formatEntityErrors(entity, validateEntity.errors ?? [])}`);
|
|
86
|
+
}
|
|
87
|
+
validateFactModelingShape(entity);
|
|
88
|
+
if (entity.type === "fact" &&
|
|
89
|
+
typeof entity.claim_key === "string" &&
|
|
90
|
+
typeof entity.claim_text === "string") {
|
|
91
|
+
const expectedClaimKey = semanticClaimKey(entity.claim_text);
|
|
92
|
+
if (entity.claim_key !== expectedClaimKey) {
|
|
93
|
+
throw new Error(`Entity validation failed: claim_key must equal the stable key derived from claim_text (expected '${expectedClaimKey}')`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const relationships = input.relationships ?? [];
|
|
97
|
+
relationships.forEach((relationship, index) => {
|
|
98
|
+
if (!validateRelationship(relationship)) {
|
|
99
|
+
const details = (validateRelationship.errors ?? [])
|
|
100
|
+
.map((error) => `${error.instancePath || "root"}: ${error.message}`)
|
|
101
|
+
.join("; ");
|
|
102
|
+
throw new Error(`Relationship validation failed at index ${index}: ${details}`);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return { entity, relationships };
|
|
106
|
+
}
|
|
107
|
+
export { isAllowedGranularityReason };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PrologPort } from "../../public/operations/runtime-types.js";
|
|
2
|
+
import type { RelationshipInput } from "./types.js";
|
|
3
|
+
export declare function scenarioCoverageWarnings(prolog: PrologPort, relationships: readonly RelationshipInput[], entityType: string, entityId: string): Promise<readonly string[]>;
|
|
4
|
+
//# sourceMappingURL=warnings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/warnings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAc5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { escapeAtom } from "../../prolog/codec.js";
|
|
2
|
+
// implements REQ-kibi-operation-interface-parity
|
|
3
|
+
export async function scenarioCoverageWarnings(prolog, relationships, entityType, entityId) {
|
|
4
|
+
if (entityType !== "req")
|
|
5
|
+
return [];
|
|
6
|
+
for (const relationship of relationships) {
|
|
7
|
+
if (relationship.type !== "verified_by")
|
|
8
|
+
continue;
|
|
9
|
+
const result = await prolog.query(`once(kb_relationship(specified_by, '${escapeAtom(entityId)}', ScenarioId))`);
|
|
10
|
+
if (result.success) {
|
|
11
|
+
return [
|
|
12
|
+
`Scenario-backed coverage: verified_by(${entityId},test) is valid but will not satisfy symbol-coverage because ${entityId} has specified_by a scenario. Use verified_by(scenario,test) or validates(test,scenario) instead.`,
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SemanticClause } from "./clauses.js";
|
|
2
|
+
import { type Payload } from "./shared.js";
|
|
3
|
+
import type { SemanticAdvisorAnalysisResult, SemanticInterpretationResult, SemanticModelingSuggestion, SemanticProposition, SemanticShadowCue, SemanticSignal } from "./types.js";
|
|
4
|
+
export declare function buildAdvisorResult(payload: Payload, signals: readonly SemanticSignal[], modeled: boolean, suggestions: readonly SemanticModelingSuggestion[], clauses: readonly SemanticClause[], propositions: readonly SemanticProposition[], interpretations: readonly SemanticInterpretationResult[], shadowAnalysis: readonly SemanticShadowCue[]): SemanticAdvisorAnalysisResult;
|
|
5
|
+
//# sourceMappingURL=analysis-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis-receipt.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analysis-receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,KAAK,OAAO,EAA6B,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EACV,6BAA6B,EAI7B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AA0CpB,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,0BAA0B,EAAE,EAClD,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,YAAY,EAAE,SAAS,mBAAmB,EAAE,EAC5C,eAAe,EAAE,SAAS,4BAA4B,EAAE,EACxD,cAAc,EAAE,SAAS,iBAAiB,EAAE,GAC3C,6BAA6B,CA4G/B"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { payloadHash, propertiesOf } from "./shared.js";
|
|
2
|
+
function chooseLane(signals) {
|
|
3
|
+
if (signals.some(({ kind }) => kind === "numeric_cardinality" || kind === "numeric_threshold"))
|
|
4
|
+
return "strict_property";
|
|
5
|
+
if (signals.some(({ kind }) => kind === "conditional" ||
|
|
6
|
+
kind === "permission" ||
|
|
7
|
+
kind === "state_or_default"))
|
|
8
|
+
return "predicate";
|
|
9
|
+
return signals.some(({ kind }) => kind === "normative_modal")
|
|
10
|
+
? "observation_review"
|
|
11
|
+
: "none";
|
|
12
|
+
}
|
|
13
|
+
function summary(readiness, lane) {
|
|
14
|
+
if (readiness === "modeled")
|
|
15
|
+
return "Requirement declares every detected atomic claim and has logical fact links; run kb_check logic-coverage to verify each manifest entry is grounded.";
|
|
16
|
+
if (readiness === "not_applicable")
|
|
17
|
+
return "No strong machine-checkable requirement signals were detected.";
|
|
18
|
+
if (lane === "strict_property")
|
|
19
|
+
return "Requirement prose appears to contain scalar, threshold, or cardinality logic that should be modeled with strict facts.";
|
|
20
|
+
if (lane === "predicate")
|
|
21
|
+
return "Requirement prose appears to contain relational or behavioral logic that should be modeled with ontology predicates.";
|
|
22
|
+
if (lane === "rule")
|
|
23
|
+
return "Requirement prose has a typed interpretation candidate; validate and persist it as a safe kibi.logic.v1 rule.";
|
|
24
|
+
return "Requirement prose appears normative but needs review before it can participate in logic checks.";
|
|
25
|
+
}
|
|
26
|
+
// implements REQ-mcp-semantic-advisor-preflight
|
|
27
|
+
export function buildAdvisorResult(payload, signals, modeled, suggestions, clauses, propositions, interpretations, shadowAnalysis) {
|
|
28
|
+
const suggestionLane = suggestions.some(({ kind }) => kind === "strict_property")
|
|
29
|
+
? "strict_property"
|
|
30
|
+
: suggestions.some(({ kind }) => kind === "rule")
|
|
31
|
+
? "rule"
|
|
32
|
+
: suggestions.some(({ kind }) => kind === "predicate")
|
|
33
|
+
? "predicate"
|
|
34
|
+
: null;
|
|
35
|
+
const candidateLane = modeled
|
|
36
|
+
? "none"
|
|
37
|
+
: (suggestionLane ?? chooseLane(signals));
|
|
38
|
+
const readiness = modeled
|
|
39
|
+
? "modeled"
|
|
40
|
+
: candidateLane === "none"
|
|
41
|
+
? "not_applicable"
|
|
42
|
+
: "needs_modeling";
|
|
43
|
+
const tools = modeled
|
|
44
|
+
? []
|
|
45
|
+
: candidateLane === "strict_property"
|
|
46
|
+
? ["kb_model_requirement"]
|
|
47
|
+
: candidateLane === "predicate"
|
|
48
|
+
? ["kb_suggest_predicates"]
|
|
49
|
+
: candidateLane === "rule"
|
|
50
|
+
? ["kb_model_requirement"]
|
|
51
|
+
: candidateLane === "observation_review"
|
|
52
|
+
? ["kb_model_requirement", "kb_suggest_predicates"]
|
|
53
|
+
: [];
|
|
54
|
+
const expectedClaimKeys = propositions
|
|
55
|
+
.filter(({ role }) => !["rationale", "example", "subjective"].includes(role))
|
|
56
|
+
.map(({ claim_key }) => claim_key);
|
|
57
|
+
const rawDeclaredClaimKeys = propertiesOf(payload).logic_claims;
|
|
58
|
+
const declaredClaimKeys = Array.isArray(rawDeclaredClaimKeys)
|
|
59
|
+
? rawDeclaredClaimKeys.filter((value) => typeof value === "string")
|
|
60
|
+
: [];
|
|
61
|
+
const missingClaimKeys = expectedClaimKeys.filter((claimKey) => !declaredClaimKeys.includes(claimKey));
|
|
62
|
+
const unresolvedClaimKeys = propositions
|
|
63
|
+
.filter(({ status }) => ["ambiguous", "ontology_gap", "missing"].includes(status))
|
|
64
|
+
.map(({ claim_key }) => claim_key);
|
|
65
|
+
const coverageStatus = expectedClaimKeys.length === 0
|
|
66
|
+
? "not_applicable"
|
|
67
|
+
: modeled
|
|
68
|
+
? "complete"
|
|
69
|
+
: declaredClaimKeys.length === 0
|
|
70
|
+
? "unverified"
|
|
71
|
+
: "partial";
|
|
72
|
+
const receipt = {
|
|
73
|
+
version: "semantic-advisor-v2",
|
|
74
|
+
payload_hash: payloadHash(payload),
|
|
75
|
+
logic_readiness: readiness,
|
|
76
|
+
candidate_lane: candidateLane,
|
|
77
|
+
signals,
|
|
78
|
+
ambiguity_witnesses: modeled
|
|
79
|
+
? []
|
|
80
|
+
: signals
|
|
81
|
+
.filter(({ kind }) => kind === "numeric_cardinality")
|
|
82
|
+
.map((signal) => ({
|
|
83
|
+
signal_kind: signal.kind,
|
|
84
|
+
evidence: signal.evidence,
|
|
85
|
+
interpretations: [
|
|
86
|
+
"exactly",
|
|
87
|
+
"at_most",
|
|
88
|
+
"at_least",
|
|
89
|
+
"named_membership",
|
|
90
|
+
"illustrative_example",
|
|
91
|
+
],
|
|
92
|
+
message: "Numeric cardinality prose can mean an exact count, an upper/lower bound, named membership, or an example; model it explicitly before relying on contradiction checks.",
|
|
93
|
+
})),
|
|
94
|
+
propositions,
|
|
95
|
+
interpretations,
|
|
96
|
+
shadow_analysis: shadowAnalysis,
|
|
97
|
+
suggestions,
|
|
98
|
+
clauses: clauses.map((clause) => ({
|
|
99
|
+
...clause,
|
|
100
|
+
suggestion_indexes: suggestions.flatMap((suggestion, index) => suggestion.claim_key === clause.claim_key ? [index] : []),
|
|
101
|
+
})),
|
|
102
|
+
logic_coverage: {
|
|
103
|
+
status: coverageStatus,
|
|
104
|
+
expected_claim_keys: expectedClaimKeys,
|
|
105
|
+
declared_claim_keys: declaredClaimKeys,
|
|
106
|
+
missing_claim_keys: missingClaimKeys,
|
|
107
|
+
unresolved_claim_keys: unresolvedClaimKeys,
|
|
108
|
+
},
|
|
109
|
+
suggested_next_tools: tools,
|
|
110
|
+
summary: summary(readiness, candidateLane),
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
receipt,
|
|
114
|
+
warnings: readiness === "needs_modeling"
|
|
115
|
+
? [
|
|
116
|
+
`Semantic advisor: ${receipt.summary} Next action: call ${tools.join(" or ")} before treating this requirement as Prolog-checkable.`,
|
|
117
|
+
]
|
|
118
|
+
: [],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SemanticAdvisorAnalysisResult, SemanticAdvisorInput } from "./types.js";
|
|
2
|
+
export declare const SEMANTIC_ADVISOR_VERSION = "semantic-advisor-v2";
|
|
3
|
+
export { semanticClaimKey } from "./clauses.js";
|
|
4
|
+
export declare function analyzeSemanticAdvisorInput(input: SemanticAdvisorInput): SemanticAdvisorAnalysisResult;
|
|
5
|
+
//# sourceMappingURL=analyze-prose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-prose.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analyze-prose.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EACV,6BAA6B,EAC7B,oBAAoB,EAWrB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA6zBhD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,GAC1B,6BAA6B,CAuD/B"}
|