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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import { existsSync, realpathSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { OperationError } from "../../cli-errors.js";
|
|
4
5
|
import { branchEnsureCommand, branchMigrateCommand, branchRecoverCommand, } from "../../commands/branch.js";
|
|
5
6
|
import { migrateCommand } from "../../commands/migrate.js";
|
|
6
7
|
import { syncCommand } from "../../commands/sync.js";
|
|
@@ -13,6 +14,7 @@ import { bootstrapEmptyKbSnapshotId, bootstrapPlanHash, } from "../bootstrap/typ
|
|
|
13
14
|
import { executeDelete } from "../mutation/delete.js";
|
|
14
15
|
import { writePendingSourceReceipt } from "../mutation/source-authoring.js";
|
|
15
16
|
import { executeUpsert } from "../mutation/upsert.js";
|
|
17
|
+
import { acquireWorkspaceMutationLock, releaseWorkspaceMutationLock, } from "../mutation/workspace-mutation-lock.js";
|
|
16
18
|
import { compilePlanHash, } from "./compile-intent.js";
|
|
17
19
|
// implements REQ-kibi-change-to-proof-plan-compiler
|
|
18
20
|
export const PLAN_APPLY_RESULT_VERSION = "kibi.plan-apply-result.v1";
|
|
@@ -96,6 +98,21 @@ function isMigrationApplyArgs(args) {
|
|
|
96
98
|
function isBootstrapApplyArgs(args) {
|
|
97
99
|
return "plan" in args && args.plan.version === "kibi.bootstrap-plan.v1";
|
|
98
100
|
}
|
|
101
|
+
export function assertSourceWriteStaysInWorkspace(root, absolute, writePath) {
|
|
102
|
+
if (absolute !== root && !absolute.startsWith(`${root}${path.sep}`)) {
|
|
103
|
+
throw new Error(`Apply plan failed: sourceWrites.path escapes workspace: ${writePath}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export function assertBootstrapRecoveryDependencies(remaining, applied) {
|
|
107
|
+
for (const action of remaining) {
|
|
108
|
+
for (const dependency of action.dependsOn ?? []) {
|
|
109
|
+
if (!applied.has(dependency) &&
|
|
110
|
+
!remaining.some((candidate) => candidate.id === dependency)) {
|
|
111
|
+
throw new Error(`Bootstrap recovery journal is missing dependency '${dependency}' for '${action.id}'`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
99
116
|
export function orderBootstrapActions(actions, completed = new Set()) {
|
|
100
117
|
const byId = new Map();
|
|
101
118
|
for (const action of actions) {
|
|
@@ -274,7 +291,7 @@ async function validateSources(context, sourceHashes) {
|
|
|
274
291
|
}
|
|
275
292
|
return checked;
|
|
276
293
|
}
|
|
277
|
-
async function applySourceWrites(context, writes, planHash, allowReplay = false) {
|
|
294
|
+
async function applySourceWrites(context, writes, planHash, allowReplay = false, onCommitted = () => undefined) {
|
|
278
295
|
if (writes.length === 0) {
|
|
279
296
|
return { paths: [], rollback: async () => undefined, journalId: null };
|
|
280
297
|
}
|
|
@@ -338,6 +355,7 @@ async function applySourceWrites(context, writes, planHash, allowReplay = false)
|
|
|
338
355
|
if (!allowReplay) {
|
|
339
356
|
throw new Error(`MUTATION_ALREADY_COMMITTED: source plan ${planHash} already crossed the authoritative commit boundary; use kb_apply_plan recoveryJournalId=${journalId} instead of retrying the original mutation`);
|
|
340
357
|
}
|
|
358
|
+
onCommitted();
|
|
341
359
|
for (const entry of prior.entries) {
|
|
342
360
|
if (entry.mode === "write" && entry.afterHash !== null) {
|
|
343
361
|
writePendingSourceReceipt(context.workspaceRoot, entry.path, entry.afterHash);
|
|
@@ -378,6 +396,7 @@ async function applySourceWrites(context, writes, planHash, allowReplay = false)
|
|
|
378
396
|
const originals = [];
|
|
379
397
|
const entries = [];
|
|
380
398
|
const paths = [];
|
|
399
|
+
let sourceCommitted = false;
|
|
381
400
|
try {
|
|
382
401
|
// Validate every target and hash before touching the working tree.
|
|
383
402
|
for (const write of writes) {
|
|
@@ -388,9 +407,7 @@ async function applySourceWrites(context, writes, planHash, allowReplay = false)
|
|
|
388
407
|
}
|
|
389
408
|
const absolute = path.resolve(context.workspaceRoot, write.path);
|
|
390
409
|
const root = path.resolve(context.workspaceRoot);
|
|
391
|
-
|
|
392
|
-
throw new Error(`Apply plan failed: sourceWrites.path escapes workspace: ${write.path}`);
|
|
393
|
-
}
|
|
410
|
+
assertSourceWriteStaysInWorkspace(root, absolute, write.path);
|
|
394
411
|
const workspaceRelative = path
|
|
395
412
|
.relative(root, absolute)
|
|
396
413
|
.split(path.sep)
|
|
@@ -471,22 +488,33 @@ async function applySourceWrites(context, writes, planHash, allowReplay = false)
|
|
|
471
488
|
await context.fs.unlink(absolute);
|
|
472
489
|
}
|
|
473
490
|
else {
|
|
474
|
-
const staged = `${absolute}.kibi-stage-${journalId}-${index}`;
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
491
|
+
const staged = `${absolute}.kibi-stage-${journalId}-${index}-${randomUUID()}`;
|
|
492
|
+
try {
|
|
493
|
+
await context.fs.writeFile(staged, write.body ?? "");
|
|
494
|
+
if (context.fs.rename) {
|
|
495
|
+
await context.fs.rename(staged, absolute);
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
// Test and constrained host ports may not expose rename. Keep the
|
|
499
|
+
// compatibility fallback explicit; production nodeFilesystem uses
|
|
500
|
+
// same-directory rename for atomic replacement.
|
|
501
|
+
await context.fs.writeFile(absolute, write.body ?? "");
|
|
502
|
+
if (context.fs.unlink)
|
|
503
|
+
await context.fs.unlink(staged).catch(() => undefined);
|
|
504
|
+
}
|
|
478
505
|
}
|
|
479
|
-
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
// same-directory rename for atomic replacement.
|
|
483
|
-
await context.fs.writeFile(absolute, write.body ?? "");
|
|
506
|
+
catch (error) {
|
|
507
|
+
// A failed rename must not leak the unique staged temp file into
|
|
508
|
+
// the authored tree; rollback of originals happens in the caller.
|
|
484
509
|
if (context.fs.unlink)
|
|
485
510
|
await context.fs.unlink(staged).catch(() => undefined);
|
|
511
|
+
throw error;
|
|
486
512
|
}
|
|
487
513
|
}
|
|
488
514
|
}
|
|
489
515
|
await context.fs.writeFile(journalPath, `${JSON.stringify({ version: 1, planHash, state: "sources_committed", entries }, null, 2)}\n`);
|
|
516
|
+
sourceCommitted = true;
|
|
517
|
+
onCommitted();
|
|
490
518
|
// A newly authored file is intentionally excluded from ordinary Git
|
|
491
519
|
// discovery until the operator stages it. The receipt binds that pending
|
|
492
520
|
// input to the exact bytes committed by this plan.
|
|
@@ -497,6 +525,17 @@ async function applySourceWrites(context, writes, planHash, allowReplay = false)
|
|
|
497
525
|
}
|
|
498
526
|
}
|
|
499
527
|
catch (error) {
|
|
528
|
+
if (sourceCommitted) {
|
|
529
|
+
// The authoritative source bytes must remain in place once the commit
|
|
530
|
+
// milestone has fired. A pending receipt failure is repair metadata
|
|
531
|
+
// failure, not permission to roll back the committed mutation. Surface
|
|
532
|
+
// the recovery journal instead of a generic exception so callers never
|
|
533
|
+
// read the committed plan as retryable.
|
|
534
|
+
await markSourceJournal(context, journalId, "repair_required");
|
|
535
|
+
if (error instanceof OperationError)
|
|
536
|
+
throw error;
|
|
537
|
+
throw new OperationError("SOURCE_COMMIT_REPAIR_REQUIRED", `Source plan ${planHash} committed its authoritative bytes, but postcommit repair metadata failed: ${error instanceof Error ? error.message : String(error)}; recovery journal ${journalId} is marked repair_required; use kb_apply_plan recoveryJournalId=${journalId} instead of retrying the original mutation`, false);
|
|
538
|
+
}
|
|
500
539
|
for (const original of [...originals].reverse()) {
|
|
501
540
|
try {
|
|
502
541
|
if (original.body === undefined && context.fs.unlink) {
|
|
@@ -542,7 +581,7 @@ async function markSourceJournal(context, journalId, state) {
|
|
|
542
581
|
// authoritative operation result behind a best-effort metadata write.
|
|
543
582
|
}
|
|
544
583
|
}
|
|
545
|
-
async function executeSourceRecovery(args, context) {
|
|
584
|
+
async function executeSourceRecovery(args, context, onCommitted = () => undefined) {
|
|
546
585
|
if (!context.fs)
|
|
547
586
|
throw new Error("Source recovery requires a filesystem-capable runtime");
|
|
548
587
|
if (!/^[A-Za-z0-9._-]+$/.test(args.recoveryJournalId)) {
|
|
@@ -569,7 +608,7 @@ async function executeSourceRecovery(args, context) {
|
|
|
569
608
|
...(body === undefined ? {} : { body }),
|
|
570
609
|
});
|
|
571
610
|
}
|
|
572
|
-
const sourceWrites = await applySourceWrites(context, writes, journal.planHash, true);
|
|
611
|
+
const sourceWrites = await applySourceWrites(context, writes, journal.planHash, true, onCommitted);
|
|
573
612
|
for (const write of writes) {
|
|
574
613
|
if (write.mode === "write" && write.afterHash !== null) {
|
|
575
614
|
writePendingSourceReceipt(context.workspaceRoot, write.path, write.afterHash);
|
|
@@ -613,7 +652,7 @@ async function executeSourceRecovery(args, context) {
|
|
|
613
652
|
},
|
|
614
653
|
};
|
|
615
654
|
}
|
|
616
|
-
async function executeBootstrapPlan(args, context, recovery = false, remainingActions, priorResults = []) {
|
|
655
|
+
async function executeBootstrapPlan(args, context, recovery = false, remainingActions, priorResults = [], onCommitted = () => undefined) {
|
|
617
656
|
const actions = recovery
|
|
618
657
|
? [...(remainingActions ?? args.plan.actions)]
|
|
619
658
|
: validateBootstrapPlanShape(args);
|
|
@@ -700,6 +739,7 @@ async function executeBootstrapPlan(args, context, recovery = false, remainingAc
|
|
|
700
739
|
activeActionId = action.id;
|
|
701
740
|
await writeJournal("applying", activeActionId);
|
|
702
741
|
const result = await executeUpsert(asUpsert(action.payload), operationContext);
|
|
742
|
+
onCommitted();
|
|
703
743
|
const payload = result.structuredContent;
|
|
704
744
|
if (payload && typeof payload === "object") {
|
|
705
745
|
const row = payload;
|
|
@@ -924,7 +964,7 @@ async function executeBootstrapPlan(args, context, recovery = false, remainingAc
|
|
|
924
964
|
};
|
|
925
965
|
}
|
|
926
966
|
// implements REQ-kibi-change-to-proof-plan-compiler, REQ-agent-guided-migration-orchestration
|
|
927
|
-
|
|
967
|
+
async function executeApplyPlanUnlocked(args, context, onCommitted = () => undefined) {
|
|
928
968
|
if ("recoveryJournalId" in args) {
|
|
929
969
|
if (args.recoveryJournalId.startsWith("bootstrap-")) {
|
|
930
970
|
if (!context.fs)
|
|
@@ -980,13 +1020,7 @@ export async function executeApplyPlan(args, context) {
|
|
|
980
1020
|
applied.add(row.actionId);
|
|
981
1021
|
}
|
|
982
1022
|
const remaining = orderBootstrapActions(ordered.filter((action) => !applied.has(action.id)), applied);
|
|
983
|
-
|
|
984
|
-
for (const dependency of action.dependsOn ?? []) {
|
|
985
|
-
if (!applied.has(dependency) &&
|
|
986
|
-
!remaining.some((candidate) => candidate.id === dependency))
|
|
987
|
-
throw new Error(`Bootstrap recovery journal is missing dependency '${dependency}' for '${action.id}'`);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
1023
|
+
assertBootstrapRecoveryDependencies(remaining, applied);
|
|
990
1024
|
return executeBootstrapPlan({ plan: journal.plan, approvedPlanHash: journal.plan.planHash }, context, true, remaining, (journal.results ?? []).flatMap((row) => row &&
|
|
991
1025
|
typeof row.actionId === "string" &&
|
|
992
1026
|
(row.outcome === "applied" ||
|
|
@@ -1002,18 +1036,18 @@ export async function executeApplyPlan(args, context) {
|
|
|
1002
1036
|
},
|
|
1003
1037
|
]
|
|
1004
1038
|
: []
|
|
1005
|
-
: []));
|
|
1039
|
+
: []), onCommitted);
|
|
1006
1040
|
}
|
|
1007
|
-
return executeSourceRecovery(args, context);
|
|
1041
|
+
return executeSourceRecovery(args, context, onCommitted);
|
|
1008
1042
|
}
|
|
1009
1043
|
if (isBootstrapApplyArgs(args))
|
|
1010
|
-
return executeBootstrapPlan(args, context);
|
|
1044
|
+
return executeBootstrapPlan(args, context, false, undefined, [], onCommitted);
|
|
1011
1045
|
if (isMigrationApplyArgs(args)) {
|
|
1012
|
-
return applyMigrationPlan(args, context);
|
|
1046
|
+
return applyMigrationPlan(args, context, onCommitted);
|
|
1013
1047
|
}
|
|
1014
1048
|
if (isEntityDeletionApplyArgs(args)) {
|
|
1015
1049
|
validateEntityDeletionPlan(args);
|
|
1016
|
-
const sourceWrites = await applySourceWrites(context, args.plan.sourceWrites ?? [], args.plan.planHash);
|
|
1050
|
+
const sourceWrites = await applySourceWrites(context, args.plan.sourceWrites ?? [], args.plan.planHash, false, onCommitted);
|
|
1017
1051
|
const operationContext = {
|
|
1018
1052
|
...context,
|
|
1019
1053
|
sourceFirst: false,
|
|
@@ -1025,6 +1059,7 @@ export async function executeApplyPlan(args, context) {
|
|
|
1025
1059
|
try {
|
|
1026
1060
|
const result = await executeDelete({ ids: args.plan.entityIds }, operationContext);
|
|
1027
1061
|
payload = result.structuredContent;
|
|
1062
|
+
onCommitted();
|
|
1028
1063
|
await markSourceJournal(operationContext, sourceWrites.journalId, "compiled_published");
|
|
1029
1064
|
}
|
|
1030
1065
|
catch (error) {
|
|
@@ -1090,18 +1125,24 @@ export async function executeApplyPlan(args, context) {
|
|
|
1090
1125
|
throw new Error("Apply plan failed: workspace snapshot changed since compilation");
|
|
1091
1126
|
const sourceHashesChecked = await validateSources(operationContext, args.plan.expected.sourceHashes);
|
|
1092
1127
|
const steps = args.plan.steps.map((step) => asUpsert(step));
|
|
1093
|
-
const sourceWrites = await applySourceWrites(operationContext, args.plan.sourceWrites, args.plan.planHash);
|
|
1128
|
+
const sourceWrites = await applySourceWrites(operationContext, args.plan.sourceWrites, args.plan.planHash, false, onCommitted);
|
|
1094
1129
|
const notes = [
|
|
1095
1130
|
"Plan steps and tracked source writes are validated before sequential application; source writes are journaled for replay.",
|
|
1096
1131
|
];
|
|
1097
1132
|
let changedEntities = 0;
|
|
1098
1133
|
let changedRelationships = 0;
|
|
1134
|
+
let appliedSteps = 0;
|
|
1099
1135
|
const effectFailures = [];
|
|
1100
1136
|
const nextActions = [];
|
|
1101
1137
|
let compiledCommit = false;
|
|
1102
1138
|
try {
|
|
1103
1139
|
for (const step of steps) {
|
|
1104
1140
|
const result = await executeUpsert(step, operationContext);
|
|
1141
|
+
appliedSteps += 1;
|
|
1142
|
+
// Each step's compiled commit is an authoritative mutation boundary.
|
|
1143
|
+
// Mark it immediately so a later step's failure can never be mistaken
|
|
1144
|
+
// for a retryable whole-plan failure.
|
|
1145
|
+
onCommitted();
|
|
1105
1146
|
const payload = result.structuredContent;
|
|
1106
1147
|
if (payload && typeof payload === "object") {
|
|
1107
1148
|
const row = payload;
|
|
@@ -1117,6 +1158,7 @@ export async function executeApplyPlan(args, context) {
|
|
|
1117
1158
|
}
|
|
1118
1159
|
}
|
|
1119
1160
|
compiledCommit = true;
|
|
1161
|
+
onCommitted();
|
|
1120
1162
|
}
|
|
1121
1163
|
catch (error) {
|
|
1122
1164
|
if (sourceWrites.journalId !== null) {
|
|
@@ -1131,8 +1173,18 @@ export async function executeApplyPlan(args, context) {
|
|
|
1131
1173
|
reason: "Authoritative source files are committed but compiled effects failed; replay the recovery journal instead of retrying the original mutation.",
|
|
1132
1174
|
required: true,
|
|
1133
1175
|
});
|
|
1176
|
+
onCommitted();
|
|
1134
1177
|
await markSourceJournal(operationContext, sourceWrites.journalId, "repair_required");
|
|
1135
1178
|
}
|
|
1179
|
+
else if (appliedSteps > 0) {
|
|
1180
|
+
// A journalless plan (sourceWrites: []) already committed earlier steps
|
|
1181
|
+
// when a later step failed. Expose an explicit non-retryable
|
|
1182
|
+
// partial-commit error instead of a generic exception that invites a
|
|
1183
|
+
// blind retry of the whole plan.
|
|
1184
|
+
if (error instanceof OperationError)
|
|
1185
|
+
throw error;
|
|
1186
|
+
throw new OperationError("PARTIAL_COMMIT_REPAIR_REQUIRED", `Plan ${args.plan.planHash} committed ${appliedSteps} of ${steps.length} step(s) before failing: ${error instanceof Error ? error.message : String(error)}. This plan carries no recovery journal; do not retry the original plan; inspect the committed snapshot and apply a fresh plan for the remaining steps`, false);
|
|
1187
|
+
}
|
|
1136
1188
|
else {
|
|
1137
1189
|
throw error;
|
|
1138
1190
|
}
|
|
@@ -1220,7 +1272,31 @@ export async function executeApplyPlan(args, context) {
|
|
|
1220
1272
|
structuredContent: payload,
|
|
1221
1273
|
};
|
|
1222
1274
|
}
|
|
1223
|
-
async function
|
|
1275
|
+
export async function executeApplyPlan(args, context) {
|
|
1276
|
+
if (!context.fs || context.sourceMutationLockHeld === true)
|
|
1277
|
+
return executeApplyPlanUnlocked(args, context);
|
|
1278
|
+
const lock = await acquireWorkspaceMutationLock(context.workspaceRoot);
|
|
1279
|
+
let operationFailure;
|
|
1280
|
+
let committed = false;
|
|
1281
|
+
try {
|
|
1282
|
+
const result = await executeApplyPlanUnlocked(args, {
|
|
1283
|
+
...context,
|
|
1284
|
+
sourceMutationLockHeld: true,
|
|
1285
|
+
}, () => {
|
|
1286
|
+
committed = true;
|
|
1287
|
+
});
|
|
1288
|
+
committed = true;
|
|
1289
|
+
return result;
|
|
1290
|
+
}
|
|
1291
|
+
catch (error) {
|
|
1292
|
+
operationFailure = { error };
|
|
1293
|
+
throw error;
|
|
1294
|
+
}
|
|
1295
|
+
finally {
|
|
1296
|
+
releaseWorkspaceMutationLock(lock, operationFailure, committed);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
async function applyMigrationPlan(args, context, onCommitted = () => undefined) {
|
|
1224
1300
|
const actions = topologicalActions(validateMigrationPlanShape(args));
|
|
1225
1301
|
const initialStatus = (await executeStatus({}, context)).structuredContent;
|
|
1226
1302
|
if (!initialStatus)
|
|
@@ -1258,6 +1334,7 @@ async function applyMigrationPlan(args, context) {
|
|
|
1258
1334
|
}
|
|
1259
1335
|
try {
|
|
1260
1336
|
await applyMigrationAction(action, context);
|
|
1337
|
+
onCommitted();
|
|
1261
1338
|
results.push({
|
|
1262
1339
|
actionId: action.id,
|
|
1263
1340
|
outcome: "applied",
|
|
@@ -1329,11 +1406,11 @@ async function applyMigrationPlan(args, context) {
|
|
|
1329
1406
|
: finalStatus.syncState === "fresh"
|
|
1330
1407
|
? "clean_fresh"
|
|
1331
1408
|
: "not_evaluated";
|
|
1332
|
-
const
|
|
1409
|
+
const snapshotState = finalStatus.proofSnapshotAvailable === false
|
|
1333
1410
|
? "unavailable"
|
|
1334
|
-
: finalStatus.
|
|
1411
|
+
: finalStatus.proofSnapshotDirty === true
|
|
1335
1412
|
? "dirty"
|
|
1336
|
-
: finalStatus.
|
|
1413
|
+
: finalStatus.proofSnapshotDirty === false
|
|
1337
1414
|
? "fresh"
|
|
1338
1415
|
: "not_evaluated";
|
|
1339
1416
|
const proven = coverageSummary?.proofProven;
|
|
@@ -1366,7 +1443,7 @@ async function applyMigrationPlan(args, context) {
|
|
|
1366
1443
|
? "blocked"
|
|
1367
1444
|
: "interim",
|
|
1368
1445
|
kbState,
|
|
1369
|
-
|
|
1446
|
+
snapshotState,
|
|
1370
1447
|
proofState,
|
|
1371
1448
|
limitationDisposition: "not_applicable",
|
|
1372
1449
|
},
|
|
@@ -24,6 +24,8 @@ export type TestDraft = Readonly<{
|
|
|
24
24
|
id?: string;
|
|
25
25
|
title: string;
|
|
26
26
|
body: string;
|
|
27
|
+
/** Stable IDs of the scenario drafts that this test verifies. */
|
|
28
|
+
scenarioIds?: readonly string[];
|
|
27
29
|
verificationScope?: "unit" | "integration" | "end_to_end";
|
|
28
30
|
verificationPerspective?: "internal" | "consumer";
|
|
29
31
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-intent.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/compile-intent.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAEV,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AAGtC,eAAO,MAAM,oBAAoB,EAAG,sBAA+B,CAAC;AAGpE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACjD,CAAC,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CA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D,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;KAC5C,CAAC;IACF,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3C,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,YAAY,EAAE,SAAS,eAAe,EAAE,CAAC;IACzC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC,CAAC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AA0eH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE,aAAa,CAAC;CAClC,CAAC,CA0RD"}
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { dump as dumpYaml } from "js-yaml";
|
|
4
4
|
import { executeIntentSearch, } from "../../intent-search.js";
|
|
5
|
-
import { parseTriples } from "../../prolog/codec.js";
|
|
5
|
+
import { normalizeEntityId, parseTriples } from "../../prolog/codec.js";
|
|
6
6
|
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
7
7
|
import { executeStatus } from "../../public/operations/discovery-executors.js";
|
|
8
8
|
import { configuredSourceTarget } from "../mutation/source-authoring.js";
|
|
@@ -227,8 +227,16 @@ async function contradictionAnalysis(prolog, requirementId) {
|
|
|
227
227
|
return { outcome: "unresolved", witnesses: [] };
|
|
228
228
|
const rows = parseTriples(result.bindings.Rows ?? "[]");
|
|
229
229
|
const witnesses = rows
|
|
230
|
-
.
|
|
231
|
-
|
|
230
|
+
.map(([left, right, reason]) => ({
|
|
231
|
+
left: normalizeEntityId(left),
|
|
232
|
+
right: normalizeEntityId(right),
|
|
233
|
+
reason,
|
|
234
|
+
}))
|
|
235
|
+
.filter(({ left, right }) => left === requirementId || right === requirementId)
|
|
236
|
+
.map(({ left, right, reason }) => ({
|
|
237
|
+
requirements: [left, right],
|
|
238
|
+
reason,
|
|
239
|
+
}));
|
|
232
240
|
return {
|
|
233
241
|
outcome: witnesses.length > 0 ? "conflict" : "no_conflict",
|
|
234
242
|
witnesses,
|
|
@@ -282,12 +290,20 @@ function applyAcceptedProposals(steps, proposals) {
|
|
|
282
290
|
function draftId(prefix, title, index) {
|
|
283
291
|
return `${prefix}-${slug(title)}-${shortHash(`${title}\0${index}`).toUpperCase()}`;
|
|
284
292
|
}
|
|
293
|
+
// implements REQ-kibi-change-to-proof-plan-compiler
|
|
285
294
|
function draftSteps(requirementId, scenarios, tests) {
|
|
286
295
|
const diagnostics = [];
|
|
287
296
|
const steps = [];
|
|
288
297
|
const scenarioIds = [];
|
|
298
|
+
const linkedScenarioIds = new Set();
|
|
299
|
+
const duplicateScenarioIds = new Set();
|
|
300
|
+
const testIds = new Set();
|
|
289
301
|
scenarios.forEach((scenario, index) => {
|
|
290
302
|
const id = text(scenario.id) || draftId("SCEN", scenario.title, index);
|
|
303
|
+
if (scenarioIds.includes(id)) {
|
|
304
|
+
duplicateScenarioIds.add(id);
|
|
305
|
+
diagnostics.push(`unresolved duplicate scenario draft ID ${id}; scenario associations are ambiguous.`);
|
|
306
|
+
}
|
|
291
307
|
scenarioIds.push(id);
|
|
292
308
|
steps.push({
|
|
293
309
|
type: "scenario",
|
|
@@ -303,9 +319,42 @@ function draftSteps(requirementId, scenarios, tests) {
|
|
|
303
319
|
});
|
|
304
320
|
tests.forEach((test, index) => {
|
|
305
321
|
const id = text(test.id) || draftId("TEST", test.title, index);
|
|
306
|
-
if (
|
|
307
|
-
diagnostics.push(`
|
|
308
|
-
|
|
322
|
+
if (testIds.has(id)) {
|
|
323
|
+
diagnostics.push(`unresolved duplicate test draft ID ${id}; test associations are ambiguous.`);
|
|
324
|
+
}
|
|
325
|
+
testIds.add(id);
|
|
326
|
+
const requestedScenarioIds = test.scenarioIds?.map(text) ?? null;
|
|
327
|
+
const soleScenarioId = scenarioIds.length === 1 ? scenarioIds[0] : undefined;
|
|
328
|
+
const associatedScenarioIds = requestedScenarioIds !== null
|
|
329
|
+
? Array.from(new Set(requestedScenarioIds.filter(Boolean)))
|
|
330
|
+
: soleScenarioId !== undefined
|
|
331
|
+
? [soleScenarioId]
|
|
332
|
+
: [];
|
|
333
|
+
if (scenarioIds.length === 0) {
|
|
334
|
+
diagnostics.push(`unresolved test draft ${id} has no scenario draft; proof-bearing tests require a scenario relationship.`);
|
|
335
|
+
}
|
|
336
|
+
else if (requestedScenarioIds === null && scenarioIds.length > 1) {
|
|
337
|
+
diagnostics.push(`unresolved test draft ${id} must declare scenarioIds when multiple scenario drafts exist; positional association is not supported.`);
|
|
338
|
+
}
|
|
339
|
+
else if (requestedScenarioIds !== null &&
|
|
340
|
+
associatedScenarioIds.length === 0) {
|
|
341
|
+
diagnostics.push(`unresolved test draft ${id} must reference at least one scenario ID in scenarioIds.`);
|
|
342
|
+
}
|
|
343
|
+
if (requestedScenarioIds !== null &&
|
|
344
|
+
(requestedScenarioIds.some((scenarioId) => !scenarioId) ||
|
|
345
|
+
requestedScenarioIds.filter(Boolean).length !==
|
|
346
|
+
associatedScenarioIds.length)) {
|
|
347
|
+
diagnostics.push(`unresolved test draft ${id} repeats or omits scenario IDs; associations must be unique and non-empty.`);
|
|
348
|
+
}
|
|
349
|
+
const validScenarioIds = associatedScenarioIds.filter((scenarioId) => scenarioIds.includes(scenarioId) &&
|
|
350
|
+
!duplicateScenarioIds.has(scenarioId));
|
|
351
|
+
for (const scenarioId of associatedScenarioIds) {
|
|
352
|
+
if (!scenarioIds.includes(scenarioId)) {
|
|
353
|
+
diagnostics.push(`unresolved test draft ${id} references unknown scenario ID ${scenarioId}.`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
for (const scenarioId of validScenarioIds)
|
|
357
|
+
linkedScenarioIds.add(scenarioId);
|
|
309
358
|
steps.push({
|
|
310
359
|
type: "test",
|
|
311
360
|
id,
|
|
@@ -314,14 +363,21 @@ function draftSteps(requirementId, scenarios, tests) {
|
|
|
314
363
|
status: "draft",
|
|
315
364
|
body: test.body.trim(),
|
|
316
365
|
source: "mcp://kibi/compile-intent",
|
|
317
|
-
verification_scope: test.verificationScope ?? "
|
|
318
|
-
verification_perspective: test.verificationPerspective ?? "
|
|
366
|
+
verification_scope: test.verificationScope ?? "integration",
|
|
367
|
+
verification_perspective: test.verificationPerspective ?? "internal",
|
|
319
368
|
},
|
|
320
|
-
relationships: scenarioId
|
|
321
|
-
|
|
322
|
-
:
|
|
369
|
+
relationships: validScenarioIds.map((scenarioId) => ({
|
|
370
|
+
type: "verified_by",
|
|
371
|
+
from: scenarioId,
|
|
372
|
+
to: id,
|
|
373
|
+
})),
|
|
323
374
|
});
|
|
324
375
|
});
|
|
376
|
+
for (const scenarioId of scenarioIds) {
|
|
377
|
+
if (!linkedScenarioIds.has(scenarioId)) {
|
|
378
|
+
diagnostics.push(`unresolved scenario draft ${scenarioId} has no test draft; add a test with scenarioIds to establish executable coverage.`);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
325
381
|
if (scenarioIds.length > 0) {
|
|
326
382
|
steps.push({
|
|
327
383
|
type: "req",
|
|
@@ -348,13 +404,13 @@ export async function executeCompileIntent(args, context) {
|
|
|
348
404
|
const status = statusResult.structuredContent;
|
|
349
405
|
if (!status)
|
|
350
406
|
throw new Error("Compile intent failed: status query returned no payload");
|
|
351
|
-
const snapshotEvidence = status?.
|
|
407
|
+
const snapshotEvidence = status?.proofSnapshot;
|
|
352
408
|
const workspaceSnapshot = snapshotEvidence
|
|
353
409
|
? {
|
|
354
410
|
version: "kibi.workspace-snapshot.v2",
|
|
355
411
|
hash: snapshotEvidence,
|
|
356
|
-
dirty: status?.
|
|
357
|
-
fileCount: status?.
|
|
412
|
+
dirty: status?.proofSnapshotDirty ?? false,
|
|
413
|
+
fileCount: status?.proofSnapshotFileCount ?? 0,
|
|
358
414
|
}
|
|
359
415
|
: {
|
|
360
416
|
version: "kibi.workspace-snapshot.v2",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ProofGap } from "../../proof/evaluate.js";
|
|
2
|
+
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
3
|
+
import { type ProofReceipt } from "../../public/proof-receipt.js";
|
|
4
|
+
export type IngestProofArgs = Readonly<{
|
|
5
|
+
snapshot: string;
|
|
6
|
+
artifact: Readonly<Record<string, unknown>>;
|
|
7
|
+
testIds?: readonly string[];
|
|
8
|
+
}>;
|
|
9
|
+
export type IngestProofTestResult = Readonly<{
|
|
10
|
+
testId: string;
|
|
11
|
+
outcome: ProofReceipt["outcome"];
|
|
12
|
+
receiptId: string;
|
|
13
|
+
applied: boolean;
|
|
14
|
+
duplicate: boolean;
|
|
15
|
+
receiptCount: number;
|
|
16
|
+
gaps: readonly ProofGap[];
|
|
17
|
+
}>;
|
|
18
|
+
export type IngestProofResult = Readonly<{
|
|
19
|
+
artifactDigest: string;
|
|
20
|
+
environmentHash: string;
|
|
21
|
+
integration: string | null;
|
|
22
|
+
passed: number;
|
|
23
|
+
failed: number;
|
|
24
|
+
unchanged: number;
|
|
25
|
+
results: readonly IngestProofTestResult[];
|
|
26
|
+
}>;
|
|
27
|
+
export declare function executeIngestProof(args: IngestProofArgs, context: OperationContext): Promise<{
|
|
28
|
+
content: Array<{
|
|
29
|
+
type: "text";
|
|
30
|
+
text: string;
|
|
31
|
+
}>;
|
|
32
|
+
structuredContent: IngestProofResult;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=ingest-proof.d.ts.map
|
|
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