kibi-cli 1.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-errors.d.ts +3 -1
- package/dist/cli-errors.d.ts.map +1 -1
- package/dist/cli-errors.js +4 -1
- package/dist/cli-json-command.d.ts +1 -0
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +13 -4
- package/dist/cli-operation-loader.js +3 -3
- package/dist/cli-operation-metadata.d.ts +4 -3
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +7 -5
- package/dist/cli-protocol.js +1 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-proof.d.ts +3 -0
- package/dist/cli-register-proof.d.ts.map +1 -0
- package/dist/cli-register-proof.js +127 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +7 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -10
- package/dist/commands/branch.d.ts +1 -0
- package/dist/commands/branch.d.ts.map +1 -1
- package/dist/commands/branch.js +8 -4
- package/dist/commands/check-generated.d.ts +7 -0
- package/dist/commands/check-generated.d.ts.map +1 -0
- package/dist/commands/check-generated.js +192 -0
- package/dist/commands/check.d.ts +14 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +193 -46
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +6 -0
- package/dist/commands/doctor.d.ts +22 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +170 -23
- package/dist/commands/engine.d.ts +12 -0
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +42 -0
- package/dist/commands/github-init.d.ts +1 -0
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +9 -5
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +49 -10
- package/dist/commands/migrate.d.ts +4 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +7 -7
- package/dist/commands/proof-explain.d.ts +10 -0
- package/dist/commands/proof-explain.d.ts.map +1 -0
- package/dist/commands/proof-explain.js +45 -0
- package/dist/commands/proof-impact.d.ts +7 -0
- package/dist/commands/proof-impact.d.ts.map +1 -0
- package/dist/commands/proof-impact.js +39 -0
- package/dist/commands/proof-migrate-legacy.d.ts +7 -0
- package/dist/commands/proof-migrate-legacy.d.ts.map +1 -0
- package/dist/commands/proof-migrate-legacy.js +45 -0
- package/dist/commands/proof-prune.d.ts +8 -0
- package/dist/commands/proof-prune.d.ts.map +1 -0
- package/dist/commands/proof-prune.js +53 -0
- package/dist/commands/prove.d.ts +37 -0
- package/dist/commands/prove.d.ts.map +1 -0
- package/dist/commands/prove.js +470 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +18 -3
- package/dist/commands/sync/discovery.d.ts +3 -0
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +36 -28
- package/dist/commands/sync/manifest.d.ts +2 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +55 -21
- package/dist/commands/sync/persistence.d.ts +4 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +31 -14
- package/dist/commands/sync/staging.d.ts +1 -0
- package/dist/commands/sync/staging.d.ts.map +1 -1
- package/dist/commands/sync/staging.js +5 -2
- package/dist/commands/sync/untracked-targets.d.ts +24 -0
- package/dist/commands/sync/untracked-targets.d.ts.map +1 -0
- package/dist/commands/sync/untracked-targets.js +108 -0
- package/dist/commands/sync.d.ts +11 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +74 -30
- package/dist/engine-daemon.d.ts +3 -1
- package/dist/engine-daemon.d.ts.map +1 -1
- package/dist/engine-daemon.js +49 -20
- package/dist/engine.d.ts +17 -77
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +331 -91
- package/dist/env/bootstrap.d.ts +84 -0
- package/dist/env/bootstrap.d.ts.map +1 -0
- package/dist/env/bootstrap.js +310 -0
- package/dist/extractors/manifest.d.ts +5 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +46 -1
- package/dist/extractors/markdown.d.ts +7 -3
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +60 -24
- package/dist/extractors/playwright-cases.js +1 -1
- package/dist/extractors/relationships.d.ts +6 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -1
- package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.d.ts +8 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +40 -0
- package/dist/extractors/symbols-ts.d.ts +9 -19
- package/dist/extractors/symbols-ts.d.ts.map +1 -1
- package/dist/extractors/symbols-ts.js +34 -429
- package/dist/intent-search.d.ts +1 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +11 -8
- package/dist/logic/ir.d.ts +1 -0
- package/dist/logic/ir.d.ts.map +1 -1
- package/dist/logic/ir.js +1 -1
- package/dist/operations/bootstrap/activation.d.ts +2 -1
- package/dist/operations/bootstrap/activation.d.ts.map +1 -1
- package/dist/operations/bootstrap/activation.js +11 -3
- package/dist/operations/bootstrap/generate.d.ts +2 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +6 -3
- package/dist/operations/bootstrap/guidance.d.ts +1 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +1 -1
- package/dist/operations/modeling/model-requirement.d.ts +5 -0
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +57 -46
- package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applicability.js +103 -4
- package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-2.js +18 -2
- package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog-3.js +17 -1
- package/dist/operations/modeling/predicate-catalog-5.d.ts +10 -0
- package/dist/operations/modeling/predicate-catalog-5.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-catalog-5.js +291 -0
- package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-catalog.js +4 -0
- package/dist/operations/modeling/predicate-loader.d.ts +1 -0
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +4 -3
- package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-ranker.js +4 -1
- package/dist/operations/modeling/predicate-types.d.ts +1 -1
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts +3 -0
- package/dist/operations/modeling/predicate-usage-hints-4.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-usage-hints-4.js +84 -0
- package/dist/operations/modeling/suggest-predicates.d.ts +4 -2
- package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
- package/dist/operations/modeling/suggest-predicates.js +82 -22
- package/dist/operations/mutation/contradictions.d.ts +2 -1
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +26 -5
- package/dist/operations/mutation/delete.d.ts +3 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +100 -32
- package/dist/operations/mutation/relationships.d.ts +1 -0
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +6 -4
- package/dist/operations/mutation/saga.d.ts +51 -0
- package/dist/operations/mutation/saga.d.ts.map +1 -0
- package/dist/operations/mutation/saga.js +67 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -2
- package/dist/operations/mutation/source-authoring.d.ts +5 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +79 -46
- package/dist/operations/mutation/strict-fact.d.ts +1 -0
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +8 -5
- package/dist/operations/mutation/symbol-compiler-lock.d.ts +5 -2
- package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-compiler-lock.js +65 -2
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +11 -89
- package/dist/operations/mutation/symbol-refresh.d.ts +1 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +10 -8
- package/dist/operations/mutation/upsert.d.ts +18 -2
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +86 -54
- package/dist/operations/mutation/validate-upsert.js +2 -2
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +46 -4
- package/dist/operations/mutation/warnings.d.ts +1 -0
- package/dist/operations/mutation/warnings.d.ts.map +1 -1
- package/dist/operations/mutation/warnings.js +7 -5
- package/dist/operations/mutation/workspace-mutation-lock.d.ts +60 -0
- package/dist/operations/mutation/workspace-mutation-lock.d.ts.map +1 -0
- package/dist/operations/mutation/workspace-mutation-lock.js +362 -0
- package/dist/operations/planning/apply-plan.d.ts +8 -106
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +113 -36
- package/dist/operations/planning/compile-intent.d.ts +51 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +133 -17
- package/dist/operations/proof/baseline-diff.d.ts +41 -0
- package/dist/operations/proof/baseline-diff.d.ts.map +1 -0
- package/dist/operations/proof/baseline-diff.js +153 -0
- package/dist/operations/proof/explain.d.ts +75 -0
- package/dist/operations/proof/explain.d.ts.map +1 -0
- package/dist/operations/proof/explain.js +294 -0
- package/dist/operations/proof/impact.d.ts +45 -0
- package/dist/operations/proof/impact.d.ts.map +1 -0
- package/dist/operations/proof/impact.js +118 -0
- package/dist/operations/proof/ingest-proof.d.ts +34 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -0
- package/dist/operations/proof/ingest-proof.js +348 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts +30 -0
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -0
- package/dist/operations/proof/migrate-legacy-receipts.js +92 -0
- package/dist/operations/proof/prune-receipts.d.ts +35 -0
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -0
- package/dist/operations/proof/prune-receipts.js +91 -0
- package/dist/operations/proof/receipt-document.d.ts +29 -0
- package/dist/operations/proof/receipt-document.d.ts.map +1 -0
- package/dist/operations/proof/receipt-document.js +117 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +3 -9
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +1 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +64 -93
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +20 -7
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts +63 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/plugin-orchestration.js +489 -0
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +15 -2
- package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-core.js +7 -140
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +11 -12
- package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-launcher.js +6 -94
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +16 -0
- package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-policy.js +7 -150
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +9 -0
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +7 -102
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +13 -0
- package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/predicate-rules-product.js +7 -133
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts +2 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-count-rules.js +40 -25
- package/dist/operations/semantic-advisor/types.d.ts +1 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/compose-ontology-packs.d.ts +51 -0
- package/dist/plugins/compose-ontology-packs.d.ts.map +1 -0
- package/dist/plugins/compose-ontology-packs.js +257 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +42 -0
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -0
- package/dist/plugins/compose-semantic-classifier.js +211 -0
- package/dist/plugins/external-allowlist.d.ts +10 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -0
- package/dist/plugins/external-allowlist.js +16 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +33 -0
- package/dist/plugins/load-plugin.d.ts +19 -0
- package/dist/plugins/load-plugin.d.ts.map +1 -0
- package/dist/plugins/load-plugin.js +59 -0
- package/dist/plugins/project-config.d.ts +28 -0
- package/dist/plugins/project-config.d.ts.map +1 -0
- package/dist/plugins/project-config.js +90 -0
- package/dist/plugins/registry.d.ts +93 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +338 -0
- package/dist/plugins/resolve-package.d.ts +47 -0
- package/dist/plugins/resolve-package.d.ts.map +1 -0
- package/dist/plugins/resolve-package.js +262 -0
- package/dist/plugins/source-analysis-service.d.ts +44 -0
- package/dist/plugins/source-analysis-service.d.ts.map +1 -0
- package/dist/plugins/source-analysis-service.js +232 -0
- package/dist/prolog/codec.d.ts +13 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +269 -154
- package/dist/prolog/error-terms.d.ts +47 -0
- package/dist/prolog/error-terms.d.ts.map +1 -0
- package/dist/prolog/error-terms.js +334 -0
- package/dist/prolog/janitor.d.ts +50 -0
- package/dist/prolog/janitor.d.ts.map +1 -0
- package/dist/prolog/janitor.js +154 -0
- package/dist/prolog/store-lock.d.ts +45 -0
- package/dist/prolog/store-lock.d.ts.map +1 -0
- package/dist/prolog/store-lock.js +195 -0
- package/dist/prolog.d.ts +7 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +55 -17
- package/dist/proof/evaluate.d.ts +27 -0
- package/dist/proof/evaluate.d.ts.map +1 -0
- package/dist/proof/evaluate.js +151 -0
- package/dist/proof/inspect.d.ts +12 -0
- package/dist/proof/inspect.d.ts.map +1 -0
- package/dist/proof/inspect.js +236 -0
- package/dist/proof/integrations.d.ts +35 -0
- package/dist/proof/integrations.d.ts.map +1 -0
- package/dist/proof/integrations.js +123 -0
- package/dist/proof/producers/junit-adapter.d.ts +26 -0
- package/dist/proof/producers/junit-adapter.d.ts.map +1 -0
- package/dist/proof/producers/junit-adapter.js +186 -0
- package/dist/{public → proof/producers}/playwright-case-id.d.ts +1 -1
- package/dist/proof/producers/playwright-case-id.d.ts.map +1 -0
- package/dist/{public → proof/producers}/playwright-case-id.js +1 -1
- package/dist/proof/producers/playwright-reporter.d.ts +27 -0
- package/dist/proof/producers/playwright-reporter.d.ts.map +1 -0
- package/dist/proof/producers/playwright-reporter.js +138 -0
- package/dist/proof/producers/tap-adapter.d.ts +10 -0
- package/dist/proof/producers/tap-adapter.d.ts.map +1 -0
- package/dist/proof/producers/tap-adapter.js +200 -0
- package/dist/proof/receipt-outcome.d.ts +2 -0
- package/dist/proof/receipt-outcome.d.ts.map +1 -0
- package/dist/proof/receipt-outcome.js +1 -0
- package/dist/public/diagnostic-usage.js +6 -6
- package/dist/public/distribution-parity.d.ts +7 -1
- package/dist/public/distribution-parity.d.ts.map +1 -1
- package/dist/public/distribution-parity.js +15 -10
- package/dist/public/extractors/symbols-coordinator.d.ts +1 -1
- package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/public/extractors/symbols-coordinator.js +1 -1
- package/dist/public/impact/analyzer.d.ts +1 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +6 -4
- package/dist/public/impact/coverage-depth-quality.d.ts +1 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +1 -1
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +2 -2
- package/dist/public/impact/diff-meaning.d.ts +1 -0
- package/dist/public/impact/diff-meaning.d.ts.map +1 -1
- package/dist/public/impact/diff-meaning.js +5 -2
- package/dist/public/impact/full-kb-quality.d.ts +5 -2
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +329 -64
- package/dist/public/operations/catalog.d.ts +450 -196
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +6 -4
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +4 -8
- package/dist/public/operations/check-helpers.d.ts +1 -1
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +1 -1
- package/dist/public/operations/contracts.d.ts +7 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +66 -34
- package/dist/public/operations/discovery-entities.d.ts +15 -0
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +38 -0
- package/dist/public/operations/discovery-executors.d.ts +9 -9
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +39 -31
- package/dist/public/operations/index.d.ts +1 -1
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -1
- package/dist/public/operations/migration-plan.d.ts +4 -3
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +23 -21
- package/dist/public/operations/node-ports.js +6 -6
- package/dist/public/operations/prolog-json.d.ts +1 -1
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +7 -7
- package/dist/public/operations/repair-plan.d.ts +3 -3
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +49 -19
- package/dist/public/operations/result-envelope.d.ts +1 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +12 -10
- package/dist/public/operations/runtime-types.d.ts +21 -1
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +5 -0
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -0
- package/dist/public/operations/specs/check-rules.generated.js +35 -0
- package/dist/public/operations/specs/check.d.ts +7 -2
- package/dist/public/operations/specs/check.d.ts.map +1 -1
- package/dist/public/operations/specs/check.js +8 -20
- package/dist/public/operations/specs/discovery.d.ts +3 -0
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +3 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +257 -163
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +15 -7
- package/dist/public/operations/specs/planning.d.ts +9 -0
- package/dist/public/operations/specs/planning.d.ts.map +1 -1
- package/dist/public/operations/specs/planning.js +6 -0
- package/dist/public/operations/specs/proof.d.ts +212 -0
- package/dist/public/operations/specs/proof.d.ts.map +1 -0
- package/dist/public/operations/specs/proof.js +30 -0
- package/dist/public/operations/specs/reporting.d.ts +20 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +112 -12
- package/dist/public/operations/specs/semantic.d.ts +1 -1
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +54 -4
- package/dist/public/operations/specs/upsert.d.ts +257 -163
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +121 -4
- package/dist/public/operations/types.d.ts +6 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-fingerprint.d.ts +54 -0
- package/dist/public/proof-fingerprint.d.ts.map +1 -0
- package/dist/public/proof-fingerprint.js +141 -0
- package/dist/public/proof-protocol.d.ts +354 -0
- package/dist/public/proof-protocol.d.ts.map +1 -0
- package/dist/public/proof-protocol.js +454 -0
- package/dist/public/proof-receipt.d.ts +279 -0
- package/dist/public/proof-receipt.d.ts.map +1 -0
- package/dist/public/proof-receipt.js +377 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +21 -7
- package/dist/public/skills/kibi-freshness/SKILL.md +1 -1
- package/dist/public/skills/kibi-usage/SKILL.md +44 -12
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/dist/public/skills/kibi-usage/resources/proof.md +150 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/dist/public/symbol-granularity.d.ts +3 -14
- package/dist/public/symbol-granularity.d.ts.map +1 -1
- package/dist/public/symbol-granularity.generated.d.ts +16 -0
- package/dist/public/symbol-granularity.generated.d.ts.map +1 -0
- package/dist/public/symbol-granularity.generated.js +53 -0
- package/dist/public/symbol-granularity.js +6 -47
- package/dist/public/telemetry-acceptance.d.ts +3 -77
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +4 -2
- package/dist/public/telemetry-remediation.js +1 -1
- package/dist/report/html-report.css +1240 -0
- package/dist/report/html-report.d.ts +4 -2
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +37 -300
- package/dist/runtime/cli-runtime.d.ts +2 -0
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +32 -7
- package/dist/schemas/entity.schema.json +355 -215
- package/dist/search-ranking.d.ts +1 -0
- package/dist/search-ranking.d.ts.map +1 -1
- package/dist/search-ranking.js +3 -0
- package/dist/traceability/evidence-model.d.ts +28 -0
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/git-staged.d.ts +20 -0
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +145 -1
- package/dist/traceability/staged-diagnostics.d.ts +7 -0
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +78 -7
- package/dist/traceability/staged-file-coverage.d.ts +33 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -0
- package/dist/traceability/staged-file-coverage.js +284 -0
- package/dist/traceability/staged-impact-contract.js +4 -4
- package/dist/traceability/staged-symbols-manifest.d.ts +13 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +138 -27
- package/dist/traceability/symbol-extract.d.ts +24 -2
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +64 -208
- package/dist/traceability/temp-kb.d.ts +2 -0
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +13 -4
- package/dist/types/entities.d.ts +5 -3
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +1 -0
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +7 -4
- package/dist/utils/branch-store.d.ts +6 -0
- package/dist/utils/branch-store.d.ts.map +1 -1
- package/dist/utils/branch-store.js +27 -0
- package/dist/utils/kb-paths.d.ts +1 -1
- package/dist/utils/kb-paths.d.ts.map +1 -1
- package/dist/utils/kb-paths.js +1 -1
- package/dist/utils/rule-registry.d.ts +1 -11
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +102 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -0
- package/dist/utils/rule-registry.generated.js +131 -0
- package/dist/utils/rule-registry.js +12 -113
- package/dist/utils/strict-modeling.d.ts +1 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +1 -1
- package/package.json +20 -20
- package/src/public/diagnostic-usage.ts +6 -6
- package/src/public/distribution-parity.ts +17 -10
- package/src/public/extractors/symbols-coordinator.ts +1 -0
- package/src/public/impact/analyzer.ts +15 -12
- package/src/public/impact/coverage-depth-quality.ts +1 -1
- package/src/public/impact/diagnostics.ts +2 -1
- package/src/public/impact/diff-meaning.ts +11 -4
- package/src/public/impact/full-kb-quality.ts +463 -72
- package/src/public/operations/catalog.ts +10 -4
- package/src/public/operations/check-executor.ts +4 -8
- package/src/public/operations/check-helpers.ts +2 -2
- package/src/public/operations/contracts.ts +78 -34
- package/src/public/operations/discovery-entities.ts +53 -0
- package/src/public/operations/discovery-executors.ts +64 -48
- package/src/public/operations/index.ts +1 -1
- package/src/public/operations/migration-plan.ts +32 -25
- package/src/public/operations/node-ports.ts +6 -6
- package/src/public/operations/prolog-json.ts +13 -5
- package/src/public/operations/repair-plan.ts +60 -23
- package/src/public/operations/result-envelope.ts +15 -10
- package/src/public/operations/runtime-types.ts +26 -2
- package/src/public/operations/specs/check-rules.generated.ts +38 -0
- package/src/public/operations/specs/check.ts +12 -21
- package/src/public/operations/specs/discovery.ts +3 -0
- package/src/public/operations/specs/mutation-schemas.ts +22 -9
- package/src/public/operations/specs/planning.ts +7 -0
- package/src/public/operations/specs/proof.ts +43 -0
- package/src/public/operations/specs/reporting.ts +140 -13
- package/src/public/operations/specs/semantic.ts +79 -17
- package/src/public/operations/symbol-repair-plan.ts +166 -7
- package/src/public/operations/types.ts +6 -1
- package/src/public/proof-fingerprint.ts +216 -0
- package/src/public/proof-protocol-types.d.ts +96 -0
- package/src/public/proof-protocol.ts +589 -0
- package/src/public/proof-receipt.ts +499 -0
- package/src/public/schemas/entity.ts +26 -10
- package/src/public/skills/kibi-freshness/SKILL.md +1 -1
- package/src/public/skills/kibi-usage/SKILL.md +44 -12
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -1
- package/src/public/skills/kibi-usage/resources/proof.md +150 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +6 -6
- package/src/public/symbol-granularity.generated.ts +74 -0
- package/src/public/symbol-granularity.ts +34 -59
- package/src/public/telemetry-acceptance-types.d.ts +98 -0
- package/src/public/telemetry-acceptance.ts +22 -100
- package/src/public/telemetry-remediation.ts +1 -1
- package/src/schemas/entity.schema.json +355 -215
- package/dist/cli-register-verification.d.ts +0 -3
- package/dist/cli-register-verification.d.ts.map +0 -1
- package/dist/cli-register-verification.js +0 -16
- package/dist/commands/verify.d.ts +0 -10
- package/dist/commands/verify.d.ts.map +0 -1
- package/dist/commands/verify.js +0 -126
- package/dist/operations/verification/ingest-verification.d.ts +0 -29
- package/dist/operations/verification/ingest-verification.d.ts.map +0 -1
- package/dist/operations/verification/ingest-verification.js +0 -192
- package/dist/public/operations/specs/verification.d.ts +0 -78
- package/dist/public/operations/specs/verification.d.ts.map +0 -1
- package/dist/public/operations/specs/verification.js +0 -62
- package/dist/public/playwright-case-id.d.ts.map +0 -1
- package/dist/public/verification-receipt.d.ts +0 -242
- package/dist/public/verification-receipt.d.ts.map +0 -1
- package/dist/public/verification-receipt.js +0 -296
- package/dist/verification/playwright-reporter.d.ts +0 -21
- package/dist/verification/playwright-reporter.d.ts.map +0 -1
- package/dist/verification/playwright-reporter.js +0 -114
- package/src/public/operations/specs/verification.ts +0 -78
- package/src/public/playwright-case-id.ts +0 -35
- package/src/public/verification-receipt.ts +0 -412
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune-receipts.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/prune-receipts.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AASjF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,uDAAuD;IAEvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAGH,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAE7C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAEzC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC3C,CAAC,CAAC;AAYH;;;;;;;;;GASG;AAEH,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,mBAAmB,CAAC;CACxC,CAAC,CAoED"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
19
|
+
import { proofReceiptHistoryErrors, } from "../../public/proof-receipt.js";
|
|
20
|
+
import { projectEntityProperties } from "../mutation/entity-projection.js";
|
|
21
|
+
import { executeUpsert } from "../mutation/upsert.js";
|
|
22
|
+
function parseKeep(value) {
|
|
23
|
+
if (value === undefined)
|
|
24
|
+
return 1;
|
|
25
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > 50) {
|
|
26
|
+
throw new Error("Proof prune failed: keep must be an integer between 1 and 50");
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Shrink each test's proof_receipts history to its newest entries.
|
|
32
|
+
*
|
|
33
|
+
* Re-proving the same snapshot appends duplicate passed receipts (one block
|
|
34
|
+
* per run), and consumers previously deduped them by hand. This is the one
|
|
35
|
+
* sanctioned history-shrinking mutation: pruned histories are still ordered,
|
|
36
|
+
* structurally valid evidence, and every shrink goes through the typed upsert
|
|
37
|
+
* with the prune carve-out (append-only validation is skipped for exactly
|
|
38
|
+
* this maintenance action).
|
|
39
|
+
*/
|
|
40
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
41
|
+
export async function executePruneReceipts(args, context) {
|
|
42
|
+
if (!context.prolog)
|
|
43
|
+
throw new Error("Proof prune requires a Prolog runtime");
|
|
44
|
+
if (context.fs === undefined)
|
|
45
|
+
throw new Error("Proof prune failed: this maintenance action rewrites authored test documents and requires a filesystem-capable runtime");
|
|
46
|
+
const keep = parseKeep(args.keep);
|
|
47
|
+
const tests = await loadEntities(context.prolog, {
|
|
48
|
+
type: "test",
|
|
49
|
+
...(args.testId === undefined ? {} : { id: args.testId }),
|
|
50
|
+
});
|
|
51
|
+
if (args.testId !== undefined && tests.length === 0) {
|
|
52
|
+
throw new Error(`Proof prune failed: test ${args.testId} was not found`);
|
|
53
|
+
}
|
|
54
|
+
const results = [];
|
|
55
|
+
for (const test of tests) {
|
|
56
|
+
const testId = String(test.id);
|
|
57
|
+
const receipts = Array.isArray(test.proof_receipts)
|
|
58
|
+
? test.proof_receipts.filter((value) => typeof value === "object" &&
|
|
59
|
+
value !== null &&
|
|
60
|
+
!Array.isArray(value))
|
|
61
|
+
: [];
|
|
62
|
+
if (receipts.length <= keep)
|
|
63
|
+
continue;
|
|
64
|
+
const nextReceipts = receipts.slice(-keep);
|
|
65
|
+
const historyErrors = proofReceiptHistoryErrors(testId, test.verification_scope, nextReceipts);
|
|
66
|
+
if (historyErrors.length > 0) {
|
|
67
|
+
throw new Error(`Proof prune failed for ${testId}: pruned history is invalid: ${historyErrors.join("; ")}`);
|
|
68
|
+
}
|
|
69
|
+
const properties = projectEntityProperties(test);
|
|
70
|
+
properties.proof_receipts = undefined;
|
|
71
|
+
await executeUpsert({
|
|
72
|
+
type: "test",
|
|
73
|
+
id: testId,
|
|
74
|
+
properties: { ...properties, proof_receipts: nextReceipts },
|
|
75
|
+
}, context, { allowReceiptsPrune: true });
|
|
76
|
+
results.push({
|
|
77
|
+
testId,
|
|
78
|
+
before: receipts.length,
|
|
79
|
+
after: nextReceipts.length,
|
|
80
|
+
pruned: receipts.length - nextReceipts.length,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const pruned = results.reduce((sum, row) => sum + row.pruned, 0);
|
|
84
|
+
const summary = results.length === 0
|
|
85
|
+
? "No test had receipts beyond the keep window."
|
|
86
|
+
: `Pruned ${pruned} receipt(s) across ${results.length} test(s).`;
|
|
87
|
+
return {
|
|
88
|
+
content: [{ type: "text", text: `Proof receipts pruned. ${summary}` }],
|
|
89
|
+
structuredContent: { pruned, tests: results },
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove a top-level frontmatter block (`key:` plus its nested lines) from a
|
|
3
|
+
* markdown document, leaving every other byte untouched. Returns the patched
|
|
4
|
+
* content, or null when the content is not a well-formed frontmatter
|
|
5
|
+
* document the remover can safely splice.
|
|
6
|
+
*
|
|
7
|
+
* Used by proof maintenance to drop legacy `verification_receipts` blocks
|
|
8
|
+
* once a `proof_contract` exists, without canonicalizing the document.
|
|
9
|
+
*/
|
|
10
|
+
export declare function removeFrontmatterBlock(content: string, key: string): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Patch the `proof_receipts` frontmatter block of an authored test document
|
|
13
|
+
* without re-rendering anything else.
|
|
14
|
+
*
|
|
15
|
+
* Receipt ingest used to route every append through the canonical entity
|
|
16
|
+
* renderer, which re-dumps the whole frontmatter: inline tag lists became
|
|
17
|
+
* block lists, timestamps gained milliseconds, and so on. Those non-receipt
|
|
18
|
+
* edits are not stripped by the workspace snapshotter, so the snapshot hash
|
|
19
|
+
* changed on the first ingest that touched a hand-authored document and every
|
|
20
|
+
* later integration in the same `kibi prove --all` run refused with
|
|
21
|
+
* "changed the tracked workspace". This patcher splices ONLY the receipts
|
|
22
|
+
* block, leaving the rest of the document byte-for-byte identical.
|
|
23
|
+
*
|
|
24
|
+
* Returns null when the content is not a well-formed frontmatter document the
|
|
25
|
+
* patcher can safely splice; the caller then falls back to the canonical
|
|
26
|
+
* render.
|
|
27
|
+
*/
|
|
28
|
+
export declare function patchReceiptsIntoDocument(content: string, receipts: readonly Readonly<Record<string, unknown>>[]): string | null;
|
|
29
|
+
//# sourceMappingURL=receipt-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipt-document.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/receipt-document.ts"],"names":[],"mappings":"AAoBA;;;;;;;;GAQG;AAEH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CA4Bf;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,GACrD,MAAM,GAAG,IAAI,CAyCf"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
+
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify
|
|
6
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
(at your option) any later version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
GNU Affero General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { dump as dumpYaml } from "js-yaml";
|
|
19
|
+
/**
|
|
20
|
+
* Remove a top-level frontmatter block (`key:` plus its nested lines) from a
|
|
21
|
+
* markdown document, leaving every other byte untouched. Returns the patched
|
|
22
|
+
* content, or null when the content is not a well-formed frontmatter
|
|
23
|
+
* document the remover can safely splice.
|
|
24
|
+
*
|
|
25
|
+
* Used by proof maintenance to drop legacy `verification_receipts` blocks
|
|
26
|
+
* once a `proof_contract` exists, without canonicalizing the document.
|
|
27
|
+
*/
|
|
28
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
29
|
+
export function removeFrontmatterBlock(content, key) {
|
|
30
|
+
const lines = content.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
31
|
+
if (lines.length === 0 || lines[0]?.trim() !== "---")
|
|
32
|
+
return null;
|
|
33
|
+
let closingIndex = -1;
|
|
34
|
+
for (let index = 1; index < lines.length; index++) {
|
|
35
|
+
if (lines[index]?.trim() === "---") {
|
|
36
|
+
closingIndex = index;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (closingIndex === -1)
|
|
41
|
+
return null;
|
|
42
|
+
let blockStart = -1;
|
|
43
|
+
let blockEnd = closingIndex;
|
|
44
|
+
for (let index = 1; index < closingIndex; index++) {
|
|
45
|
+
if (new RegExp(`^${key}\\s*:`).test(lines[index] ?? "")) {
|
|
46
|
+
blockStart = index;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (blockStart === -1)
|
|
51
|
+
return null;
|
|
52
|
+
for (let index = blockStart + 1; index < closingIndex; index++) {
|
|
53
|
+
const line = lines[index] ?? "";
|
|
54
|
+
if (/^[A-Za-z_][A-Za-z0-9_-]*\s*:/.test(line)) {
|
|
55
|
+
blockEnd = index;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return [...lines.slice(0, blockStart), ...lines.slice(blockEnd)].join("");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Patch the `proof_receipts` frontmatter block of an authored test document
|
|
63
|
+
* without re-rendering anything else.
|
|
64
|
+
*
|
|
65
|
+
* Receipt ingest used to route every append through the canonical entity
|
|
66
|
+
* renderer, which re-dumps the whole frontmatter: inline tag lists became
|
|
67
|
+
* block lists, timestamps gained milliseconds, and so on. Those non-receipt
|
|
68
|
+
* edits are not stripped by the workspace snapshotter, so the snapshot hash
|
|
69
|
+
* changed on the first ingest that touched a hand-authored document and every
|
|
70
|
+
* later integration in the same `kibi prove --all` run refused with
|
|
71
|
+
* "changed the tracked workspace". This patcher splices ONLY the receipts
|
|
72
|
+
* block, leaving the rest of the document byte-for-byte identical.
|
|
73
|
+
*
|
|
74
|
+
* Returns null when the content is not a well-formed frontmatter document the
|
|
75
|
+
* patcher can safely splice; the caller then falls back to the canonical
|
|
76
|
+
* render.
|
|
77
|
+
*/
|
|
78
|
+
// implements REQ-kibi-verification-evidence-contract
|
|
79
|
+
export function patchReceiptsIntoDocument(content, receipts) {
|
|
80
|
+
const lines = content.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
81
|
+
if (lines.length === 0 || lines[0]?.trim() !== "---")
|
|
82
|
+
return null;
|
|
83
|
+
let closingIndex = -1;
|
|
84
|
+
for (let index = 1; index < lines.length; index++) {
|
|
85
|
+
if (lines[index]?.trim() === "---") {
|
|
86
|
+
closingIndex = index;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (closingIndex === -1)
|
|
91
|
+
return null;
|
|
92
|
+
let receiptsStart = -1;
|
|
93
|
+
let receiptsEnd = closingIndex;
|
|
94
|
+
for (let index = 1; index < closingIndex; index++) {
|
|
95
|
+
if (/^proof_receipts\s*:/.test(lines[index] ?? "")) {
|
|
96
|
+
receiptsStart = index;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (receiptsStart !== -1) {
|
|
101
|
+
for (let index = receiptsStart + 1; index < closingIndex; index++) {
|
|
102
|
+
const line = lines[index] ?? "";
|
|
103
|
+
if (/^[A-Za-z_][A-Za-z0-9_-]*\s*:/.test(line)) {
|
|
104
|
+
receiptsEnd = index;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const block = dumpYaml({ proof_receipts: receipts.map((receipt) => ({ ...receipt })) }, { noRefs: true, lineWidth: -1, sortKeys: false });
|
|
110
|
+
const blockLines = block.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
111
|
+
const spliced = [
|
|
112
|
+
...lines.slice(0, receiptsStart === -1 ? closingIndex : receiptsStart),
|
|
113
|
+
...blockLines,
|
|
114
|
+
...lines.slice(receiptsEnd),
|
|
115
|
+
];
|
|
116
|
+
return spliced.join("");
|
|
117
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis-receipt.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analysis-receipt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analysis-receipt.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analysis-receipt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,6BAA6B,EAI7B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAyBpB,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,0BAA0B,EAAE,EAClD,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,YAAY,EAAE,SAAS,mBAAmB,EAAE,EAC5C,eAAe,EAAE,SAAS,4BAA4B,EAAE,EACxD,cAAc,EAAE,SAAS,iBAAiB,EAAE,GAC3C,6BAA6B,CAkH/B"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
+
import { chooseLane as chooseBuiltinLane } from "kibi-plugin-builtin";
|
|
1
2
|
import { SEMANTIC_INVENTORY_VERSION, payloadHash, propertiesOf, semanticSourceHash, semanticSourceOf, } from "./shared.js";
|
|
3
|
+
/** Builtin classifier is the single source of signal→lane selection. */
|
|
2
4
|
function chooseLane(signals) {
|
|
3
|
-
|
|
4
|
-
return "strict_property";
|
|
5
|
-
if (signals.some(({ kind }) => kind === "conditional" ||
|
|
6
|
-
kind === "permission" ||
|
|
7
|
-
kind === "state_or_default"))
|
|
8
|
-
return "predicate";
|
|
9
|
-
return signals.some(({ kind }) => kind === "normative_modal")
|
|
10
|
-
? "observation_review"
|
|
11
|
-
: "none";
|
|
5
|
+
return chooseBuiltinLane(signals);
|
|
12
6
|
}
|
|
13
7
|
function summary(readiness, lane) {
|
|
14
8
|
if (readiness === "modeled")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SemanticAdvisorAnalysisResult, SemanticAdvisorInput } from "./types.js";
|
|
2
2
|
export declare const SEMANTIC_ADVISOR_VERSION = "semantic-advisor-v2";
|
|
3
3
|
export { semanticClaimKey } from "./clauses.js";
|
|
4
|
+
export declare function stringLogicClaims(value: unknown): string[];
|
|
4
5
|
export declare function analyzeSemanticAdvisorInput(input: SemanticAdvisorInput): SemanticAdvisorAnalysisResult;
|
|
5
6
|
//# sourceMappingURL=analyze-prose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-prose.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analyze-prose.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyze-prose.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/analyze-prose.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EACV,6BAA6B,EAC7B,oBAAoB,EAWrB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAI1D;AAg0BD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,GAC1B,6BAA6B,CA+D/B"}
|
|
@@ -1,58 +1,18 @@
|
|
|
1
|
+
import { createBuiltinOntologyPack, detectSignals as detectBuiltinSignals, } from "kibi-plugin-builtin";
|
|
1
2
|
import { utf8Span, validateLogicIr, } from "../../logic/ir.js";
|
|
2
3
|
import { logicRuleFactId } from "../modeling/logic-modeling.js";
|
|
3
4
|
import { buildAdvisorResult } from "./analysis-receipt.js";
|
|
4
5
|
import { extractSemanticClauses, semanticClaimKey, } from "./clauses.js";
|
|
5
6
|
import { observationPlan } from "./observation-plan.js";
|
|
6
|
-
import {
|
|
7
|
-
import { CORE_PREDICATE_RULES } from "./predicate-rules-core.js";
|
|
8
|
-
import { LAUNCHER_PREDICATE_RULES } from "./predicate-rules-launcher.js";
|
|
9
|
-
import { POLICY_PREDICATE_RULES } from "./predicate-rules-policy.js";
|
|
10
|
-
import { PRODUCT_TAIL_PREDICATE_RULES } from "./predicate-rules-product-tail.js";
|
|
11
|
-
import { PRODUCT_PREDICATE_RULES } from "./predicate-rules-product.js";
|
|
12
|
-
import { isRecord, payloadHash, propertiesOf, relationship, semanticClausesOf, semanticSourceHash, semanticSourceOf, sourceOf, statementOf, stringValue, } from "./shared.js";
|
|
7
|
+
import { predicateSuggestion as buildPredicateSuggestion, isRecord, payloadHash, propertiesOf, relationship, semanticClausesOf, semanticSourceHash, semanticSourceOf, sourceOf, statementOf, stringValue, } from "./shared.js";
|
|
13
8
|
import { detectStrictSuggestion } from "./strict-rules.js";
|
|
14
9
|
export const SEMANTIC_ADVISOR_VERSION = "semantic-advisor-v2";
|
|
15
10
|
export { semanticClaimKey } from "./clauses.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pattern: /\b(?:(?:at\s+most|at\s+least|exactly|no\s+more\s+than|up\s+to|cap(?:ped)?\s+at)\s+)?(?:\d+|zero|one|two|three|four|five|six|seven|eight|nine|ten)\b/i,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
kind: "numeric_threshold",
|
|
25
|
-
candidateLane: "strict_property",
|
|
26
|
-
confidence: 0.86,
|
|
27
|
-
pattern: /\b(?:maximum|minimum|under|within|below|above|expires?|retained\s+for)\s+(?:\d+|zero|one|two|three|four|five|six|seven|eight|nine|ten)\b/i,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
kind: "conditional",
|
|
31
|
-
candidateLane: "predicate",
|
|
32
|
-
confidence: 0.82,
|
|
33
|
-
pattern: /\b(?:if|when|unless|except|only\s+if|provided\s+that)\b/i,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
kind: "permission",
|
|
37
|
-
candidateLane: "predicate",
|
|
38
|
-
confidence: 0.8,
|
|
39
|
-
pattern: /\b(?:only|may|can|allowed|denied|forbidden|must\s+not|cannot|can't)\b/i,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
kind: "state_or_default",
|
|
43
|
-
candidateLane: "predicate",
|
|
44
|
-
confidence: 0.74,
|
|
45
|
-
pattern: /\b(?:state|mode|defaults?\s+to|ready|disabled|enabled|terminal)\b/i,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
kind: "normative_modal",
|
|
49
|
-
candidateLane: "observation_review",
|
|
50
|
-
confidence: 0.65,
|
|
51
|
-
// Modal-free validity, rejection, prohibition, and failure-outcome
|
|
52
|
-
// assertions are normative even when they omit must/shall.
|
|
53
|
-
pattern: /\b(?:must|shall|should|may|must\s+not|cannot|can't|invalid|unresolved|reject(?:ed|ion)?|prohibited|forbidden|fail(?:s|ed|ure)?\s+(?:clearly|explicitly|with)|required\s+outcome)\b/i,
|
|
54
|
-
},
|
|
55
|
-
];
|
|
11
|
+
export function stringLogicClaims(value) {
|
|
12
|
+
return Array.isArray(value)
|
|
13
|
+
? value.filter((entry) => typeof entry === "string")
|
|
14
|
+
: [];
|
|
15
|
+
}
|
|
56
16
|
function proseOf(payload) {
|
|
57
17
|
const properties = propertiesOf(payload);
|
|
58
18
|
return [
|
|
@@ -101,22 +61,14 @@ function isModeled(payload, expectedClaimKeys) {
|
|
|
101
61
|
types.has("requires_predicate") ||
|
|
102
62
|
types.has("requires_rule")));
|
|
103
63
|
}
|
|
64
|
+
/** Builtin semantic classifier is the single source of signal/lane detection. */
|
|
104
65
|
function detectSignals(prose) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return [
|
|
112
|
-
{
|
|
113
|
-
kind: candidate.kind,
|
|
114
|
-
evidence,
|
|
115
|
-
candidate_lane: candidate.candidateLane,
|
|
116
|
-
confidence: candidate.confidence,
|
|
117
|
-
},
|
|
118
|
-
];
|
|
119
|
-
});
|
|
66
|
+
return detectBuiltinSignals(prose).map((signal) => ({
|
|
67
|
+
kind: signal.kind,
|
|
68
|
+
evidence: signal.evidence,
|
|
69
|
+
candidate_lane: signal.candidateLane,
|
|
70
|
+
confidence: signal.confidence,
|
|
71
|
+
}));
|
|
120
72
|
}
|
|
121
73
|
function ambiguitySuggestion(payload, statement) {
|
|
122
74
|
const match = statement.match(/\b(?<value>\d+|zero|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?<resource>active\s+sessions?|sessions?)\b/i);
|
|
@@ -164,11 +116,15 @@ function ontologyGapSuggestion(payload, statement) {
|
|
|
164
116
|
};
|
|
165
117
|
}
|
|
166
118
|
function predicateSuggestion(payload, statement) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
119
|
+
// Deterministic builtin pack — never loads external plugins on sync paths.
|
|
120
|
+
const matches = createBuiltinOntologyPack().match({
|
|
121
|
+
claimKey: "",
|
|
122
|
+
statement,
|
|
123
|
+
});
|
|
124
|
+
const hit = matches[0];
|
|
125
|
+
if (!hit)
|
|
126
|
+
return null;
|
|
127
|
+
return buildPredicateSuggestion(payload, hit.evidence, hit.predicateName, hit.arguments, hit.rationale ?? "", hit.polarity);
|
|
172
128
|
}
|
|
173
129
|
function ruleSuggestion(payload, candidate) {
|
|
174
130
|
const validation = validateLogicIr(candidate.ir);
|
|
@@ -289,8 +245,9 @@ function modelingSuggestions(payload, modeled, clauses, interpretations) {
|
|
|
289
245
|
return suggestions;
|
|
290
246
|
}
|
|
291
247
|
function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, statement, sourceField) {
|
|
292
|
-
const
|
|
293
|
-
const
|
|
248
|
+
const clauseLocation = propositionSpan(statement, clause, 0);
|
|
249
|
+
const clauseText = clauseLocation.sourceText;
|
|
250
|
+
const clauseSpan = clauseLocation.span;
|
|
294
251
|
const status = suggestion.kind === "ambiguity_observation"
|
|
295
252
|
? "ambiguous"
|
|
296
253
|
: suggestion.kind === "ontology_gap"
|
|
@@ -309,7 +266,7 @@ function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, st
|
|
|
309
266
|
: "missing";
|
|
310
267
|
return {
|
|
311
268
|
claim_key: entry.claim_key,
|
|
312
|
-
claim_text:
|
|
269
|
+
claim_text: located.sourceText,
|
|
313
270
|
role,
|
|
314
271
|
status: entryStatus,
|
|
315
272
|
span: located.span,
|
|
@@ -334,9 +291,7 @@ function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, st
|
|
|
334
291
|
if (properties === null)
|
|
335
292
|
return step;
|
|
336
293
|
if (step.type === "req") {
|
|
337
|
-
const existing =
|
|
338
|
-
? properties.logic_claims.filter((value) => typeof value === "string")
|
|
339
|
-
: [];
|
|
294
|
+
const existing = stringLogicClaims(properties.logic_claims);
|
|
340
295
|
return {
|
|
341
296
|
...step,
|
|
342
297
|
properties: {
|
|
@@ -357,7 +312,7 @@ function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, st
|
|
|
357
312
|
properties: {
|
|
358
313
|
...properties,
|
|
359
314
|
claim_key: clause.claim_key,
|
|
360
|
-
claim_text:
|
|
315
|
+
claim_text: clauseText,
|
|
361
316
|
claim_span_start: clauseSpan.start,
|
|
362
317
|
claim_span_end: clauseSpan.end,
|
|
363
318
|
},
|
|
@@ -366,14 +321,14 @@ function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, st
|
|
|
366
321
|
return {
|
|
367
322
|
...suggestion,
|
|
368
323
|
claim_key: clause.claim_key,
|
|
369
|
-
claim_text:
|
|
324
|
+
claim_text: clauseText,
|
|
370
325
|
applyPlan,
|
|
371
326
|
...(suggestion.kind === "predicate" && suggestion.relationshipPlan !== null
|
|
372
327
|
? {
|
|
373
328
|
relationshipPlan: {
|
|
374
329
|
...suggestion.relationshipPlan,
|
|
375
330
|
claimKey: clause.claim_key,
|
|
376
|
-
claimText:
|
|
331
|
+
claimText: clauseText,
|
|
377
332
|
logicClaims: expectedClaimKeys,
|
|
378
333
|
semanticClauses: clauses.map(({ text }) => text),
|
|
379
334
|
semanticInventory,
|
|
@@ -387,7 +342,7 @@ function withClauseProvenance(suggestion, clause, clauses, expectedClaimKeys, st
|
|
|
387
342
|
relationshipPlan: {
|
|
388
343
|
...suggestion.relationshipPlan,
|
|
389
344
|
claimKey: clause.claim_key,
|
|
390
|
-
claimText:
|
|
345
|
+
claimText: clauseText,
|
|
391
346
|
logicClaims: expectedClaimKeys,
|
|
392
347
|
semanticClauses: clauses.map(({ text }) => text),
|
|
393
348
|
semanticInventory,
|
|
@@ -554,12 +509,36 @@ function shadowAnalysis(text, interpretations) {
|
|
|
554
509
|
}));
|
|
555
510
|
}
|
|
556
511
|
function propositionSpan(text, clause, cursor) {
|
|
557
|
-
const
|
|
512
|
+
const located = locateSourceText(text, clause.text, cursor);
|
|
513
|
+
return {
|
|
514
|
+
span: utf8Span(text, located.start, located.end),
|
|
515
|
+
next: Math.max(cursor, located.end),
|
|
516
|
+
sourceText: text.slice(located.start, located.end),
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function escapeRegExp(value) {
|
|
520
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Locate canonical claim text while accepting source-only whitespace layout.
|
|
524
|
+
* The caller receives the authored slice so strict ingestion can compare the
|
|
525
|
+
* span with the claim text without rewriting the source document.
|
|
526
|
+
*/
|
|
527
|
+
function locateSourceText(source, claimText, cursor) {
|
|
528
|
+
const canonicalPattern = escapeRegExp(claimText).replace(/\s+/g, "\\s+");
|
|
529
|
+
const match = new RegExp(canonicalPattern).exec(source.slice(cursor));
|
|
530
|
+
if (match?.index !== undefined) {
|
|
531
|
+
const start = cursor + match.index;
|
|
532
|
+
return { start, end: start + match[0].length };
|
|
533
|
+
}
|
|
534
|
+
const exact = source.indexOf(claimText, cursor);
|
|
558
535
|
const start = exact >= 0 ? exact : cursor;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
:
|
|
562
|
-
|
|
536
|
+
return {
|
|
537
|
+
start,
|
|
538
|
+
end: exact >= 0
|
|
539
|
+
? exact + claimText.length
|
|
540
|
+
: Math.min(source.length, start + claimText.length),
|
|
541
|
+
};
|
|
563
542
|
}
|
|
564
543
|
function interpretationResults(interpretations, clauses, statement) {
|
|
565
544
|
if (interpretations === undefined)
|
|
@@ -582,16 +561,8 @@ function interpretationResults(interpretations, clauses, statement) {
|
|
|
582
561
|
(candidate.span.start < 0 || candidate.span.end < candidate.span.start))
|
|
583
562
|
errors.push("interpretation span is invalid");
|
|
584
563
|
if (clause && candidate.span) {
|
|
585
|
-
const
|
|
586
|
-
const
|
|
587
|
-
const sourceStart = candidateStart >= 0 ? candidateStart : clauseStart;
|
|
588
|
-
const sourceEnd = sourceStart >= 0
|
|
589
|
-
? sourceStart +
|
|
590
|
-
(candidateStart >= 0
|
|
591
|
-
? candidate.claim_text.length
|
|
592
|
-
: clause.text.length)
|
|
593
|
-
: 0;
|
|
594
|
-
const expectedSpan = utf8Span(statement, Math.max(0, sourceStart), Math.max(0, sourceEnd));
|
|
564
|
+
const candidateLocation = locateSourceText(statement, candidate.claim_text, 0);
|
|
565
|
+
const expectedSpan = utf8Span(statement, candidateLocation.start, candidateLocation.end);
|
|
595
566
|
if (candidate.span.start !== expectedSpan.start ||
|
|
596
567
|
candidate.span.end !== expectedSpan.end)
|
|
597
568
|
errors.push(`interpretation span for ${candidate.claim_key} does not match the exact UTF-8 proposition span`);
|
|
@@ -671,7 +642,7 @@ function propositionInventory(statement, clauses, suggestions, interpretations,
|
|
|
671
642
|
}
|
|
672
643
|
return {
|
|
673
644
|
claim_key: clause.claim_key,
|
|
674
|
-
claim_text:
|
|
645
|
+
claim_text: located.sourceText,
|
|
675
646
|
role,
|
|
676
647
|
status,
|
|
677
648
|
span: located.span,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clauses.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/clauses.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACjC,CAAC,CAAC;AAKH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW7D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AA4BD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,GAClC,SAAS,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"clauses.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/clauses.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACjC,CAAC,CAAC;AAKH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW7D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIrD;AA4BD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,GAClC,SAAS,cAAc,EAAE,CA4B3B"}
|
|
@@ -46,11 +46,24 @@ export function extractSemanticClauses(text, suppliedClauses) {
|
|
|
46
46
|
if (suppliedClauses !== undefined && normalized.length === 0) {
|
|
47
47
|
throw new Error("Semantic advisor clauses must contain at least one non-empty atomic claim");
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
// A repeated sentence has one logical identity. Keep the first source
|
|
50
|
+
// occurrence for its source span and provenance; retaining repeated claim
|
|
51
|
+
// keys would make the inventory impossible to persist because logic_claims
|
|
52
|
+
// is a set-like manifest and grounding is one-to-one.
|
|
53
|
+
const seen = new Set();
|
|
54
|
+
return normalized.flatMap((clause, index) => {
|
|
55
|
+
const identity = clause.toLowerCase();
|
|
56
|
+
if (seen.has(identity))
|
|
57
|
+
return [];
|
|
58
|
+
seen.add(identity);
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
claim_key: semanticClaimKey(clause),
|
|
62
|
+
text: clause,
|
|
63
|
+
index,
|
|
64
|
+
normative: NORMATIVE_PATTERN.test(clause),
|
|
65
|
+
source,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
});
|
|
56
69
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PluginProviderStamp, SemanticClassificationDecision, SemanticClassifierInput } from "kibi-plugin-sdk";
|
|
2
|
+
import { type ComposedOntologyCatalog, type StampedOntologyCandidate } from "../../plugins/compose-ontology-packs.js";
|
|
3
|
+
import { type ComposedSemanticClassifierResult } from "../../plugins/compose-semantic-classifier.js";
|
|
4
|
+
import type { CapabilityRegistry } from "../../plugins/registry.js";
|
|
5
|
+
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
6
|
+
import type { SemanticAdvisorAnalysisResult, SemanticAdvisorInput } from "./types.js";
|
|
7
|
+
export type SemanticPluginOrchestrationResult = Readonly<{
|
|
8
|
+
analysis: SemanticAdvisorAnalysisResult;
|
|
9
|
+
classification: ComposedSemanticClassifierResult | null;
|
|
10
|
+
ontologyCatalog: ComposedOntologyCatalog | null;
|
|
11
|
+
ontologyMatches: readonly StampedOntologyCandidate[];
|
|
12
|
+
ontologyShadowMatches: readonly StampedOntologyCandidate[];
|
|
13
|
+
stamps: readonly PluginProviderStamp[];
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Drop sync-path builtin ontology `predicate` suggestions.
|
|
17
|
+
*
|
|
18
|
+
* `analyzeSemanticAdvisorInput` always consults the builtin pack for
|
|
19
|
+
* maintenance-safe deterministic matching. When a replace ontology pack is
|
|
20
|
+
* active, those suggestions must not survive into the public receipt —
|
|
21
|
+
* including when the replace pack abstains with a valid empty match set.
|
|
22
|
+
*/
|
|
23
|
+
export declare function stripSyncBuiltinOntologySuggestions(analysis: SemanticAdvisorAnalysisResult): SemanticAdvisorAnalysisResult;
|
|
24
|
+
/**
|
|
25
|
+
* Host-construct advisory modeling suggestions from validated ontology matches.
|
|
26
|
+
*
|
|
27
|
+
* When `replaced` is true, matches replace any remaining claim-keyed
|
|
28
|
+
* suggestion for the matched claim (after sync builtin predicates were
|
|
29
|
+
* stripped). When false (augment/builtin), matches only fill claims that
|
|
30
|
+
* lack a suggestion.
|
|
31
|
+
*/
|
|
32
|
+
export declare function applyOntologyMatchSuggestions(analysis: SemanticAdvisorAnalysisResult, ontologyMatches: readonly StampedOntologyCandidate[], options?: Readonly<{
|
|
33
|
+
replaced: boolean;
|
|
34
|
+
}>): SemanticAdvisorAnalysisResult;
|
|
35
|
+
/**
|
|
36
|
+
* Apply host-validated classifier decisions as a bounded routing seam.
|
|
37
|
+
*
|
|
38
|
+
* Plugins may influence per-proposition routing, candidate lane, suggested
|
|
39
|
+
* next tools, and advisory ambiguity metadata. They must not delete
|
|
40
|
+
* propositions, erase assertive unresolved obligations, downgrade modeled
|
|
41
|
+
* completeness, manufacture typed grounding, or invent mutation/proof.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyClassificationRouting(analysis: SemanticAdvisorAnalysisResult, classification: ComposedSemanticClassifierResult, ontologyMatches?: readonly StampedOntologyCandidate[], options?: Readonly<{
|
|
44
|
+
replaced?: boolean;
|
|
45
|
+
/** True when a replace semantic classifier succeeded (not builtin fallback). */
|
|
46
|
+
classifierReplaced?: boolean;
|
|
47
|
+
}>): SemanticAdvisorAnalysisResult;
|
|
48
|
+
/**
|
|
49
|
+
* Async orchestration for allowlisted semantic operations.
|
|
50
|
+
* Maintenance paths must keep calling sync `analyzeSemanticAdvisorInput`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function analyzeSemanticAdvisorInputWithPlugins(input: SemanticAdvisorInput, options: Readonly<{
|
|
53
|
+
ensurePlugins?: () => Promise<CapabilityRegistry>;
|
|
54
|
+
operationName: string;
|
|
55
|
+
}>): Promise<SemanticPluginOrchestrationResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Run allowlisted semantic classifier composition without re-running advisor
|
|
58
|
+
* analysis.
|
|
59
|
+
*/
|
|
60
|
+
export declare function composeSemanticClassificationForOperation(context: OperationContext | undefined, operationName: string, input: SemanticClassifierInput): Promise<ComposedSemanticClassifierResult | null>;
|
|
61
|
+
export declare function composeOntologyCatalogForOperation(context: OperationContext | undefined, operationName: string): Promise<ComposedOntologyCatalog | null>;
|
|
62
|
+
export type { SemanticClassificationDecision };
|
|
63
|
+
//# sourceMappingURL=plugin-orchestration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-orchestration.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/plugin-orchestration.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,mBAAmB,EACnB,8BAA8B,EAC9B,uBAAuB,EAExB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAG9B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,KAAK,EACV,6BAA6B,EAC7B,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CAAC;IACvD,QAAQ,EAAE,6BAA6B,CAAC;IACxC,cAAc,EAAE,gCAAgC,GAAG,IAAI,CAAC;IACxD,eAAe,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAChD,eAAe,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACrD,qBAAqB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC3D,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACxC,CAAC,CAAC;AAmDH;;;;;;;GAOG;AAEH,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,6BAA6B,GACtC,6BAA6B,CAkB/B;AAED;;;;;;;GAOG;AAEH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,6BAA6B,EACvC,eAAe,EAAE,SAAS,wBAAwB,EAAE,EACpD,OAAO,GAAE,QAAQ,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAuB,GAC7D,6BAA6B,CAiG/B;AAED;;;;;;;GAOG;AAEH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,6BAA6B,EACvC,cAAc,EAAE,gCAAgC,EAChD,eAAe,GAAE,SAAS,wBAAwB,EAAO,EACzD,OAAO,GAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAM,GACN,6BAA6B,CAqM/B;AAED;;;GAGG;AAEH,wBAAsB,sCAAsC,CAC1D,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,QAAQ,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClD,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,GACD,OAAO,CAAC,iCAAiC,CAAC,CA8H5C;AAED;;;GAGG;AAEH,wBAAsB,yCAAyC,CAC7D,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gCAAgC,GAAG,IAAI,CAAC,CAOlD;AAGD,wBAAsB,kCAAkC,CACtD,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAOzC;AAED,YAAY,EAAE,8BAA8B,EAAE,CAAC"}
|