kibi-cli 0.12.8 → 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 -210
- 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 +2 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +145 -152
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +12 -17
- package/dist/commands/discovery-shared.d.ts +3 -1
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +8 -209
- package/dist/commands/discovery-table.d.ts +3 -0
- package/dist/commands/discovery-table.d.ts.map +1 -0
- package/dist/commands/discovery-table.js +204 -0
- 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/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +8 -1
- package/dist/commands/sync/extraction.d.ts +6 -1
- package/dist/commands/sync/extraction.d.ts.map +1 -1
- package/dist/commands/sync/extraction.js +7 -3
- 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 +51 -2
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +18 -0
- package/dist/extractors/markdown.d.ts +20 -2
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +38 -1
- package/dist/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +73 -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/analyzer.d.ts +3 -0
- package/dist/public/impact/analyzer.d.ts.map +1 -0
- package/dist/public/impact/analyzer.js +54 -0
- package/dist/public/impact/coverage-depth-quality.d.ts +4 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -0
- package/dist/public/impact/coverage-depth-quality.js +179 -0
- package/dist/public/impact/diagnostics.d.ts +7 -0
- package/dist/public/impact/diagnostics.d.ts.map +1 -0
- package/dist/public/impact/diagnostics.js +126 -0
- package/dist/public/impact/diff-meaning.d.ts +2 -0
- package/dist/public/impact/diff-meaning.d.ts.map +1 -0
- package/dist/public/impact/diff-meaning.js +101 -0
- package/dist/public/impact/full-kb-quality.d.ts +10 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -0
- package/dist/public/impact/full-kb-quality.js +191 -0
- package/dist/public/impact/manifest.d.ts +5 -0
- package/dist/public/impact/manifest.d.ts.map +1 -0
- package/dist/public/impact/manifest.js +43 -0
- package/dist/public/impact/requirement-quality.d.ts +4 -0
- package/dist/public/impact/requirement-quality.d.ts.map +1 -0
- package/dist/public/impact/requirement-quality.js +199 -0
- package/dist/public/impact/source-changes.d.ts +5 -0
- package/dist/public/impact/source-changes.d.ts.map +1 -0
- package/dist/public/impact/source-changes.js +129 -0
- package/dist/public/impact/summaries.d.ts +6 -0
- package/dist/public/impact/summaries.d.ts.map +1 -0
- package/dist/public/impact/summaries.js +68 -0
- package/dist/public/impact/symbol-quality-model.d.ts +21 -0
- package/dist/public/impact/symbol-quality-model.d.ts.map +1 -0
- package/dist/public/impact/symbol-quality-model.js +116 -0
- package/dist/public/impact/symbol-quality.d.ts +4 -0
- package/dist/public/impact/symbol-quality.d.ts.map +1 -0
- package/dist/public/impact/symbol-quality.js +159 -0
- package/dist/public/impact/types.d.ts +79 -0
- package/dist/public/impact/types.d.ts.map +1 -0
- package/dist/public/impact/types.js +1 -0
- package/dist/public/impact-diagnostics.d.ts +7 -0
- package/dist/public/impact-diagnostics.d.ts.map +1 -0
- package/dist/public/impact-diagnostics.js +5 -0
- 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 +48 -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 +123 -95
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +107 -5
- package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +30 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +40 -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 +1 -1
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.js +2 -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 +23 -0
- package/dist/traceability/evidence-model.d.ts +1 -1
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +1 -1
- package/dist/traceability/staged-diagnostics.d.ts +6 -6
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +12 -6
- 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 +60 -27
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +58 -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 +8 -1
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/prolog-query-plan-safety.d.ts +8 -0
- package/dist/utils/prolog-query-plan-safety.d.ts.map +1 -0
- package/dist/utils/prolog-query-plan-safety.js +47 -0
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.js +18 -0
- package/package.json +60 -2
- package/schema/entities.pl +4 -0
- package/src/public/impact/analyzer.ts +90 -0
- package/src/public/impact/coverage-depth-quality.ts +268 -0
- package/src/public/impact/diagnostics.ts +199 -0
- package/src/public/impact/diff-meaning.ts +121 -0
- package/src/public/impact/full-kb-quality.ts +230 -0
- package/src/public/impact/manifest.ts +57 -0
- package/src/public/impact/requirement-quality.ts +262 -0
- package/src/public/impact/source-changes.ts +180 -0
- package/src/public/impact/summaries.ts +100 -0
- package/src/public/impact/symbol-quality-model.ts +171 -0
- package/src/public/impact/symbol-quality.ts +207 -0
- package/src/public/impact/types.ts +99 -0
- package/src/public/impact-diagnostics.ts +22 -0
- 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 +50 -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 +123 -95
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +107 -5
- package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +30 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +40 -3
- package/src/public/skills.ts +18 -427
- package/src/public/symbol-granularity.ts +4 -0
- package/src/schemas/entity.schema.json +23 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type DiagnosticTelemetry = Readonly<Record<string, unknown>>;
|
|
2
|
+
export type ValidationResult = {
|
|
3
|
+
readonly valid: true;
|
|
4
|
+
} | {
|
|
5
|
+
readonly valid: false;
|
|
6
|
+
readonly errors: readonly string[];
|
|
7
|
+
};
|
|
8
|
+
export type PreparedInputResult = {
|
|
9
|
+
readonly valid: true;
|
|
10
|
+
readonly businessInput: Readonly<Record<string, unknown>>;
|
|
11
|
+
readonly telemetry?: DiagnosticTelemetry;
|
|
12
|
+
} | {
|
|
13
|
+
readonly valid: false;
|
|
14
|
+
readonly errors: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function prepareOperationInput(input: unknown, schema: object): PreparedInputResult;
|
|
17
|
+
export declare function validateAgainstSchema(input: unknown, schema: object): ValidationResult;
|
|
18
|
+
//# sourceMappingURL=cli-validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-validate.d.ts","sourceRoot":"","sources":["../src/cli-validate.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAGpE,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GACxB;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAGlE,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CAC1C,GACD;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAiBlE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,GACb,mBAAmB,CAgCrB;AAGD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,GACb,gBAAgB,CAKlB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
function isObject(value) {
|
|
3
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function formatValidationErrors(errors) {
|
|
6
|
+
return errors.map((error) => {
|
|
7
|
+
const location = error.instancePath.length > 0 ? error.instancePath : "/";
|
|
8
|
+
const parameters = Object.values(error.params).join(", ");
|
|
9
|
+
return `${location} ${error.message ?? "is invalid"}${parameters.length > 0 ? `: ${parameters}` : ""}`;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
// implements REQ-kibi-operation-interface-parity
|
|
13
|
+
export function prepareOperationInput(input, schema) {
|
|
14
|
+
if (!isObject(input)) {
|
|
15
|
+
return { valid: false, errors: ["input must be an object"] };
|
|
16
|
+
}
|
|
17
|
+
const telemetryValue = input._diagnostic_telemetry;
|
|
18
|
+
if (telemetryValue !== undefined && !isObject(telemetryValue)) {
|
|
19
|
+
return {
|
|
20
|
+
valid: false,
|
|
21
|
+
errors: ["_diagnostic_telemetry must be an object when provided"],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const businessInput = Object.fromEntries(Object.entries(input).filter(([key]) => key !== "_diagnostic_telemetry"));
|
|
25
|
+
const schemaWithExactTopLevel = { ...schema, additionalProperties: false };
|
|
26
|
+
const validator = new Ajv({ allErrors: true, strict: false }).compile(schemaWithExactTopLevel);
|
|
27
|
+
if (!validator(businessInput)) {
|
|
28
|
+
return {
|
|
29
|
+
valid: false,
|
|
30
|
+
errors: validator.errors
|
|
31
|
+
? formatValidationErrors(validator.errors)
|
|
32
|
+
: ["input is invalid"],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return telemetryValue === undefined
|
|
36
|
+
? { valid: true, businessInput }
|
|
37
|
+
: { valid: true, businessInput, telemetry: telemetryValue };
|
|
38
|
+
}
|
|
39
|
+
// implements REQ-kibi-operation-interface-parity
|
|
40
|
+
export function validateAgainstSchema(input, schema) {
|
|
41
|
+
const result = prepareOperationInput(input, schema);
|
|
42
|
+
return result.valid
|
|
43
|
+
? { valid: true }
|
|
44
|
+
: { valid: false, errors: result.errors };
|
|
45
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export type { CommandResult } from "./cli-command.js";
|
|
3
|
+
export declare function buildProgram(): Command;
|
|
4
|
+
export declare function main(): Promise<never>;
|
|
5
5
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAmBtD,wBAAgB,YAAY,IAAI,OAAO,CAYtC;AAGD,wBAAsB,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAgB3C"}
|
package/dist/cli.js
CHANGED
|
@@ -15,218 +15,56 @@
|
|
|
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 { once } from "node:events";
|
|
18
19
|
import { readFileSync } from "node:fs";
|
|
20
|
+
import { resolve } from "node:path";
|
|
21
|
+
import { pathToFileURL } from "node:url";
|
|
19
22
|
import { Command } from "commander";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { gcCommand } from "./commands/gc.js";
|
|
26
|
-
import { graphCommand } from "./commands/graph.js";
|
|
27
|
-
import { initCommand } from "./commands/init.js";
|
|
28
|
-
import { migrateCommand } from "./commands/migrate.js";
|
|
29
|
-
import { queryCommand } from "./commands/query.js";
|
|
30
|
-
import { searchCommand } from "./commands/search.js";
|
|
31
|
-
import { skillsListCommand, skillsLoadCommand, skillsReadCommand, skillsValidateCommand, } from "./commands/skills.js";
|
|
32
|
-
import { statusCommand } from "./commands/status.js";
|
|
33
|
-
import { syncCommand } from "./commands/sync.js";
|
|
34
|
-
import { usageMetricsCommand } from "./commands/usage-metrics.js";
|
|
23
|
+
import { registerJsonOnlyCommands } from "./cli-json-command.js";
|
|
24
|
+
import { registerFoundationCommands } from "./cli-register-foundation.js";
|
|
25
|
+
import { registerMaintenanceCommands } from "./cli-register-maintenance.js";
|
|
26
|
+
import { registerReportingCommands } from "./cli-register-reporting.js";
|
|
27
|
+
import { registerSkillsCommands } from "./cli-register-skills.js";
|
|
35
28
|
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
function packageVersion(value) {
|
|
30
|
+
if (value !== null &&
|
|
31
|
+
typeof value === "object" &&
|
|
32
|
+
"version" in value &&
|
|
33
|
+
typeof value.version === "string") {
|
|
34
|
+
return value.version;
|
|
35
|
+
}
|
|
36
|
+
return "0.1.0";
|
|
37
|
+
}
|
|
38
|
+
// implements REQ-kibi-operation-interface-parity
|
|
39
|
+
export function buildProgram() {
|
|
40
|
+
const program = new Command()
|
|
41
|
+
.name("kibi")
|
|
42
|
+
.description("Prolog-based project knowledge base")
|
|
43
|
+
.version(packageVersion(packageJson));
|
|
44
|
+
registerFoundationCommands(program);
|
|
45
|
+
registerReportingCommands(program);
|
|
46
|
+
registerMaintenanceCommands(program);
|
|
47
|
+
registerSkillsCommands(program);
|
|
48
|
+
registerJsonOnlyCommands(program);
|
|
49
|
+
return program;
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}));
|
|
59
|
-
program
|
|
60
|
-
.command("migrate")
|
|
61
|
-
.description("Migrate .kb/config.json to the latest schema version")
|
|
62
|
-
.option("--dry-run", "Preview migration changes without writing files")
|
|
63
|
-
.option("--yes", "Apply migration changes without prompting")
|
|
64
|
-
.action(withExitCode(async (options) => {
|
|
65
|
-
return migrateCommand(options);
|
|
66
|
-
}));
|
|
67
|
-
program
|
|
68
|
-
.command("sync")
|
|
69
|
-
.description("Sync entities from documents")
|
|
70
|
-
.option("--validate-only", "Perform validation without mutations")
|
|
71
|
-
.option("--refresh-symbol-coordinates", "Refresh generated symbol coordinates")
|
|
72
|
-
.option("--rebuild", "Rebuild branch snapshot from scratch (discards current KB)")
|
|
73
|
-
.action(withExitCode(async (options) => {
|
|
74
|
-
return syncCommand(options);
|
|
75
|
-
}));
|
|
76
|
-
program;
|
|
77
|
-
program
|
|
78
|
-
.command("query [type]")
|
|
79
|
-
.description("Query knowledge base")
|
|
80
|
-
.option("--id <id>", "Query specific entity by ID")
|
|
81
|
-
.option("--tag <tag>", "Filter by tag")
|
|
82
|
-
.option("--source <path>", "Filter by source file path (substring match)")
|
|
83
|
-
.option("--relationships <id>", "Get relationships from entity")
|
|
84
|
-
.option("--format <format>", "Output format: json|table", "json")
|
|
85
|
-
.option("--limit <n>", "Limit results", "100")
|
|
86
|
-
.option("--offset <n>", "Skip results", "0")
|
|
87
|
-
.action(withExitCode(async (type, options) => {
|
|
88
|
-
return queryCommand(type, options);
|
|
89
|
-
}));
|
|
90
|
-
program
|
|
91
|
-
.command("search [query]")
|
|
92
|
-
.description("Search knowledge base metadata and markdown content")
|
|
93
|
-
.option("--type <type>", "Filter by entity type")
|
|
94
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
95
|
-
.option("--limit <n>", "Limit results", "20")
|
|
96
|
-
.option("--offset <n>", "Skip results", "0")
|
|
97
|
-
.action(async (query, options) => {
|
|
98
|
-
await searchCommand(query, options);
|
|
99
|
-
});
|
|
100
|
-
program
|
|
101
|
-
.command("status")
|
|
102
|
-
.description("Show KB snapshot and freshness metadata")
|
|
103
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
104
|
-
.action(async (options) => {
|
|
105
|
-
await statusCommand(options);
|
|
106
|
-
});
|
|
107
|
-
program
|
|
108
|
-
.command("gaps [type]")
|
|
109
|
-
.description("Find entities missing or present on selected relationships")
|
|
110
|
-
.option("--missing-rel <rels>", "Comma-separated missing relationship filters")
|
|
111
|
-
.option("--present-rel <rels>", "Comma-separated present relationship filters")
|
|
112
|
-
.option("--tag <tags>", "Comma-separated tag filter")
|
|
113
|
-
.option("--source <path>", "Source file substring filter")
|
|
114
|
-
.option("--limit <n>", "Limit results", "100")
|
|
115
|
-
.option("--offset <n>", "Skip results", "0")
|
|
116
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
117
|
-
.action(async (type, options) => {
|
|
118
|
-
await gapsCommand(type, options);
|
|
119
|
-
});
|
|
120
|
-
program
|
|
121
|
-
.command("coverage")
|
|
122
|
-
.description("Generate curated coverage reports")
|
|
123
|
-
.option("--by <group>", "Coverage mode: req|symbol|type", "req")
|
|
124
|
-
.option("--tag <tags>", "Comma-separated tag filter")
|
|
125
|
-
.option("--include-passing", "Include passing rows", false)
|
|
126
|
-
.option("--no-include-transitive", "Disable transitive symbol coverage")
|
|
127
|
-
.option("--limit <n>", "Limit results", "100")
|
|
128
|
-
.option("--offset <n>", "Skip results", "0")
|
|
129
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
130
|
-
.action(async (options) => {
|
|
131
|
-
await coverageCommand(options);
|
|
132
|
-
});
|
|
133
|
-
program
|
|
134
|
-
.command("graph")
|
|
135
|
-
.description("Traverse the KB graph from one or more seed IDs")
|
|
136
|
-
.option("--from <ids>", "Comma-separated seed IDs")
|
|
137
|
-
.option("--relationships <rels>", "Comma-separated relationship filter")
|
|
138
|
-
.option("--direction <direction>", "Direction: outgoing|incoming|both", "outgoing")
|
|
139
|
-
.option("--depth <n>", "Traversal depth", "1")
|
|
140
|
-
.option("--entity-types <types>", "Comma-separated entity type filter")
|
|
141
|
-
.option("--max-nodes <n>", "Maximum node count", "200")
|
|
142
|
-
.option("--max-edges <n>", "Maximum edge count", "500")
|
|
143
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
144
|
-
.action(async (options) => {
|
|
145
|
-
await graphCommand(options);
|
|
146
|
-
});
|
|
147
|
-
program
|
|
148
|
-
.command("check")
|
|
149
|
-
.description("Check KB consistency and integrity")
|
|
150
|
-
.option("--fix", "Suggest fixes for violations")
|
|
151
|
-
.option("--kb-path <dir>", "Path to KB directory (overrides branch resolution)")
|
|
152
|
-
.option("--rules <csv>", "Comma-separated allowlist of rule names to run")
|
|
153
|
-
.option("--staged", "Run check only against staged changes (experimental)")
|
|
154
|
-
.option("--min-links <n>", "Minimum number of links required for symbol coverage", "1")
|
|
155
|
-
.option("--dry-run", "Do not modify files; only print what would happen")
|
|
156
|
-
.action(withExitCode(async (options) => {
|
|
157
|
-
return checkCommand(options);
|
|
158
|
-
}));
|
|
159
|
-
program
|
|
160
|
-
.command("gc")
|
|
161
|
-
.description("Garbage collect stale branch KBs")
|
|
162
|
-
.option("--dry-run", "Preview without deleting (default)", true)
|
|
163
|
-
.option("--force", "Actually delete stale branches")
|
|
164
|
-
.action(async (options) => {
|
|
165
|
-
const dryRun = !options.force;
|
|
166
|
-
await gcCommand({ dryRun, force: options.force });
|
|
167
|
-
});
|
|
168
|
-
program
|
|
169
|
-
.command("doctor")
|
|
170
|
-
.description("Diagnose KB setup and configuration")
|
|
171
|
-
.action(withExitCode(async () => doctorCommand()));
|
|
172
|
-
program
|
|
173
|
-
.command("usage-metrics")
|
|
174
|
-
.description("Report usage and quality metrics from .kb/usage.log")
|
|
175
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
176
|
-
.option("--limit <n>", "Limit top zero-result source files", "10")
|
|
177
|
-
.action(withExitCode(async (options) => {
|
|
178
|
-
return usageMetricsCommand(options);
|
|
179
|
-
}));
|
|
180
|
-
const skillsProgram = program
|
|
181
|
-
.command("skills")
|
|
182
|
-
.description("Manage bundled markdown skills");
|
|
183
|
-
skillsProgram
|
|
184
|
-
.command("list")
|
|
185
|
-
.description("List bundled markdown skills")
|
|
186
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
187
|
-
.action(withExitCode(async (options) => {
|
|
188
|
-
return skillsListCommand(options);
|
|
189
|
-
}));
|
|
190
|
-
skillsProgram
|
|
191
|
-
.command("load")
|
|
192
|
-
.description("Load a bundled markdown skill")
|
|
193
|
-
.argument("<id>", "Bundled skill ID")
|
|
194
|
-
.option("--format <format>", "Output format: json|markdown", "markdown")
|
|
195
|
-
.action(withExitCode(async (id, options) => {
|
|
196
|
-
return skillsLoadCommand(id, options);
|
|
197
|
-
}));
|
|
198
|
-
skillsProgram
|
|
199
|
-
.command("read")
|
|
200
|
-
.description("Read a declared bundled skill resource")
|
|
201
|
-
.argument("<id>", "Bundled skill ID")
|
|
202
|
-
.argument("<resource>", "Declared resource path")
|
|
203
|
-
.option("--format <format>", "Output format: text|json", "text")
|
|
204
|
-
.action(withExitCode(async (id, resource, options) => {
|
|
205
|
-
return skillsReadCommand(id, resource, options);
|
|
206
|
-
}));
|
|
207
|
-
skillsProgram
|
|
208
|
-
.command("validate")
|
|
209
|
-
.description("Validate a bundled markdown skill path")
|
|
210
|
-
.argument("<path>", "Skill bundle directory or SKILL.md path")
|
|
211
|
-
.option("--format <format>", "Output format: json|table", "table")
|
|
212
|
-
.action(withExitCode(async (pathLike, options) => {
|
|
213
|
-
return skillsValidateCommand(pathLike, options);
|
|
214
|
-
}));
|
|
215
|
-
program
|
|
216
|
-
.command("branch")
|
|
217
|
-
.description("Manage branch KBs")
|
|
218
|
-
.argument("<action>", "Action: ensure")
|
|
219
|
-
.option("--from <branch>", "Source branch to copy KB from")
|
|
220
|
-
.action(async (action, options) => {
|
|
221
|
-
if (action === "ensure") {
|
|
222
|
-
await branchEnsureCommand(options);
|
|
51
|
+
// implements REQ-kibi-operation-interface-parity
|
|
52
|
+
export async function main() {
|
|
53
|
+
let exitCode = process.exitCode ?? 0;
|
|
54
|
+
try {
|
|
55
|
+
await buildProgram().parseAsync(process.argv);
|
|
56
|
+
exitCode = process.exitCode ?? 0;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
60
|
+
console.error(message);
|
|
61
|
+
exitCode = 1;
|
|
223
62
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
63
|
+
await Promise.all([process.stdout, process.stderr].map((stream) => stream.writableNeedDrain ? once(stream, "drain") : Promise.resolve()));
|
|
64
|
+
process.exit(exitCode);
|
|
65
|
+
}
|
|
66
|
+
const entryPath = process.argv[1];
|
|
67
|
+
if (entryPath !== undefined &&
|
|
68
|
+
import.meta.url === pathToFileURL(resolve(entryPath)).href) {
|
|
69
|
+
void main();
|
|
70
|
+
}
|
|
@@ -8,5 +8,5 @@ import type { Violation } from "./check.js";
|
|
|
8
8
|
* @param rulesAllowlist - Set of rule names to run (null = all)
|
|
9
9
|
* @param requireAdr - Whether to require ADR constraints for symbol-traceability
|
|
10
10
|
*/
|
|
11
|
-
export declare function runAggregatedChecks(prolog: PrologProcess, rulesAllowlist: Set<string> | null, requireAdr?: boolean): Promise<Violation[]>;
|
|
11
|
+
export declare function runAggregatedChecks(prolog: Pick<PrologProcess, "query">, rulesAllowlist: Set<string> | null, requireAdr?: boolean): Promise<Violation[]>;
|
|
12
12
|
//# sourceMappingURL=aggregated-checks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregated-checks.d.ts","sourceRoot":"","sources":["../../src/commands/aggregated-checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAU5C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"aggregated-checks.d.ts","sourceRoot":"","sources":["../../src/commands/aggregated-checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAU5C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EACpC,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,EAClC,UAAU,UAAQ,GACjB,OAAO,CAAC,SAAS,EAAE,CAAC,CAuDtB"}
|
|
@@ -21,44 +21,38 @@ export async function runAggregatedChecks(prolog, rulesAllowlist, requireAdr = f
|
|
|
21
21
|
-> call(checks:check_all_json_with_options(JsonString, ${requireAdrStr}))
|
|
22
22
|
; call(checks:check_all_json(JsonString))
|
|
23
23
|
))`;
|
|
24
|
+
const result = await prolog.query(query);
|
|
25
|
+
if (!result.success) {
|
|
26
|
+
throw new Error(`Aggregated checks query failed: ${result.error || "Unknown error"}`);
|
|
27
|
+
}
|
|
28
|
+
let violationsDict;
|
|
24
29
|
try {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
throw new Error(
|
|
28
|
-
}
|
|
29
|
-
let violationsDict;
|
|
30
|
-
try {
|
|
31
|
-
const jsonString = result.bindings.JsonString;
|
|
32
|
-
if (!jsonString) {
|
|
33
|
-
throw new Error("No JSON string in binding");
|
|
34
|
-
}
|
|
35
|
-
let parsed = JSON.parse(jsonString);
|
|
36
|
-
if (typeof parsed === "string") {
|
|
37
|
-
parsed = JSON.parse(parsed);
|
|
38
|
-
}
|
|
39
|
-
violationsDict = parsed;
|
|
30
|
+
const jsonString = result.bindings.JsonString;
|
|
31
|
+
if (!jsonString) {
|
|
32
|
+
throw new Error("No JSON string in binding");
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
let parsed = JSON.parse(jsonString);
|
|
35
|
+
if (typeof parsed === "string") {
|
|
36
|
+
parsed = JSON.parse(parsed);
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
violationsDict = parsed;
|
|
39
|
+
}
|
|
40
|
+
catch (parseError) {
|
|
41
|
+
throw new Error(`Failed to parse violations JSON: ${parseError instanceof Error ? parseError.message : String(parseError)}`);
|
|
42
|
+
}
|
|
43
|
+
for (const ruleViolations of Object.values(violationsDict)) {
|
|
44
|
+
for (const v of ruleViolations) {
|
|
45
|
+
const isAllowed = !rulesAllowlist || rulesAllowlist.has(v.rule);
|
|
46
|
+
if (isAllowed) {
|
|
47
|
+
violations.push({
|
|
48
|
+
rule: v.rule,
|
|
49
|
+
entityId: v.entityId,
|
|
50
|
+
description: v.description,
|
|
51
|
+
...(v.suggestion ? { suggestion: v.suggestion } : {}),
|
|
52
|
+
...(v.source ? { source: v.source } : {}),
|
|
53
|
+
});
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
return violations;
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
62
|
-
throw new Error(`Error running aggregated checks: ${message}`);
|
|
63
56
|
}
|
|
57
|
+
return violations;
|
|
64
58
|
}
|
package/dist/commands/check.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Violation } from "../utils/rule-registry.js";
|
|
2
2
|
export type { Violation };
|
|
3
3
|
export interface CheckOptions {
|
|
4
4
|
fix?: boolean;
|
|
@@ -7,6 +7,7 @@ export interface CheckOptions {
|
|
|
7
7
|
staged?: boolean;
|
|
8
8
|
minLinks?: string | number;
|
|
9
9
|
dryRun?: boolean;
|
|
10
|
+
format?: "text" | "json";
|
|
10
11
|
}
|
|
11
12
|
export declare function checkCommand(options: CheckOptions): Promise<{
|
|
12
13
|
exitCode: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,YAAY,EAAE,SAAS,EAAE,CAAC;AAG1B,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AA2bD,wBAAsB,YAAY,CAChC,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAmW/B"}
|