kibi-cli 0.14.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +52 -94
- 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 +1 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +9 -17
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +22 -1
- package/dist/extractors/markdown.d.ts +14 -2
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +38 -1
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +11 -1
- 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/model-requirement.d.ts +10 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
- package/dist/operations/modeling/model-requirement.js +108 -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 +104 -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 +148 -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 +88 -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 +24 -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 +61 -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 +49 -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 +134 -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 +85 -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 +67 -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 +112 -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 +271 -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 +19 -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 +18 -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 +135 -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 +9 -2
- package/dist/prolog.d.ts +5 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +82 -30
- 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 +907 -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 +20 -0
- package/dist/public/operations/index.d.ts.map +1 -0
- package/dist/public/operations/index.js +18 -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 +62 -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 +126 -0
- package/dist/public/operations/specs/modeling.d.ts.map +1 -0
- package/dist/public/operations/specs/modeling.js +117 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +233 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
- package/dist/public/operations/specs/mutation-schemas.js +267 -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 +53 -0
- package/dist/public/operations/specs/semantic.d.ts.map +1 -0
- package/dist/public/operations/specs/semantic.js +105 -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 +256 -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 +27 -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 +119 -99
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +26 -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/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 +23 -0
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +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 +38 -27
- 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 +34 -1
- package/dist/types/entities.d.ts +3 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +6 -0
- package/package.json +56 -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 +19 -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 +72 -0
- package/src/public/operations/specs/discovery.ts +126 -0
- package/src/public/operations/specs/modeling.ts +154 -0
- package/src/public/operations/specs/mutation-schemas.ts +296 -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 +135 -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 +27 -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 +119 -99
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +26 -3
- package/src/public/skills.ts +18 -427
- package/src/schemas/entity.schema.json +23 -0
package/dist/commands/check.js
CHANGED
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { existsSync
|
|
18
|
+
import { existsSync } from "node:fs";
|
|
19
19
|
import * as path from "node:path";
|
|
20
20
|
import { getBranchOverride, isCliTraceOrDebugEnabled } from "../env.js";
|
|
21
21
|
import { extractFromManifest, extractFromManifestString, } from "../extractors/manifest.js";
|
|
22
22
|
import { extractFromMarkdownString, } from "../extractors/markdown.js";
|
|
23
|
-
import { PrologProcess
|
|
23
|
+
import { PrologProcess } from "../prolog.js";
|
|
24
24
|
import { escapeAtom, parseTriples, parseViolationRows, } from "../prolog/codec.js";
|
|
25
|
-
import {
|
|
25
|
+
import { createSemanticReviewDiagnostics, createSymbolGranularityDiagnostics, createSymbolQualityDiagnostics, hasBlockingImpactDiagnostics, } from "../public/impact-diagnostics.js";
|
|
26
|
+
import { executeCheck } from "../public/operations/check-executor.js";
|
|
26
27
|
import { KIBI_NO_IMPACT_DECLARATION, KIBI_SYMBOLS_MANIFEST_PATH, } from "../traceability/evidence-model.js";
|
|
27
28
|
import { getStagedFiles } from "../traceability/git-staged.js";
|
|
28
29
|
import { validateStagedMarkdown } from "../traceability/markdown-validate.js";
|
|
@@ -34,21 +35,7 @@ import { cleanupTempKb, consultOverlay, createOverlayFacts, createTempKb, projec
|
|
|
34
35
|
import { formatViolations as formatStagedViolations, validateStagedSymbols, } from "../traceability/validate.js";
|
|
35
36
|
import { loadConfig } from "../utils/config.js";
|
|
36
37
|
import { safeCleanupProlog } from "../utils/prolog-cleanup.js";
|
|
37
|
-
import { analyzePrologQueryPlanSafety } from "../utils/prolog-query-plan-safety.js";
|
|
38
|
-
import { RULES, getEffectiveRules, } from "../utils/rule-registry.js";
|
|
39
|
-
import { runAggregatedChecks } from "./aggregated-checks.js";
|
|
40
38
|
import { getCurrentBranch } from "./init-helpers.js";
|
|
41
|
-
function collectQueryPlanSafetyViolations() {
|
|
42
|
-
const checksPlPath = path.join(path.dirname(resolveKbPlPath()), "checks.pl");
|
|
43
|
-
const source = readFileSync(checksPlPath, "utf8");
|
|
44
|
-
return analyzePrologQueryPlanSafety(source).map((violation) => ({
|
|
45
|
-
rule: "query-plan-safety",
|
|
46
|
-
entityId: violation.predicate,
|
|
47
|
-
description: violation.description,
|
|
48
|
-
suggestion: violation.suggestion,
|
|
49
|
-
source: `${checksPlPath}:${violation.line}`,
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
39
|
function getMatchGroup(match, index = 1) {
|
|
53
40
|
const value = match?.[index];
|
|
54
41
|
return typeof value === "string" ? value : null;
|
|
@@ -58,6 +45,27 @@ function buildManifestLookup(stagedFiles) {
|
|
|
58
45
|
const manifestResults = [];
|
|
59
46
|
const authoredSymbolResults = [];
|
|
60
47
|
const stagedAuthoredSymbolResults = [];
|
|
48
|
+
const makeLookupKey = (entry) => {
|
|
49
|
+
if (typeof entry.entity.id === "string" && entry.entity.id.length > 0) {
|
|
50
|
+
return `id:${entry.entity.id}`;
|
|
51
|
+
}
|
|
52
|
+
return `fallback:${entry.sourceFile ?? entry.entity.source ?? ""}\u0000${entry.entity.title}`;
|
|
53
|
+
};
|
|
54
|
+
const authoredSymbolIndexByKey = new Map();
|
|
55
|
+
const manifestResultIndexByKey = new Map();
|
|
56
|
+
const stagedAuthoredSymbolIndexByKey = new Map();
|
|
57
|
+
const upsertResult = (results, indexByKey, result, preferNew = false) => {
|
|
58
|
+
const key = makeLookupKey(result);
|
|
59
|
+
const existingIndex = indexByKey.get(key);
|
|
60
|
+
if (existingIndex === undefined) {
|
|
61
|
+
indexByKey.set(key, results.length);
|
|
62
|
+
results.push(result);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (preferNew) {
|
|
66
|
+
results[existingIndex] = result;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
61
69
|
// Pre-populate lookup from working-tree manifests so that code-only changes
|
|
62
70
|
// (where symbols.yaml is not staged) still resolve to the correct symbol IDs
|
|
63
71
|
// and relationships already defined on disk.
|
|
@@ -69,7 +77,7 @@ function buildManifestLookup(stagedFiles) {
|
|
|
69
77
|
try {
|
|
70
78
|
const entries = extractFromManifest(absSymbolsPath);
|
|
71
79
|
for (const entry of entries) {
|
|
72
|
-
authoredSymbolResults
|
|
80
|
+
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, entry);
|
|
73
81
|
const sourceFile = entry.sourceFile || entry.entity.source || absSymbolsPath;
|
|
74
82
|
const key = `${sourceFile}:${entry.entity.title}`;
|
|
75
83
|
manifestLookup.set(key, {
|
|
@@ -107,22 +115,23 @@ function buildManifestLookup(stagedFiles) {
|
|
|
107
115
|
try {
|
|
108
116
|
const entries = extractFromManifestString(manifestFile.content ?? "", manifestFile.path);
|
|
109
117
|
for (const entry of entries) {
|
|
110
|
-
|
|
118
|
+
const authoredSymbolResult = {
|
|
111
119
|
entity: entry.entity,
|
|
112
120
|
relationships: entry.relationships,
|
|
113
121
|
...(entry.sourceFile !== undefined
|
|
114
122
|
? { sourceFile: entry.sourceFile }
|
|
115
123
|
: {}),
|
|
116
|
-
}
|
|
117
|
-
const
|
|
124
|
+
};
|
|
125
|
+
const manifestResult = {
|
|
118
126
|
entity: entry.entity,
|
|
119
127
|
relationships: entry.relationships,
|
|
120
128
|
...(entry.sourceFile !== undefined
|
|
121
129
|
? { sourceFile: entry.sourceFile }
|
|
122
130
|
: {}),
|
|
123
131
|
};
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
upsertResult(manifestResults, manifestResultIndexByKey, manifestResult, true);
|
|
133
|
+
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, authoredSymbolResult, true);
|
|
134
|
+
upsertResult(stagedAuthoredSymbolResults, stagedAuthoredSymbolIndexByKey, authoredSymbolResult);
|
|
126
135
|
const sourceFile = entry.sourceFile || entry.entity.source || manifestFile.path;
|
|
127
136
|
const key = `${sourceFile}:${entry.entity.title}`;
|
|
128
137
|
manifestLookup.set(key, {
|
|
@@ -325,12 +334,12 @@ function buildStagedKibiImpactEvidence(options) {
|
|
|
325
334
|
rationale: parsedOverride.rationale ?? "",
|
|
326
335
|
};
|
|
327
336
|
}
|
|
328
|
-
if (stagedAuthoredSymbolsEvidence.
|
|
337
|
+
if (stagedAuthoredSymbolsEvidence.changedEntityIds.length > 0) {
|
|
329
338
|
resolvedKbArtifacts.push({
|
|
330
339
|
kind: "symbols_manifest",
|
|
331
340
|
path: stagedAuthoredSymbolsEvidence.path,
|
|
332
341
|
entityTypes: ["symbol"],
|
|
333
|
-
entityIds:
|
|
342
|
+
entityIds: stagedAuthoredSymbolsEvidence.changedEntityIds,
|
|
334
343
|
sourcePaths: uniqueSorted(stagedAuthoredSymbolsEvidence.entries.map((entry) => entry.sourcePath)),
|
|
335
344
|
});
|
|
336
345
|
}
|
|
@@ -450,9 +459,8 @@ export async function checkCommand(options) {
|
|
|
450
459
|
.filter((artifact) => artifact.kind === "symbols_manifest")
|
|
451
460
|
.flatMap((artifact) => artifact.entityIds)
|
|
452
461
|
: []);
|
|
453
|
-
const stagedAuthoredSymbolSet = new Set(stagedAuthoredSymbolResults);
|
|
454
462
|
const stagedSourcePaths = new Set(sourceFiles.map((file) => file.path));
|
|
455
|
-
const activeGranularityResults = authoredSymbolResults.filter((result) =>
|
|
463
|
+
const activeGranularityResults = authoredSymbolResults.filter((result) => activeStagedSymbolEntityIds.has(result.entity.id) ||
|
|
456
464
|
(result.sourceFile !== undefined &&
|
|
457
465
|
stagedSourcePaths.has(result.sourceFile)));
|
|
458
466
|
stagedKibiDiagnostics.push(...createSymbolGranularityDiagnostics({
|
|
@@ -566,77 +574,27 @@ export async function checkCommand(options) {
|
|
|
566
574
|
return { exitCode: 1 };
|
|
567
575
|
}
|
|
568
576
|
attached = true;
|
|
569
|
-
const violations = [];
|
|
570
|
-
const config = loadConfig(process.cwd());
|
|
571
|
-
const checksConfig = config.checks ?? {
|
|
572
|
-
rules: Object.fromEntries(RULES.map((r) => [r.name, true])),
|
|
573
|
-
symbolTraceability: { requireAdr: false },
|
|
574
|
-
};
|
|
575
|
-
const effectiveRules = getEffectiveRules(checksConfig.rules, options.rules);
|
|
576
|
-
// Helper to conditionally run a check by name
|
|
577
|
-
async function runCheck(name, fn, ...args) {
|
|
578
|
-
if (!effectiveRules.has(name))
|
|
579
|
-
return;
|
|
580
|
-
if (!prolog) {
|
|
581
|
-
throw new Error("Prolog process not initialized");
|
|
582
|
-
}
|
|
583
|
-
const res = await fn(prolog, ...args);
|
|
584
|
-
if (res?.length)
|
|
585
|
-
violations.push(...res);
|
|
586
|
-
}
|
|
587
577
|
if (!prolog) {
|
|
588
578
|
throw new Error("Prolog process not initialized");
|
|
589
579
|
}
|
|
590
580
|
const activeProlog = prolog;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
];
|
|
608
|
-
const canUseAggregated = Array.from(effectiveRules).every((r) => supportedRules.includes(r));
|
|
609
|
-
if (canUseAggregated) {
|
|
610
|
-
// Fast path: single Prolog call returning all violations
|
|
611
|
-
// Pass the requireAdr option for symbol-traceability
|
|
612
|
-
const aggregatedViolations = await runAggregatedChecks(activeProlog, effectiveRules, checksConfig.symbolTraceability?.requireAdr ?? false);
|
|
613
|
-
violations.push(...aggregatedViolations);
|
|
614
|
-
}
|
|
615
|
-
else {
|
|
616
|
-
// Legacy path: individual checks for backward compatibility
|
|
617
|
-
await runCheck("must-priority-coverage", checkMustPriorityCoverage);
|
|
618
|
-
await runCheck("symbol-coverage", checkSymbolCoverage);
|
|
619
|
-
await runCheck("symbol-traceability", (p) => checkSymbolTraceability(p, checksConfig.symbolTraceability?.requireAdr ?? false));
|
|
620
|
-
await runCheck("no-dangling-refs", checkNoDanglingRefs);
|
|
621
|
-
await runCheck("no-cycles", checkNoCycles);
|
|
622
|
-
const allEntityIds = await getAllEntityIds(activeProlog);
|
|
623
|
-
if (effectiveRules.has("required-fields")) {
|
|
624
|
-
const requiredViolations = await checkRequiredFields(activeProlog, allEntityIds);
|
|
625
|
-
violations.push(...requiredViolations);
|
|
626
|
-
}
|
|
627
|
-
await runCheck("deprecated-adr-no-successor", checkDeprecatedAdrs);
|
|
628
|
-
await runCheck("domain-contradictions", checkDomainContradictions);
|
|
629
|
-
await runCheck("strict-fact-shape", checkStrictFactShape);
|
|
630
|
-
await runCheck("strict-req-fact-pairing", checkStrictReqFactPairing);
|
|
631
|
-
await runCheck("strict-readiness", checkStrictReadiness);
|
|
632
|
-
}
|
|
633
|
-
if (effectiveRules.has("query-plan-safety")) {
|
|
634
|
-
violations.push(...collectQueryPlanSafetyViolations());
|
|
635
|
-
}
|
|
636
|
-
const qualityDiagnostics = await collectFullKbQualityDiagnostics({
|
|
637
|
-
prolog: activeProlog,
|
|
638
|
-
hardViolationEntityIds: new Set(violations.map((violation) => violation.entityId)),
|
|
639
|
-
});
|
|
581
|
+
const rules = options.rules
|
|
582
|
+
?.split(",")
|
|
583
|
+
.map((rule) => rule.trim())
|
|
584
|
+
.filter((rule) => rule.length > 0);
|
|
585
|
+
const result = await executeCheck(rules === undefined ? {} : { rules }, {
|
|
586
|
+
workspaceRoot: process.cwd(),
|
|
587
|
+
signal: new AbortController().signal,
|
|
588
|
+
clock: () => new Date(),
|
|
589
|
+
prolog: {
|
|
590
|
+
query: (goal) => activeProlog.query(goal),
|
|
591
|
+
nextSolution: async () => null,
|
|
592
|
+
invalidateCache: () => activeProlog.invalidateCache(),
|
|
593
|
+
save: () => activeProlog.query("kb_save"),
|
|
594
|
+
},
|
|
595
|
+
}, { collectFullQualityDiagnosticsForExplicitRules: true });
|
|
596
|
+
const violations = result.structuredContent?.violations ?? [];
|
|
597
|
+
const qualityDiagnostics = result.structuredContent?.qualityDiagnostics ?? [];
|
|
640
598
|
if (options.format === "json") {
|
|
641
599
|
printStructuredCheckResult({ violations, qualityDiagnostics });
|
|
642
600
|
return { exitCode: violations.length === 0 ? 0 : 1 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/commands/coverage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/commands/coverage.ts"],"names":[],"mappings":"AAMA,UAAU,eAAe;IACvB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAGD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB7E"}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { coverageSpec } from "../public/operations/index.js";
|
|
2
|
+
import { executeReportingSpec, printDiscoveryResult, } from "./discovery-shared.js";
|
|
3
3
|
// implements REQ-002, REQ-003
|
|
4
4
|
export async function coverageCommand(options) {
|
|
5
|
-
await
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
? `[${options.tag
|
|
5
|
+
const result = await executeReportingSpec(coverageSpec, {
|
|
6
|
+
by: options.by ?? "req",
|
|
7
|
+
tags: options.tag
|
|
8
|
+
? options.tag
|
|
10
9
|
.split(",")
|
|
11
10
|
.map((item) => item.trim())
|
|
12
11
|
.filter(Boolean)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const limit = Number.parseInt(options.limit || "100", 10);
|
|
19
|
-
const offset = Number.parseInt(options.offset || "0", 10);
|
|
20
|
-
const result = await runJsonModuleQuery(prolog, "discovery.pl", `discovery:coverage_report_json('${by}', ${tags}, ${includePassing}, ${includeTransitive}, ${limit}, ${offset}, JsonString)`, "coverage query failed", kbPath);
|
|
21
|
-
const summary = (result.summary ?? {});
|
|
22
|
-
printDiscoveryResult(options.format, result, `Coverage summary: ${summary.fullyCovered ?? 0} fully covered out of ${summary.total ?? 0}.`);
|
|
12
|
+
: [],
|
|
13
|
+
includePassing: options.includePassing ?? false,
|
|
14
|
+
includeTransitive: options.includeTransitive ?? true,
|
|
15
|
+
limit: Number.parseInt(options.limit || "100", 10),
|
|
16
|
+
offset: Number.parseInt(options.offset || "0", 10),
|
|
23
17
|
});
|
|
18
|
+
printDiscoveryResult(options.format, result.structuredContent, result.content[0]?.text ?? "Coverage summary unavailable.");
|
|
24
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PrologProcess, resolveKbPlPath } from "../prolog.js";
|
|
2
|
+
import { type OperationSpec, type RuntimeOptions } from "../public/operations/index.js";
|
|
2
3
|
export { renderCoverageTable } from "./discovery-table.js";
|
|
3
4
|
export interface DiscoveryCommandOptions {
|
|
4
5
|
format?: "json" | "table";
|
|
@@ -10,8 +11,8 @@ export interface DiscoveryDeps {
|
|
|
10
11
|
}) => PrologProcess;
|
|
11
12
|
resolveKbPl: typeof resolveKbPlPath;
|
|
12
13
|
}
|
|
14
|
+
export declare function executeReportingSpec<TInput, TOutput>(spec: OperationSpec<TInput, TOutput>, input: TInput, options?: RuntimeOptions): Promise<import("../public/operations/types.js").OperationResult<TOutput>>;
|
|
13
15
|
export declare function withAttachedBranchProlog<T>(callback: (prolog: PrologProcess) => Promise<T>, deps?: Partial<DiscoveryDeps>): Promise<T>;
|
|
14
|
-
export declare function withPrologProcess<T>(callback: (prolog: PrologProcess) => Promise<T>, deps?: Partial<DiscoveryDeps>): Promise<T>;
|
|
15
16
|
export declare function resolveCurrentKbPath(): Promise<string>;
|
|
16
17
|
export declare function resolveCoreModulePath(fileName: string, deps?: Partial<DiscoveryDeps>): string;
|
|
17
18
|
export declare function runJsonModuleQuery<T>(prolog: PrologProcess, fileName: string, goal: string, errorLabel: string, kbPath?: string, deps?: Partial<DiscoveryDeps>): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-shared.d.ts","sourceRoot":"","sources":["../../src/commands/discovery-shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery-shared.d.ts","sourceRoot":"","sources":["../../src/commands/discovery-shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EAEpB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,aAAa,CAAC;IAC3D,WAAW,EAAE,OAAO,eAAe,CAAC;CACrC;AAGD,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EACxD,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,cAAmB,6EAG7B;AAGD,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,EAC/C,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CAmCZ;AAID,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAS5D;AAGD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,MAAM,CAGR;AAGD,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CAwBZ;AAGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,EACpC,UAAU,EAAE,OAAO,EACnB,YAAY,EAAE,MAAM,GACnB,IAAI,CAQN"}
|
|
@@ -2,10 +2,16 @@ import path from "node:path";
|
|
|
2
2
|
import { getBranchOverride } from "../env.js";
|
|
3
3
|
import { PrologProcess, resolveKbPlPath } from "../prolog.js";
|
|
4
4
|
import { escapeAtom } from "../prolog/codec.js";
|
|
5
|
+
import { executeOperation, } from "../public/operations/index.js";
|
|
6
|
+
import { createCliRuntime } from "../runtime/cli-runtime.js";
|
|
5
7
|
import { safeCleanupProlog } from "../utils/prolog-cleanup.js";
|
|
6
8
|
import { renderDiscoveryTable } from "./discovery-table.js";
|
|
7
9
|
import { getCurrentBranch } from "./init-helpers.js";
|
|
8
10
|
export { renderCoverageTable } from "./discovery-table.js";
|
|
11
|
+
// implements REQ-kibi-operation-interface-parity
|
|
12
|
+
export async function executeReportingSpec(spec, input, options = {}) {
|
|
13
|
+
return executeOperation(createCliRuntime(options), spec, input, options);
|
|
14
|
+
}
|
|
9
15
|
// implements REQ-003
|
|
10
16
|
export async function withAttachedBranchProlog(callback, deps) {
|
|
11
17
|
const createProlog = deps?.createProlog ?? ((opts) => new PrologProcess(opts));
|
|
@@ -35,24 +41,6 @@ export async function withAttachedBranchProlog(callback, deps) {
|
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
// implements REQ-003
|
|
38
|
-
export async function withPrologProcess(callback, deps) {
|
|
39
|
-
const createProlog = deps?.createProlog ?? ((opts) => new PrologProcess(opts));
|
|
40
|
-
const prolog = createProlog({ timeout: 120000 });
|
|
41
|
-
try {
|
|
42
|
-
await prolog.start();
|
|
43
|
-
// NOTE: useOneShotMode is an internal optimization flag on PrologProcess that
|
|
44
|
-
// forces single-query mode (start → query → terminate per call) instead of the
|
|
45
|
-
// default interactive session. It is not exposed in the public PrologProcess
|
|
46
|
-
// type because callers should not set it directly — only internal discovery
|
|
47
|
-
// helpers use it for lightweight one-shot queries that don't need session state.
|
|
48
|
-
prolog.useOneShotMode = true;
|
|
49
|
-
await prolog.query("set_prolog_flag(answer_write_options, [max_depth(0), spacing(next_argument)])");
|
|
50
|
-
return await callback(prolog);
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
await safeCleanupProlog(prolog);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
44
|
// implements REQ-003
|
|
57
45
|
export async function resolveCurrentKbPath() {
|
|
58
46
|
let branch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaps.d.ts","sourceRoot":"","sources":["../../src/commands/gaps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gaps.d.ts","sourceRoot":"","sources":["../../src/commands/gaps.ts"],"names":[],"mappings":"AAMA,UAAU,WAAW;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAGD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAef"}
|
package/dist/commands/gaps.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { findGapsSpec } from "../public/operations/index.js";
|
|
2
|
+
import { executeReportingSpec, printDiscoveryResult, } from "./discovery-shared.js";
|
|
3
3
|
// implements REQ-002, REQ-003
|
|
4
4
|
export async function gapsCommand(type, options) {
|
|
5
|
-
await
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const typeArg = type ? `'${escapeAtom(type)}'` : "none";
|
|
14
|
-
const result = await runJsonModuleQuery(prolog, "discovery.pl", `discovery:find_gaps_json(${typeArg}, ${missing}, ${present}, ${tags}, ${source}, ${limit}, ${offset}, JsonString)`, "gaps query failed", kbPath);
|
|
15
|
-
printDiscoveryResult(options.format, result, `Found ${result.count ?? 0} gap rows.`);
|
|
5
|
+
const result = await executeReportingSpec(findGapsSpec, {
|
|
6
|
+
...(type === undefined ? {} : { type }),
|
|
7
|
+
missingRelationships: csvValues(options.missingRel),
|
|
8
|
+
presentRelationships: csvValues(options.presentRel),
|
|
9
|
+
tags: csvValues(options.tag),
|
|
10
|
+
...(options.source === undefined ? {} : { sourceFile: options.source }),
|
|
11
|
+
limit: Number.parseInt(options.limit || "100", 10),
|
|
12
|
+
offset: Number.parseInt(options.offset || "0", 10),
|
|
16
13
|
});
|
|
14
|
+
printDiscoveryResult(options.format, result.structuredContent, result.content[0]?.text ?? "No matching gaps found.");
|
|
17
15
|
}
|
|
18
|
-
function
|
|
16
|
+
function csvValues(value) {
|
|
19
17
|
if (!value?.trim()) {
|
|
20
|
-
return
|
|
18
|
+
return [];
|
|
21
19
|
}
|
|
22
|
-
return
|
|
20
|
+
return value
|
|
23
21
|
.split(",")
|
|
24
22
|
.map((item) => item.trim())
|
|
25
|
-
.filter(Boolean)
|
|
26
|
-
.map((item) => `'${escapeAtom(item)}'`)
|
|
27
|
-
.join(",")}]`;
|
|
23
|
+
.filter(Boolean);
|
|
28
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AAMA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAGD,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBvE"}
|
package/dist/commands/graph.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { graphSpec } from "../public/operations/index.js";
|
|
2
|
+
import { executeReportingSpec, printDiscoveryResult, } from "./discovery-shared.js";
|
|
3
3
|
// implements REQ-002, REQ-003
|
|
4
4
|
export async function graphCommand(options) {
|
|
5
5
|
if (!options.from?.trim()) {
|
|
@@ -7,29 +7,23 @@ export async function graphCommand(options) {
|
|
|
7
7
|
process.exitCode = 1;
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
await
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const maxEdges = Number.parseInt(options.maxEdges || "500", 10);
|
|
19
|
-
const result = await runJsonModuleQuery(prolog, "discovery.pl", `discovery:graph_expand_json(${seedIds}, ${relationships}, '${direction}', ${depth}, ${entityTypes}, ${maxNodes}, ${maxEdges}, JsonString)`, "graph query failed", kbPath);
|
|
20
|
-
const nodes = Array.isArray(result.nodes) ? result.nodes.length : 0;
|
|
21
|
-
const edges = Array.isArray(result.edges) ? result.edges.length : 0;
|
|
22
|
-
printDiscoveryResult(options.format, result, `Graph traversal returned ${nodes} nodes and ${edges} edges.`);
|
|
10
|
+
const result = await executeReportingSpec(graphSpec, {
|
|
11
|
+
seedIds: csvValues(options.from),
|
|
12
|
+
relationships: csvValues(options.relationships),
|
|
13
|
+
direction: options.direction ?? "outgoing",
|
|
14
|
+
depth: Number.parseInt(options.depth || "1", 10),
|
|
15
|
+
entityTypes: csvValues(options.entityTypes),
|
|
16
|
+
maxNodes: Number.parseInt(options.maxNodes || "200", 10),
|
|
17
|
+
maxEdges: Number.parseInt(options.maxEdges || "500", 10),
|
|
23
18
|
});
|
|
19
|
+
printDiscoveryResult(options.format, result.structuredContent, result.content[0]?.text ?? "Graph traversal returned no nodes.");
|
|
24
20
|
}
|
|
25
|
-
function
|
|
21
|
+
function csvValues(value) {
|
|
26
22
|
if (!value?.trim()) {
|
|
27
|
-
return
|
|
23
|
+
return [];
|
|
28
24
|
}
|
|
29
|
-
return
|
|
25
|
+
return value
|
|
30
26
|
.split(",")
|
|
31
27
|
.map((item) => item.trim())
|
|
32
|
-
.filter(Boolean)
|
|
33
|
-
.map((item) => `'${escapeAtom(item)}'`)
|
|
34
|
-
.join(",")}]`;
|
|
28
|
+
.filter(Boolean);
|
|
35
29
|
}
|
package/dist/commands/query.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
interface QueryOptions {
|
|
2
|
-
id?: string;
|
|
3
|
-
tag?: string;
|
|
4
|
-
source?: string;
|
|
5
|
-
relationships?: string;
|
|
6
|
-
format?: "json" | "table";
|
|
7
|
-
limit?: string;
|
|
8
|
-
offset?: string;
|
|
2
|
+
readonly id?: string;
|
|
3
|
+
readonly tag?: string;
|
|
4
|
+
readonly source?: string;
|
|
5
|
+
readonly relationships?: string;
|
|
6
|
+
readonly format?: "json" | "table";
|
|
7
|
+
readonly limit?: string;
|
|
8
|
+
readonly offset?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare function queryCommand(type: string | undefined, options: QueryOptions): Promise<{
|
|
11
11
|
exitCode: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/commands/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/commands/query.ts"],"names":[],"mappings":"AAqBA,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA+C/B"}
|