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
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
validateUpsertSpec,
|
|
17
17
|
} from "./specs/mutation.js";
|
|
18
18
|
import { applyPlanSpec, compileIntentSpec } from "./specs/planning.js";
|
|
19
|
+
import { ingestProofSpec } from "./specs/proof.js";
|
|
19
20
|
import { coverageSpec, findGapsSpec, graphSpec } from "./specs/reporting.js";
|
|
20
21
|
import { semanticAdvisorSpec } from "./specs/semantic.js";
|
|
21
22
|
import {
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
skillsReadSpec,
|
|
25
26
|
} from "./specs/skills.js";
|
|
26
27
|
import { sparqlRemoteSpec } from "./specs/sparql.js";
|
|
27
|
-
import { ingestVerificationSpec } from "./specs/verification.js";
|
|
28
28
|
import type {
|
|
29
29
|
OperationName,
|
|
30
30
|
OperationSpec,
|
|
@@ -52,7 +52,7 @@ export const OPERATION_CATALOG = [
|
|
|
52
52
|
sparqlRemoteSpec,
|
|
53
53
|
compileIntentSpec,
|
|
54
54
|
applyPlanSpec,
|
|
55
|
-
|
|
55
|
+
ingestProofSpec,
|
|
56
56
|
] as const satisfies readonly OperationSpec[];
|
|
57
57
|
|
|
58
58
|
function envelopeSchema(
|
|
@@ -183,14 +183,20 @@ const SPECS_BY_NAME: ReadonlyMap<OperationName, ResolvedOperationSpec> =
|
|
|
183
183
|
);
|
|
184
184
|
|
|
185
185
|
// implements REQ-kibi-operation-interface-parity
|
|
186
|
-
export function
|
|
187
|
-
|
|
186
|
+
export function requireKnownSpec(
|
|
187
|
+
spec: ResolvedOperationSpec | undefined,
|
|
188
|
+
name: OperationName,
|
|
189
|
+
): ResolvedOperationSpec {
|
|
188
190
|
if (!spec) {
|
|
189
191
|
throw new RangeError(`Unknown Kibi operation: ${name}`);
|
|
190
192
|
}
|
|
191
193
|
return spec;
|
|
192
194
|
}
|
|
193
195
|
|
|
196
|
+
export function getSpec(name: OperationName): ResolvedOperationSpec {
|
|
197
|
+
return requireKnownSpec(SPECS_BY_NAME.get(name), name);
|
|
198
|
+
}
|
|
199
|
+
|
|
194
200
|
// implements REQ-kibi-operation-interface-parity
|
|
195
201
|
export function listSpecs(): readonly ResolvedOperationSpec[] {
|
|
196
202
|
return OPERATION_CATALOG.map(withContractDefaults);
|
|
@@ -127,7 +127,7 @@ export async function executeCheck(
|
|
|
127
127
|
const workspaceRoot = args.workspaceRoot ?? context.workspaceRoot;
|
|
128
128
|
const prolog = requireProlog(context);
|
|
129
129
|
const snapshotEvidence = await readWorkspaceSnapshot(context);
|
|
130
|
-
const
|
|
130
|
+
const proofSnapshot = snapshotEvidence.available
|
|
131
131
|
? snapshotEvidence.snapshot.hash
|
|
132
132
|
: undefined;
|
|
133
133
|
const checkedAt = context.clock().toISOString();
|
|
@@ -152,9 +152,7 @@ export async function executeCheck(
|
|
|
152
152
|
: await collectFullKbQualityDiagnostics({
|
|
153
153
|
prolog,
|
|
154
154
|
workspaceRoot,
|
|
155
|
-
...(
|
|
156
|
-
? { verificationSnapshot }
|
|
157
|
-
: {}),
|
|
155
|
+
...(proofSnapshot !== undefined ? { proofSnapshot } : {}),
|
|
158
156
|
checkedAt,
|
|
159
157
|
now: context.clock(),
|
|
160
158
|
...maxDiagnosticsOption,
|
|
@@ -229,9 +227,7 @@ export async function executeCheck(
|
|
|
229
227
|
prolog,
|
|
230
228
|
hardViolationEntityIds: new Set(violations.map((v) => v.entityId)),
|
|
231
229
|
workspaceRoot,
|
|
232
|
-
...(
|
|
233
|
-
? { verificationSnapshot }
|
|
234
|
-
: {}),
|
|
230
|
+
...(proofSnapshot !== undefined ? { proofSnapshot } : {}),
|
|
235
231
|
checkedAt,
|
|
236
232
|
now: context.clock(),
|
|
237
233
|
...maxDiagnosticsOption,
|
|
@@ -45,7 +45,9 @@ const stringArray: OperationJsonSchema = {
|
|
|
45
45
|
/** Preserve JSON Schema's nullable scalar/object representation in every
|
|
46
46
|
* generated consumer contract. Using a `type` union keeps the catalog
|
|
47
47
|
* readable and lets the MCP bridge round-trip the same wire schema. */
|
|
48
|
-
function
|
|
48
|
+
export function nullableJsonSchema(
|
|
49
|
+
schema: OperationJsonSchema,
|
|
50
|
+
): OperationJsonSchema {
|
|
49
51
|
const type = schema.type;
|
|
50
52
|
if (typeof type === "string") {
|
|
51
53
|
return { ...schema, type: [type, "null"] };
|
|
@@ -86,19 +88,23 @@ export const OPERATION_DATA_SCHEMAS: Readonly<
|
|
|
86
88
|
syncState: stringValue,
|
|
87
89
|
kbPath: stringValue,
|
|
88
90
|
lastSyncSource: stringValue,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
attachedPath: stringValue,
|
|
92
|
+
attachedGeneration: stringValue,
|
|
93
|
+
attachedDev: integerValue,
|
|
94
|
+
attachedIno: integerValue,
|
|
95
|
+
proofSnapshot: stringValue,
|
|
96
|
+
proofSnapshotAvailable: booleanValue,
|
|
97
|
+
proofSnapshotDirty: booleanValue,
|
|
98
|
+
proofSnapshotFileCount: integerValue,
|
|
99
|
+
proofSnapshotVersion: stringValue,
|
|
100
|
+
proofSnapshotError: stringValue,
|
|
95
101
|
staleReasons: recordArray,
|
|
96
102
|
staleReasonCount: integerValue,
|
|
97
103
|
staleReasonsTruncated: booleanValue,
|
|
98
104
|
branchAttachment: recordValue,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
proofSnapshotChanges: recordArray,
|
|
106
|
+
proofSnapshotChangeCount: integerValue,
|
|
107
|
+
proofSnapshotChangesTruncated: booleanValue,
|
|
102
108
|
branchStore: recordValue,
|
|
103
109
|
engineStatus: recordValue,
|
|
104
110
|
schemaStatus: recordValue,
|
|
@@ -204,8 +210,8 @@ export const OPERATION_DATA_SCHEMAS: Readonly<
|
|
|
204
210
|
valid: booleanValue,
|
|
205
211
|
errors: valueArray,
|
|
206
212
|
warnings: valueArray,
|
|
207
|
-
semanticAdvisor:
|
|
208
|
-
normalizedPreview:
|
|
213
|
+
semanticAdvisor: nullableJsonSchema(recordValue),
|
|
214
|
+
normalizedPreview: nullableJsonSchema(recordValue),
|
|
209
215
|
}),
|
|
210
216
|
kb_upsert: objectData({
|
|
211
217
|
created: integerValue,
|
|
@@ -280,12 +286,14 @@ export const OPERATION_DATA_SCHEMAS: Readonly<
|
|
|
280
286
|
effectFailures: recordArray,
|
|
281
287
|
nextActions: recordArray,
|
|
282
288
|
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
kb_ingest_proof: objectData({
|
|
290
|
+
artifactDigest: stringValue,
|
|
291
|
+
environmentHash: stringValue,
|
|
292
|
+
integration: stringValue,
|
|
293
|
+
passed: integerValue,
|
|
294
|
+
failed: integerValue,
|
|
295
|
+
unchanged: integerValue,
|
|
296
|
+
results: recordArray,
|
|
289
297
|
status: stringValue,
|
|
290
298
|
effectFailures: recordArray,
|
|
291
299
|
nextActions: recordArray,
|
|
@@ -333,11 +341,21 @@ const EFFECT_OVERRIDES: Readonly<
|
|
|
333
341
|
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
334
342
|
"workspace-write": { destructive: true, retrySafety: "unsafe" },
|
|
335
343
|
},
|
|
336
|
-
|
|
344
|
+
kb_ingest_proof: {
|
|
337
345
|
"kb-write": { destructive: true, retrySafety: "unsafe" },
|
|
338
346
|
},
|
|
339
347
|
};
|
|
340
348
|
|
|
349
|
+
export function assertUniqueEffectKinds(
|
|
350
|
+
operation: string,
|
|
351
|
+
declarations: readonly { readonly kind: string }[],
|
|
352
|
+
expectedSize: number,
|
|
353
|
+
): void {
|
|
354
|
+
if (new Set(declarations.map(({ kind }) => kind)).size !== expectedSize) {
|
|
355
|
+
throw new Error(`Duplicate effect contract for ${operation}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
341
359
|
export function declaredEffects(
|
|
342
360
|
operation: OperationName,
|
|
343
361
|
effects: readonly OperationEffect[],
|
|
@@ -359,8 +377,6 @@ export function declaredEffects(
|
|
|
359
377
|
openWorld: override.openWorld === true,
|
|
360
378
|
};
|
|
361
379
|
});
|
|
362
|
-
|
|
363
|
-
throw new Error(`Duplicate effect contract for ${operation}`);
|
|
364
|
-
}
|
|
380
|
+
assertUniqueEffectKinds(operation, declarations, expected.size);
|
|
365
381
|
return declarations;
|
|
366
382
|
}
|
|
@@ -11,6 +11,9 @@ export type EntityQueryInput = {
|
|
|
11
11
|
readonly id?: string;
|
|
12
12
|
readonly tags?: readonly string[];
|
|
13
13
|
readonly sourceFile?: string;
|
|
14
|
+
/** Page size for index-backed queries; bounds each query's output. */
|
|
15
|
+
readonly limit?: number;
|
|
16
|
+
readonly offset?: number;
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
export const VALID_ENTITY_TYPES = [
|
|
@@ -63,6 +66,10 @@ export function buildEntityGoal(input: EntityQueryInput): string {
|
|
|
63
66
|
}
|
|
64
67
|
if (type) {
|
|
65
68
|
const safeType = escapeAtomContent(type);
|
|
69
|
+
if (input.limit !== undefined) {
|
|
70
|
+
const offset = input.offset ?? 0;
|
|
71
|
+
return `kb_query_entities('${safeType}', none, [], none, ${input.limit}, ${offset}, Results, Count)`;
|
|
72
|
+
}
|
|
66
73
|
return `findall([Id,'${safeType}',Props], kb_entity(Id, '${safeType}', Props), Results)`;
|
|
67
74
|
}
|
|
68
75
|
return "findall([Id,Type,Props], kb_entity(Id, Type, Props), Results)";
|
|
@@ -14,6 +14,7 @@ import { resolveBranchAttachment } from "../../utils/branch-resolver.js";
|
|
|
14
14
|
import {
|
|
15
15
|
type BranchStoreInspection,
|
|
16
16
|
branchStoreReason,
|
|
17
|
+
storeLockJournalReason,
|
|
17
18
|
inspectBranchStore,
|
|
18
19
|
} from "../../utils/branch-store.js";
|
|
19
20
|
import {
|
|
@@ -76,12 +77,12 @@ export type StatusPayload = {
|
|
|
76
77
|
readonly syncState: string;
|
|
77
78
|
readonly kbPath?: string;
|
|
78
79
|
readonly lastSyncSource?: string;
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
readonly
|
|
80
|
+
readonly proofSnapshot?: string;
|
|
81
|
+
readonly proofSnapshotAvailable?: boolean;
|
|
82
|
+
readonly proofSnapshotDirty?: boolean;
|
|
83
|
+
readonly proofSnapshotFileCount?: number;
|
|
84
|
+
readonly proofSnapshotVersion?: string;
|
|
85
|
+
readonly proofSnapshotError?: string;
|
|
85
86
|
readonly staleReasons?: readonly Record<string, unknown>[];
|
|
86
87
|
readonly staleReasonCount?: number;
|
|
87
88
|
readonly staleReasonsTruncated?: boolean;
|
|
@@ -91,9 +92,9 @@ export type StatusPayload = {
|
|
|
91
92
|
readonly kind: "exact" | "explicit_override" | "legacy_compat";
|
|
92
93
|
readonly migrationRequired: boolean;
|
|
93
94
|
};
|
|
94
|
-
readonly
|
|
95
|
-
readonly
|
|
96
|
-
readonly
|
|
95
|
+
readonly proofSnapshotChanges?: readonly Record<string, unknown>[];
|
|
96
|
+
readonly proofSnapshotChangeCount?: number;
|
|
97
|
+
readonly proofSnapshotChangesTruncated?: boolean;
|
|
97
98
|
readonly branchStore?: BranchStoreInspection;
|
|
98
99
|
readonly engineStatus?: {
|
|
99
100
|
readonly state: "healthy" | "unavailable";
|
|
@@ -385,6 +386,7 @@ export async function executeStatus(
|
|
|
385
386
|
const snapshotEvidence = await readWorkspaceSnapshot(context);
|
|
386
387
|
const existingReasons = payload.staleReasons ?? [];
|
|
387
388
|
const storeReason = branchStoreReason(store);
|
|
389
|
+
const lockReason = storeLockJournalReason(store.path);
|
|
388
390
|
const engineReason = engineStatus
|
|
389
391
|
? {
|
|
390
392
|
code: engineStatus.errorCode ?? "engine_status_unavailable",
|
|
@@ -402,6 +404,7 @@ export async function executeStatus(
|
|
|
402
404
|
const staleReasons = [
|
|
403
405
|
...existingReasons,
|
|
404
406
|
...(storeReason ? [storeReason] : []),
|
|
407
|
+
...(lockReason ? [lockReason] : []),
|
|
405
408
|
...(engineReason ? [engineReason] : []),
|
|
406
409
|
].sort((left, right) =>
|
|
407
410
|
String(left.path ?? "").localeCompare(String(right.path ?? "")),
|
|
@@ -414,23 +417,22 @@ export async function executeStatus(
|
|
|
414
417
|
staleReasons,
|
|
415
418
|
staleReasonCount: staleReasons.length,
|
|
416
419
|
staleReasonsTruncated: false,
|
|
417
|
-
|
|
420
|
+
proofSnapshot: snapshotEvidence.available
|
|
418
421
|
? snapshotEvidence.snapshot.hash
|
|
419
422
|
: "unknown",
|
|
420
|
-
|
|
423
|
+
proofSnapshotAvailable: snapshotEvidence.available,
|
|
421
424
|
...(snapshotEvidence.available
|
|
422
425
|
? {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
verificationSnapshotChangeCount:
|
|
426
|
+
proofSnapshotDirty: snapshotEvidence.snapshot.dirty,
|
|
427
|
+
proofSnapshotFileCount: snapshotEvidence.snapshot.fileCount,
|
|
428
|
+
proofSnapshotVersion: snapshotEvidence.snapshot.version,
|
|
429
|
+
proofSnapshotChanges: snapshotEvidence.snapshot.changes ?? [],
|
|
430
|
+
proofSnapshotChangeCount:
|
|
429
431
|
snapshotEvidence.snapshot.changeCount ?? 0,
|
|
430
|
-
|
|
432
|
+
proofSnapshotChangesTruncated:
|
|
431
433
|
snapshotEvidence.snapshot.changesTruncated ?? false,
|
|
432
434
|
}
|
|
433
|
-
: {
|
|
435
|
+
: { proofSnapshotError: snapshotEvidence.error }),
|
|
434
436
|
};
|
|
435
437
|
const schemaStatus = readMigrationConfigStatus(context.workspaceRoot);
|
|
436
438
|
const migrationPlan = buildActionsFromStatus({
|
|
@@ -438,9 +440,9 @@ export async function executeStatus(
|
|
|
438
440
|
branchAttachment: attachment,
|
|
439
441
|
branchStore: store,
|
|
440
442
|
staleReasons,
|
|
441
|
-
|
|
443
|
+
proofSnapshotAvailable: snapshotEvidence.available,
|
|
442
444
|
...(snapshotEvidence.available
|
|
443
|
-
? {
|
|
445
|
+
? { proofSnapshotDirty: snapshotEvidence.snapshot.dirty }
|
|
444
446
|
: {}),
|
|
445
447
|
kbSnapshotId: payload.snapshotId,
|
|
446
448
|
workspaceSnapshot: snapshotEvidence.available
|
|
@@ -448,7 +450,7 @@ export async function executeStatus(
|
|
|
448
450
|
: null,
|
|
449
451
|
configStatus: schemaStatus,
|
|
450
452
|
});
|
|
451
|
-
const
|
|
453
|
+
const listed = context.fs?.glob
|
|
452
454
|
? await context.fs.glob(
|
|
453
455
|
[
|
|
454
456
|
".kb/requirements/**/*.md",
|
|
@@ -463,6 +465,7 @@ export async function executeStatus(
|
|
|
463
465
|
{ cwd: context.workspaceRoot },
|
|
464
466
|
)
|
|
465
467
|
: [];
|
|
468
|
+
const bootstrapSourceFiles = Array.isArray(listed) ? listed : [];
|
|
466
469
|
const bootstrapActivation = await classifyActivation(
|
|
467
470
|
context,
|
|
468
471
|
bootstrapSourceFiles,
|
|
@@ -514,7 +517,7 @@ export async function executeStatus(
|
|
|
514
517
|
content: [
|
|
515
518
|
{
|
|
516
519
|
type: "text",
|
|
517
|
-
text: `Branch ${payload.branch} is ${payload.syncState} (snapshot ${payload.snapshotId}, dirty=${payload.dirty},
|
|
520
|
+
text: `Branch ${payload.branch} is ${payload.syncState} (snapshot ${payload.snapshotId}, dirty=${payload.dirty}, proofSnapshot=${enrichedPayload.proofSnapshot})`,
|
|
518
521
|
},
|
|
519
522
|
],
|
|
520
523
|
structuredContent: statusWithPlan,
|
|
@@ -13,7 +13,7 @@ export * from "./specs/check.js";
|
|
|
13
13
|
export * from "./specs/discovery.js";
|
|
14
14
|
export * from "./specs/modeling.js";
|
|
15
15
|
export * from "./specs/planning.js";
|
|
16
|
-
export * from "./specs/
|
|
16
|
+
export * from "./specs/proof.js";
|
|
17
17
|
export * from "./specs/mutation.js";
|
|
18
18
|
export * from "./specs/reporting.js";
|
|
19
19
|
export * from "./specs/semantic.js";
|
|
@@ -41,7 +41,7 @@ export type MigrationAction = Readonly<{
|
|
|
41
41
|
| "relationship"
|
|
42
42
|
| "symbol"
|
|
43
43
|
| "semantic"
|
|
44
|
-
| "
|
|
44
|
+
| "proof"
|
|
45
45
|
| "quality";
|
|
46
46
|
state: MigrationActionState;
|
|
47
47
|
safety: MigrationSafety;
|
|
@@ -134,6 +134,19 @@ function actionSort(left: MigrationAction, right: MigrationAction): number {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
export function compareReadyActionIds(
|
|
138
|
+
left: string,
|
|
139
|
+
right: string,
|
|
140
|
+
byId: ReadonlyMap<string, MigrationAction>,
|
|
141
|
+
): number {
|
|
142
|
+
const leftAction = byId.get(left);
|
|
143
|
+
const rightAction = byId.get(right);
|
|
144
|
+
if (leftAction === undefined || rightAction === undefined) {
|
|
145
|
+
return left.localeCompare(right);
|
|
146
|
+
}
|
|
147
|
+
return actionSort(leftAction, rightAction);
|
|
148
|
+
}
|
|
149
|
+
|
|
137
150
|
/** Return actions in a deterministic dependency-first order for agents and the applier. */
|
|
138
151
|
function dependencyOrder(
|
|
139
152
|
actions: readonly MigrationAction[],
|
|
@@ -168,14 +181,7 @@ function dependencyOrder(
|
|
|
168
181
|
}
|
|
169
182
|
ready.push(candidateId);
|
|
170
183
|
queued.add(candidateId);
|
|
171
|
-
ready.sort((left, right) =>
|
|
172
|
-
const leftAction = byId.get(left);
|
|
173
|
-
const rightAction = byId.get(right);
|
|
174
|
-
if (leftAction === undefined || rightAction === undefined) {
|
|
175
|
-
return left.localeCompare(right);
|
|
176
|
-
}
|
|
177
|
-
return actionSort(leftAction, rightAction);
|
|
178
|
-
});
|
|
184
|
+
ready.sort((left, right) => compareReadyActionIds(left, right, byId));
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
// Preserve cyclic/missing-dependency actions in canonical order; validation will block them.
|
|
@@ -387,17 +393,18 @@ export function buildActionsFromCoverage(input: {
|
|
|
387
393
|
const req =
|
|
388
394
|
typeof batch.requirementId === "string" ? batch.requirementId : "";
|
|
389
395
|
const ready = batch.state === "ready";
|
|
390
|
-
const automatic =
|
|
396
|
+
const automatic =
|
|
397
|
+
phase === "source_coordinates" &&
|
|
398
|
+
batch.writePolicy === "refresh_then_sync";
|
|
391
399
|
actions.push(
|
|
392
400
|
migrationAction({
|
|
393
401
|
id: `coverage-${id}`,
|
|
394
402
|
code: `coverage_${phase}`,
|
|
395
|
-
category:
|
|
396
|
-
phase === "verification_evidence" ? "verification" : "semantic",
|
|
403
|
+
category: phase === "proof_evidence" ? "proof" : "semantic",
|
|
397
404
|
state: ready ? "ready" : "blocked",
|
|
398
405
|
safety: automatic
|
|
399
406
|
? "automatic"
|
|
400
|
-
: phase === "
|
|
407
|
+
: phase === "proof_evidence"
|
|
401
408
|
? "execution"
|
|
402
409
|
: "review",
|
|
403
410
|
invocation: automatic
|
|
@@ -445,7 +452,7 @@ export function buildActionsFromCoverage(input: {
|
|
|
445
452
|
}
|
|
446
453
|
: {
|
|
447
454
|
kind: "review",
|
|
448
|
-
instruction: `Review ${action} for ${symbolId} using current extraction and Git evidence.`,
|
|
455
|
+
instruction: `Review ${action} for ${symbolId} using current extraction and Git evidence. Query the symbol and validate/upsert a corrected sourceFile/title or an intentional granularity_reason: extractor-miss when extraction cannot locate it.`,
|
|
449
456
|
},
|
|
450
457
|
affectedEntityIds: [symbolId],
|
|
451
458
|
evidence: { repair },
|
|
@@ -527,8 +534,8 @@ export function buildActionsFromStatus(input: {
|
|
|
527
534
|
branchAttachment?: Readonly<Record<string, unknown>>;
|
|
528
535
|
branchStore?: Readonly<Record<string, unknown>>;
|
|
529
536
|
staleReasons?: readonly Readonly<Record<string, unknown>>[];
|
|
530
|
-
|
|
531
|
-
|
|
537
|
+
proofSnapshotAvailable?: boolean;
|
|
538
|
+
proofSnapshotDirty?: boolean;
|
|
532
539
|
kbSnapshotId?: string | null;
|
|
533
540
|
workspaceSnapshot?: string | null;
|
|
534
541
|
configStatus?: MigrationConfigStatus;
|
|
@@ -673,35 +680,35 @@ export function buildActionsFromStatus(input: {
|
|
|
673
680
|
}),
|
|
674
681
|
);
|
|
675
682
|
}
|
|
676
|
-
if (input.
|
|
683
|
+
if (input.proofSnapshotAvailable === false) {
|
|
677
684
|
actions.push(
|
|
678
685
|
migrationAction({
|
|
679
686
|
id: "verification-snapshot-unavailable",
|
|
680
|
-
code: "
|
|
681
|
-
category: "
|
|
687
|
+
code: "proof_snapshot_unavailable",
|
|
688
|
+
category: "proof",
|
|
682
689
|
safety: "operator",
|
|
683
690
|
invocation: {
|
|
684
691
|
kind: "review",
|
|
685
692
|
instruction:
|
|
686
693
|
"Use a runtime that can compute a workspace verification snapshot before claiming proof.",
|
|
687
694
|
},
|
|
688
|
-
evidence: {
|
|
695
|
+
evidence: { proofSnapshotAvailable: false },
|
|
689
696
|
dispositionRequired: true,
|
|
690
697
|
}),
|
|
691
698
|
);
|
|
692
|
-
} else if (input.
|
|
699
|
+
} else if (input.proofSnapshotDirty === true) {
|
|
693
700
|
actions.push(
|
|
694
701
|
migrationAction({
|
|
695
702
|
id: "verification-snapshot-dirty",
|
|
696
|
-
code: "
|
|
697
|
-
category: "
|
|
703
|
+
code: "proof_snapshot_dirty",
|
|
704
|
+
category: "proof",
|
|
698
705
|
safety: "review",
|
|
699
706
|
invocation: {
|
|
700
707
|
kind: "review",
|
|
701
708
|
instruction:
|
|
702
709
|
"Resolve or intentionally record the listed dirty workspace paths before reusing or creating proof receipts.",
|
|
703
710
|
},
|
|
704
|
-
evidence: {
|
|
711
|
+
evidence: { proofSnapshotDirty: true },
|
|
705
712
|
dispositionRequired: true,
|
|
706
713
|
}),
|
|
707
714
|
);
|
|
@@ -732,7 +739,7 @@ export function buildActionsFromStatus(input: {
|
|
|
732
739
|
"storage",
|
|
733
740
|
"schema",
|
|
734
741
|
"freshness",
|
|
735
|
-
"
|
|
742
|
+
"proof",
|
|
736
743
|
],
|
|
737
744
|
incompleteDomains,
|
|
738
745
|
actions,
|
|
@@ -28,7 +28,7 @@ const SNAPSHOT_EXCLUDED_PREFIXES = [
|
|
|
28
28
|
".changeset/",
|
|
29
29
|
".kb/branches/",
|
|
30
30
|
".kb/recovery/",
|
|
31
|
-
".kb/
|
|
31
|
+
".kb/proof/runs/",
|
|
32
32
|
".kb/briefs/",
|
|
33
33
|
".kb/migrations/",
|
|
34
34
|
"docs/",
|
|
@@ -37,7 +37,7 @@ const ALWAYS_IGNORED_GLOBS = [
|
|
|
37
37
|
"**/.git/**",
|
|
38
38
|
"**/.kb/branches/**",
|
|
39
39
|
"**/.kb/recovery/**",
|
|
40
|
-
"**/.kb/
|
|
40
|
+
"**/.kb/proof/runs/**",
|
|
41
41
|
"**/.kb/briefs/**",
|
|
42
42
|
"**/.kb/migrations/**",
|
|
43
43
|
"**/node_modules/**",
|
|
@@ -58,7 +58,7 @@ function includedSnapshotPath(relativePath: string): boolean {
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
function
|
|
61
|
+
function withoutProofReceiptFrontmatter(content: string): string {
|
|
62
62
|
const lines = content.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
63
63
|
if (lines[0]?.trim() !== "---") return content;
|
|
64
64
|
let inFrontmatter = true;
|
|
@@ -72,7 +72,7 @@ function withoutVerificationReceiptFrontmatter(content: string): string {
|
|
|
72
72
|
retained.push(line);
|
|
73
73
|
continue;
|
|
74
74
|
}
|
|
75
|
-
if (inFrontmatter && /^
|
|
75
|
+
if (inFrontmatter && /^proof_receipts\s*:/.test(line)) {
|
|
76
76
|
skippingReceipts = true;
|
|
77
77
|
continue;
|
|
78
78
|
}
|
|
@@ -91,14 +91,14 @@ function withoutVerificationReceiptFrontmatter(content: string): string {
|
|
|
91
91
|
function snapshotFileContent(relativePath: string, content: Buffer): Buffer {
|
|
92
92
|
if (relativePath.endsWith(".md")) {
|
|
93
93
|
return Buffer.from(
|
|
94
|
-
|
|
94
|
+
withoutProofReceiptFrontmatter(content.toString("utf8")),
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
return content;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* A tracked markdown file whose only change is
|
|
101
|
+
* A tracked markdown file whose only change is proof-receipt frontmatter
|
|
102
102
|
* cannot alter the snapshot hash (receipts are stripped before hashing), so it
|
|
103
103
|
* must not mark the workspace dirty either. CI proof runs append receipts to
|
|
104
104
|
* tracked proof documents before reporting, and would otherwise always surface
|
|
@@ -126,15 +126,14 @@ const REPAIR_PHASES = {
|
|
|
126
126
|
validationRules: [],
|
|
127
127
|
writePolicy: "runtime_recovery",
|
|
128
128
|
},
|
|
129
|
-
|
|
129
|
+
proof_evidence: {
|
|
130
130
|
order: 80,
|
|
131
131
|
objective:
|
|
132
|
-
"Run the
|
|
132
|
+
"Run the configured proof integration with kibi prove and append fresh snapshot-bound passing receipts.",
|
|
133
133
|
workflowSteps: [
|
|
134
134
|
"kb_status",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"kb_upsert",
|
|
135
|
+
"execute_proof_run",
|
|
136
|
+
"kb_ingest_proof",
|
|
138
137
|
"kb_coverage",
|
|
139
138
|
],
|
|
140
139
|
validationRules: ["required-fields", "no-dangling-refs"],
|
|
@@ -206,12 +205,13 @@ const GAP_PHASE: Readonly<Record<string, RepairPhase>> = {
|
|
|
206
205
|
blocking_contradiction: "contradiction_resolution",
|
|
207
206
|
missing_scenario: "scenario_endpoints",
|
|
208
207
|
missing_scenario_test: "scenario_tests",
|
|
209
|
-
|
|
210
|
-
missing_passing_e2e: "
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
208
|
+
proof_snapshot_unavailable: "snapshot_runtime",
|
|
209
|
+
missing_passing_e2e: "proof_evidence",
|
|
210
|
+
proof_contract_mismatch: "proof_evidence",
|
|
211
|
+
missing_proof_receipt: "proof_evidence",
|
|
212
|
+
stale_proof_receipt: "proof_evidence",
|
|
213
|
+
failed_proof_receipt: "proof_evidence",
|
|
214
|
+
invalid_proof_receipt: "proof_evidence",
|
|
215
215
|
missing_executable_test_symbol: "executable_symbols",
|
|
216
216
|
missing_production_symbol: "production_ownership",
|
|
217
217
|
missing_production_symbol_coverage: "production_coverage",
|
|
@@ -233,12 +233,12 @@ const GAP_STAGE: Readonly<Record<string, string>> = {
|
|
|
233
233
|
missing_scenario: "scenarios",
|
|
234
234
|
missing_scenario_test: "scenario_tests",
|
|
235
235
|
missing_passing_e2e: "passing_e2e",
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
missing_proof_receipt: "passing_e2e",
|
|
237
|
+
stale_proof_receipt: "passing_e2e",
|
|
238
|
+
failed_proof_receipt: "passing_e2e",
|
|
239
|
+
invalid_proof_receipt: "passing_e2e",
|
|
240
|
+
proof_contract_mismatch: "passing_e2e",
|
|
241
|
+
proof_snapshot_unavailable: "passing_e2e",
|
|
242
242
|
missing_executable_test_symbol: "executable_symbols",
|
|
243
243
|
missing_production_symbol: "production_symbols",
|
|
244
244
|
missing_production_symbol_coverage: "production_symbols",
|
|
@@ -427,7 +427,38 @@ function buildRequirementBatches(
|
|
|
427
427
|
);
|
|
428
428
|
const priorBatchIds: string[] = [];
|
|
429
429
|
return phases.map((phase) => {
|
|
430
|
-
const
|
|
430
|
+
const phaseRepairs = byPhase.get(phase) ?? [];
|
|
431
|
+
const coordinatesNeedReview =
|
|
432
|
+
phase === "source_coordinates" &&
|
|
433
|
+
phaseRepairs.some((repair) => {
|
|
434
|
+
const evidence = repair.evidence.coordinateRepairs;
|
|
435
|
+
return (
|
|
436
|
+
repair.gap !== "missing_symbol_coordinates" ||
|
|
437
|
+
!Array.isArray(evidence) ||
|
|
438
|
+
evidence.length === 0 ||
|
|
439
|
+
evidence.some((item) => !isRecord(item) || item.refreshable !== true)
|
|
440
|
+
);
|
|
441
|
+
});
|
|
442
|
+
const definition: RepairPhaseDefinition = coordinatesNeedReview
|
|
443
|
+
? {
|
|
444
|
+
...REPAIR_PHASES[phase],
|
|
445
|
+
objective: phaseRepairs.some(
|
|
446
|
+
(repair) => repair.gap === "missing_requirement_source",
|
|
447
|
+
)
|
|
448
|
+
? "Bind the requirement to its current source document through validated upsert and inspect any missing symbol anchors before refreshing."
|
|
449
|
+
: "Query the affected symbols and repair their sourceFile/title or explicitly author granularity_reason: extractor-miss (or another intentional coarse anchor) through validated upsert before refreshing.",
|
|
450
|
+
workflowSteps: [
|
|
451
|
+
"kb_query",
|
|
452
|
+
"kb_validate_upsert",
|
|
453
|
+
"kb_upsert",
|
|
454
|
+
"kibi sync --refresh-symbol-coordinates",
|
|
455
|
+
"kibi sync",
|
|
456
|
+
"kb_check",
|
|
457
|
+
"kb_coverage",
|
|
458
|
+
],
|
|
459
|
+
writePolicy: "review_then_sequential_upsert",
|
|
460
|
+
}
|
|
461
|
+
: REPAIR_PHASES[phase];
|
|
431
462
|
const id = batchId(requirementId, phase);
|
|
432
463
|
const batch: RepairPlanBatch = {
|
|
433
464
|
id,
|
|
@@ -441,11 +472,17 @@ function buildRequirementBatches(
|
|
|
441
472
|
validationRules: definition.validationRules,
|
|
442
473
|
writePolicy: definition.writePolicy,
|
|
443
474
|
autoApplicable: false,
|
|
444
|
-
repairs:
|
|
445
|
-
(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
475
|
+
repairs: phaseRepairs
|
|
476
|
+
.map((repair) =>
|
|
477
|
+
coordinatesNeedReview
|
|
478
|
+
? { ...repair, action: definition.objective }
|
|
479
|
+
: repair,
|
|
480
|
+
)
|
|
481
|
+
.sort(
|
|
482
|
+
(left, right) =>
|
|
483
|
+
left.proofPriority - right.proofPriority ||
|
|
484
|
+
left.gap.localeCompare(right.gap),
|
|
485
|
+
),
|
|
449
486
|
};
|
|
450
487
|
priorBatchIds.push(id);
|
|
451
488
|
return batch;
|