kibi-cli 1.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-errors.d.ts +3 -1
- package/dist/cli-errors.d.ts.map +1 -1
- package/dist/cli-errors.js +4 -1
- package/dist/cli-json-command.d.ts +1 -0
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +13 -4
- package/dist/cli-operation-loader.js +3 -3
- package/dist/cli-operation-metadata.d.ts +4 -3
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +7 -5
- package/dist/cli-protocol.js +1 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-proof.d.ts +3 -0
- package/dist/cli-register-proof.d.ts.map +1 -0
- package/dist/cli-register-proof.js +127 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +7 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -10
- package/dist/commands/branch.d.ts +1 -0
- package/dist/commands/branch.d.ts.map +1 -1
- package/dist/commands/branch.js +8 -4
- package/dist/commands/check-generated.d.ts +7 -0
- package/dist/commands/check-generated.d.ts.map +1 -0
- package/dist/commands/check-generated.js +192 -0
- package/dist/commands/check.d.ts +14 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +193 -46
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +6 -0
- package/dist/commands/doctor.d.ts +22 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +170 -23
- package/dist/commands/engine.d.ts +12 -0
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +42 -0
- package/dist/commands/github-init.d.ts +1 -0
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +9 -5
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +49 -10
- package/dist/commands/migrate.d.ts +4 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +7 -7
- package/dist/commands/proof-explain.d.ts +10 -0
- package/dist/commands/proof-explain.d.ts.map +1 -0
- package/dist/commands/proof-explain.js +45 -0
- package/dist/commands/proof-impact.d.ts +7 -0
- package/dist/commands/proof-impact.d.ts.map +1 -0
- package/dist/commands/proof-impact.js +39 -0
- package/dist/commands/proof-migrate-legacy.d.ts +7 -0
- package/dist/commands/proof-migrate-legacy.d.ts.map +1 -0
- package/dist/commands/proof-migrate-legacy.js +45 -0
- package/dist/commands/proof-prune.d.ts +8 -0
- package/dist/commands/proof-prune.d.ts.map +1 -0
- package/dist/commands/proof-prune.js +53 -0
- package/dist/commands/prove.d.ts +37 -0
- package/dist/commands/prove.d.ts.map +1 -0
- package/dist/commands/prove.js +470 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +18 -3
- package/dist/commands/sync/discovery.d.ts +3 -0
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +36 -28
- package/dist/commands/sync/manifest.d.ts +2 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +55 -21
- package/dist/commands/sync/persistence.d.ts +4 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +31 -14
- package/dist/commands/sync/staging.d.ts +1 -0
- package/dist/commands/sync/staging.d.ts.map +1 -1
- package/dist/commands/sync/staging.js +5 -2
- package/dist/commands/sync/untracked-targets.d.ts +24 -0
- package/dist/commands/sync/untracked-targets.d.ts.map +1 -0
- package/dist/commands/sync/untracked-targets.js +108 -0
- package/dist/commands/sync.d.ts +11 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +74 -30
- package/dist/engine-daemon.d.ts +3 -1
- package/dist/engine-daemon.d.ts.map +1 -1
- package/dist/engine-daemon.js +49 -20
- package/dist/engine.d.ts +17 -77
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +331 -91
- package/dist/env/bootstrap.d.ts +84 -0
- package/dist/env/bootstrap.d.ts.map +1 -0
- package/dist/env/bootstrap.js +310 -0
- package/dist/extractors/manifest.d.ts +5 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +46 -1
- package/dist/extractors/markdown.d.ts +7 -3
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +60 -24
- package/dist/extractors/playwright-cases.js +1 -1
- package/dist/extractors/relationships.d.ts +6 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -1
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.d.ts +8 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +40 -0
- package/dist/extractors/symbols-ts.d.ts +9 -19
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +34 -429
- package/dist/intent-search.d.ts +1 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +11 -8
- package/dist/logic/ir.d.ts +1 -0
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +1 -1
- package/dist/operations/bootstrap/activation.d.ts +2 -1
- package/dist/operations/bootstrap/activation.d.ts.map +1 -1
- package/dist/operations/bootstrap/activation.js +11 -3
- package/dist/operations/bootstrap/generate.d.ts +2 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +6 -3
- package/dist/operations/bootstrap/guidance.d.ts +1 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/modeling/model-requirement.d.ts +5 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +57 -46
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +103 -4
- package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-2.js +18 -2
- package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-3.js +17 -1
- package/dist/operations/modeling/predicate-catalog-5.d.ts +10 -0
- package/dist/operations/modeling/predicate-catalog-5.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-5.js +291 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +4 -0
- package/dist/operations/modeling/predicate-loader.d.ts +1 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +4 -3
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +4 -1
- package/dist/operations/modeling/predicate-types.d.ts +1 -1
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-4.js +84 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +4 -2
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +82 -22
- package/dist/operations/mutation/contradictions.d.ts +2 -1
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +26 -5
- package/dist/operations/mutation/delete.d.ts +3 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +100 -32
- package/dist/operations/mutation/relationships.d.ts +1 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +6 -4
- package/dist/operations/mutation/saga.d.ts +51 -0
- package/dist/operations/mutation/saga.d.ts.map +1 -0
- package/dist/operations/mutation/saga.js +67 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -2
- package/dist/operations/mutation/source-authoring.d.ts +5 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +79 -46
- package/dist/operations/mutation/strict-fact.d.ts +1 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +8 -5
- package/dist/operations/mutation/symbol-compiler-lock.d.ts +5 -2
- package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-compiler-lock.js +65 -2
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +11 -89
- package/dist/operations/mutation/symbol-refresh.d.ts +1 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +10 -8
- package/dist/operations/mutation/upsert.d.ts +18 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +86 -54
- package/dist/operations/mutation/validate-upsert.js +2 -2
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +46 -4
- package/dist/operations/mutation/warnings.d.ts +1 -0
- package/dist/operations/mutation/warnings.d.ts.map +1 -1
- package/dist/operations/mutation/warnings.js +7 -5
- package/dist/operations/mutation/workspace-mutation-lock.d.ts +60 -0
- package/dist/operations/mutation/workspace-mutation-lock.d.ts.map +1 -0
- package/dist/operations/mutation/workspace-mutation-lock.js +362 -0
- package/dist/operations/planning/apply-plan.d.ts +8 -106
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +113 -36
- package/dist/operations/planning/compile-intent.d.ts +51 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +133 -17
- package/dist/operations/proof/baseline-diff.d.ts +41 -0
- package/dist/operations/proof/baseline-diff.d.ts.map +1 -0
- package/dist/operations/proof/baseline-diff.js +153 -0
- package/dist/operations/proof/explain.d.ts +75 -0
- package/dist/operations/proof/explain.d.ts.map +1 -0
- package/dist/operations/proof/explain.js +294 -0
- package/dist/operations/proof/impact.d.ts +45 -0
- package/dist/operations/proof/impact.d.ts.map +1 -0
- package/dist/operations/proof/impact.js +118 -0
- package/dist/operations/proof/ingest-proof.d.ts +34 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -0
- package/dist/operations/proof/ingest-proof.js +348 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts +30 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -0
- package/dist/operations/proof/migrate-legacy-receipts.js +92 -0
- package/dist/operations/proof/prune-receipts.d.ts +35 -0
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -0
- package/dist/operations/proof/prune-receipts.js +91 -0
- package/dist/operations/proof/receipt-document.d.ts +29 -0
- package/dist/operations/proof/receipt-document.d.ts.map +1 -0
- package/dist/operations/proof/receipt-document.js +117 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +3 -9
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +1 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +64 -93
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +20 -7
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts +63 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.js +489 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +15 -2
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-core.js +7 -140
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +11 -12
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +6 -94
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +16 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +7 -150
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +9 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +7 -102
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +13 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product.js +7 -133
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts +2 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-count-rules.js +40 -25
- package/dist/operations/semantic-advisor/types.d.ts +1 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/compose-ontology-packs.d.ts +51 -0
- package/dist/plugins/compose-ontology-packs.d.ts.map +1 -0
- package/dist/plugins/compose-ontology-packs.js +257 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +42 -0
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -0
- package/dist/plugins/compose-semantic-classifier.js +211 -0
- package/dist/plugins/external-allowlist.d.ts +10 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -0
- package/dist/plugins/external-allowlist.js +16 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +33 -0
- package/dist/plugins/load-plugin.d.ts +19 -0
- package/dist/plugins/load-plugin.d.ts.map +1 -0
- package/dist/plugins/load-plugin.js +59 -0
- package/dist/plugins/project-config.d.ts +28 -0
- package/dist/plugins/project-config.d.ts.map +1 -0
- package/dist/plugins/project-config.js +90 -0
- package/dist/plugins/registry.d.ts +93 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +338 -0
- package/dist/plugins/resolve-package.d.ts +47 -0
- package/dist/plugins/resolve-package.d.ts.map +1 -0
- package/dist/plugins/resolve-package.js +262 -0
- package/dist/plugins/source-analysis-service.d.ts +44 -0
- package/dist/plugins/source-analysis-service.d.ts.map +1 -0
- package/dist/plugins/source-analysis-service.js +232 -0
- package/dist/prolog/codec.d.ts +13 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +269 -154
- package/dist/prolog/error-terms.d.ts +47 -0
- package/dist/prolog/error-terms.d.ts.map +1 -0
- package/dist/prolog/error-terms.js +334 -0
- package/dist/prolog/janitor.d.ts +50 -0
- package/dist/prolog/janitor.d.ts.map +1 -0
- package/dist/prolog/janitor.js +154 -0
- package/dist/prolog/store-lock.d.ts +45 -0
- package/dist/prolog/store-lock.d.ts.map +1 -0
- package/dist/prolog/store-lock.js +195 -0
- package/dist/prolog.d.ts +7 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +55 -17
- package/dist/proof/evaluate.d.ts +27 -0
- package/dist/proof/evaluate.d.ts.map +1 -0
- package/dist/proof/evaluate.js +151 -0
- package/dist/proof/inspect.d.ts +12 -0
- package/dist/proof/inspect.d.ts.map +1 -0
- package/dist/proof/inspect.js +236 -0
- package/dist/proof/integrations.d.ts +35 -0
- package/dist/proof/integrations.d.ts.map +1 -0
- package/dist/proof/integrations.js +123 -0
- package/dist/proof/producers/junit-adapter.d.ts +26 -0
- package/dist/proof/producers/junit-adapter.d.ts.map +1 -0
- package/dist/proof/producers/junit-adapter.js +186 -0
- package/dist/{public → proof/producers}/playwright-case-id.d.ts +1 -1
- package/dist/proof/producers/playwright-case-id.d.ts.map +1 -0
- package/dist/{public → proof/producers}/playwright-case-id.js +1 -1
- package/dist/proof/producers/playwright-reporter.d.ts +27 -0
- package/dist/proof/producers/playwright-reporter.d.ts.map +1 -0
- package/dist/proof/producers/playwright-reporter.js +138 -0
- package/dist/proof/producers/tap-adapter.d.ts +10 -0
- package/dist/proof/producers/tap-adapter.d.ts.map +1 -0
- package/dist/proof/producers/tap-adapter.js +200 -0
- package/dist/proof/receipt-outcome.d.ts +2 -0
- package/dist/proof/receipt-outcome.d.ts.map +1 -0
- package/dist/proof/receipt-outcome.js +1 -0
- package/dist/public/diagnostic-usage.js +6 -6
- package/dist/public/distribution-parity.d.ts +7 -1
- package/dist/public/distribution-parity.d.ts.map +1 -1
- package/dist/public/distribution-parity.js +15 -10
- package/dist/public/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/public/extractors/symbols-coordinator.js +1 -1
- package/dist/public/impact/analyzer.d.ts +1 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +6 -4
- package/dist/public/impact/coverage-depth-quality.d.ts +1 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +1 -1
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +2 -2
- package/dist/public/impact/diff-meaning.d.ts +1 -0
- package/dist/public/impact/diff-meaning.d.ts.map +1 -1
- package/dist/public/impact/diff-meaning.js +5 -2
- package/dist/public/impact/full-kb-quality.d.ts +5 -2
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +329 -64
- package/dist/public/operations/catalog.d.ts +450 -196
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +6 -4
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +4 -8
- package/dist/public/operations/check-helpers.d.ts +1 -1
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +1 -1
- package/dist/public/operations/contracts.d.ts +7 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +66 -34
- package/dist/public/operations/discovery-entities.d.ts +15 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +38 -0
- package/dist/public/operations/discovery-executors.d.ts +9 -9
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +39 -31
- package/dist/public/operations/index.d.ts +1 -1
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -1
- package/dist/public/operations/migration-plan.d.ts +4 -3
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +23 -21
- package/dist/public/operations/node-ports.js +6 -6
- package/dist/public/operations/prolog-json.d.ts +1 -1
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +7 -7
- package/dist/public/operations/repair-plan.d.ts +3 -3
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +49 -19
- package/dist/public/operations/result-envelope.d.ts +1 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +12 -10
- package/dist/public/operations/runtime-types.d.ts +21 -1
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +5 -0
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -0
- package/dist/public/operations/specs/check-rules.generated.js +35 -0
- package/dist/public/operations/specs/check.d.ts +7 -2
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +8 -20
- package/dist/public/operations/specs/discovery.d.ts +3 -0
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +3 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +257 -163
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +15 -7
- package/dist/public/operations/specs/planning.d.ts +9 -0
- package/dist/public/operations/specs/planning.d.ts.map +1 -1
- package/dist/public/operations/specs/planning.js +6 -0
- package/dist/public/operations/specs/proof.d.ts +212 -0
- package/dist/public/operations/specs/proof.d.ts.map +1 -0
- package/dist/public/operations/specs/proof.js +30 -0
- package/dist/public/operations/specs/reporting.d.ts +20 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +112 -12
- package/dist/public/operations/specs/semantic.d.ts +1 -1
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +54 -4
- package/dist/public/operations/specs/upsert.d.ts +257 -163
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +121 -4
- package/dist/public/operations/types.d.ts +6 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-fingerprint.d.ts +54 -0
- package/dist/public/proof-fingerprint.d.ts.map +1 -0
- package/dist/public/proof-fingerprint.js +141 -0
- package/dist/public/proof-protocol.d.ts +354 -0
- package/dist/public/proof-protocol.d.ts.map +1 -0
- package/dist/public/proof-protocol.js +454 -0
- package/dist/public/proof-receipt.d.ts +279 -0
- package/dist/public/proof-receipt.d.ts.map +1 -0
- package/dist/public/proof-receipt.js +377 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +21 -7
- package/dist/public/skills/kibi-freshness/SKILL.md +1 -1
- package/dist/public/skills/kibi-usage/SKILL.md +44 -12
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/dist/public/skills/kibi-usage/resources/proof.md +150 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/dist/public/symbol-granularity.d.ts +3 -14
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.generated.d.ts +16 -0
- package/dist/public/symbol-granularity.generated.d.ts.map +1 -0
- package/dist/public/symbol-granularity.generated.js +53 -0
- package/dist/public/symbol-granularity.js +6 -47
- package/dist/public/telemetry-acceptance.d.ts +3 -77
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +4 -2
- package/dist/public/telemetry-remediation.js +1 -1
- package/dist/report/html-report.css +1240 -0
- package/dist/report/html-report.d.ts +4 -2
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +37 -300
- package/dist/runtime/cli-runtime.d.ts +2 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +32 -7
- package/dist/schemas/entity.schema.json +355 -215
- package/dist/search-ranking.d.ts +1 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +3 -0
- package/dist/traceability/evidence-model.d.ts +28 -0
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/git-staged.d.ts +20 -0
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +145 -1
- package/dist/traceability/staged-diagnostics.d.ts +7 -0
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +78 -7
- package/dist/traceability/staged-file-coverage.d.ts +33 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -0
- package/dist/traceability/staged-file-coverage.js +284 -0
- package/dist/traceability/staged-impact-contract.js +4 -4
- package/dist/traceability/staged-symbols-manifest.d.ts +13 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +138 -27
- package/dist/traceability/symbol-extract.d.ts +24 -2
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +64 -208
- package/dist/traceability/temp-kb.d.ts +2 -0
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +13 -4
- package/dist/types/entities.d.ts +5 -3
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +1 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +7 -4
- package/dist/utils/branch-store.d.ts +6 -0
- package/dist/utils/branch-store.d.ts.map +1 -1
- package/dist/utils/branch-store.js +27 -0
- package/dist/utils/kb-paths.d.ts +1 -1
- package/dist/utils/kb-paths.d.ts.map +1 -1
- package/dist/utils/kb-paths.js +1 -1
- package/dist/utils/rule-registry.d.ts +1 -11
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +102 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -0
- package/dist/utils/rule-registry.generated.js +131 -0
- package/dist/utils/rule-registry.js +12 -113
- package/dist/utils/strict-modeling.d.ts +1 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +1 -1
- package/package.json +20 -20
- package/src/public/diagnostic-usage.ts +6 -6
- package/src/public/distribution-parity.ts +17 -10
- package/src/public/extractors/symbols-coordinator.ts +1 -0
- package/src/public/impact/analyzer.ts +15 -12
- package/src/public/impact/coverage-depth-quality.ts +1 -1
- package/src/public/impact/diagnostics.ts +2 -1
- package/src/public/impact/diff-meaning.ts +11 -4
- package/src/public/impact/full-kb-quality.ts +463 -72
- package/src/public/operations/catalog.ts +10 -4
- package/src/public/operations/check-executor.ts +4 -8
- package/src/public/operations/check-helpers.ts +2 -2
- package/src/public/operations/contracts.ts +78 -34
- package/src/public/operations/discovery-entities.ts +53 -0
- package/src/public/operations/discovery-executors.ts +64 -48
- package/src/public/operations/index.ts +1 -1
- package/src/public/operations/migration-plan.ts +32 -25
- package/src/public/operations/node-ports.ts +6 -6
- package/src/public/operations/prolog-json.ts +13 -5
- package/src/public/operations/repair-plan.ts +60 -23
- package/src/public/operations/result-envelope.ts +15 -10
- package/src/public/operations/runtime-types.ts +26 -2
- package/src/public/operations/specs/check-rules.generated.ts +38 -0
- package/src/public/operations/specs/check.ts +12 -21
- package/src/public/operations/specs/discovery.ts +3 -0
- package/src/public/operations/specs/mutation-schemas.ts +22 -9
- package/src/public/operations/specs/planning.ts +7 -0
- package/src/public/operations/specs/proof.ts +43 -0
- package/src/public/operations/specs/reporting.ts +140 -13
- package/src/public/operations/specs/semantic.ts +79 -17
- package/src/public/operations/symbol-repair-plan.ts +166 -7
- package/src/public/operations/types.ts +6 -1
- package/src/public/proof-fingerprint.ts +216 -0
- package/src/public/proof-protocol-types.d.ts +96 -0
- package/src/public/proof-protocol.ts +589 -0
- package/src/public/proof-receipt.ts +499 -0
- package/src/public/schemas/entity.ts +26 -10
- package/src/public/skills/kibi-freshness/SKILL.md +1 -1
- package/src/public/skills/kibi-usage/SKILL.md +44 -12
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/src/public/skills/kibi-usage/resources/proof.md +150 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/src/public/symbol-granularity.generated.ts +74 -0
- package/src/public/symbol-granularity.ts +34 -59
- package/src/public/telemetry-acceptance-types.d.ts +98 -0
- package/src/public/telemetry-acceptance.ts +22 -100
- package/src/public/telemetry-remediation.ts +1 -1
- package/src/schemas/entity.schema.json +355 -215
- package/dist/cli-register-verification.d.ts +0 -3
- package/dist/cli-register-verification.d.ts.map +0 -1
- package/dist/cli-register-verification.js +0 -16
- package/dist/commands/verify.d.ts +0 -10
- package/dist/commands/verify.d.ts.map +0 -1
- package/dist/commands/verify.js +0 -126
- package/dist/operations/verification/ingest-verification.d.ts +0 -29
- package/dist/operations/verification/ingest-verification.d.ts.map +0 -1
- package/dist/operations/verification/ingest-verification.js +0 -192
- package/dist/public/operations/specs/verification.d.ts +0 -78
- package/dist/public/operations/specs/verification.d.ts.map +0 -1
- package/dist/public/operations/specs/verification.js +0 -62
- package/dist/public/playwright-case-id.d.ts.map +0 -1
- package/dist/public/verification-receipt.d.ts +0 -242
- package/dist/public/verification-receipt.d.ts.map +0 -1
- package/dist/public/verification-receipt.js +0 -296
- package/dist/verification/playwright-reporter.d.ts +0 -21
- package/dist/verification/playwright-reporter.d.ts.map +0 -1
- package/dist/verification/playwright-reporter.js +0 -114
- package/src/public/operations/specs/verification.ts +0 -78
- package/src/public/playwright-case-id.ts +0 -35
- package/src/public/verification-receipt.ts +0 -412
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/serialization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/serialization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoDpD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,CAMR;AAGD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAOxE;AAGD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBtD"}
|
|
@@ -28,8 +28,9 @@ function serializeValue(key, value) {
|
|
|
28
28
|
}
|
|
29
29
|
if (key === "rule_ir" ||
|
|
30
30
|
key === "semantic_inventory" ||
|
|
31
|
-
key === "
|
|
32
|
-
key === "
|
|
31
|
+
key === "proof_contract" ||
|
|
32
|
+
key === "proof_bindings" ||
|
|
33
|
+
key === "proof_receipts") {
|
|
33
34
|
return toPrologString(JSON.stringify(value));
|
|
34
35
|
}
|
|
35
36
|
if (Array.isArray(value))
|
|
@@ -19,6 +19,10 @@ export declare function configuredSourceTarget(workspaceRoot: string, type: stri
|
|
|
19
19
|
export declare function hasConfiguredSourceTarget(workspaceRoot: string, type: string): boolean;
|
|
20
20
|
/** Generated coordinate fields belong exclusively to `.kb/symbol-coordinates.yaml`. */
|
|
21
21
|
export declare const GENERATED_SYMBOL_FIELDS: readonly ["sourceLine", "sourceColumn", "sourceEndLine", "sourceEndColumn", "coordinatesGeneratedAt"];
|
|
22
|
+
export declare function manifestRelationships(item: unknown): Array<{
|
|
23
|
+
type: string;
|
|
24
|
+
target: string;
|
|
25
|
+
}>;
|
|
22
26
|
export declare function renderSourceDeletion(sourcePathValue: string, entityId: string, entityType: string, existingContent: string): {
|
|
23
27
|
mode: "write" | "delete";
|
|
24
28
|
body?: string;
|
|
@@ -52,7 +56,7 @@ export declare function renderYamlRelationshipDeletion(sourcePathValue: string,
|
|
|
52
56
|
body: string;
|
|
53
57
|
removed: boolean;
|
|
54
58
|
};
|
|
55
|
-
export declare function writeSourceForUpsert(input: UpsertInput, entity: Readonly<Record<string, unknown>>, existing?: Readonly<Record<string, unknown>>, context?: OperationContext): Promise<{
|
|
59
|
+
export declare function writeSourceForUpsert(input: UpsertInput, entity: Readonly<Record<string, unknown>>, existing?: Readonly<Record<string, unknown>>, context?: OperationContext, sourceDocumentOverride?: string): Promise<{
|
|
56
60
|
receipt: SourceWriteReceipt;
|
|
57
61
|
rollback: () => Promise<void>;
|
|
58
62
|
} | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-authoring.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/source-authoring.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-authoring.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/source-authoring.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,KAAK,EAAqB,WAAW,EAA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AOR"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { dump as dumpYaml, load as loadYaml } from "js-yaml";
|
|
@@ -196,7 +197,7 @@ function symbolManifestRecord(entity, relationships = []) {
|
|
|
196
197
|
}
|
|
197
198
|
return record;
|
|
198
199
|
}
|
|
199
|
-
function manifestRelationships(item) {
|
|
200
|
+
export function manifestRelationships(item) {
|
|
200
201
|
if (item === null ||
|
|
201
202
|
typeof item !== "object" ||
|
|
202
203
|
!("get" in item) ||
|
|
@@ -452,7 +453,7 @@ function renderSourceDocument(input, entity, existingContent, relativePath) {
|
|
|
452
453
|
}
|
|
453
454
|
return renderEntityDocument(input, entity, existingContent);
|
|
454
455
|
}
|
|
455
|
-
export async function writeSourceForUpsert(input, entity, existing, context) {
|
|
456
|
+
export async function writeSourceForUpsert(input, entity, existing, context, sourceDocumentOverride) {
|
|
456
457
|
if (!context?.fs)
|
|
457
458
|
return null;
|
|
458
459
|
const absolute = sourcePath(context, input, entity, existing);
|
|
@@ -466,16 +467,30 @@ export async function writeSourceForUpsert(input, entity, existing, context) {
|
|
|
466
467
|
catch {
|
|
467
468
|
before = undefined;
|
|
468
469
|
}
|
|
469
|
-
|
|
470
|
+
// Proof-receipt ingest supplies pre-patched bytes so unrelated frontmatter
|
|
471
|
+
// keeps its authored formatting (and the workspace snapshot stays stable).
|
|
472
|
+
// Only valid when the document already exists; a new document still needs
|
|
473
|
+
// the canonical render.
|
|
474
|
+
const after = before !== undefined && sourceDocumentOverride !== undefined
|
|
475
|
+
? sourceDocumentOverride
|
|
476
|
+
: renderSourceDocument(input, entity, before, relative);
|
|
470
477
|
await context.fs.mkdir(path.dirname(absolute));
|
|
471
|
-
const temporary = `${absolute}.kibi-source-${
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
478
|
+
const temporary = `${absolute}.kibi-source-${process.pid}-${randomUUID()}`;
|
|
479
|
+
try {
|
|
480
|
+
await context.fs.writeFile(temporary, after);
|
|
481
|
+
if (context.fs.rename) {
|
|
482
|
+
await context.fs.rename(temporary, absolute);
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
await context.fs.writeFile(absolute, after);
|
|
486
|
+
await context.fs.unlink?.(temporary).catch(() => undefined);
|
|
487
|
+
}
|
|
475
488
|
}
|
|
476
|
-
|
|
477
|
-
|
|
489
|
+
catch (error) {
|
|
490
|
+
// A failed rename must not leak the unique temp file into the authored
|
|
491
|
+
// tree; the published target (if any) is untouched at this point.
|
|
478
492
|
await context.fs.unlink?.(temporary).catch(() => undefined);
|
|
493
|
+
throw error;
|
|
479
494
|
}
|
|
480
495
|
const receipt = {
|
|
481
496
|
path: relative,
|
|
@@ -484,46 +499,40 @@ export async function writeSourceForUpsert(input, entity, existing, context) {
|
|
|
484
499
|
afterHash: digest(after),
|
|
485
500
|
created: before === undefined,
|
|
486
501
|
};
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
(
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
receipt
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
+
const rollback = async () => {
|
|
503
|
+
const fsPort = context.fs;
|
|
504
|
+
if (fsPort === undefined)
|
|
505
|
+
return;
|
|
506
|
+
// Compare before restore: a concurrent writer may have replaced the file
|
|
507
|
+
// after our publication. Never clobber newer bytes; keep the recovery
|
|
508
|
+
// receipt so the next sync reconciles deterministically instead.
|
|
509
|
+
let current;
|
|
510
|
+
try {
|
|
511
|
+
current = await fsPort.readFile(absolute);
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
current = undefined;
|
|
515
|
+
}
|
|
516
|
+
if (current !== undefined && digest(current) !== digest(after)) {
|
|
517
|
+
writePendingSourceReceipt(context.workspaceRoot, relative, receipt.afterHash);
|
|
518
|
+
console.warn(`Skipped source rollback for ${relative}: file changed after the Kibi write; kept concurrent content and recorded recovery metadata.`);
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
if (before === undefined) {
|
|
522
|
+
if (fsPort.unlink)
|
|
523
|
+
await fsPort.unlink(absolute);
|
|
524
|
+
else
|
|
525
|
+
await fsPort.writeFile(absolute, "");
|
|
502
526
|
try {
|
|
503
|
-
|
|
527
|
+
fs.unlinkSync(pendingReceiptPath(context.workspaceRoot, relative));
|
|
504
528
|
}
|
|
505
529
|
catch {
|
|
506
|
-
|
|
530
|
+
// The pending receipt is advisory recovery metadata.
|
|
507
531
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
if (before === undefined) {
|
|
514
|
-
if (fsPort.unlink)
|
|
515
|
-
await fsPort.unlink(absolute);
|
|
516
|
-
else
|
|
517
|
-
await fsPort.writeFile(absolute, "");
|
|
518
|
-
try {
|
|
519
|
-
fs.unlinkSync(pendingReceiptPath(context.workspaceRoot, relative));
|
|
520
|
-
}
|
|
521
|
-
catch {
|
|
522
|
-
// The pending receipt is advisory recovery metadata.
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
else {
|
|
526
|
-
const rollbackTemp = `${absolute}.kibi-rollback-${digest(relative).slice(0, 12)}`;
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
const rollbackTemp = `${absolute}.kibi-rollback-${process.pid}-${randomUUID()}`;
|
|
535
|
+
try {
|
|
527
536
|
await fsPort.writeFile(rollbackTemp, before);
|
|
528
537
|
if (fsPort.rename)
|
|
529
538
|
await fsPort.rename(rollbackTemp, absolute);
|
|
@@ -532,8 +541,32 @@ export async function writeSourceForUpsert(input, entity, existing, context) {
|
|
|
532
541
|
await fsPort.unlink?.(rollbackTemp).catch(() => undefined);
|
|
533
542
|
}
|
|
534
543
|
}
|
|
535
|
-
|
|
544
|
+
catch (error) {
|
|
545
|
+
await fsPort.unlink?.(rollbackTemp).catch(() => undefined);
|
|
546
|
+
throw error;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
536
549
|
};
|
|
550
|
+
const pendingReceipt = pendingReceiptPath(context.workspaceRoot, relative);
|
|
551
|
+
try {
|
|
552
|
+
if (receipt.afterHash !== null &&
|
|
553
|
+
(before === undefined || fs.existsSync(pendingReceipt))) {
|
|
554
|
+
writePendingSourceReceipt(context.workspaceRoot, relative, receipt.afterHash);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
catch (receiptError) {
|
|
558
|
+
// The source bytes are already published but the caller has not received
|
|
559
|
+
// the rollback handle yet. Unwind the publication here so no failed call
|
|
560
|
+
// ever leaves a half-registered source write behind.
|
|
561
|
+
try {
|
|
562
|
+
await rollback();
|
|
563
|
+
}
|
|
564
|
+
catch (rollbackError) {
|
|
565
|
+
throw new AggregateError([receiptError, rollbackError], `Source published for ${relative}, but pending receipt publication and rollback both failed; recover from the pending-source receipt or restore the authored file manually`);
|
|
566
|
+
}
|
|
567
|
+
throw receiptError;
|
|
568
|
+
}
|
|
569
|
+
return { receipt, rollback };
|
|
537
570
|
}
|
|
538
571
|
/** Resolve and normalize the canonical authored path for an entity. */
|
|
539
572
|
export function canonicalSourcePath(context, input, entity, existing) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function valueFieldHint(value: unknown): string;
|
|
2
2
|
export declare function factKindShapeHints(entity: Readonly<Record<string, unknown>>): string[];
|
|
3
|
+
export declare function assertRuleSchemaArity(argumentNames: unknown, argumentTypes: unknown): void;
|
|
3
4
|
export declare function validateFactModelingShape(entity: Readonly<Record<string, unknown>>): void;
|
|
4
5
|
//# sourceMappingURL=strict-fact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAarD;AAGD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,EAAE,CA+EV;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,IAAI,
|
|
1
|
+
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAarD;AAGD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,EAAE,CA+EV;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,OAAO,EACtB,aAAa,EAAE,OAAO,GACrB,IAAI,CAUN;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,IAAI,CA+CN"}
|
|
@@ -93,6 +93,13 @@ export function factKindShapeHints(entity) {
|
|
|
93
93
|
];
|
|
94
94
|
return [];
|
|
95
95
|
}
|
|
96
|
+
export function assertRuleSchemaArity(argumentNames, argumentTypes) {
|
|
97
|
+
if (!Array.isArray(argumentNames) ||
|
|
98
|
+
!Array.isArray(argumentTypes) ||
|
|
99
|
+
argumentNames.length !== argumentTypes.length) {
|
|
100
|
+
throw new Error("Entity validation failed: rule_schema argument_names and argument_types must have equal lengths");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
96
103
|
// implements REQ-kibi-operation-interface-parity
|
|
97
104
|
export function validateFactModelingShape(entity) {
|
|
98
105
|
const hints = factKindShapeHints(entity);
|
|
@@ -123,10 +130,6 @@ export function validateFactModelingShape(entity) {
|
|
|
123
130
|
entity.rule_name.trim() === "") {
|
|
124
131
|
throw new Error("Entity validation failed: fact_kind 'rule_schema' requires rule_name");
|
|
125
132
|
}
|
|
126
|
-
|
|
127
|
-
!Array.isArray(entity.argument_types) ||
|
|
128
|
-
entity.argument_names.length !== entity.argument_types.length) {
|
|
129
|
-
throw new Error("Entity validation failed: rule_schema argument_names and argument_types must have equal lengths");
|
|
130
|
-
}
|
|
133
|
+
assertRuleSchemaArity(entity.argument_names, entity.argument_types);
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -15,6 +15,7 @@ export interface SymbolCompilerLockOptions {
|
|
|
15
15
|
readonly now?: () => number;
|
|
16
16
|
readonly sleep?: (ms: number) => Promise<void>;
|
|
17
17
|
readonly fileSystem?: SymbolCompilerLockFileSystem;
|
|
18
|
+
readonly isProcessAlive?: (pid: number) => boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare class SymbolCompilerLockError extends Error {
|
|
20
21
|
readonly name = "SymbolCompilerLockError";
|
|
@@ -31,7 +32,7 @@ export interface SymbolCompilerLockHandle {
|
|
|
31
32
|
}
|
|
32
33
|
export declare function releaseSymbolCompilerLock(handle: SymbolCompilerLockHandle | undefined, operationFailure?: {
|
|
33
34
|
readonly error: unknown;
|
|
34
|
-
}): void;
|
|
35
|
+
}, committed?: boolean): void;
|
|
35
36
|
/**
|
|
36
37
|
* Acquire the workspace symbol compiler lock without a callback shape, for
|
|
37
38
|
* operations whose lock must span several awaits (source publication,
|
|
@@ -44,7 +45,9 @@ export declare function acquireSymbolCompilerLock(workspaceRoot: string, options
|
|
|
44
45
|
* Atomic directory creation is the lock authority. Owner metadata is
|
|
45
46
|
* release authorization and diagnostics: every existing target, including a
|
|
46
47
|
* legacy file or a directory with missing/corrupt metadata, blocks contenders
|
|
47
|
-
* until timeout.
|
|
48
|
+
* until timeout. A well-formed owner record whose holder pid is provably
|
|
49
|
+
* dead is stolen immediately instead of blocking for the full timeout;
|
|
50
|
+
* corrupt metadata and live holders stay fail-closed.
|
|
48
51
|
* Release failures propagate so successful work is never reported unlocked.
|
|
49
52
|
*/
|
|
50
53
|
export declare function withSymbolCompilerLock<T>(workspaceRoot: string, operation: () => Promise<T>, options?: SymbolCompilerLockOptions): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-compiler-lock.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-compiler-lock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"symbol-compiler-lock.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-compiler-lock.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,SAAS,EAAE,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KACvC,IAAI,CAAC;IACV,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,QAAQ,CAAC,aAAa,EAAE,CACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;KAAE,KACxD,IAAI,CAAC;IACV,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAeD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,QAAQ,CAAC,UAAU,CAAC,EAAE,4BAA4B,CAAC;IACnD,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACpD;AAGD,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,SAAkB,IAAI,6BAA6B;CACpD;AA8MD,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAC9C,SAAS,UAAQ,GAChB,IAAI,CAoBN;AAED;;;;GAIG;AAEH,wBAAsB,yBAAyB,CAC7C,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,wBAAwB,CAAC,CA2InC;AAED;;;;;;;;;;GAUG;AAEH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
+
import { OperationError } from "../../cli-errors.js";
|
|
3
4
|
/**
|
|
4
5
|
* Workspace-scoped mutex serializing every writer of the symbol compiler
|
|
5
6
|
* surface: authored manifest edits, targeted coordinate refresh, full
|
|
@@ -125,17 +126,73 @@ function existingLockDescription(fileSystem, target, ownerPath) {
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
}
|
|
129
|
+
function defaultIsProcessAlive(pid) {
|
|
130
|
+
try {
|
|
131
|
+
process.kill(pid, 0);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
return !(error instanceof Error &&
|
|
136
|
+
"code" in error &&
|
|
137
|
+
error.code === "ESRCH");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Read the current lock owner record and steal the lock only when the
|
|
142
|
+
* recorded holder pid is provably dead. A readable owner.json identifies a
|
|
143
|
+
* directory lock; a readable lock path itself identifies a legacy file lock.
|
|
144
|
+
* Corrupt, missing, or unreadable metadata stays fail-closed: an
|
|
145
|
+
* initializing writer must never be stolen from, and a live holder (or an
|
|
146
|
+
* unverifiable pid) keeps the mutex.
|
|
147
|
+
*/
|
|
148
|
+
function stealStaleLockIfHolderIsDead(fileSystem, target, ownerPath, isProcessAlive) {
|
|
149
|
+
let record = null;
|
|
150
|
+
let legacyFileLock = false;
|
|
151
|
+
try {
|
|
152
|
+
record = readLockRecord(fileSystem.readFileSync(ownerPath));
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
try {
|
|
156
|
+
record = readLockRecord(fileSystem.readFileSync(target));
|
|
157
|
+
legacyFileLock = true;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return "unknown";
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (record === null)
|
|
164
|
+
return "unknown";
|
|
165
|
+
if (isProcessAlive(record.pid))
|
|
166
|
+
return "live";
|
|
167
|
+
try {
|
|
168
|
+
if (legacyFileLock) {
|
|
169
|
+
const removal = retryTransientFilesystemOperation(() => fileSystem.unlinkSync(target));
|
|
170
|
+
if (!removal.ok)
|
|
171
|
+
return "unknown";
|
|
172
|
+
return "stolen";
|
|
173
|
+
}
|
|
174
|
+
removeLockOwner(fileSystem, target, ownerPath, true);
|
|
175
|
+
removeLockDirectory(fileSystem, target);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return "unknown";
|
|
179
|
+
}
|
|
180
|
+
return "stolen";
|
|
181
|
+
}
|
|
128
182
|
async function defaultSleep(ms) {
|
|
129
183
|
await new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
|
|
130
184
|
}
|
|
131
185
|
// implements REQ-generated-coordinate-persistence
|
|
132
|
-
export function releaseSymbolCompilerLock(handle, operationFailure) {
|
|
186
|
+
export function releaseSymbolCompilerLock(handle, operationFailure, committed = false) {
|
|
133
187
|
if (handle === undefined)
|
|
134
188
|
return;
|
|
135
189
|
try {
|
|
136
190
|
handle.release();
|
|
137
191
|
}
|
|
138
192
|
catch (releaseError) {
|
|
193
|
+
if (committed) {
|
|
194
|
+
throw new OperationError("SYMBOL_COMPILER_LOCK_RELEASE_FAILED", `Mutation committed, but symbol compiler lock release failed: ${errorDetail(releaseError)}; do not retry the mutation until the lock is manually verified and released`, false);
|
|
195
|
+
}
|
|
139
196
|
if (operationFailure !== undefined) {
|
|
140
197
|
throw new AggregateError([operationFailure.error, releaseError], "Operation failed and symbol compiler lock release failed");
|
|
141
198
|
}
|
|
@@ -153,6 +210,7 @@ export async function acquireSymbolCompilerLock(workspaceRoot, options = {}) {
|
|
|
153
210
|
const now = options.now ?? Date.now;
|
|
154
211
|
const sleep = options.sleep ?? defaultSleep;
|
|
155
212
|
const fileSystem = options.fileSystem ?? NODE_FILE_SYSTEM;
|
|
213
|
+
const isProcessAlive = options.isProcessAlive ?? defaultIsProcessAlive;
|
|
156
214
|
const target = lockPath(workspaceRoot);
|
|
157
215
|
const ownerPath = path.join(target, OWNER_FILE);
|
|
158
216
|
const token = randomToken();
|
|
@@ -177,6 +235,9 @@ export async function acquireSymbolCompilerLock(workspaceRoot, options = {}) {
|
|
|
177
235
|
throw new SymbolCompilerLockError(`failed to acquire symbol compiler lock directory at ${target} after ${targetResult.attempts} attempt(s): ${errorDetail(targetResult.error)}`);
|
|
178
236
|
}
|
|
179
237
|
lastBlocker = existingLockDescription(fileSystem, target, ownerPath);
|
|
238
|
+
if (stealStaleLockIfHolderIsDead(fileSystem, target, ownerPath, isProcessAlive) === "stolen") {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
180
241
|
await sleep(RETRY_INTERVAL_MS);
|
|
181
242
|
}
|
|
182
243
|
if (!acquired) {
|
|
@@ -254,7 +315,9 @@ export async function acquireSymbolCompilerLock(workspaceRoot, options = {}) {
|
|
|
254
315
|
* Atomic directory creation is the lock authority. Owner metadata is
|
|
255
316
|
* release authorization and diagnostics: every existing target, including a
|
|
256
317
|
* legacy file or a directory with missing/corrupt metadata, blocks contenders
|
|
257
|
-
* until timeout.
|
|
318
|
+
* until timeout. A well-formed owner record whose holder pid is provably
|
|
319
|
+
* dead is stolen immediately instead of blocking for the full timeout;
|
|
320
|
+
* corrupt metadata and live holders stay fail-closed.
|
|
258
321
|
* Release failures propagate so successful work is never reported unlocked.
|
|
259
322
|
*/
|
|
260
323
|
// implements REQ-generated-coordinate-persistence
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-granularity.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-granularity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"symbol-granularity.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-granularity.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAWjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA2BpD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
|
@@ -1,96 +1,18 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
import { getBehavioralSymbolNames, getNonBehavioralSymbolNames, inferSymbolRole, isAllowedGranularityReason, isTraceabilityRelationshipType, } from "../../public/symbol-granularity.js";
|
|
4
|
-
function scriptKind(filePath) {
|
|
5
|
-
const extension = path.extname(filePath).toLowerCase();
|
|
6
|
-
if (extension === ".tsx")
|
|
7
|
-
return ScriptKind.TSX;
|
|
8
|
-
if ([".ts", ".mts", ".cts"].includes(extension))
|
|
9
|
-
return ScriptKind.TS;
|
|
10
|
-
if (extension === ".jsx")
|
|
11
|
-
return ScriptKind.JSX;
|
|
12
|
-
return ScriptKind.JS;
|
|
13
|
-
}
|
|
2
|
+
import { collectGranularityCandidates } from "kibi-plugin-builtin";
|
|
3
|
+
import { ALLOWED_GRANULARITY_REASONS_PROSE, getBehavioralSymbolNames, getNonBehavioralSymbolNames, inferSymbolRole, isAllowedGranularityReason, isTraceabilityRelationshipType, } from "../../public/symbol-granularity.js";
|
|
14
4
|
function candidate(name, kind) {
|
|
15
5
|
return { name, kind, role: inferSymbolRole(kind) };
|
|
16
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Granularity candidates must include bare unique method names (parity with
|
|
9
|
+
* the pre-plugin `collectGranularityCandidates` behavior). The extractor
|
|
10
|
+
* symbol list alone is too narrow and rejects previously-valid upserts.
|
|
11
|
+
*/
|
|
17
12
|
function candidates(filePath, content) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
overwrite: true,
|
|
22
|
-
scriptKind: scriptKind(filePath),
|
|
23
|
-
});
|
|
24
|
-
const found = [];
|
|
25
|
-
const methodCounts = new Map();
|
|
26
|
-
const bareMethods = new Map();
|
|
27
|
-
for (const fn of source.getFunctions()) {
|
|
28
|
-
const name = fn.getName();
|
|
29
|
-
if (fn.isExported() && name)
|
|
30
|
-
found.push(candidate(name, "function"));
|
|
31
|
-
}
|
|
32
|
-
for (const cls of source.getClasses()) {
|
|
33
|
-
if (!cls.isExported())
|
|
34
|
-
continue;
|
|
35
|
-
const className = cls.getName();
|
|
36
|
-
if (className)
|
|
37
|
-
found.push(candidate(className, "class"));
|
|
38
|
-
for (const method of cls.getMethods()) {
|
|
39
|
-
if (isPrivateClassMember(method))
|
|
40
|
-
continue;
|
|
41
|
-
const name = method.getName();
|
|
42
|
-
if (className)
|
|
43
|
-
found.push(candidate(`${className}.${name}`, "method"));
|
|
44
|
-
bareMethods.set(name, candidate(name, "method"));
|
|
45
|
-
methodCounts.set(name, (methodCounts.get(name) ?? 0) + 1);
|
|
46
|
-
}
|
|
47
|
-
for (const property of cls.getProperties()) {
|
|
48
|
-
if (isPrivateClassMember(property))
|
|
49
|
-
continue;
|
|
50
|
-
const name = property.getName();
|
|
51
|
-
if (className)
|
|
52
|
-
found.push(candidate(`${className}.${name}`, "property"));
|
|
53
|
-
}
|
|
54
|
-
for (const accessor of [
|
|
55
|
-
...cls.getGetAccessors(),
|
|
56
|
-
...cls.getSetAccessors(),
|
|
57
|
-
]) {
|
|
58
|
-
if (isPrivateClassMember(accessor))
|
|
59
|
-
continue;
|
|
60
|
-
const name = accessor.getName();
|
|
61
|
-
if (className)
|
|
62
|
-
found.push(candidate(`${className}.${name}`, "accessor"));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
for (const [name, count] of methodCounts) {
|
|
66
|
-
const method = bareMethods.get(name);
|
|
67
|
-
if (count === 1 && method)
|
|
68
|
-
found.push(method);
|
|
69
|
-
}
|
|
70
|
-
for (const item of source.getInterfaces()) {
|
|
71
|
-
if (item.isExported())
|
|
72
|
-
found.push(candidate(item.getName(), "interface"));
|
|
73
|
-
}
|
|
74
|
-
for (const item of source.getTypeAliases()) {
|
|
75
|
-
if (item.isExported())
|
|
76
|
-
found.push(candidate(item.getName(), "type"));
|
|
77
|
-
}
|
|
78
|
-
for (const item of source.getEnums()) {
|
|
79
|
-
if (item.isExported())
|
|
80
|
-
found.push(candidate(item.getName(), "enum"));
|
|
81
|
-
}
|
|
82
|
-
for (const statement of source.getVariableStatements()) {
|
|
83
|
-
if (!statement.isExported())
|
|
84
|
-
continue;
|
|
85
|
-
for (const declaration of statement.getDeclarations()) {
|
|
86
|
-
found.push(candidate(declaration.getName(), "variable"));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return found.sort((left, right) => left.name.localeCompare(right.name));
|
|
90
|
-
}
|
|
91
|
-
function isPrivateClassMember(member) {
|
|
92
|
-
return (member.hasModifier(SyntaxKind.PrivateKeyword) ||
|
|
93
|
-
member.getName().startsWith("#"));
|
|
13
|
+
return collectGranularityCandidates(filePath, content)
|
|
14
|
+
.map((item) => candidate(item.name, item.kind))
|
|
15
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
94
16
|
}
|
|
95
17
|
function summarized(names) {
|
|
96
18
|
const shown = names.slice(0, 10);
|
|
@@ -136,5 +58,5 @@ export async function validateSymbolGranularity(entity, relationships, context)
|
|
|
136
58
|
const ignored = nonBehavioral.length > 0
|
|
137
59
|
? ` Non-behavioral symbols in the file were ignored for this decision: ${summarized(nonBehavioral)}.`
|
|
138
60
|
: "";
|
|
139
|
-
throw new Error(`Symbol ${String(entity.id)} links ${entity.sourceFile} coarsely while granular symbols are available (behavioral only): ${summarized(behavioral)}. Move relationships to a behavioral symbol, add a manifest behavioral anchor, or set granularity_reason to
|
|
61
|
+
throw new Error(`Symbol ${String(entity.id)} links ${entity.sourceFile} coarsely while granular symbols are available (behavioral only): ${summarized(behavioral)}. Move relationships to a behavioral symbol, add a manifest behavioral anchor, or set granularity_reason to ${ALLOWED_GRANULARITY_REASONS_PROSE}.${ignored}`);
|
|
140
62
|
}
|
|
@@ -13,6 +13,7 @@ export type ArtifactPublicationReceipt = {
|
|
|
13
13
|
rollback(): void;
|
|
14
14
|
};
|
|
15
15
|
type RefreshImplementation = (symbolId: string, context: OperationContext) => Promise<RefreshResult>;
|
|
16
|
+
export declare function restoreOrUnlinkCoordinateArtifact(targetPath: string, before: string | null): void;
|
|
16
17
|
/** Targeted coordinate refresh under the workspace symbol compiler lock. */
|
|
17
18
|
export declare function refreshSymbolCoordinates(symbolId: string, context: OperationContext): Promise<RefreshResult>;
|
|
18
19
|
/** Run one refresh step without acquiring the lock (caller holds it). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-refresh.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-refresh.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAgBjF,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,CAAC;AAGhB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,0BAA0B,CAAC;CACnD,CAAC;AAGF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,IAAI,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,qBAAqB,GAAG,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"symbol-refresh.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-refresh.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAgBjF,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,CAAC;AAGhB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,EA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, unlinkSync, writeFileSync, } from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { load as parseYaml } from "js-yaml";
|
|
@@ -46,8 +46,15 @@ function sourceTextFor(sourceFile, workspaceRoot) {
|
|
|
46
46
|
function contentHash(content) {
|
|
47
47
|
return createHash("sha256").update(content).digest("hex");
|
|
48
48
|
}
|
|
49
|
+
export function restoreOrUnlinkCoordinateArtifact(targetPath, before) {
|
|
50
|
+
if (before === null) {
|
|
51
|
+
unlinkSync(targetPath);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
replaceArtifactAtomically(targetPath, before);
|
|
55
|
+
}
|
|
49
56
|
function replaceArtifactAtomically(targetPath, content) {
|
|
50
|
-
const temporary = `${targetPath}.kibi-tmp-${process.pid}`;
|
|
57
|
+
const temporary = `${targetPath}.kibi-tmp-${process.pid}-${randomUUID()}`;
|
|
51
58
|
try {
|
|
52
59
|
writeFileSync(temporary, content, "utf8");
|
|
53
60
|
renameSync(temporary, targetPath);
|
|
@@ -81,12 +88,7 @@ function publishArtifact(targetPath, content) {
|
|
|
81
88
|
if (contentHash(current) !== afterHash) {
|
|
82
89
|
throw new CoordinateArtifactError(`coordinate artifact changed after publication; refusing rollback: ${targetPath}`);
|
|
83
90
|
}
|
|
84
|
-
|
|
85
|
-
unlinkSync(targetPath);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
replaceArtifactAtomically(targetPath, before);
|
|
89
|
-
}
|
|
91
|
+
restoreOrUnlinkCoordinateArtifact(targetPath, before);
|
|
90
92
|
},
|
|
91
93
|
};
|
|
92
94
|
}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
2
|
import type { OperationResult } from "../../public/operations/types.js";
|
|
3
3
|
import type { RelationshipInput, UpsertInput, UpsertPayload } from "./types.js";
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function validateAppendOnlyProofReceipts(entity: Readonly<Record<string, unknown>>, context: OperationContext): Promise<void>;
|
|
5
5
|
export declare function effectiveRelationships(input: UpsertInput, entity: Readonly<Record<string, unknown>>, relationships: readonly RelationshipInput[], context: OperationContext): Promise<readonly RelationshipInput[]>;
|
|
6
|
-
export
|
|
6
|
+
export type UpsertExecutionOptions = Readonly<{
|
|
7
|
+
/**
|
|
8
|
+
* Internal escape hatch for proof-receipt ingest: when provided, the
|
|
9
|
+
* authored document is written with exactly these bytes instead of the
|
|
10
|
+
* canonical re-render. Receipt appends must not canonicalize unrelated
|
|
11
|
+
* frontmatter — a mid-campaign reformat would change the workspace
|
|
12
|
+
* snapshot hash and make every later `kibi prove` integration refuse.
|
|
13
|
+
*/
|
|
14
|
+
readonly sourceDocumentOverride?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Internal escape hatch for `kibi proof prune`: the prune maintenance
|
|
17
|
+
* command deliberately shrinks a test's receipt history to its newest
|
|
18
|
+
* entries. Everything else keeps the append-only invariant fail-closed.
|
|
19
|
+
*/
|
|
20
|
+
readonly allowReceiptsPrune?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function executeUpsert(input: UpsertInput, context: OperationContext, options?: UpsertExecutionOptions): Promise<OperationResult<UpsertPayload>>;
|
|
7
23
|
//# sourceMappingURL=upsert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAkCxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,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