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
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
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,8 +35,6 @@ 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 { RULES, getEffectiveRules, } from "../utils/rule-registry.js";
|
|
38
|
-
import { runAggregatedChecks } from "./aggregated-checks.js";
|
|
39
38
|
import { getCurrentBranch } from "./init-helpers.js";
|
|
40
39
|
function getMatchGroup(match, index = 1) {
|
|
41
40
|
const value = match?.[index];
|
|
@@ -46,6 +45,27 @@ function buildManifestLookup(stagedFiles) {
|
|
|
46
45
|
const manifestResults = [];
|
|
47
46
|
const authoredSymbolResults = [];
|
|
48
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
|
+
};
|
|
49
69
|
// Pre-populate lookup from working-tree manifests so that code-only changes
|
|
50
70
|
// (where symbols.yaml is not staged) still resolve to the correct symbol IDs
|
|
51
71
|
// and relationships already defined on disk.
|
|
@@ -57,7 +77,7 @@ function buildManifestLookup(stagedFiles) {
|
|
|
57
77
|
try {
|
|
58
78
|
const entries = extractFromManifest(absSymbolsPath);
|
|
59
79
|
for (const entry of entries) {
|
|
60
|
-
authoredSymbolResults
|
|
80
|
+
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, entry);
|
|
61
81
|
const sourceFile = entry.sourceFile || entry.entity.source || absSymbolsPath;
|
|
62
82
|
const key = `${sourceFile}:${entry.entity.title}`;
|
|
63
83
|
manifestLookup.set(key, {
|
|
@@ -95,22 +115,23 @@ function buildManifestLookup(stagedFiles) {
|
|
|
95
115
|
try {
|
|
96
116
|
const entries = extractFromManifestString(manifestFile.content ?? "", manifestFile.path);
|
|
97
117
|
for (const entry of entries) {
|
|
98
|
-
|
|
118
|
+
const authoredSymbolResult = {
|
|
99
119
|
entity: entry.entity,
|
|
100
120
|
relationships: entry.relationships,
|
|
101
121
|
...(entry.sourceFile !== undefined
|
|
102
122
|
? { sourceFile: entry.sourceFile }
|
|
103
123
|
: {}),
|
|
104
|
-
}
|
|
105
|
-
const
|
|
124
|
+
};
|
|
125
|
+
const manifestResult = {
|
|
106
126
|
entity: entry.entity,
|
|
107
127
|
relationships: entry.relationships,
|
|
108
128
|
...(entry.sourceFile !== undefined
|
|
109
129
|
? { sourceFile: entry.sourceFile }
|
|
110
130
|
: {}),
|
|
111
131
|
};
|
|
112
|
-
|
|
113
|
-
|
|
132
|
+
upsertResult(manifestResults, manifestResultIndexByKey, manifestResult, true);
|
|
133
|
+
upsertResult(authoredSymbolResults, authoredSymbolIndexByKey, authoredSymbolResult, true);
|
|
134
|
+
upsertResult(stagedAuthoredSymbolResults, stagedAuthoredSymbolIndexByKey, authoredSymbolResult);
|
|
114
135
|
const sourceFile = entry.sourceFile || entry.entity.source || manifestFile.path;
|
|
115
136
|
const key = `${sourceFile}:${entry.entity.title}`;
|
|
116
137
|
manifestLookup.set(key, {
|
|
@@ -137,70 +158,6 @@ function buildManifestLookup(stagedFiles) {
|
|
|
137
158
|
stagedAuthoredSymbolResults,
|
|
138
159
|
};
|
|
139
160
|
}
|
|
140
|
-
function hasTraceabilityRelationship(result) {
|
|
141
|
-
return result.relationships.some((relationship) => isTraceabilityRelationshipType(relationship.type));
|
|
142
|
-
}
|
|
143
|
-
function hasValidGranularityReason(result) {
|
|
144
|
-
return isAllowedGranularityReason(result.entity.granularity_reason);
|
|
145
|
-
}
|
|
146
|
-
function createSymbolGranularityDiagnostics(options) {
|
|
147
|
-
const diagnostics = [];
|
|
148
|
-
for (const result of options.manifestResults) {
|
|
149
|
-
if (!result.sourceFile)
|
|
150
|
-
continue;
|
|
151
|
-
if (!hasTraceabilityRelationship(result))
|
|
152
|
-
continue;
|
|
153
|
-
if (hasValidGranularityReason(result))
|
|
154
|
-
continue;
|
|
155
|
-
const granularSymbols = getGranularSymbolsForSourceFile(result.sourceFile, options.symbolsByFile, options.sourceContentByFile);
|
|
156
|
-
if (granularSymbols.length === 0)
|
|
157
|
-
continue;
|
|
158
|
-
const granularNames = [
|
|
159
|
-
...new Set(granularSymbols.map((s) => s.name)),
|
|
160
|
-
].sort();
|
|
161
|
-
if (granularNames.includes(result.entity.title))
|
|
162
|
-
continue;
|
|
163
|
-
const behavioralNames = getBehavioralSymbolNames(granularSymbols);
|
|
164
|
-
if (behavioralNames.length === 0)
|
|
165
|
-
continue;
|
|
166
|
-
const nonBehavioralNames = getNonBehavioralSymbolNames(granularSymbols);
|
|
167
|
-
const ignoredSymbolsSuggestion = nonBehavioralNames.length > 0
|
|
168
|
-
? ` Non-behavioral symbols ignored for this decision: ${nonBehavioralNames.join(", ")}.`
|
|
169
|
-
: "";
|
|
170
|
-
diagnostics.push({
|
|
171
|
-
id: "symbol_granularity_violation",
|
|
172
|
-
severity: "error",
|
|
173
|
-
files: [result.entity.source, result.sourceFile],
|
|
174
|
-
docs: ["docs/symbol-traceability-taxonomy.md"],
|
|
175
|
-
message: `Symbol ${result.entity.id} links ${result.sourceFile} coarsely while granular symbols are available (behavioral only): ${behavioralNames.join(", ")}`,
|
|
176
|
-
suggestion: `Move ownership/coverage/test relationships to the narrow behavioral symbol, add a manifest behavioral anchor, or add granularity_reason with config-artifact, module-level-behavior, extractor-miss, or legacy-link when the coarse symbol is intentional.${ignoredSymbolsSuggestion}`,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
return diagnostics;
|
|
180
|
-
}
|
|
181
|
-
function getGranularSymbolsForSourceFile(sourceFile, symbolsByFile, sourceContentByFile) {
|
|
182
|
-
const stagedContent = sourceContentByFile.get(sourceFile);
|
|
183
|
-
if (stagedContent !== undefined) {
|
|
184
|
-
return extractSymbolsFromStagedFile({
|
|
185
|
-
path: sourceFile,
|
|
186
|
-
status: "M",
|
|
187
|
-
hunkRanges: [{ start: 1, end: Number.MAX_SAFE_INTEGER }],
|
|
188
|
-
content: stagedContent,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
const absolutePath = path.isAbsolute(sourceFile)
|
|
192
|
-
? sourceFile
|
|
193
|
-
: path.resolve(process.cwd(), sourceFile);
|
|
194
|
-
if (!existsSync(absolutePath)) {
|
|
195
|
-
return [];
|
|
196
|
-
}
|
|
197
|
-
return extractSymbolsFromStagedFile({
|
|
198
|
-
path: sourceFile,
|
|
199
|
-
status: "M",
|
|
200
|
-
hunkRanges: [{ start: 1, end: Number.MAX_SAFE_INTEGER }],
|
|
201
|
-
content: readFileSync(absolutePath, "utf8"),
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
161
|
const KIBI_ENTITY_TYPES = new Set([
|
|
205
162
|
"req",
|
|
206
163
|
"scenario",
|
|
@@ -257,7 +214,9 @@ function getStagedDiffText(stagedFile) {
|
|
|
257
214
|
function formatStagedKibiDiagnostics(diagnostics) {
|
|
258
215
|
return diagnostics
|
|
259
216
|
.map((diagnostic) => {
|
|
260
|
-
const lines = [
|
|
217
|
+
const lines = [
|
|
218
|
+
`[${diagnostic.severity.toUpperCase()} ${diagnostic.id}] ${diagnostic.message}`,
|
|
219
|
+
];
|
|
261
220
|
if (diagnostic.files.length > 0) {
|
|
262
221
|
lines.push(` Files: ${diagnostic.files.join(", ")}`);
|
|
263
222
|
}
|
|
@@ -269,11 +228,48 @@ function formatStagedKibiDiagnostics(diagnostics) {
|
|
|
269
228
|
})
|
|
270
229
|
.join("\n\n");
|
|
271
230
|
}
|
|
231
|
+
function formatQualityDiagnostics(diagnostics) {
|
|
232
|
+
if (diagnostics.length === 0) {
|
|
233
|
+
return "";
|
|
234
|
+
}
|
|
235
|
+
const details = diagnostics.map((diagnostic) => {
|
|
236
|
+
const lines = [
|
|
237
|
+
`[${diagnostic.severity.toUpperCase()} ${diagnostic.id}] ${diagnostic.message}`,
|
|
238
|
+
];
|
|
239
|
+
if (diagnostic.entityId !== undefined) {
|
|
240
|
+
lines.push(` Entity: ${diagnostic.entityId}`);
|
|
241
|
+
}
|
|
242
|
+
if (diagnostic.files !== undefined && diagnostic.files.length > 0) {
|
|
243
|
+
lines.push(` Files: ${diagnostic.files.join(", ")}`);
|
|
244
|
+
}
|
|
245
|
+
if (diagnostic.docs !== undefined && diagnostic.docs.length > 0) {
|
|
246
|
+
lines.push(` Docs: ${diagnostic.docs.join(", ")}`);
|
|
247
|
+
}
|
|
248
|
+
lines.push(` Blocking: ${diagnostic.blocking ? "yes" : "no"}`);
|
|
249
|
+
lines.push(` Suggestion: ${diagnostic.suggestion}`);
|
|
250
|
+
return lines.join("\n");
|
|
251
|
+
});
|
|
252
|
+
return `Quality diagnostics (${diagnostics.length}):\n${details.join("\n\n")}`;
|
|
253
|
+
}
|
|
254
|
+
function printStructuredCheckResult(input) {
|
|
255
|
+
console.log(JSON.stringify({
|
|
256
|
+
structuredContent: {
|
|
257
|
+
violations: input.violations,
|
|
258
|
+
count: input.violations.length,
|
|
259
|
+
diagnostics: [],
|
|
260
|
+
qualityDiagnostics: input.qualityDiagnostics,
|
|
261
|
+
},
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
272
264
|
function uniqueSorted(values) {
|
|
273
265
|
return Array.from(new Set(values)).sort();
|
|
274
266
|
}
|
|
267
|
+
function hasYamlFrontmatter(content) {
|
|
268
|
+
const trimmed = content.trimStart();
|
|
269
|
+
return trimmed.startsWith("---") && trimmed.slice(3).includes("\n---");
|
|
270
|
+
}
|
|
275
271
|
function buildStagedKibiImpactEvidence(options) {
|
|
276
|
-
const { stagedFiles, sourceFiles, markdownFiles,
|
|
272
|
+
const { stagedFiles, sourceFiles, markdownFiles, markdownResultsByPath, symbolsByFile, symbolsManifestPath, } = options;
|
|
277
273
|
const sourceChanges = sourceFiles.map((file) => {
|
|
278
274
|
const symbolsForFile = symbolsByFile.get(file.path) ?? [];
|
|
279
275
|
const behaviorCandidate = !isTestOnlySourcePath(file.path) &&
|
|
@@ -304,13 +300,6 @@ function buildStagedKibiImpactEvidence(options) {
|
|
|
304
300
|
stagedFiles,
|
|
305
301
|
sourceFiles: behaviorSourceFiles,
|
|
306
302
|
});
|
|
307
|
-
const markdownResultsByPath = new Map();
|
|
308
|
-
for (const [index, file] of markdownFiles.entries()) {
|
|
309
|
-
const result = markdownResults[index];
|
|
310
|
-
if (result) {
|
|
311
|
-
markdownResultsByPath.set(file.path, result);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
303
|
const resolvedKbArtifacts = [];
|
|
315
304
|
let override = null;
|
|
316
305
|
for (const file of markdownFiles) {
|
|
@@ -345,12 +334,12 @@ function buildStagedKibiImpactEvidence(options) {
|
|
|
345
334
|
rationale: parsedOverride.rationale ?? "",
|
|
346
335
|
};
|
|
347
336
|
}
|
|
348
|
-
if (stagedAuthoredSymbolsEvidence.
|
|
337
|
+
if (stagedAuthoredSymbolsEvidence.changedEntityIds.length > 0) {
|
|
349
338
|
resolvedKbArtifacts.push({
|
|
350
339
|
kind: "symbols_manifest",
|
|
351
340
|
path: stagedAuthoredSymbolsEvidence.path,
|
|
352
341
|
entityTypes: ["symbol"],
|
|
353
|
-
entityIds:
|
|
342
|
+
entityIds: stagedAuthoredSymbolsEvidence.changedEntityIds,
|
|
354
343
|
sourcePaths: uniqueSorted(stagedAuthoredSymbolsEvidence.entries.map((entry) => entry.sourcePath)),
|
|
355
344
|
});
|
|
356
345
|
}
|
|
@@ -442,40 +431,63 @@ export async function checkCommand(options) {
|
|
|
442
431
|
console.error(`Error extracting symbols from staged file ${f.path}: ${e instanceof Error ? e.message : String(e)}`);
|
|
443
432
|
}
|
|
444
433
|
}
|
|
445
|
-
const
|
|
434
|
+
const markdownResultsByPath = new Map();
|
|
435
|
+
for (const file of markdownFiles) {
|
|
436
|
+
const content = file.content ?? "";
|
|
437
|
+
if (hasYamlFrontmatter(content)) {
|
|
438
|
+
markdownResultsByPath.set(file.path, extractFromMarkdownString(content, file.path));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
446
441
|
const stagedSourceFilePaths = new Set(sourceFiles.map((file) => file.path));
|
|
447
442
|
const scopedManifestResults = manifestResults.filter((result) => result.sourceFile !== undefined &&
|
|
448
443
|
stagedSourceFilePaths.has(result.sourceFile));
|
|
449
444
|
const stagedEntityResults = [
|
|
450
445
|
...scopedManifestResults,
|
|
451
|
-
...
|
|
446
|
+
...markdownResultsByPath.values(),
|
|
452
447
|
];
|
|
453
448
|
const stagedKibiEvidence = buildStagedKibiImpactEvidence({
|
|
454
449
|
stagedFiles,
|
|
455
450
|
sourceFiles,
|
|
456
451
|
markdownFiles,
|
|
457
|
-
|
|
452
|
+
markdownResultsByPath,
|
|
458
453
|
symbolsByFile,
|
|
459
454
|
symbolsManifestPath,
|
|
460
455
|
});
|
|
461
456
|
const stagedKibiDiagnostics = collectStagedKibiDiagnostics(stagedKibiEvidence);
|
|
462
|
-
const
|
|
457
|
+
const activeStagedSymbolEntityIds = new Set(stagedKibiEvidence.mode.kind === "kb_changes"
|
|
458
|
+
? stagedKibiEvidence.mode.kbArtifacts
|
|
459
|
+
.filter((artifact) => artifact.kind === "symbols_manifest")
|
|
460
|
+
.flatMap((artifact) => artifact.entityIds)
|
|
461
|
+
: []);
|
|
463
462
|
const stagedSourcePaths = new Set(sourceFiles.map((file) => file.path));
|
|
464
|
-
const activeGranularityResults = authoredSymbolResults.filter((result) =>
|
|
463
|
+
const activeGranularityResults = authoredSymbolResults.filter((result) => activeStagedSymbolEntityIds.has(result.entity.id) ||
|
|
465
464
|
(result.sourceFile !== undefined &&
|
|
466
465
|
stagedSourcePaths.has(result.sourceFile)));
|
|
467
466
|
stagedKibiDiagnostics.push(...createSymbolGranularityDiagnostics({
|
|
468
467
|
manifestResults: activeGranularityResults,
|
|
468
|
+
...(activeStagedSymbolEntityIds.size > 0
|
|
469
|
+
? { activeEntityIds: activeStagedSymbolEntityIds }
|
|
470
|
+
: {}),
|
|
469
471
|
symbolsByFile,
|
|
470
472
|
sourceContentByFile,
|
|
471
|
-
})
|
|
473
|
+
}), ...createSymbolQualityDiagnostics({
|
|
474
|
+
manifestResults: activeGranularityResults,
|
|
475
|
+
...(activeStagedSymbolEntityIds.size > 0
|
|
476
|
+
? { activeEntityIds: activeStagedSymbolEntityIds }
|
|
477
|
+
: {}),
|
|
478
|
+
symbolsByFile,
|
|
479
|
+
}), ...createSemanticReviewDiagnostics({ symbolsByFile }));
|
|
472
480
|
if (allSymbols.length === 0 && stagedEntityResults.length === 0) {
|
|
473
481
|
if (stagedKibiDiagnostics.length > 0) {
|
|
474
482
|
console.log(formatStagedKibiDiagnostics(stagedKibiDiagnostics));
|
|
475
483
|
if (options.dryRun) {
|
|
476
484
|
return { exitCode: 0 };
|
|
477
485
|
}
|
|
478
|
-
return {
|
|
486
|
+
return {
|
|
487
|
+
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
488
|
+
? 1
|
|
489
|
+
: 0,
|
|
490
|
+
};
|
|
479
491
|
}
|
|
480
492
|
console.log("No exported symbols or staged entities found in staged files.");
|
|
481
493
|
return { exitCode: 0 };
|
|
@@ -486,7 +498,11 @@ export async function checkCommand(options) {
|
|
|
486
498
|
if (options.dryRun) {
|
|
487
499
|
return { exitCode: 0 };
|
|
488
500
|
}
|
|
489
|
-
return {
|
|
501
|
+
return {
|
|
502
|
+
exitCode: hasBlockingImpactDiagnostics(stagedKibiDiagnostics)
|
|
503
|
+
? 1
|
|
504
|
+
: 0,
|
|
505
|
+
};
|
|
490
506
|
}
|
|
491
507
|
console.log("✓ No violations found in staged files.");
|
|
492
508
|
return { exitCode: 0 };
|
|
@@ -523,7 +539,13 @@ export async function checkCommand(options) {
|
|
|
523
539
|
if (options.dryRun) {
|
|
524
540
|
return { exitCode: 0 };
|
|
525
541
|
}
|
|
526
|
-
|
|
542
|
+
if (!hasBlockingImpactDiagnostics(stagedKibiDiagnostics)) {
|
|
543
|
+
console.log("✓ No violations found in staged symbols.");
|
|
544
|
+
return { exitCode: 0 };
|
|
545
|
+
}
|
|
546
|
+
return {
|
|
547
|
+
exitCode: 1,
|
|
548
|
+
};
|
|
527
549
|
}
|
|
528
550
|
console.log("✓ No violations found in staged symbols.");
|
|
529
551
|
await cleanupTempKb(tempCtx.tempDir);
|
|
@@ -552,71 +574,38 @@ export async function checkCommand(options) {
|
|
|
552
574
|
return { exitCode: 1 };
|
|
553
575
|
}
|
|
554
576
|
attached = true;
|
|
555
|
-
const violations = [];
|
|
556
|
-
const config = loadConfig(process.cwd());
|
|
557
|
-
const checksConfig = config.checks ?? {
|
|
558
|
-
rules: Object.fromEntries(RULES.map((r) => [r.name, true])),
|
|
559
|
-
symbolTraceability: { requireAdr: false },
|
|
560
|
-
};
|
|
561
|
-
const effectiveRules = getEffectiveRules(checksConfig.rules, options.rules);
|
|
562
|
-
// Helper to conditionally run a check by name
|
|
563
|
-
async function runCheck(name, fn, ...args) {
|
|
564
|
-
if (!effectiveRules.has(name))
|
|
565
|
-
return;
|
|
566
|
-
if (!prolog) {
|
|
567
|
-
throw new Error("Prolog process not initialized");
|
|
568
|
-
}
|
|
569
|
-
const res = await fn(prolog, ...args);
|
|
570
|
-
if (res?.length)
|
|
571
|
-
violations.push(...res);
|
|
572
|
-
}
|
|
573
577
|
if (!prolog) {
|
|
574
578
|
throw new Error("Prolog process not initialized");
|
|
575
579
|
}
|
|
576
580
|
const activeProlog = prolog;
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
];
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
const aggregatedViolations = await runAggregatedChecks(activeProlog, effectiveRules, checksConfig.symbolTraceability?.requireAdr ?? false);
|
|
598
|
-
violations.push(...aggregatedViolations);
|
|
599
|
-
}
|
|
600
|
-
else {
|
|
601
|
-
// Legacy path: individual checks for backward compatibility
|
|
602
|
-
await runCheck("must-priority-coverage", checkMustPriorityCoverage);
|
|
603
|
-
await runCheck("symbol-coverage", checkSymbolCoverage);
|
|
604
|
-
await runCheck("symbol-traceability", (p) => checkSymbolTraceability(p, checksConfig.symbolTraceability?.requireAdr ?? false));
|
|
605
|
-
await runCheck("no-dangling-refs", checkNoDanglingRefs);
|
|
606
|
-
await runCheck("no-cycles", checkNoCycles);
|
|
607
|
-
const allEntityIds = await getAllEntityIds(activeProlog);
|
|
608
|
-
if (effectiveRules.has("required-fields")) {
|
|
609
|
-
const requiredViolations = await checkRequiredFields(activeProlog, allEntityIds);
|
|
610
|
-
violations.push(...requiredViolations);
|
|
611
|
-
}
|
|
612
|
-
await runCheck("deprecated-adr-no-successor", checkDeprecatedAdrs);
|
|
613
|
-
await runCheck("domain-contradictions", checkDomainContradictions);
|
|
614
|
-
await runCheck("strict-fact-shape", checkStrictFactShape);
|
|
615
|
-
await runCheck("strict-req-fact-pairing", checkStrictReqFactPairing);
|
|
616
|
-
await runCheck("strict-readiness", checkStrictReadiness);
|
|
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 ?? [];
|
|
598
|
+
if (options.format === "json") {
|
|
599
|
+
printStructuredCheckResult({ violations, qualityDiagnostics });
|
|
600
|
+
return { exitCode: violations.length === 0 ? 0 : 1 };
|
|
617
601
|
}
|
|
602
|
+
const qualityOutput = formatQualityDiagnostics(qualityDiagnostics);
|
|
618
603
|
if (violations.length === 0) {
|
|
619
604
|
console.log("✓ No violations found. KB is valid.");
|
|
605
|
+
if (qualityOutput.length > 0) {
|
|
606
|
+
console.log();
|
|
607
|
+
console.log(qualityOutput);
|
|
608
|
+
}
|
|
620
609
|
return { exitCode: 0 };
|
|
621
610
|
}
|
|
622
611
|
console.log(`Found ${violations.length} violation(s):`);
|
|
@@ -636,6 +625,10 @@ export async function checkCommand(options) {
|
|
|
636
625
|
}
|
|
637
626
|
console.log();
|
|
638
627
|
}
|
|
628
|
+
if (qualityOutput.length > 0) {
|
|
629
|
+
console.log(qualityOutput);
|
|
630
|
+
console.log();
|
|
631
|
+
}
|
|
639
632
|
return { exitCode: 1 };
|
|
640
633
|
}
|
|
641
634
|
catch (error) {
|
|
@@ -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,6 @@
|
|
|
1
1
|
import { PrologProcess, resolveKbPlPath } from "../prolog.js";
|
|
2
|
+
import { type OperationSpec, type RuntimeOptions } from "../public/operations/index.js";
|
|
3
|
+
export { renderCoverageTable } from "./discovery-table.js";
|
|
2
4
|
export interface DiscoveryCommandOptions {
|
|
3
5
|
format?: "json" | "table";
|
|
4
6
|
}
|
|
@@ -9,8 +11,8 @@ export interface DiscoveryDeps {
|
|
|
9
11
|
}) => PrologProcess;
|
|
10
12
|
resolveKbPl: typeof resolveKbPlPath;
|
|
11
13
|
}
|
|
14
|
+
export declare function executeReportingSpec<TInput, TOutput>(spec: OperationSpec<TInput, TOutput>, input: TInput, options?: RuntimeOptions): Promise<import("../public/operations/types.js").OperationResult<TOutput>>;
|
|
12
15
|
export declare function withAttachedBranchProlog<T>(callback: (prolog: PrologProcess) => Promise<T>, deps?: Partial<DiscoveryDeps>): Promise<T>;
|
|
13
|
-
export declare function withPrologProcess<T>(callback: (prolog: PrologProcess) => Promise<T>, deps?: Partial<DiscoveryDeps>): Promise<T>;
|
|
14
16
|
export declare function resolveCurrentKbPath(): Promise<string>;
|
|
15
17
|
export declare function resolveCoreModulePath(fileName: string, deps?: Partial<DiscoveryDeps>): string;
|
|
16
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":"
|
|
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"}
|