kibi-cli 1.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-errors.d.ts +3 -1
- package/dist/cli-errors.d.ts.map +1 -1
- package/dist/cli-errors.js +4 -1
- package/dist/cli-json-command.d.ts +1 -0
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +13 -4
- package/dist/cli-operation-loader.js +3 -3
- package/dist/cli-operation-metadata.d.ts +4 -3
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +7 -5
- package/dist/cli-protocol.js +1 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-proof.d.ts +3 -0
- package/dist/cli-register-proof.d.ts.map +1 -0
- package/dist/cli-register-proof.js +127 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +7 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -10
- package/dist/commands/branch.d.ts +1 -0
- package/dist/commands/branch.d.ts.map +1 -1
- package/dist/commands/branch.js +8 -4
- package/dist/commands/check-generated.d.ts +7 -0
- package/dist/commands/check-generated.d.ts.map +1 -0
- package/dist/commands/check-generated.js +192 -0
- package/dist/commands/check.d.ts +14 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +193 -46
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +6 -0
- package/dist/commands/doctor.d.ts +22 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +170 -23
- package/dist/commands/engine.d.ts +12 -0
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +42 -0
- package/dist/commands/github-init.d.ts +1 -0
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +9 -5
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +49 -10
- package/dist/commands/migrate.d.ts +4 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +7 -7
- package/dist/commands/proof-explain.d.ts +10 -0
- package/dist/commands/proof-explain.d.ts.map +1 -0
- package/dist/commands/proof-explain.js +45 -0
- package/dist/commands/proof-impact.d.ts +7 -0
- package/dist/commands/proof-impact.d.ts.map +1 -0
- package/dist/commands/proof-impact.js +39 -0
- package/dist/commands/proof-migrate-legacy.d.ts +7 -0
- package/dist/commands/proof-migrate-legacy.d.ts.map +1 -0
- package/dist/commands/proof-migrate-legacy.js +45 -0
- package/dist/commands/proof-prune.d.ts +8 -0
- package/dist/commands/proof-prune.d.ts.map +1 -0
- package/dist/commands/proof-prune.js +53 -0
- package/dist/commands/prove.d.ts +37 -0
- package/dist/commands/prove.d.ts.map +1 -0
- package/dist/commands/prove.js +470 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +18 -3
- package/dist/commands/sync/discovery.d.ts +3 -0
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +36 -28
- package/dist/commands/sync/manifest.d.ts +2 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +55 -21
- package/dist/commands/sync/persistence.d.ts +4 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +31 -14
- package/dist/commands/sync/staging.d.ts +1 -0
- package/dist/commands/sync/staging.d.ts.map +1 -1
- package/dist/commands/sync/staging.js +5 -2
- package/dist/commands/sync/untracked-targets.d.ts +24 -0
- package/dist/commands/sync/untracked-targets.d.ts.map +1 -0
- package/dist/commands/sync/untracked-targets.js +108 -0
- package/dist/commands/sync.d.ts +11 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +74 -30
- package/dist/engine-daemon.d.ts +3 -1
- package/dist/engine-daemon.d.ts.map +1 -1
- package/dist/engine-daemon.js +49 -20
- package/dist/engine.d.ts +17 -77
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +331 -91
- package/dist/env/bootstrap.d.ts +84 -0
- package/dist/env/bootstrap.d.ts.map +1 -0
- package/dist/env/bootstrap.js +310 -0
- package/dist/extractors/manifest.d.ts +5 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +46 -1
- package/dist/extractors/markdown.d.ts +7 -3
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +60 -24
- package/dist/extractors/playwright-cases.js +1 -1
- package/dist/extractors/relationships.d.ts +6 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -1
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.d.ts +8 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +40 -0
- package/dist/extractors/symbols-ts.d.ts +9 -19
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +34 -429
- package/dist/intent-search.d.ts +1 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +11 -8
- package/dist/logic/ir.d.ts +1 -0
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +1 -1
- package/dist/operations/bootstrap/activation.d.ts +2 -1
- package/dist/operations/bootstrap/activation.d.ts.map +1 -1
- package/dist/operations/bootstrap/activation.js +11 -3
- package/dist/operations/bootstrap/generate.d.ts +2 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +6 -3
- package/dist/operations/bootstrap/guidance.d.ts +1 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/modeling/model-requirement.d.ts +5 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +57 -46
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +103 -4
- package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-2.js +18 -2
- package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-3.js +17 -1
- package/dist/operations/modeling/predicate-catalog-5.d.ts +10 -0
- package/dist/operations/modeling/predicate-catalog-5.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-5.js +291 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +4 -0
- package/dist/operations/modeling/predicate-loader.d.ts +1 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +4 -3
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +4 -1
- package/dist/operations/modeling/predicate-types.d.ts +1 -1
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-4.js +84 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +4 -2
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +82 -22
- package/dist/operations/mutation/contradictions.d.ts +2 -1
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +26 -5
- package/dist/operations/mutation/delete.d.ts +3 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +100 -32
- package/dist/operations/mutation/relationships.d.ts +1 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +6 -4
- package/dist/operations/mutation/saga.d.ts +51 -0
- package/dist/operations/mutation/saga.d.ts.map +1 -0
- package/dist/operations/mutation/saga.js +67 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -2
- package/dist/operations/mutation/source-authoring.d.ts +5 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +79 -46
- package/dist/operations/mutation/strict-fact.d.ts +1 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +8 -5
- package/dist/operations/mutation/symbol-compiler-lock.d.ts +5 -2
- package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-compiler-lock.js +65 -2
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +11 -89
- package/dist/operations/mutation/symbol-refresh.d.ts +1 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +10 -8
- package/dist/operations/mutation/upsert.d.ts +18 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +86 -54
- package/dist/operations/mutation/validate-upsert.js +2 -2
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +46 -4
- package/dist/operations/mutation/warnings.d.ts +1 -0
- package/dist/operations/mutation/warnings.d.ts.map +1 -1
- package/dist/operations/mutation/warnings.js +7 -5
- package/dist/operations/mutation/workspace-mutation-lock.d.ts +60 -0
- package/dist/operations/mutation/workspace-mutation-lock.d.ts.map +1 -0
- package/dist/operations/mutation/workspace-mutation-lock.js +362 -0
- package/dist/operations/planning/apply-plan.d.ts +8 -106
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +113 -36
- package/dist/operations/planning/compile-intent.d.ts +51 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +133 -17
- package/dist/operations/proof/baseline-diff.d.ts +41 -0
- package/dist/operations/proof/baseline-diff.d.ts.map +1 -0
- package/dist/operations/proof/baseline-diff.js +153 -0
- package/dist/operations/proof/explain.d.ts +75 -0
- package/dist/operations/proof/explain.d.ts.map +1 -0
- package/dist/operations/proof/explain.js +294 -0
- package/dist/operations/proof/impact.d.ts +45 -0
- package/dist/operations/proof/impact.d.ts.map +1 -0
- package/dist/operations/proof/impact.js +118 -0
- package/dist/operations/proof/ingest-proof.d.ts +34 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -0
- package/dist/operations/proof/ingest-proof.js +348 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts +30 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -0
- package/dist/operations/proof/migrate-legacy-receipts.js +92 -0
- package/dist/operations/proof/prune-receipts.d.ts +35 -0
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -0
- package/dist/operations/proof/prune-receipts.js +91 -0
- package/dist/operations/proof/receipt-document.d.ts +29 -0
- package/dist/operations/proof/receipt-document.d.ts.map +1 -0
- package/dist/operations/proof/receipt-document.js +117 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +3 -9
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +1 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +64 -93
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +20 -7
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts +63 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.js +489 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +15 -2
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-core.js +7 -140
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +11 -12
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +6 -94
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +16 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +7 -150
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +9 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +7 -102
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +13 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product.js +7 -133
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts +2 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-count-rules.js +40 -25
- package/dist/operations/semantic-advisor/types.d.ts +1 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/compose-ontology-packs.d.ts +51 -0
- package/dist/plugins/compose-ontology-packs.d.ts.map +1 -0
- package/dist/plugins/compose-ontology-packs.js +257 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +42 -0
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -0
- package/dist/plugins/compose-semantic-classifier.js +211 -0
- package/dist/plugins/external-allowlist.d.ts +10 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -0
- package/dist/plugins/external-allowlist.js +16 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +33 -0
- package/dist/plugins/load-plugin.d.ts +19 -0
- package/dist/plugins/load-plugin.d.ts.map +1 -0
- package/dist/plugins/load-plugin.js +59 -0
- package/dist/plugins/project-config.d.ts +28 -0
- package/dist/plugins/project-config.d.ts.map +1 -0
- package/dist/plugins/project-config.js +90 -0
- package/dist/plugins/registry.d.ts +93 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +338 -0
- package/dist/plugins/resolve-package.d.ts +47 -0
- package/dist/plugins/resolve-package.d.ts.map +1 -0
- package/dist/plugins/resolve-package.js +262 -0
- package/dist/plugins/source-analysis-service.d.ts +44 -0
- package/dist/plugins/source-analysis-service.d.ts.map +1 -0
- package/dist/plugins/source-analysis-service.js +232 -0
- package/dist/prolog/codec.d.ts +13 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +269 -154
- package/dist/prolog/error-terms.d.ts +47 -0
- package/dist/prolog/error-terms.d.ts.map +1 -0
- package/dist/prolog/error-terms.js +334 -0
- package/dist/prolog/janitor.d.ts +50 -0
- package/dist/prolog/janitor.d.ts.map +1 -0
- package/dist/prolog/janitor.js +154 -0
- package/dist/prolog/store-lock.d.ts +45 -0
- package/dist/prolog/store-lock.d.ts.map +1 -0
- package/dist/prolog/store-lock.js +195 -0
- package/dist/prolog.d.ts +7 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +55 -17
- package/dist/proof/evaluate.d.ts +27 -0
- package/dist/proof/evaluate.d.ts.map +1 -0
- package/dist/proof/evaluate.js +151 -0
- package/dist/proof/inspect.d.ts +12 -0
- package/dist/proof/inspect.d.ts.map +1 -0
- package/dist/proof/inspect.js +236 -0
- package/dist/proof/integrations.d.ts +35 -0
- package/dist/proof/integrations.d.ts.map +1 -0
- package/dist/proof/integrations.js +123 -0
- package/dist/proof/producers/junit-adapter.d.ts +26 -0
- package/dist/proof/producers/junit-adapter.d.ts.map +1 -0
- package/dist/proof/producers/junit-adapter.js +186 -0
- package/dist/{public → proof/producers}/playwright-case-id.d.ts +1 -1
- package/dist/proof/producers/playwright-case-id.d.ts.map +1 -0
- package/dist/{public → proof/producers}/playwright-case-id.js +1 -1
- package/dist/proof/producers/playwright-reporter.d.ts +27 -0
- package/dist/proof/producers/playwright-reporter.d.ts.map +1 -0
- package/dist/proof/producers/playwright-reporter.js +138 -0
- package/dist/proof/producers/tap-adapter.d.ts +10 -0
- package/dist/proof/producers/tap-adapter.d.ts.map +1 -0
- package/dist/proof/producers/tap-adapter.js +200 -0
- package/dist/proof/receipt-outcome.d.ts +2 -0
- package/dist/proof/receipt-outcome.d.ts.map +1 -0
- package/dist/proof/receipt-outcome.js +1 -0
- package/dist/public/diagnostic-usage.js +6 -6
- package/dist/public/distribution-parity.d.ts +7 -1
- package/dist/public/distribution-parity.d.ts.map +1 -1
- package/dist/public/distribution-parity.js +15 -10
- package/dist/public/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/public/extractors/symbols-coordinator.js +1 -1
- package/dist/public/impact/analyzer.d.ts +1 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +6 -4
- package/dist/public/impact/coverage-depth-quality.d.ts +1 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +1 -1
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +2 -2
- package/dist/public/impact/diff-meaning.d.ts +1 -0
- package/dist/public/impact/diff-meaning.d.ts.map +1 -1
- package/dist/public/impact/diff-meaning.js +5 -2
- package/dist/public/impact/full-kb-quality.d.ts +5 -2
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +329 -64
- package/dist/public/operations/catalog.d.ts +450 -196
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +6 -4
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +4 -8
- package/dist/public/operations/check-helpers.d.ts +1 -1
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +1 -1
- package/dist/public/operations/contracts.d.ts +7 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +66 -34
- package/dist/public/operations/discovery-entities.d.ts +15 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +38 -0
- package/dist/public/operations/discovery-executors.d.ts +9 -9
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +39 -31
- package/dist/public/operations/index.d.ts +1 -1
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -1
- package/dist/public/operations/migration-plan.d.ts +4 -3
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +23 -21
- package/dist/public/operations/node-ports.js +6 -6
- package/dist/public/operations/prolog-json.d.ts +1 -1
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +7 -7
- package/dist/public/operations/repair-plan.d.ts +3 -3
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +49 -19
- package/dist/public/operations/result-envelope.d.ts +1 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +12 -10
- package/dist/public/operations/runtime-types.d.ts +21 -1
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +5 -0
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -0
- package/dist/public/operations/specs/check-rules.generated.js +35 -0
- package/dist/public/operations/specs/check.d.ts +7 -2
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +8 -20
- package/dist/public/operations/specs/discovery.d.ts +3 -0
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +3 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +257 -163
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +15 -7
- package/dist/public/operations/specs/planning.d.ts +9 -0
- package/dist/public/operations/specs/planning.d.ts.map +1 -1
- package/dist/public/operations/specs/planning.js +6 -0
- package/dist/public/operations/specs/proof.d.ts +212 -0
- package/dist/public/operations/specs/proof.d.ts.map +1 -0
- package/dist/public/operations/specs/proof.js +30 -0
- package/dist/public/operations/specs/reporting.d.ts +20 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +112 -12
- package/dist/public/operations/specs/semantic.d.ts +1 -1
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +54 -4
- package/dist/public/operations/specs/upsert.d.ts +257 -163
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +121 -4
- package/dist/public/operations/types.d.ts +6 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-fingerprint.d.ts +54 -0
- package/dist/public/proof-fingerprint.d.ts.map +1 -0
- package/dist/public/proof-fingerprint.js +141 -0
- package/dist/public/proof-protocol.d.ts +354 -0
- package/dist/public/proof-protocol.d.ts.map +1 -0
- package/dist/public/proof-protocol.js +454 -0
- package/dist/public/proof-receipt.d.ts +279 -0
- package/dist/public/proof-receipt.d.ts.map +1 -0
- package/dist/public/proof-receipt.js +377 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +21 -7
- package/dist/public/skills/kibi-freshness/SKILL.md +1 -1
- package/dist/public/skills/kibi-usage/SKILL.md +44 -12
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/dist/public/skills/kibi-usage/resources/proof.md +150 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/dist/public/symbol-granularity.d.ts +3 -14
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.generated.d.ts +16 -0
- package/dist/public/symbol-granularity.generated.d.ts.map +1 -0
- package/dist/public/symbol-granularity.generated.js +53 -0
- package/dist/public/symbol-granularity.js +6 -47
- package/dist/public/telemetry-acceptance.d.ts +3 -77
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +4 -2
- package/dist/public/telemetry-remediation.js +1 -1
- package/dist/report/html-report.css +1240 -0
- package/dist/report/html-report.d.ts +4 -2
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +37 -300
- package/dist/runtime/cli-runtime.d.ts +2 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +32 -7
- package/dist/schemas/entity.schema.json +355 -215
- package/dist/search-ranking.d.ts +1 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +3 -0
- package/dist/traceability/evidence-model.d.ts +28 -0
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/git-staged.d.ts +20 -0
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +145 -1
- package/dist/traceability/staged-diagnostics.d.ts +7 -0
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +78 -7
- package/dist/traceability/staged-file-coverage.d.ts +33 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -0
- package/dist/traceability/staged-file-coverage.js +284 -0
- package/dist/traceability/staged-impact-contract.js +4 -4
- package/dist/traceability/staged-symbols-manifest.d.ts +13 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +138 -27
- package/dist/traceability/symbol-extract.d.ts +24 -2
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +64 -208
- package/dist/traceability/temp-kb.d.ts +2 -0
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +13 -4
- package/dist/types/entities.d.ts +5 -3
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +1 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +7 -4
- package/dist/utils/branch-store.d.ts +6 -0
- package/dist/utils/branch-store.d.ts.map +1 -1
- package/dist/utils/branch-store.js +27 -0
- package/dist/utils/kb-paths.d.ts +1 -1
- package/dist/utils/kb-paths.d.ts.map +1 -1
- package/dist/utils/kb-paths.js +1 -1
- package/dist/utils/rule-registry.d.ts +1 -11
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +102 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -0
- package/dist/utils/rule-registry.generated.js +131 -0
- package/dist/utils/rule-registry.js +12 -113
- package/dist/utils/strict-modeling.d.ts +1 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +1 -1
- package/package.json +20 -20
- package/src/public/diagnostic-usage.ts +6 -6
- package/src/public/distribution-parity.ts +17 -10
- package/src/public/extractors/symbols-coordinator.ts +1 -0
- package/src/public/impact/analyzer.ts +15 -12
- package/src/public/impact/coverage-depth-quality.ts +1 -1
- package/src/public/impact/diagnostics.ts +2 -1
- package/src/public/impact/diff-meaning.ts +11 -4
- package/src/public/impact/full-kb-quality.ts +463 -72
- package/src/public/operations/catalog.ts +10 -4
- package/src/public/operations/check-executor.ts +4 -8
- package/src/public/operations/check-helpers.ts +2 -2
- package/src/public/operations/contracts.ts +78 -34
- package/src/public/operations/discovery-entities.ts +53 -0
- package/src/public/operations/discovery-executors.ts +64 -48
- package/src/public/operations/index.ts +1 -1
- package/src/public/operations/migration-plan.ts +32 -25
- package/src/public/operations/node-ports.ts +6 -6
- package/src/public/operations/prolog-json.ts +13 -5
- package/src/public/operations/repair-plan.ts +60 -23
- package/src/public/operations/result-envelope.ts +15 -10
- package/src/public/operations/runtime-types.ts +26 -2
- package/src/public/operations/specs/check-rules.generated.ts +38 -0
- package/src/public/operations/specs/check.ts +12 -21
- package/src/public/operations/specs/discovery.ts +3 -0
- package/src/public/operations/specs/mutation-schemas.ts +22 -9
- package/src/public/operations/specs/planning.ts +7 -0
- package/src/public/operations/specs/proof.ts +43 -0
- package/src/public/operations/specs/reporting.ts +140 -13
- package/src/public/operations/specs/semantic.ts +79 -17
- package/src/public/operations/symbol-repair-plan.ts +166 -7
- package/src/public/operations/types.ts +6 -1
- package/src/public/proof-fingerprint.ts +216 -0
- package/src/public/proof-protocol-types.d.ts +96 -0
- package/src/public/proof-protocol.ts +589 -0
- package/src/public/proof-receipt.ts +499 -0
- package/src/public/schemas/entity.ts +26 -10
- package/src/public/skills/kibi-freshness/SKILL.md +1 -1
- package/src/public/skills/kibi-usage/SKILL.md +44 -12
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/src/public/skills/kibi-usage/resources/proof.md +150 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/src/public/symbol-granularity.generated.ts +74 -0
- package/src/public/symbol-granularity.ts +34 -59
- package/src/public/telemetry-acceptance-types.d.ts +98 -0
- package/src/public/telemetry-acceptance.ts +22 -100
- package/src/public/telemetry-remediation.ts +1 -1
- package/src/schemas/entity.schema.json +355 -215
- package/dist/cli-register-verification.d.ts +0 -3
- package/dist/cli-register-verification.d.ts.map +0 -1
- package/dist/cli-register-verification.js +0 -16
- package/dist/commands/verify.d.ts +0 -10
- package/dist/commands/verify.d.ts.map +0 -1
- package/dist/commands/verify.js +0 -126
- package/dist/operations/verification/ingest-verification.d.ts +0 -29
- package/dist/operations/verification/ingest-verification.d.ts.map +0 -1
- package/dist/operations/verification/ingest-verification.js +0 -192
- package/dist/public/operations/specs/verification.d.ts +0 -78
- package/dist/public/operations/specs/verification.d.ts.map +0 -1
- package/dist/public/operations/specs/verification.js +0 -62
- package/dist/public/playwright-case-id.d.ts.map +0 -1
- package/dist/public/verification-receipt.d.ts +0 -242
- package/dist/public/verification-receipt.d.ts.map +0 -1
- package/dist/public/verification-receipt.js +0 -296
- package/dist/verification/playwright-reporter.d.ts +0 -21
- package/dist/verification/playwright-reporter.d.ts.map +0 -1
- package/dist/verification/playwright-reporter.js +0 -114
- package/src/public/operations/specs/verification.ts +0 -78
- package/src/public/playwright-case-id.ts +0 -35
- package/src/public/verification-receipt.ts +0 -412
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IngestProofArgs,
|
|
3
|
+
type IngestProofResult,
|
|
4
|
+
executeIngestProof,
|
|
5
|
+
} from "../../../operations/proof/ingest-proof.js";
|
|
6
|
+
import { PROOF_RUN_ARTIFACT_SCHEMA } from "../../proof-protocol.js";
|
|
7
|
+
import type { OperationSpec } from "../types.js";
|
|
8
|
+
|
|
9
|
+
export type {
|
|
10
|
+
IngestProofArgs,
|
|
11
|
+
IngestProofResult,
|
|
12
|
+
} from "../../../operations/proof/ingest-proof.js";
|
|
13
|
+
export { executeIngestProof } from "../../../operations/proof/ingest-proof.js";
|
|
14
|
+
|
|
15
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
16
|
+
export const ingestProofSpec = {
|
|
17
|
+
name: "kb_ingest_proof",
|
|
18
|
+
cliName: "ingest-proof",
|
|
19
|
+
description:
|
|
20
|
+
"Ingest a producer-emitted kibi.proof-run.v1 artifact and evaluate it against each selected test's kibi.proof-contract.v1 proof obligations. Revalidates the live workspace snapshot, integration command binding, run-level outcome, attempt history, success policy, and append-only proof-receipt history before deriving and appending idempotent kibi.proof-receipt.v1 receipts. Producers report what happened; Kibi evaluates proof. Prefer `kibi prove` so the configured producer runs automatically; direct ingestion is an integration path for custom producers and agents.",
|
|
21
|
+
businessInputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
required: ["snapshot", "artifact"],
|
|
24
|
+
properties: {
|
|
25
|
+
snapshot: {
|
|
26
|
+
type: "string",
|
|
27
|
+
pattern: "^[a-f0-9]{64}$",
|
|
28
|
+
description: "Workspace snapshot captured immediately before the run.",
|
|
29
|
+
},
|
|
30
|
+
artifact: PROOF_RUN_ARTIFACT_SCHEMA,
|
|
31
|
+
testIds: {
|
|
32
|
+
type: "array",
|
|
33
|
+
minItems: 1,
|
|
34
|
+
items: { type: "string", minLength: 1 },
|
|
35
|
+
description:
|
|
36
|
+
"Existing test entities with proof_contract.v1. Omit to evaluate every test contracted to the artifact's integration.",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
requiresProlog: true,
|
|
41
|
+
effects: ["kb-read", "kb-write", "workspace-read"],
|
|
42
|
+
execute: executeIngestProof,
|
|
43
|
+
} as const satisfies OperationSpec<IngestProofArgs, IngestProofResult>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
|
|
3
|
+
import { resolveBoundSymbolScope } from "../../../extractors/manifest.js";
|
|
4
|
+
import { PROOF_RECEIPT_MAX_AGE_SECONDS } from "../../proof-receipt.js";
|
|
2
5
|
import { executeStatus } from "../discovery-executors.js";
|
|
3
6
|
import {
|
|
4
7
|
type LegacyMigrationPlan,
|
|
@@ -17,7 +20,10 @@ import {
|
|
|
17
20
|
} from "../prolog-json.js";
|
|
18
21
|
import { type RepairPlan, buildRepairPlan } from "../repair-plan.js";
|
|
19
22
|
import type { OperationContext } from "../runtime-types.js";
|
|
20
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
addCoordinateRepairEvidence,
|
|
25
|
+
buildSymbolRepairPlan,
|
|
26
|
+
} from "../symbol-repair-plan.js";
|
|
21
27
|
import type { OperationResult, OperationSpec } from "../types.js";
|
|
22
28
|
import { readWorkspaceSnapshot } from "../workspace-snapshot.js";
|
|
23
29
|
|
|
@@ -53,6 +59,8 @@ export type CoverageInput = {
|
|
|
53
59
|
readonly by?: "req" | "symbol" | "type";
|
|
54
60
|
readonly tags?: readonly string[];
|
|
55
61
|
readonly includePassing?: boolean;
|
|
62
|
+
/** Requirement proof-status filter (req mode). Implies include-passing. */
|
|
63
|
+
readonly statuses?: readonly string[];
|
|
56
64
|
readonly includeTransitive?: boolean;
|
|
57
65
|
readonly limit?: number;
|
|
58
66
|
readonly offset?: number;
|
|
@@ -105,6 +113,22 @@ function validateEntityType(type?: string): void {
|
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
|
|
116
|
+
const COVERAGE_PROOF_STATUSES: ReadonlySet<string> = new Set([
|
|
117
|
+
"proven",
|
|
118
|
+
"missing",
|
|
119
|
+
"unresolved",
|
|
120
|
+
"not_applicable",
|
|
121
|
+
]);
|
|
122
|
+
|
|
123
|
+
function validateCoverageStatus(status: string): string {
|
|
124
|
+
if (!COVERAGE_PROOF_STATUSES.has(status)) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
`Invalid coverage status '${status}'. Valid statuses: ${[...COVERAGE_PROOF_STATUSES].join(", ")}.`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
return status;
|
|
130
|
+
}
|
|
131
|
+
|
|
108
132
|
export async function executeFindGaps(
|
|
109
133
|
input: FindGapsInput,
|
|
110
134
|
context: OperationContext,
|
|
@@ -161,6 +185,79 @@ export const findGapsSpec = {
|
|
|
161
185
|
execute: executeFindGaps,
|
|
162
186
|
} as const satisfies OperationSpec<FindGapsInput, FindGapsPayload>;
|
|
163
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Per-contract receipt binding (W2): compute the current binding hash for
|
|
190
|
+
* every receipt-bearing test (contract + receipt-stripped authored document
|
|
191
|
+
* + bound-symbol code scope) and hand the Prolog coverage stage a
|
|
192
|
+
* TestId -> BindingHash dict. This is the default binding mode since slice 3;
|
|
193
|
+
* KIBI_PROOF_BINDING_MODE=strict-snapshot opts out (receipts then match only
|
|
194
|
+
* against the whole-workspace snapshot they were proven on).
|
|
195
|
+
*/
|
|
196
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
197
|
+
export function currentProofBindingMode(): "per_contract" | "strict_snapshot" {
|
|
198
|
+
return process.env.KIBI_PROOF_BINDING_MODE?.trim() === "strict-snapshot"
|
|
199
|
+
? "strict_snapshot"
|
|
200
|
+
: "per_contract";
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export async function perContractTestBindings(
|
|
204
|
+
context: OperationContext,
|
|
205
|
+
): Promise<string | null> {
|
|
206
|
+
if (currentProofBindingMode() !== "per_contract") return null;
|
|
207
|
+
const { loadEntities } = await import("../discovery-entities.js");
|
|
208
|
+
const { receiptBindingHash } = await import("../../proof-fingerprint.js");
|
|
209
|
+
const { removeFrontmatterBlock } = await import(
|
|
210
|
+
"../../../operations/proof/receipt-document.js"
|
|
211
|
+
);
|
|
212
|
+
let tests: Record<string, unknown>[];
|
|
213
|
+
try {
|
|
214
|
+
tests = await loadEntities(context.prolog as never, { type: "test" });
|
|
215
|
+
} catch {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const entries: string[] = [];
|
|
219
|
+
const manifestPath = join(context.workspaceRoot, ".kb", "symbols.yaml");
|
|
220
|
+
for (const test of tests) {
|
|
221
|
+
const testId = typeof test.id === "string" ? test.id : "";
|
|
222
|
+
const contract =
|
|
223
|
+
test.proof_contract !== undefined &&
|
|
224
|
+
test.proof_contract !== null &&
|
|
225
|
+
typeof test.proof_contract === "object"
|
|
226
|
+
? (test.proof_contract as Record<string, unknown>)
|
|
227
|
+
: undefined;
|
|
228
|
+
const source = typeof test.source === "string" ? test.source : "";
|
|
229
|
+
if (testId === "" || contract === undefined || source === "") continue;
|
|
230
|
+
if (!/\.(md|mdx)$/i.test(source)) continue;
|
|
231
|
+
if (!context.fs) continue;
|
|
232
|
+
try {
|
|
233
|
+
const absolute = join(context.workspaceRoot, source);
|
|
234
|
+
const authored = await context.fs.readFile(absolute);
|
|
235
|
+
const stripped = removeFrontmatterBlock(authored, "proof_receipts");
|
|
236
|
+
const rawBindings: ReadonlyArray<{ symbol_id?: unknown }> = Array.isArray(
|
|
237
|
+
test.proof_bindings,
|
|
238
|
+
)
|
|
239
|
+
? (test.proof_bindings as ReadonlyArray<{ symbol_id?: unknown }>)
|
|
240
|
+
: [];
|
|
241
|
+
const boundIds = rawBindings
|
|
242
|
+
.map((binding) =>
|
|
243
|
+
typeof binding.symbol_id === "string" ? binding.symbol_id : "",
|
|
244
|
+
)
|
|
245
|
+
.filter((id) => id !== "");
|
|
246
|
+
const codeScope = resolveBoundSymbolScope(manifestPath, boundIds);
|
|
247
|
+
const binding = receiptBindingHash(
|
|
248
|
+
contract as never,
|
|
249
|
+
stripped ?? authored,
|
|
250
|
+
codeScope,
|
|
251
|
+
);
|
|
252
|
+
entries.push(`${toPrologAtom(testId)}: ${toPrologAtom(binding)}`);
|
|
253
|
+
} catch {
|
|
254
|
+
// Unreadable documents keep strict semantics for that test.
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (entries.length === 0) return null;
|
|
258
|
+
return `_{${entries.join(", ")}}`;
|
|
259
|
+
}
|
|
260
|
+
|
|
164
261
|
export async function executeCoverage(
|
|
165
262
|
input: CoverageInput,
|
|
166
263
|
context: OperationContext,
|
|
@@ -171,13 +268,34 @@ export async function executeCoverage(
|
|
|
171
268
|
? snapshotEvidence.snapshot.hash
|
|
172
269
|
: "unknown";
|
|
173
270
|
const checkedAt = context.clock().toISOString();
|
|
271
|
+
const statuses = (input.statuses ?? []).map((status) =>
|
|
272
|
+
validateCoverageStatus(status),
|
|
273
|
+
);
|
|
274
|
+
const bindingsDict =
|
|
275
|
+
statuses.length === 0 && (input.by ?? "req") === "req"
|
|
276
|
+
? await perContractTestBindings(context)
|
|
277
|
+
: null;
|
|
278
|
+
const goal =
|
|
279
|
+
bindingsDict !== null
|
|
280
|
+
? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, per_contract, ${bindingsDict}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
|
|
281
|
+
: statuses.length > 0
|
|
282
|
+
? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${toPrologList(statuses)}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
|
|
283
|
+
: `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`;
|
|
174
284
|
const payload = await runOperationJsonQuery<CoveragePayload>(
|
|
175
285
|
requireProlog(context),
|
|
176
286
|
"discovery.pl",
|
|
177
|
-
|
|
287
|
+
goal,
|
|
178
288
|
"Coverage execution",
|
|
179
289
|
);
|
|
180
|
-
const
|
|
290
|
+
const rows =
|
|
291
|
+
(input.by ?? "req") === "req"
|
|
292
|
+
? await addCoordinateRepairEvidence(payload.rows, context)
|
|
293
|
+
: payload.rows;
|
|
294
|
+
const repairPlan = buildRepairPlan(
|
|
295
|
+
{ ...payload, rows },
|
|
296
|
+
input,
|
|
297
|
+
codeSnapshot,
|
|
298
|
+
);
|
|
181
299
|
const symbolRepairPlan =
|
|
182
300
|
input.by === "symbol"
|
|
183
301
|
? await buildSymbolRepairPlan(payload.rows, context)
|
|
@@ -212,7 +330,7 @@ export async function executeCoverage(
|
|
|
212
330
|
: {}),
|
|
213
331
|
workspaceSnapshot: codeSnapshot,
|
|
214
332
|
},
|
|
215
|
-
evaluatedDomains: ["semantic", "
|
|
333
|
+
evaluatedDomains: ["semantic", "proof", "symbol"],
|
|
216
334
|
incompleteDomains:
|
|
217
335
|
payload.meta?.scopeComplete === false ? ["coverage"] : [],
|
|
218
336
|
actions: buildActionsFromCoverage({
|
|
@@ -231,23 +349,23 @@ export async function executeCoverage(
|
|
|
231
349
|
: coveragePlan;
|
|
232
350
|
const enrichedPayload = {
|
|
233
351
|
...payload,
|
|
352
|
+
rows,
|
|
234
353
|
...(repairPlan !== undefined ? { repairPlan } : {}),
|
|
235
354
|
...(legacyMigrationPlan !== undefined ? { legacyMigrationPlan } : {}),
|
|
236
355
|
...(symbolRepairPlan !== undefined ? { symbolRepairPlan } : {}),
|
|
237
356
|
migrationPlan,
|
|
238
357
|
meta: {
|
|
239
358
|
...(payload.meta ?? {}),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
359
|
+
proofReceiptMaxAgeSeconds: PROOF_RECEIPT_MAX_AGE_SECONDS,
|
|
360
|
+
proofSnapshot: codeSnapshot,
|
|
361
|
+
proofSnapshotAvailable: snapshotEvidence.available,
|
|
243
362
|
...(snapshotEvidence.available
|
|
244
363
|
? {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
verificationSnapshotVersion: snapshotEvidence.snapshot.version,
|
|
364
|
+
proofSnapshotDirty: snapshotEvidence.snapshot.dirty,
|
|
365
|
+
proofSnapshotFileCount: snapshotEvidence.snapshot.fileCount,
|
|
366
|
+
proofSnapshotVersion: snapshotEvidence.snapshot.version,
|
|
249
367
|
}
|
|
250
|
-
: {
|
|
368
|
+
: { proofSnapshotError: snapshotEvidence.error }),
|
|
251
369
|
},
|
|
252
370
|
};
|
|
253
371
|
const fullyCovered = Number(enrichedPayload.summary?.fullyCovered ?? 0);
|
|
@@ -279,6 +397,15 @@ export const coverageSpec = {
|
|
|
279
397
|
by: { type: "string", enum: ["req", "symbol", "type"], default: "req" },
|
|
280
398
|
tags: { type: "array", items: { type: "string" } },
|
|
281
399
|
includePassing: { type: "boolean", default: false },
|
|
400
|
+
statuses: {
|
|
401
|
+
type: "array",
|
|
402
|
+
items: {
|
|
403
|
+
type: "string",
|
|
404
|
+
enum: ["proven", "missing", "unresolved", "not_applicable"],
|
|
405
|
+
},
|
|
406
|
+
description:
|
|
407
|
+
"Requirement proof-status filter (req mode): include only rows whose proofStatus is listed. Selecting statuses implies include-passing; not_applicable rows carry their typed applicability reason in proofStages.applicability.reason. The summary always reflects the whole KB.",
|
|
408
|
+
},
|
|
282
409
|
includeTransitive: { type: "boolean", default: true },
|
|
283
410
|
limit: { type: "integer", default: 100 },
|
|
284
411
|
offset: { type: "integer", default: 0 },
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { InputError } from "../../../cli-errors.js";
|
|
2
|
-
import {
|
|
2
|
+
import { analyzeSemanticAdvisorInputWithPlugins } from "../../../operations/semantic-advisor/plugin-orchestration.js";
|
|
3
3
|
import type {
|
|
4
4
|
SemanticAdvisorArgs,
|
|
5
5
|
SemanticAdvisorOperationResult,
|
|
6
6
|
} from "../../../operations/semantic-advisor/types.js";
|
|
7
|
+
import { publicCapabilityStamp } from "../../../plugins/compose-semantic-classifier.js";
|
|
7
8
|
import type { OperationContext } from "../runtime-types.js";
|
|
8
9
|
import type { OperationSpec } from "../types.js";
|
|
9
10
|
|
|
@@ -25,28 +26,85 @@ function optionalString(value: unknown): string | undefined {
|
|
|
25
26
|
|
|
26
27
|
export async function executeSemanticAdvisor(
|
|
27
28
|
args: SemanticAdvisorArgs,
|
|
28
|
-
|
|
29
|
+
context?: OperationContext,
|
|
29
30
|
): Promise<SemanticAdvisorOperationResult> {
|
|
30
31
|
const text = requiredText(args.text);
|
|
31
32
|
const id = optionalString(args.id) ?? "REQ-SEMANTIC-ADVISOR-PREVIEW";
|
|
32
33
|
const title = optionalString(args.title) ?? text.split(/[.!?]/, 1)[0] ?? text;
|
|
33
34
|
const source = optionalString(args.source) ?? "mcp://kibi/semantic-advisor";
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const orchestrated = await analyzeSemanticAdvisorInputWithPlugins(
|
|
36
|
+
{
|
|
37
|
+
payload: {
|
|
38
|
+
type: optionalString(args.type) ?? "req",
|
|
39
|
+
id,
|
|
40
|
+
properties: {
|
|
41
|
+
title,
|
|
42
|
+
status: optionalString(args.status) ?? "open",
|
|
43
|
+
source,
|
|
44
|
+
semantic_text: text,
|
|
45
|
+
},
|
|
43
46
|
},
|
|
47
|
+
...(args.clauses !== undefined ? { clauses: args.clauses } : {}),
|
|
48
|
+
...(args.interpretations !== undefined
|
|
49
|
+
? { interpretations: args.interpretations }
|
|
50
|
+
: {}),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
operationName: "kb_semantic_advisor",
|
|
54
|
+
...(context?.ensurePlugins
|
|
55
|
+
? { ensurePlugins: context.ensurePlugins }
|
|
56
|
+
: {}),
|
|
44
57
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
);
|
|
59
|
+
const result = orchestrated.analysis;
|
|
60
|
+
const pluginWarnings =
|
|
61
|
+
orchestrated.stamps.length > 0
|
|
62
|
+
? [
|
|
63
|
+
`Capability plugins consulted: ${orchestrated.stamps
|
|
64
|
+
.map((stamp) => `${stamp.pluginId}/${stamp.capability}`)
|
|
65
|
+
.join(", ")}.`,
|
|
66
|
+
]
|
|
67
|
+
: [];
|
|
68
|
+
const capabilityPlugins =
|
|
69
|
+
orchestrated.stamps.length > 0 ||
|
|
70
|
+
(orchestrated.classification?.shadowComparisons.length ?? 0) > 0 ||
|
|
71
|
+
orchestrated.ontologyShadowMatches.length > 0
|
|
72
|
+
? {
|
|
73
|
+
stamps: orchestrated.stamps.map((stamp) =>
|
|
74
|
+
publicCapabilityStamp(stamp),
|
|
75
|
+
),
|
|
76
|
+
classification: orchestrated.classification
|
|
77
|
+
? {
|
|
78
|
+
fallbackUsed: orchestrated.classification.fallbackUsed,
|
|
79
|
+
decisions: orchestrated.classification.decisions,
|
|
80
|
+
shadowComparisons:
|
|
81
|
+
orchestrated.classification.shadowComparisons.map(
|
|
82
|
+
(comparison) => ({
|
|
83
|
+
...publicCapabilityStamp(comparison.stamp),
|
|
84
|
+
decisions: comparison.decisions.map((decision) => ({
|
|
85
|
+
claimKey: decision.claimKey,
|
|
86
|
+
lane: decision.lane,
|
|
87
|
+
confidence: decision.confidence,
|
|
88
|
+
})),
|
|
89
|
+
}),
|
|
90
|
+
),
|
|
91
|
+
}
|
|
92
|
+
: null,
|
|
93
|
+
ontology: {
|
|
94
|
+
replaced: orchestrated.ontologyCatalog?.replaced ?? false,
|
|
95
|
+
matchCount: orchestrated.ontologyMatches.length,
|
|
96
|
+
shadowMatchCount: orchestrated.ontologyShadowMatches.length,
|
|
97
|
+
shadowMatches: orchestrated.ontologyShadowMatches.map(
|
|
98
|
+
(candidate) => ({
|
|
99
|
+
packId: candidate.packId,
|
|
100
|
+
schemaId: candidate.schemaId,
|
|
101
|
+
predicateName: candidate.predicateName,
|
|
102
|
+
confidence: candidate.confidence,
|
|
103
|
+
}),
|
|
104
|
+
),
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: undefined;
|
|
50
108
|
return {
|
|
51
109
|
content: [
|
|
52
110
|
{
|
|
@@ -54,7 +112,11 @@ export async function executeSemanticAdvisor(
|
|
|
54
112
|
text: `kb_semantic_advisor: ${result.receipt.summary} Suggestions: ${result.receipt.suggestions.map(({ kind }) => kind).join(", ") || "none"}.`,
|
|
55
113
|
},
|
|
56
114
|
],
|
|
57
|
-
structuredContent: {
|
|
115
|
+
structuredContent: {
|
|
116
|
+
receipt: result.receipt,
|
|
117
|
+
warnings: [...result.warnings, ...pluginWarnings],
|
|
118
|
+
...(capabilityPlugins ? { capabilityPlugins } : {}),
|
|
119
|
+
},
|
|
58
120
|
};
|
|
59
121
|
}
|
|
60
122
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { coarseCoordinateSpan } from "../../extractors/symbol-coordinates.js";
|
|
4
|
+
import {
|
|
5
|
+
type ManifestSymbolEntry,
|
|
6
|
+
analyzeSourceText,
|
|
7
|
+
enrichSymbolCoordinates,
|
|
8
|
+
} from "../../extractors/symbols-coordinator.js";
|
|
9
|
+
import { isCoarseGranularityReason } from "../symbol-granularity.js";
|
|
4
10
|
import { loadEntities } from "./discovery-entities.js";
|
|
5
11
|
import type { OperationContext } from "./runtime-types.js";
|
|
6
12
|
|
|
@@ -31,6 +37,152 @@ function coordinatesPresent(
|
|
|
31
37
|
].every((value) => Number.isInteger(value) && Number(value) >= 0);
|
|
32
38
|
}
|
|
33
39
|
|
|
40
|
+
export type CoordinateRepairEvidence = Readonly<{
|
|
41
|
+
symbolId: string;
|
|
42
|
+
sourceFile: string | null;
|
|
43
|
+
refreshable: boolean;
|
|
44
|
+
reason:
|
|
45
|
+
| "extractable"
|
|
46
|
+
| "coarse_anchor"
|
|
47
|
+
| "extractor_miss"
|
|
48
|
+
| "source_unavailable";
|
|
49
|
+
suggestion: string;
|
|
50
|
+
}>;
|
|
51
|
+
|
|
52
|
+
/** Preview the same extraction and explicit coarse fallback used by refresh. */
|
|
53
|
+
export async function inspectCoordinateRepairs(
|
|
54
|
+
symbols: readonly Readonly<Record<string, unknown>>[],
|
|
55
|
+
workspaceRoot: string,
|
|
56
|
+
): Promise<Map<string, CoordinateRepairEvidence>> {
|
|
57
|
+
const entries: ManifestSymbolEntry[] = symbols.map((symbol) => {
|
|
58
|
+
const sourceFile = sourceFileOf(symbol);
|
|
59
|
+
return {
|
|
60
|
+
id: String(symbol.id),
|
|
61
|
+
title: typeof symbol.title === "string" ? symbol.title : "",
|
|
62
|
+
...(sourceFile === null ? {} : { sourceFile }),
|
|
63
|
+
...(typeof symbol.granularity_reason === "string"
|
|
64
|
+
? { granularity_reason: symbol.granularity_reason }
|
|
65
|
+
: {}),
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
const enriched = await enrichSymbolCoordinates(entries, workspaceRoot);
|
|
69
|
+
return new Map(
|
|
70
|
+
entries.map((entry, index) => {
|
|
71
|
+
const sourceFile = entry.sourceFile ?? null;
|
|
72
|
+
let source: string | null = null;
|
|
73
|
+
if (sourceFile) {
|
|
74
|
+
try {
|
|
75
|
+
source = readFileSync(
|
|
76
|
+
path.resolve(workspaceRoot, sourceFile),
|
|
77
|
+
"utf8",
|
|
78
|
+
);
|
|
79
|
+
} catch {
|
|
80
|
+
/* A missing or unreadable source requires authored repair. */
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const extracted =
|
|
84
|
+
entry.title.length > 0 && coordinatesPresent(enriched[index] ?? {});
|
|
85
|
+
const coarse =
|
|
86
|
+
source !== null &&
|
|
87
|
+
sourceFile !== null &&
|
|
88
|
+
isCoarseGranularityReason(entry.granularity_reason) &&
|
|
89
|
+
coarseCoordinateSpan(sourceFile, entry.title, source) !== null;
|
|
90
|
+
const reason =
|
|
91
|
+
source === null
|
|
92
|
+
? "source_unavailable"
|
|
93
|
+
: extracted
|
|
94
|
+
? "extractable"
|
|
95
|
+
: coarse
|
|
96
|
+
? "coarse_anchor"
|
|
97
|
+
: "extractor_miss";
|
|
98
|
+
const refreshable = source !== null && (extracted || coarse);
|
|
99
|
+
return [
|
|
100
|
+
entry.id,
|
|
101
|
+
{
|
|
102
|
+
symbolId: entry.id,
|
|
103
|
+
sourceFile,
|
|
104
|
+
refreshable,
|
|
105
|
+
reason,
|
|
106
|
+
suggestion: refreshable
|
|
107
|
+
? "Refresh and persist current symbol coordinates."
|
|
108
|
+
: source === null
|
|
109
|
+
? "Repair sourceFile to point to readable implementation code before refreshing."
|
|
110
|
+
: "Query and validate the symbol, then author a resolvable title/sourceFile or an explicit granularity_reason: extractor-miss (or another intentional coarse anchor) through kb_upsert before refreshing.",
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Attach current extraction evidence before constructing requirement repairs. */
|
|
118
|
+
export async function addCoordinateRepairEvidence(
|
|
119
|
+
rows: readonly Readonly<Record<string, unknown>>[],
|
|
120
|
+
context: OperationContext,
|
|
121
|
+
): Promise<readonly Readonly<Record<string, unknown>>[]> {
|
|
122
|
+
const missingByRow = rows.map((row) => {
|
|
123
|
+
const stages = row.proofStages as
|
|
124
|
+
| { sourceCoordinates?: { missingSymbols?: unknown } }
|
|
125
|
+
| undefined;
|
|
126
|
+
const missing = stages?.sourceCoordinates?.missingSymbols;
|
|
127
|
+
return Array.isArray(missing)
|
|
128
|
+
? missing.filter((id): id is string => typeof id === "string")
|
|
129
|
+
: [];
|
|
130
|
+
});
|
|
131
|
+
const ids = new Set(missingByRow.flat());
|
|
132
|
+
if (ids.size === 0 || !context.prolog) return rows;
|
|
133
|
+
const symbols = (
|
|
134
|
+
await loadEntities(context.prolog, { type: "symbol" })
|
|
135
|
+
).filter((symbol) => ids.has(String(symbol.id)));
|
|
136
|
+
const evidence = await inspectCoordinateRepairs(
|
|
137
|
+
symbols,
|
|
138
|
+
context.workspaceRoot,
|
|
139
|
+
);
|
|
140
|
+
return rows.map((row, index) => {
|
|
141
|
+
const missing = missingByRow[index] ?? [];
|
|
142
|
+
if (missing.length === 0) return row;
|
|
143
|
+
const coordinateRepairs = missing.map(
|
|
144
|
+
(id) =>
|
|
145
|
+
evidence.get(id) ?? {
|
|
146
|
+
symbolId: id,
|
|
147
|
+
sourceFile: null,
|
|
148
|
+
refreshable: false,
|
|
149
|
+
reason: "source_unavailable",
|
|
150
|
+
suggestion: "Query and repair the missing symbol before refreshing.",
|
|
151
|
+
},
|
|
152
|
+
);
|
|
153
|
+
const stages = row.proofStages as Record<string, Record<string, unknown>>;
|
|
154
|
+
return {
|
|
155
|
+
...row,
|
|
156
|
+
...(Array.isArray(row.proofRepairs)
|
|
157
|
+
? {
|
|
158
|
+
proofRepairs: row.proofRepairs.map((repair) =>
|
|
159
|
+
repair?.gap === "missing_symbol_coordinates" &&
|
|
160
|
+
coordinateRepairs.some((item) => !item.refreshable)
|
|
161
|
+
? {
|
|
162
|
+
...repair,
|
|
163
|
+
action: [
|
|
164
|
+
...new Set(
|
|
165
|
+
coordinateRepairs
|
|
166
|
+
.filter((item) => !item.refreshable)
|
|
167
|
+
.map((item) => item.suggestion),
|
|
168
|
+
),
|
|
169
|
+
].join(" "),
|
|
170
|
+
}
|
|
171
|
+
: repair,
|
|
172
|
+
),
|
|
173
|
+
}
|
|
174
|
+
: {}),
|
|
175
|
+
proofStages: {
|
|
176
|
+
...stages,
|
|
177
|
+
sourceCoordinates: {
|
|
178
|
+
...stages.sourceCoordinates,
|
|
179
|
+
coordinateRepairs,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
34
186
|
function currentCandidates(
|
|
35
187
|
entity: Readonly<Record<string, unknown>>,
|
|
36
188
|
symbols: readonly Readonly<Record<string, unknown>>[],
|
|
@@ -88,10 +240,10 @@ export async function buildSymbolRepairPlan(
|
|
|
88
240
|
: path.resolve(context.workspaceRoot, source);
|
|
89
241
|
if (!existsSync(absolute)) continue;
|
|
90
242
|
try {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
243
|
+
const content = readFileSync(absolute, "utf8");
|
|
244
|
+
// Coverage/impact is a maintenance path: never import project plugins.
|
|
245
|
+
const analysis = analyzeSourceText(absolute, content);
|
|
246
|
+
if (analysis.providerId === null) continue;
|
|
95
247
|
extractedByPath.set(
|
|
96
248
|
source,
|
|
97
249
|
analysis.symbols.map((candidate) => ({
|
|
@@ -100,10 +252,14 @@ export async function buildSymbolRepairPlan(
|
|
|
100
252
|
})),
|
|
101
253
|
);
|
|
102
254
|
} catch {
|
|
103
|
-
|
|
255
|
+
// An unavailable extractor cannot establish that a declaration is absent.
|
|
104
256
|
}
|
|
105
257
|
}
|
|
106
258
|
|
|
259
|
+
const coordinateEvidence = await inspectCoordinateRepairs(
|
|
260
|
+
symbols.filter((symbol) => !coordinatesPresent(symbol)),
|
|
261
|
+
context.workspaceRoot,
|
|
262
|
+
);
|
|
107
263
|
const repairs = rows.flatMap((row) => {
|
|
108
264
|
if (row.type !== "symbol") return [];
|
|
109
265
|
const entity = symbols.find((candidate) => candidate.id === row.id);
|
|
@@ -133,7 +289,9 @@ export async function buildSymbolRepairPlan(
|
|
|
133
289
|
: extractionProvesAbsent && entity.symbol_origin === "extracted"
|
|
134
290
|
? "delete_obsolete_symbol"
|
|
135
291
|
: !coordinatesPresent(entity)
|
|
136
|
-
?
|
|
292
|
+
? coordinateEvidence.get(String(entity.id))?.refreshable === true
|
|
293
|
+
? "refresh_coordinates"
|
|
294
|
+
: "review"
|
|
137
295
|
: candidates.length > 0
|
|
138
296
|
? "remap"
|
|
139
297
|
: "review";
|
|
@@ -151,6 +309,7 @@ export async function buildSymbolRepairPlan(
|
|
|
151
309
|
? extractedByPath.has(source)
|
|
152
310
|
: false,
|
|
153
311
|
autoApply: false,
|
|
312
|
+
coordinateRepair: coordinateEvidence.get(String(entity.id)),
|
|
154
313
|
},
|
|
155
314
|
},
|
|
156
315
|
];
|
|
@@ -21,7 +21,7 @@ export type OperationName =
|
|
|
21
21
|
| "kb_plan_bootstrap"
|
|
22
22
|
| "kb_compile_intent"
|
|
23
23
|
| "kb_apply_plan"
|
|
24
|
-
| "
|
|
24
|
+
| "kb_ingest_proof";
|
|
25
25
|
|
|
26
26
|
export type OperationEffect =
|
|
27
27
|
| "local-read"
|
|
@@ -93,6 +93,11 @@ export interface OperationSpec<
|
|
|
93
93
|
readonly businessInputSchema: Readonly<Record<string, unknown>>;
|
|
94
94
|
readonly requiresProlog: boolean;
|
|
95
95
|
readonly effects: readonly OperationEffect[];
|
|
96
|
+
/**
|
|
97
|
+
* When true, MCP duplicates envelope `data` into tool `content` text so hosts
|
|
98
|
+
* that hide `structuredContent` still expose discovery/proof payloads.
|
|
99
|
+
*/
|
|
100
|
+
readonly agentVisibleStructuredData?: boolean;
|
|
96
101
|
/** Generated effect metadata used by MCP annotations and telemetry. */
|
|
97
102
|
readonly declaredEffects?: readonly OperationEffectDeclaration[];
|
|
98
103
|
/** Version of the machine-readable result data for this operation. */
|