kibi-cli 1.0.1 → 2.0.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 +103 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +17 -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.d.ts +14 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +190 -44
- 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 +48 -22
- package/dist/commands/engine.d.ts +12 -0
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +40 -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 +38 -5
- 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-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.js +1 -1
- 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 +1 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +53 -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 +25 -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 +14 -76
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +197 -30
- 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 +5 -3
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +41 -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-ts.d.ts +1 -0
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +142 -67
- package/dist/intent-search.d.ts +1 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +7 -3
- 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 +53 -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 +3 -1
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +52 -19
- 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 +2 -2
- 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 +2 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +70 -14
- 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 +307 -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 +88 -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/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 +46 -26
- 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/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/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 +3 -3
- 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/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 +447 -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 +3 -7
- 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 +31 -22
- package/dist/public/operations/discovery-entities.d.ts +3 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +4 -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 +17 -14
- 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/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 +5 -0
- 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 +34 -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/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 +19 -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/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 +118 -3
- package/dist/public/operations/types.d.ts +1 -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 +41 -12
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/dist/public/skills/kibi-usage/resources/proof.md +105 -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 +20 -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 +282 -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 +14 -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 +5 -0
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +1 -1
- 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 +97 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -0
- package/dist/utils/rule-registry.generated.js +125 -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 +8 -11
- package/src/public/diagnostic-usage.ts +6 -6
- package/src/public/distribution-parity.ts +17 -10
- 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 +3 -7
- package/src/public/operations/contracts.ts +38 -22
- package/src/public/operations/discovery-entities.ts +7 -0
- package/src/public/operations/discovery-executors.ts +26 -23
- 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/repair-plan.ts +60 -23
- package/src/public/operations/result-envelope.ts +15 -10
- package/src/public/operations/runtime-types.ts +5 -0
- package/src/public/operations/specs/check-rules.generated.ts +37 -0
- package/src/public/operations/specs/check.ts +12 -21
- 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/symbol-repair-plan.ts +163 -3
- package/src/public/operations/types.ts +1 -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 +41 -12
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/src/public/skills/kibi-usage/resources/proof.md +105 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/src/public/symbol-granularity.generated.ts +41 -0
- package/src/public/symbol-granularity.ts +35 -60
- 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
|
@@ -36,6 +36,20 @@ function nextActions(value: unknown): KibiResult["nextActions"] {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export function failedEffectStatus(
|
|
40
|
+
effect: OperationEffect,
|
|
41
|
+
failure: Record<string, unknown>,
|
|
42
|
+
): KibiResult["effects"][number] {
|
|
43
|
+
return {
|
|
44
|
+
kind: effect,
|
|
45
|
+
status: "failed",
|
|
46
|
+
detail: failure.detail,
|
|
47
|
+
...(typeof failure.errorCode === "string"
|
|
48
|
+
? { errorCode: failure.errorCode }
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
39
53
|
function effectStatus(
|
|
40
54
|
effect: OperationEffect,
|
|
41
55
|
data: Record<string, unknown> | undefined,
|
|
@@ -45,16 +59,7 @@ function effectStatus(
|
|
|
45
59
|
const failure = failures.find(
|
|
46
60
|
(entry) => record(entry) && entry.kind === effect,
|
|
47
61
|
);
|
|
48
|
-
if (record(failure))
|
|
49
|
-
return {
|
|
50
|
-
kind: effect,
|
|
51
|
-
status: "failed",
|
|
52
|
-
detail: failure.detail,
|
|
53
|
-
...(typeof failure.errorCode === "string"
|
|
54
|
-
? { errorCode: failure.errorCode }
|
|
55
|
-
: {}),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
62
|
+
if (record(failure)) return failedEffectStatus(effect, failure);
|
|
58
63
|
}
|
|
59
64
|
return { kind: effect, status: "completed" };
|
|
60
65
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PrologErrorRecord } from "../../prolog/error-terms.js";
|
|
1
2
|
import type { BranchAttachment } from "../../utils/branch-resolver.js";
|
|
2
3
|
import type { OperationEffect } from "./types.js";
|
|
3
4
|
|
|
@@ -7,6 +8,8 @@ export type PrologQueryResult = {
|
|
|
7
8
|
readonly success: boolean;
|
|
8
9
|
readonly bindings: Readonly<Record<string, string>>;
|
|
9
10
|
readonly error?: string;
|
|
11
|
+
/** Structured error term when the failure crossed a kb.pl throw site. */
|
|
12
|
+
readonly errorRecord?: PrologErrorRecord;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
export type PrologEntityQueryInput = Readonly<{
|
|
@@ -187,6 +190,8 @@ export type OperationContext = {
|
|
|
187
190
|
readonly sourceFirst?: boolean;
|
|
188
191
|
/** Internal apply-plan capability: source bytes were already approved/published. */
|
|
189
192
|
readonly sourcePlanApplication?: boolean;
|
|
193
|
+
/** Internal apply-plan capability: caller holds the cooperative source lock. */
|
|
194
|
+
readonly sourceMutationLockHeld?: boolean;
|
|
190
195
|
readonly git?: GitPort;
|
|
191
196
|
readonly net?: NetworkPort;
|
|
192
197
|
readonly branchAttachment?: BranchAttachment;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
* Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by scripts/generate-rule-registry.mjs from
|
|
6
|
+
* packages/core/schema/rule-registry.json. Do not edit it directly; edit the
|
|
7
|
+
* JSON source and regenerate.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// implements REQ-006
|
|
11
|
+
/** Every selectable kb_check rule name, registry order. */
|
|
12
|
+
export const SELECTABLE_RULE_NAMES: readonly string[] = [
|
|
13
|
+
"must-priority-coverage",
|
|
14
|
+
"symbol-coverage",
|
|
15
|
+
"symbol-traceability",
|
|
16
|
+
"no-dangling-refs",
|
|
17
|
+
"source-relationship-parity",
|
|
18
|
+
"no-cycles",
|
|
19
|
+
"required-fields",
|
|
20
|
+
"deprecated-adr-no-successor",
|
|
21
|
+
"domain-contradictions",
|
|
22
|
+
"logic-coverage",
|
|
23
|
+
"rule-safety",
|
|
24
|
+
"rule-verifiability",
|
|
25
|
+
"query-plan-safety",
|
|
26
|
+
"req-status-vocabulary",
|
|
27
|
+
"strict-fact-shape",
|
|
28
|
+
"strict-req-fact-pairing",
|
|
29
|
+
"predicate-verifiability",
|
|
30
|
+
"strict-readiness",
|
|
31
|
+
"semantic-completeness",
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
// implements REQ-006
|
|
35
|
+
/** Comma-separated "Allowed:" fragment for the kb_check rules description. */
|
|
36
|
+
export const SELECTABLE_RULES_ALLOWED =
|
|
37
|
+
"must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { executeCheck } from "../check-executor.js";
|
|
2
2
|
import type { OperationSpec } from "../types.js";
|
|
3
|
+
import {
|
|
4
|
+
SELECTABLE_RULES_ALLOWED,
|
|
5
|
+
SELECTABLE_RULE_NAMES,
|
|
6
|
+
} from "./check-rules.generated.js";
|
|
3
7
|
|
|
4
8
|
export const checkSpec = {
|
|
5
9
|
name: "kb_check",
|
|
@@ -13,28 +17,9 @@ export const checkSpec = {
|
|
|
13
17
|
type: "array",
|
|
14
18
|
items: {
|
|
15
19
|
type: "string",
|
|
16
|
-
enum: [
|
|
17
|
-
"must-priority-coverage",
|
|
18
|
-
"symbol-coverage",
|
|
19
|
-
"symbol-traceability",
|
|
20
|
-
"no-dangling-refs",
|
|
21
|
-
"source-relationship-parity",
|
|
22
|
-
"no-cycles",
|
|
23
|
-
"required-fields",
|
|
24
|
-
"deprecated-adr-no-successor",
|
|
25
|
-
"domain-contradictions",
|
|
26
|
-
"strict-fact-shape",
|
|
27
|
-
"strict-req-fact-pairing",
|
|
28
|
-
"predicate-verifiability",
|
|
29
|
-
"logic-coverage",
|
|
30
|
-
"rule-safety",
|
|
31
|
-
"rule-verifiability",
|
|
32
|
-
"semantic-completeness",
|
|
33
|
-
"query-plan-safety",
|
|
34
|
-
],
|
|
20
|
+
enum: [...SELECTABLE_RULE_NAMES],
|
|
35
21
|
},
|
|
36
|
-
description:
|
|
37
|
-
"Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, logic-coverage, rule-safety, rule-verifiability, semantic-completeness, query-plan-safety. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.",
|
|
22
|
+
description: `Optional rule subset. Allowed: ${SELECTABLE_RULES_ALLOWED}. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.`,
|
|
38
23
|
},
|
|
39
24
|
sourceFiles: {
|
|
40
25
|
type: "array",
|
|
@@ -68,6 +53,12 @@ export const checkSpec = {
|
|
|
68
53
|
description:
|
|
69
54
|
"Optional workspace root for impact diagnostics. Defaults to the MCP server workspace.",
|
|
70
55
|
},
|
|
56
|
+
async: {
|
|
57
|
+
type: "boolean",
|
|
58
|
+
default: false,
|
|
59
|
+
description:
|
|
60
|
+
"When true, start the check as a background job and return a kibi.job.v1 receipt immediately instead of holding the request until the tool timeout. Poll kb_job_status with the returned jobId. Use for full checks on large KBs that exceed the configured tool timeout.",
|
|
61
|
+
},
|
|
71
62
|
},
|
|
72
63
|
},
|
|
73
64
|
requiresProlog: true,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../../
|
|
2
|
+
PROOF_BINDINGS_SCHEMA,
|
|
3
|
+
PROOF_CONTRACT_SCHEMA,
|
|
4
|
+
} from "../../proof-protocol.js";
|
|
5
|
+
import {
|
|
6
|
+
MAX_PROOF_RECEIPTS,
|
|
7
|
+
PROOF_RECEIPT_SCHEMA,
|
|
8
|
+
} from "../../proof-receipt.js";
|
|
5
9
|
|
|
6
10
|
export const ENTITY_TYPES = [
|
|
7
11
|
"req",
|
|
@@ -152,13 +156,22 @@ export const ENTITY_PROPERTIES_SCHEMA = {
|
|
|
152
156
|
description:
|
|
153
157
|
"Optional typed verification perspective for test entities. Example: 'consumer'.",
|
|
154
158
|
},
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
proof_contract: {
|
|
160
|
+
...PROOF_CONTRACT_SCHEMA,
|
|
161
|
+
description:
|
|
162
|
+
"Semantic proof contract binding this test to explicit proof obligations executed by one configured integration.",
|
|
163
|
+
},
|
|
164
|
+
proof_bindings: {
|
|
165
|
+
...PROOF_BINDINGS_SCHEMA,
|
|
166
|
+
description:
|
|
167
|
+
"Optional native-runner bindings (native ids, aliases, source coordinates) for proof obligations. Bindings are provenance metadata and never replace the semantic contract.",
|
|
168
|
+
},
|
|
169
|
+
proof_receipts: {
|
|
157
170
|
type: "array",
|
|
158
|
-
maxItems:
|
|
159
|
-
items:
|
|
171
|
+
maxItems: MAX_PROOF_RECEIPTS,
|
|
172
|
+
items: PROOF_RECEIPT_SCHEMA,
|
|
160
173
|
description:
|
|
161
|
-
"Append-only
|
|
174
|
+
"Append-only proof evidence. Proof accepts only the newest valid passed receipt bound to the current code snapshot, current contract hash, and effective execution fingerprint within the seven-day freshness window. Ingest rotates the oldest entries at the cap.",
|
|
162
175
|
},
|
|
163
176
|
fact_kind: {
|
|
164
177
|
type: "string",
|
|
@@ -323,7 +336,7 @@ export const ENTITY_PROPERTIES_SCHEMA = {
|
|
|
323
336
|
allOf: [
|
|
324
337
|
CLAIM_PROVENANCE_CONDITIONAL,
|
|
325
338
|
{
|
|
326
|
-
if: { required: ["
|
|
339
|
+
if: { required: ["proof_receipts"] },
|
|
327
340
|
// biome-ignore lint/suspicious/noThenProperty: JSON Schema conditional keyword.
|
|
328
341
|
then: { required: ["verification_scope"] },
|
|
329
342
|
},
|
|
@@ -143,6 +143,13 @@ export const compileIntentSpec = {
|
|
|
143
143
|
id: { type: "string" },
|
|
144
144
|
title: { type: "string", minLength: 1 },
|
|
145
145
|
body: { type: "string", minLength: 1 },
|
|
146
|
+
scenarioIds: {
|
|
147
|
+
type: "array",
|
|
148
|
+
items: { type: "string", minLength: 1 },
|
|
149
|
+
maxItems: 20,
|
|
150
|
+
description:
|
|
151
|
+
"Stable scenario draft IDs verified by this test. Required when multiple scenario drafts are supplied.",
|
|
152
|
+
},
|
|
146
153
|
verificationScope: {
|
|
147
154
|
type: "string",
|
|
148
155
|
enum: ["unit", "integration", "end_to_end"],
|
|
@@ -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-proof-evidence-protocol
|
|
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-proof-evidence-protocol
|
|
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
|
+
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 },
|