kibi-cli 2.3.0 → 2.5.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-json-command.d.ts +6 -0
- package/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +39 -11
- package/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +7 -0
- package/dist/cli-operation-metadata.d.ts +13 -5
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +15 -5
- package/dist/cli-protocol.d.ts +14 -0
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +31 -2
- 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.map +1 -1
- package/dist/cli-register-proof.js +13 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +11 -2
- package/dist/commands/discovery-shared.d.ts.map +1 -1
- package/dist/commands/discovery-shared.js +8 -2
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +4 -2
- package/dist/commands/gc.d.ts.map +1 -1
- package/dist/commands/gc.js +7 -0
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +0 -1
- package/dist/commands/merge-driver.d.ts +31 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +268 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +281 -14
- package/dist/commands/proof-compact.d.ts +9 -0
- package/dist/commands/proof-compact.d.ts.map +1 -0
- package/dist/commands/proof-compact.js +58 -0
- package/dist/commands/prove.d.ts +38 -0
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +222 -47
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +61 -16
- package/dist/commands/sync.d.ts +8 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +42 -16
- package/dist/diagnostics.js +1 -1
- package/dist/engine-limits.d.ts +74 -0
- package/dist/engine-limits.d.ts.map +1 -0
- package/dist/engine-limits.js +201 -0
- package/dist/engine.d.ts +10 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +57 -9
- package/dist/extractors/manifest.d.ts +8 -0
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +34 -5
- package/dist/extractors/markdown.d.ts +8 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +57 -0
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +2 -0
- package/dist/intent-search.d.ts +4 -1
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +186 -33
- package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidate-helpers.js +8 -1
- package/dist/operations/bootstrap/candidates.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidates.js +55 -39
- package/dist/operations/bootstrap/discovery.js +1 -1
- package/dist/operations/bootstrap/generate.d.ts +2 -0
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +107 -37
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +3 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +7 -1
- package/dist/operations/bootstrap/intent-claims.d.ts +17 -0
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -0
- package/dist/operations/bootstrap/intent-claims.js +103 -0
- package/dist/operations/bootstrap/markdown-candidates.d.ts +2 -0
- package/dist/operations/bootstrap/markdown-candidates.d.ts.map +1 -1
- package/dist/operations/bootstrap/markdown-candidates.js +32 -10
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +66 -3
- package/dist/operations/bootstrap/requirement-claims.d.ts +1 -0
- package/dist/operations/bootstrap/requirement-claims.d.ts.map +1 -1
- package/dist/operations/bootstrap/requirement-claims.js +13 -1
- package/dist/operations/bootstrap/types.d.ts +28 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/bootstrap/types.js +16 -0
- package/dist/operations/bootstrap/validation.d.ts +4 -0
- package/dist/operations/bootstrap/validation.d.ts.map +1 -0
- package/dist/operations/bootstrap/validation.js +20 -0
- package/dist/operations/migration/inventory-rederive.d.ts +81 -0
- package/dist/operations/migration/inventory-rederive.d.ts.map +1 -0
- package/dist/operations/migration/inventory-rederive.js +484 -0
- package/dist/operations/migration/kb-sources.d.ts +53 -0
- package/dist/operations/migration/kb-sources.d.ts.map +1 -0
- package/dist/operations/migration/kb-sources.js +233 -0
- package/dist/operations/migration/origin-backfill.d.ts +39 -0
- package/dist/operations/migration/origin-backfill.d.ts.map +1 -0
- package/dist/operations/migration/origin-backfill.js +164 -0
- package/dist/operations/migration/polarity-values.d.ts +10 -0
- package/dist/operations/migration/polarity-values.d.ts.map +1 -0
- package/dist/operations/migration/polarity-values.js +60 -0
- package/dist/operations/migration/schema6.d.ts +59 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -0
- package/dist/operations/migration/schema6.js +379 -0
- package/dist/operations/migration/source-paths.d.ts +131 -0
- package/dist/operations/migration/source-paths.d.ts.map +1 -0
- package/dist/operations/migration/source-paths.js +308 -0
- package/dist/operations/migration/superseded-closure.d.ts +54 -0
- package/dist/operations/migration/superseded-closure.d.ts.map +1 -0
- package/dist/operations/migration/superseded-closure.js +187 -0
- package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
- package/dist/operations/modeling/logic-modeling.js +3 -5
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +225 -67
- package/dist/operations/mutation/contradictions.d.ts +16 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +32 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +15 -7
- package/dist/operations/mutation/origin.d.ts +21 -0
- package/dist/operations/mutation/origin.d.ts.map +1 -0
- package/dist/operations/mutation/origin.js +78 -0
- package/dist/operations/mutation/plan-apply-journal.d.ts +182 -0
- package/dist/operations/mutation/plan-apply-journal.d.ts.map +1 -0
- package/dist/operations/mutation/plan-apply-journal.js +613 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +3 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.js +13 -2
- package/dist/operations/mutation/relationships.d.ts +5 -5
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +31 -11
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +3 -1
- package/dist/operations/mutation/source-authoring.d.ts +6 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +7 -1
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +4 -1
- package/dist/operations/mutation/types.d.ts +14 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +30 -3
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +105 -35
- package/dist/operations/mutation/validate-upsert.d.ts +6 -0
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +34 -30
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +751 -144
- package/dist/operations/planning/compile-intent.d.ts +34 -1
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +314 -98
- package/dist/operations/proof/code-scope.d.ts +28 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +72 -0
- package/dist/operations/proof/compact-receipts.d.ts +49 -0
- package/dist/operations/proof/compact-receipts.d.ts.map +1 -0
- package/dist/operations/proof/compact-receipts.js +160 -0
- package/dist/operations/proof/ingest-proof.d.ts +2 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +44 -23
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
- package/dist/operations/proof/prune-receipts.js +5 -9
- package/dist/operations/proof/receipt-compaction.d.ts +48 -0
- package/dist/operations/proof/receipt-compaction.d.ts.map +1 -0
- package/dist/operations/proof/receipt-compaction.js +121 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +12 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +2 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +51 -5
- package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +11 -1
- package/dist/operations/semantic-advisor/conditional-rules.d.ts +33 -0
- package/dist/operations/semantic-advisor/conditional-rules.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/conditional-rules.js +262 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +3 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +14 -6
- package/dist/operations/semantic-advisor/plugin-orchestration.js +1 -1
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -1
- package/dist/prolog.d.ts +9 -0
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +56 -10
- package/dist/proof/command-test-report.d.ts +74 -0
- package/dist/proof/command-test-report.d.ts.map +1 -0
- package/dist/proof/command-test-report.js +206 -0
- package/dist/public/branch-resolver.d.ts +1 -0
- package/dist/public/branch-resolver.d.ts.map +1 -1
- package/dist/public/branch-resolver.js +1 -0
- package/dist/public/diagnostic-usage.d.ts +14 -0
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +55 -1
- package/dist/public/entity-origin.d.ts +69 -0
- package/dist/public/entity-origin.d.ts.map +1 -0
- package/dist/public/entity-origin.js +142 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +1 -0
- package/dist/public/impact/requirement-quality.js +1 -1
- package/dist/public/operations/catalog.d.ts +203 -20
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +3 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +8 -0
- package/dist/public/operations/contracts.d.ts +0 -5
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +63 -14
- 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 +59 -0
- package/dist/public/operations/discovery-executors.d.ts +6 -1
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +65 -6
- package/dist/public/operations/index.d.ts +1 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +1 -0
- package/dist/public/operations/migration-plan.d.ts +5 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +26 -1
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +24 -3
- package/dist/public/operations/origin-review.d.ts +51 -0
- package/dist/public/operations/origin-review.d.ts.map +1 -0
- package/dist/public/operations/origin-review.js +307 -0
- package/dist/public/operations/predicate-schema-conformance.js +1 -1
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +4 -0
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +17 -5
- package/dist/public/operations/runtime-types.d.ts +9 -0
- package/dist/public/operations/runtime-types.d.ts.map +1 -1
- package/dist/public/operations/schema6-check-actions.d.ts +127 -0
- package/dist/public/operations/schema6-check-actions.d.ts.map +1 -0
- package/dist/public/operations/schema6-check-actions.js +575 -0
- package/dist/public/operations/source-path-dangling.d.ts +17 -0
- package/dist/public/operations/source-path-dangling.d.ts.map +1 -0
- package/dist/public/operations/source-path-dangling.js +66 -0
- package/dist/public/operations/specs/bootstrap.d.ts +73 -1
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
- package/dist/public/operations/specs/bootstrap.js +66 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +15 -1
- package/dist/public/operations/specs/check.d.ts +2 -2
- package/dist/public/operations/specs/check.js +1 -1
- package/dist/public/operations/specs/composite.d.ts +351 -0
- package/dist/public/operations/specs/composite.d.ts.map +1 -0
- package/dist/public/operations/specs/composite.js +96 -0
- package/dist/public/operations/specs/discovery.d.ts +8 -3
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +8 -3
- package/dist/public/operations/specs/modeling.d.ts +2 -2
- package/dist/public/operations/specs/modeling.js +2 -2
- package/dist/public/operations/specs/mutation-schemas.d.ts +73 -8
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +43 -7
- package/dist/public/operations/specs/mutation.d.ts +1 -1
- package/dist/public/operations/specs/mutation.js +1 -1
- package/dist/public/operations/specs/planning.d.ts +2 -2
- package/dist/public/operations/specs/planning.js +4 -4
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +13 -26
- package/dist/public/operations/specs/upsert.d.ts +79 -9
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +6 -1
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +3 -1
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/proof-receipt.d.ts +1 -0
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +52 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +2 -0
- package/dist/public/skills/kibi-bootstrap/SKILL.md +52 -11
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/dist/public/skills/kibi-usage/SKILL.md +82 -18
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/dist/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/dist/public/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/dist/public/skills/kibi-usage/resources/operation-access.md +29 -1
- package/dist/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/dist/public/skills/kibi-usage/resources/workflows.md +42 -25
- package/dist/public/telemetry-acceptance.d.ts +64 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +143 -7
- package/dist/public/telemetry-remediation.d.ts.map +1 -1
- package/dist/public/telemetry-remediation.js +26 -10
- package/dist/relationships/shards.d.ts +13 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +54 -28
- package/dist/runtime/cli-runtime.d.ts.map +1 -1
- package/dist/runtime/cli-runtime.js +44 -3
- package/dist/runtime/detached-snapshot.d.ts +38 -0
- package/dist/runtime/detached-snapshot.d.ts.map +1 -0
- package/dist/runtime/detached-snapshot.js +92 -0
- package/dist/schemas/entity.schema.json +122 -0
- package/dist/search-answer.d.ts +157 -0
- package/dist/search-answer.d.ts.map +1 -0
- package/dist/search-answer.js +846 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +7 -0
- package/dist/traceability/symbol-extract.js +3 -3
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +12 -0
- package/dist/types/entities.d.ts +13 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/types/relationships.d.ts +1 -1
- package/dist/types/relationships.d.ts.map +1 -1
- package/dist/utils/branch-resolver.d.ts +37 -1
- package/dist/utils/branch-resolver.d.ts.map +1 -1
- package/dist/utils/branch-resolver.js +130 -3
- package/dist/utils/repo-relative-path.d.ts +18 -0
- package/dist/utils/repo-relative-path.d.ts.map +1 -0
- package/dist/utils/repo-relative-path.js +58 -0
- package/dist/utils/rule-registry.generated.d.ts +75 -3
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +89 -3
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +4 -3
- package/dist/utils/strict-modeling.d.ts +1 -1
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +23 -3
- package/package.json +3 -3
- package/schema/entities.pl +22 -0
- package/schema/relationships.pl +14 -0
- package/schema/validation.pl +45 -1
- package/src/public/branch-resolver.ts +1 -0
- package/src/public/diagnostic-usage.ts +59 -1
- package/src/public/entity-origin.ts +175 -0
- package/src/public/impact/full-kb-quality.ts +1 -0
- package/src/public/impact/requirement-quality.ts +1 -1
- package/src/public/operations/catalog.ts +3 -0
- package/src/public/operations/check-executor.ts +15 -0
- package/src/public/operations/contracts.ts +75 -15
- package/src/public/operations/discovery-entities.ts +74 -0
- package/src/public/operations/discovery-executors.ts +88 -10
- package/src/public/operations/index.ts +1 -0
- package/src/public/operations/migration-plan.ts +30 -1
- package/src/public/operations/node-ports.ts +24 -3
- package/src/public/operations/origin-review.ts +375 -0
- package/src/public/operations/predicate-schema-conformance.ts +1 -1
- package/src/public/operations/repair-plan.ts +4 -0
- package/src/public/operations/result-envelope.ts +18 -6
- package/src/public/operations/runtime-types.ts +9 -0
- package/src/public/operations/schema6-check-actions.ts +699 -0
- package/src/public/operations/source-path-dangling.ts +81 -0
- package/src/public/operations/specs/bootstrap.ts +78 -4
- package/src/public/operations/specs/check-rules.generated.ts +15 -1
- package/src/public/operations/specs/check.ts +1 -1
- package/src/public/operations/specs/composite.ts +141 -0
- package/src/public/operations/specs/discovery.ts +9 -3
- package/src/public/operations/specs/modeling.ts +2 -2
- package/src/public/operations/specs/mutation-schemas.ts +49 -7
- package/src/public/operations/specs/mutation.ts +1 -1
- package/src/public/operations/specs/planning.ts +4 -4
- package/src/public/operations/specs/reporting.ts +13 -38
- package/src/public/operations/specs/upsert.ts +7 -1
- package/src/public/operations/symbol-repair-plan.ts +3 -1
- package/src/public/operations/types.ts +2 -0
- package/src/public/proof-receipt.ts +1 -0
- package/src/public/schemas/entity.ts +57 -0
- package/src/public/schemas/relationship.ts +2 -0
- package/src/public/skills/kibi-bootstrap/SKILL.md +52 -11
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/src/public/skills/kibi-usage/SKILL.md +82 -18
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/src/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/src/public/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/src/public/skills/kibi-usage/resources/operation-access.md +29 -1
- package/src/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/src/public/skills/kibi-usage/resources/workflows.md +42 -25
- package/src/public/telemetry-acceptance-types.d.ts +4 -1
- package/src/public/telemetry-acceptance.ts +210 -7
- package/src/public/telemetry-remediation.ts +39 -10
- package/src/schemas/entity.schema.json +122 -0
- package/src/schemas/relationship.schema.json +2 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { FilesystemPort, OperationContext, PrologPort } from "../../public/operations/runtime-types.js";
|
|
2
|
+
import type { RelationshipInput } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Write-ahead journal for atomic kb_apply_plan application.
|
|
5
|
+
*
|
|
6
|
+
* A compile plan changes two resources: workspace files (the plan's
|
|
7
|
+
* sourceWrites and the relationship shards its steps append) and the compiled
|
|
8
|
+
* branch store. Before the first write, the journal records every intended
|
|
9
|
+
* file change with exact before/after bytes and hashes, every store upsert,
|
|
10
|
+
* and a fingerprint of the store entities the plan touches. Files are then
|
|
11
|
+
* published with temp-file + rename (fsync where the port supports it), and
|
|
12
|
+
* the store mutations commit in one Prolog transaction. The store commit is
|
|
13
|
+
* the only commit point: any failure before it restores every file from the
|
|
14
|
+
* journal, and an interrupted application is completed or rolled back from
|
|
15
|
+
* the journal by the next mutating call.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PLAN_APPLY_JOURNAL_VERSION: "kibi.plan-apply-journal.v1";
|
|
18
|
+
export type PlanApplyFileWrite = Readonly<{
|
|
19
|
+
/** Workspace-relative path with forward slashes. */
|
|
20
|
+
path: string;
|
|
21
|
+
/**
|
|
22
|
+
* plan: one of the plan's sourceWrites; entity-document: the authored
|
|
23
|
+
* document a step's entity is rendered into; relationship-shard: a shard
|
|
24
|
+
* the steps' relationships append to.
|
|
25
|
+
*/
|
|
26
|
+
origin: "plan" | "entity-document" | "relationship-shard";
|
|
27
|
+
mode: "write" | "delete";
|
|
28
|
+
beforeHash: string | null;
|
|
29
|
+
afterHash: string | null;
|
|
30
|
+
/** Exact bytes before the plan; null when the file did not exist. */
|
|
31
|
+
before: string | null;
|
|
32
|
+
/** Exact bytes after the plan; null for a delete. */
|
|
33
|
+
after: string | null;
|
|
34
|
+
}>;
|
|
35
|
+
export type PlanApplyStoreEntry = Readonly<{
|
|
36
|
+
entity: Readonly<Record<string, unknown>>;
|
|
37
|
+
relationships: readonly RelationshipInput[];
|
|
38
|
+
skipContradictionCheck: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
export type PlanApplyJournalState =
|
|
41
|
+
/** Journal durable; files may be partly published; store untouched. */
|
|
42
|
+
"prepared"
|
|
43
|
+
/** Files published; the store batch was (or is about to be) submitted. */
|
|
44
|
+
| "store_committing"
|
|
45
|
+
/** The store accepted the batch; postcommit receipts may be pending. */
|
|
46
|
+
| "store_committed" | "committed" | "rolled_back";
|
|
47
|
+
export type PlanApplyJournal = Readonly<{
|
|
48
|
+
version: typeof PLAN_APPLY_JOURNAL_VERSION;
|
|
49
|
+
journalId: string;
|
|
50
|
+
planHash: string;
|
|
51
|
+
branch: string;
|
|
52
|
+
state: PlanApplyJournalState;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
updatedAt: string;
|
|
55
|
+
/** Emptied once the journal reaches a terminal state. */
|
|
56
|
+
files: readonly PlanApplyFileWrite[];
|
|
57
|
+
store: Readonly<{
|
|
58
|
+
entityIds: readonly string[];
|
|
59
|
+
/** Fingerprint of the touched store entities before the commit. */
|
|
60
|
+
preCommitFingerprint: string;
|
|
61
|
+
/** Emptied once the journal reaches a terminal state. */
|
|
62
|
+
entries: readonly PlanApplyStoreEntry[];
|
|
63
|
+
}>;
|
|
64
|
+
summary: Readonly<{
|
|
65
|
+
planPaths: readonly string[];
|
|
66
|
+
filePaths: readonly string[];
|
|
67
|
+
changedEntities: number;
|
|
68
|
+
changedRelationships: number;
|
|
69
|
+
}>;
|
|
70
|
+
resolution?: Readonly<{
|
|
71
|
+
action: "completed" | "rolled_back";
|
|
72
|
+
by: "apply" | "recovery";
|
|
73
|
+
detail: string;
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
export type PlanApplyRecovery = Readonly<{
|
|
77
|
+
journalId: string;
|
|
78
|
+
planHash: string;
|
|
79
|
+
/** What this recovery did; "none" when the journal was already terminal. */
|
|
80
|
+
action: "completed" | "rolled_back" | "none";
|
|
81
|
+
state: "committed" | "rolled_back";
|
|
82
|
+
/** Workspace files this recovery changed. */
|
|
83
|
+
restoredPaths: readonly string[];
|
|
84
|
+
detail: string;
|
|
85
|
+
/** Postcommit receipt failure left for the next recovery, if any. */
|
|
86
|
+
receiptFailure?: string;
|
|
87
|
+
}>;
|
|
88
|
+
export declare function planApplyJournalId(planHash: string): string;
|
|
89
|
+
export declare function isPlanApplyJournalId(value: string): boolean;
|
|
90
|
+
export declare function contentHash(value: string): string;
|
|
91
|
+
/** A journal handle bound to its file. */
|
|
92
|
+
export type PlanApplyJournalHandle = {
|
|
93
|
+
readonly journalPath: string;
|
|
94
|
+
journal: PlanApplyJournal;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The terminal-or-absent journal slot for a plan. Returns the existing
|
|
98
|
+
* journal (if any) so the caller can refuse a plan that already committed.
|
|
99
|
+
*/
|
|
100
|
+
export declare function openPlanApplyJournal(context: OperationContext, planHash: string): Readonly<{
|
|
101
|
+
journalId: string;
|
|
102
|
+
journalPath: string;
|
|
103
|
+
branch: string;
|
|
104
|
+
existing: PlanApplyJournal | null;
|
|
105
|
+
}>;
|
|
106
|
+
/** Durably record a journal state; the handle tracks the latest record. */
|
|
107
|
+
export declare function recordPlanApplyJournal(handle: PlanApplyJournalHandle, update: Partial<Pick<PlanApplyJournal, "state" | "resolution">>, now?: Date): void;
|
|
108
|
+
export declare function createPlanApplyJournal(journalPath: string, journal: PlanApplyJournal): PlanApplyJournalHandle;
|
|
109
|
+
/** Bind pending-source receipts to the bytes a committed plan published. */
|
|
110
|
+
export declare function reconcilePendingSourceReceipts(workspaceRoot: string, writes: readonly {
|
|
111
|
+
readonly path: string;
|
|
112
|
+
readonly mode?: "write" | "delete";
|
|
113
|
+
readonly afterHash: string | null;
|
|
114
|
+
}[]): void;
|
|
115
|
+
/**
|
|
116
|
+
* Replace one workspace file atomically: write a unique staged file in the
|
|
117
|
+
* target directory, fsync it, rename it over the target, then fsync the
|
|
118
|
+
* directory. Ports without rename (test and constrained hosts) write the
|
|
119
|
+
* target directly.
|
|
120
|
+
*/
|
|
121
|
+
export declare function publishWorkspaceFile(fsPort: FilesystemPort, absolute: string, content: string): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Publish every journaled file's after-bytes in journal order. Throws on the
|
|
124
|
+
* first failure; the caller restores the before-bytes from the journal.
|
|
125
|
+
*/
|
|
126
|
+
export declare function publishJournaledFiles(fsPort: FilesystemPort, workspaceRoot: string, files: readonly PlanApplyFileWrite[]): Promise<void>;
|
|
127
|
+
/** Restore every journaled file's before-bytes (in-process rollback). */
|
|
128
|
+
export declare function restoreJournaledFiles(fsPort: FilesystemPort, workspaceRoot: string, journalPath: string, files: readonly PlanApplyFileWrite[]): Promise<string[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Fingerprint the store state of the entities a plan touches: their sorted
|
|
131
|
+
* properties and outgoing relationships. Comparing the fingerprint taken
|
|
132
|
+
* before the commit with a later one decides whether an interrupted batch
|
|
133
|
+
* commit took effect; the batch is one transaction, so it either changed the
|
|
134
|
+
* plan's entities or changed nothing.
|
|
135
|
+
*/
|
|
136
|
+
export declare function storeFingerprint(prolog: PrologPort, entityIds: readonly string[]): Promise<string>;
|
|
137
|
+
type RecoveryOptions = Readonly<{
|
|
138
|
+
/** Lazily acquire Prolog; needed only to resolve a store_committing journal. */
|
|
139
|
+
prolog: () => Promise<PrologPort | undefined>;
|
|
140
|
+
now?: () => Date;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Deterministically finish one journal:
|
|
144
|
+
* - prepared: the store was never asked to commit, so every file is restored
|
|
145
|
+
* to its before-bytes and the journal ends rolled_back;
|
|
146
|
+
* - store_committing: the store fingerprint decides. Unchanged since the
|
|
147
|
+
* journal was written means the batch never took effect (roll back);
|
|
148
|
+
* changed means it committed (complete: publish every after-byte);
|
|
149
|
+
* - store_committed: complete;
|
|
150
|
+
* - committed / rolled_back: nothing to do (replay is idempotent).
|
|
151
|
+
* Recovery refuses, changing nothing, when a journaled file holds neither
|
|
152
|
+
* its before nor its after bytes.
|
|
153
|
+
*/
|
|
154
|
+
export declare function recoverPlanApplyJournal(context: OperationContext, handle: PlanApplyJournalHandle, options: RecoveryOptions): Promise<PlanApplyRecovery>;
|
|
155
|
+
/** Open an explicit journal by id for kb_apply_plan recoveryJournalId. */
|
|
156
|
+
export declare function openPlanApplyJournalById(context: OperationContext, journalId: string): PlanApplyJournalHandle;
|
|
157
|
+
/**
|
|
158
|
+
* Detect and finish every incomplete plan journal of the active branch. Runs
|
|
159
|
+
* at the start of each mutating call that holds the workspace mutation lock,
|
|
160
|
+
* before that call reads or writes anything. Journals are finished in path
|
|
161
|
+
* order so the outcome does not depend on directory enumeration order.
|
|
162
|
+
*/
|
|
163
|
+
export declare function recoverPendingPlanApplyJournals(context: OperationContext, options: RecoveryOptions): Promise<PlanApplyRecovery[]>;
|
|
164
|
+
/** One line per journal a recovery actually changed, for result warnings. */
|
|
165
|
+
export declare function planRecoveryNotes(recoveries: readonly PlanApplyRecovery[]): string[];
|
|
166
|
+
/**
|
|
167
|
+
* A mutating call that settled an interrupted plan and then failed on its own
|
|
168
|
+
* work still reports the settlement in its failure text. Typed errors keep
|
|
169
|
+
* their class, code and retryability.
|
|
170
|
+
*/
|
|
171
|
+
export declare function withPlanRecoveryNotes(error: unknown, notes: readonly string[]): unknown;
|
|
172
|
+
/**
|
|
173
|
+
* Recover every pending plan journal before another mutation, then refuse
|
|
174
|
+
* that mutation while a recovered plan still has unfinished postcommit work
|
|
175
|
+
* (pending-source receipts): a later write could change the files the
|
|
176
|
+
* journal guards and leave it unrecoverable. `explicitJournalId` is the
|
|
177
|
+
* journal the caller is recovering on purpose, which reports its own
|
|
178
|
+
* unfinished work instead.
|
|
179
|
+
*/
|
|
180
|
+
export declare function settlePendingPlanApplyJournals(context: OperationContext, options: RecoveryOptions, explicitJournalId?: string): Promise<PlanApplyRecovery[]>;
|
|
181
|
+
export {};
|
|
182
|
+
//# sourceMappingURL=plan-apply-journal.d.ts.map
|
|
@@ -0,0 +1 @@
|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