kibi-cli 2.1.0 → 2.3.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-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +3 -0
- package/dist/cli-operation-metadata.d.ts +4 -0
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +5 -0
- package/dist/cli-protocol.d.ts.map +1 -1
- package/dist/cli-protocol.js +3 -2
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +4 -0
- package/dist/commands/aggregated-checks.d.ts +7 -0
- package/dist/commands/aggregated-checks.d.ts.map +1 -1
- package/dist/commands/aggregated-checks.js +25 -1
- package/dist/commands/check-diff.d.ts +5 -0
- package/dist/commands/check-diff.d.ts.map +1 -0
- package/dist/commands/check-diff.js +62 -0
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +41 -18
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +231 -86
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +168 -53
- package/dist/commands/github-init.d.ts +1 -1
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +10 -3
- package/dist/commands/init-helpers.d.ts +17 -2
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +123 -23
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +110 -15
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +10 -18
- package/dist/commands/sync/cache.d.ts +20 -1
- package/dist/commands/sync/cache.d.ts.map +1 -1
- package/dist/commands/sync/cache.js +51 -2
- package/dist/commands/sync/discovery.d.ts.map +1 -1
- package/dist/commands/sync/discovery.js +1 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +3 -1
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +8 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +11 -3
- package/dist/engine.d.ts +41 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +377 -80
- package/dist/extractors/manifest.d.ts.map +1 -1
- package/dist/extractors/manifest.js +66 -28
- package/dist/extractors/markdown.d.ts +2 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +14 -3
- package/dist/extractors/relationships.d.ts.map +1 -1
- package/dist/extractors/relationships.js +1 -0
- package/dist/extractors/symbols-coordinator.d.ts +7 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +75 -39
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +68 -29
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +4 -3
- package/dist/operations/modeling/model-requirement.d.ts +1 -1
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +176 -10
- package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-applyplan.js +14 -2
- package/dist/operations/modeling/predicate-inference-1.js +1 -1
- package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-loader.js +24 -0
- package/dist/operations/modeling/predicate-types.d.ts +4 -0
- package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
- package/dist/operations/modeling/predicate-vocabulary.d.ts +54 -0
- package/dist/operations/modeling/predicate-vocabulary.d.ts.map +1 -0
- package/dist/operations/modeling/predicate-vocabulary.js +169 -0
- package/dist/operations/modeling/requirement-types.d.ts +5 -0
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
- package/dist/operations/modeling/vocabulary-alignment.d.ts +60 -0
- package/dist/operations/modeling/vocabulary-alignment.d.ts.map +1 -0
- package/dist/operations/modeling/vocabulary-alignment.js +178 -0
- package/dist/operations/mutation/contradictions.d.ts +3 -0
- package/dist/operations/mutation/contradictions.d.ts.map +1 -1
- package/dist/operations/mutation/contradictions.js +29 -0
- package/dist/operations/mutation/delete.d.ts.map +1 -1
- package/dist/operations/mutation/delete.js +33 -1
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +8 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -0
- package/dist/operations/mutation/predicate-vocabulary-guard.js +64 -0
- package/dist/operations/mutation/relationships.d.ts +1 -1
- package/dist/operations/mutation/relationships.d.ts.map +1 -1
- package/dist/operations/mutation/relationships.js +1 -0
- package/dist/operations/mutation/saga.d.ts +5 -0
- package/dist/operations/mutation/saga.d.ts.map +1 -1
- package/dist/operations/mutation/saga.js +10 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +2 -0
- 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 +213 -52
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +5 -0
- package/dist/operations/mutation/types.d.ts +17 -0
- package/dist/operations/mutation/types.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.d.ts +6 -0
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +77 -11
- package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
- package/dist/operations/mutation/validate-upsert.js +24 -1
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +16 -3
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +66 -26
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +3 -1
- package/dist/operations/proof/code-scope.d.ts +17 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -0
- package/dist/operations/proof/code-scope.js +60 -0
- package/dist/operations/proof/ingest-proof.d.ts +4 -2
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +208 -74
- package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -1
- package/dist/operations/proof/migrate-legacy-receipts.js +7 -5
- package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
- package/dist/operations/proof/prune-receipts.js +7 -5
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
- 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 +7 -1
- package/dist/performance-trace.d.ts +17 -0
- package/dist/performance-trace.d.ts.map +1 -0
- package/dist/performance-trace.js +134 -0
- package/dist/plugins/approved-source-analyzers.d.ts +13 -0
- package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.js +77 -0
- package/dist/plugins/approved-source-analyzers.js +3 -0
- package/dist/plugins/compose-semantic-classifier.d.ts +6 -1
- package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -1
- package/dist/plugins/compose-semantic-classifier.js +8 -3
- package/dist/plugins/compose-vocabulary-alignment.d.ts +23 -0
- package/dist/plugins/compose-vocabulary-alignment.d.ts.map +1 -0
- package/dist/plugins/compose-vocabulary-alignment.js +141 -0
- package/dist/plugins/external-allowlist.d.ts +7 -0
- package/dist/plugins/external-allowlist.d.ts.map +1 -1
- package/dist/plugins/external-allowlist.js +13 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
- package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
- package/dist/plugins/maintenance-source-analysis.js +191 -0
- package/dist/plugins/registry.d.ts +3 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +27 -1
- package/dist/plugins/source-analysis-service.d.ts +36 -1
- package/dist/plugins/source-analysis-service.d.ts.map +1 -1
- package/dist/plugins/source-analysis-service.js +184 -27
- package/dist/plugins/source-change-analysis.d.ts +15 -0
- package/dist/plugins/source-change-analysis.d.ts.map +1 -0
- package/dist/plugins/source-change-analysis.js +54 -0
- package/dist/plugins/source-classification.d.ts +41 -0
- package/dist/plugins/source-classification.d.ts.map +1 -0
- package/dist/plugins/source-classification.js +490 -0
- package/dist/prolog/codec.d.ts.map +1 -1
- package/dist/prolog/codec.js +2 -0
- package/dist/prolog/swipl-resolver.d.ts +88 -0
- package/dist/prolog/swipl-resolver.d.ts.map +1 -0
- package/dist/prolog/swipl-resolver.js +446 -0
- package/dist/prolog.d.ts +51 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +145 -15
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +7 -25
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +56 -5
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +3 -1
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +4 -12
- package/dist/public/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +15 -1
- package/dist/public/impact/source-changes.d.ts.map +1 -1
- package/dist/public/impact/source-changes.js +35 -27
- package/dist/public/impact/types.d.ts +2 -0
- package/dist/public/impact/types.d.ts.map +1 -1
- package/dist/public/operations/catalog.d.ts +80 -7
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +2 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +10 -2
- package/dist/public/operations/check-helpers.d.ts +6 -0
- package/dist/public/operations/check-helpers.d.ts.map +1 -1
- package/dist/public/operations/check-helpers.js +21 -1
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +325 -8
- package/dist/public/operations/discovery-entities.d.ts +42 -2
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +195 -22
- package/dist/public/operations/discovery-executors.d.ts +1 -0
- package/dist/public/operations/discovery-executors.d.ts.map +1 -1
- package/dist/public/operations/discovery-executors.js +75 -46
- package/dist/public/operations/impact-review-preparation.d.ts +14 -0
- package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/impact-review-preparation.js +379 -0
- package/dist/public/operations/index.d.ts +2 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +2 -0
- package/dist/public/operations/migration-plan.d.ts +2 -0
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +50 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +1 -35
- package/dist/public/operations/predicate-schema-conformance.d.ts +41 -0
- package/dist/public/operations/predicate-schema-conformance.d.ts.map +1 -0
- package/dist/public/operations/predicate-schema-conformance.js +242 -0
- package/dist/public/operations/prolog-json.d.ts.map +1 -1
- package/dist/public/operations/prolog-json.js +9 -3
- package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
- package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
- package/dist/public/operations/proof-receipt-projection.js +36 -0
- package/dist/public/operations/result-envelope.d.ts +34 -1
- package/dist/public/operations/result-envelope.d.ts.map +1 -1
- package/dist/public/operations/result-envelope.js +78 -2
- package/dist/public/operations/runtime-types.d.ts +1 -1
- package/dist/public/operations/runtime-types.d.ts.map +1 -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 +8 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/discovery.d.ts +7 -1
- package/dist/public/operations/specs/discovery.d.ts.map +1 -1
- package/dist/public/operations/specs/discovery.js +7 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/specs/impact-review-preparation.js +43 -0
- package/dist/public/operations/specs/mutation-schemas.d.ts +27 -4
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +21 -3
- package/dist/public/operations/specs/reporting.d.ts +8 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +46 -15
- package/dist/public/operations/specs/upsert.d.ts +28 -5
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/specs/upsert.js +1 -1
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +8 -3
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +22 -0
- package/dist/public/schemas/relationship.d.ts.map +1 -1
- package/dist/public/schemas/relationship.js +1 -0
- package/dist/public/skills/kibi-usage/SKILL.md +7 -3
- package/dist/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -0
- package/dist/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
- package/dist/public/skills/kibi-usage/resources/source-authoring.md +36 -0
- package/dist/public/skills/kibi-usage/resources/workflows.md +52 -1
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +21 -5
- package/dist/relationships/shards.d.ts +6 -0
- package/dist/relationships/shards.d.ts.map +1 -1
- package/dist/relationships/shards.js +26 -19
- package/dist/schemas/entity.schema.json +32 -0
- package/dist/traceability/analysis-gate.d.ts +39 -0
- package/dist/traceability/analysis-gate.d.ts.map +1 -0
- package/dist/traceability/analysis-gate.js +51 -0
- package/dist/traceability/git-change-snapshot.d.ts +27 -0
- package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
- package/dist/traceability/git-change-snapshot.js +411 -0
- package/dist/traceability/git-staged.d.ts +5 -1
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +16 -11
- package/dist/traceability/impact-evaluator.d.ts +54 -0
- package/dist/traceability/impact-evaluator.d.ts.map +1 -0
- package/dist/traceability/impact-evaluator.js +270 -0
- package/dist/traceability/impact-git-tree.d.ts +12 -0
- package/dist/traceability/impact-git-tree.d.ts.map +1 -0
- package/dist/traceability/impact-git-tree.js +46 -0
- package/dist/traceability/impact-knowledge.d.ts +16 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -0
- package/dist/traceability/impact-knowledge.js +165 -0
- package/dist/traceability/impact-policy.d.ts +15 -0
- package/dist/traceability/impact-policy.d.ts.map +1 -0
- package/dist/traceability/impact-policy.js +48 -0
- package/dist/traceability/impact-policy.v1.schema.json +48 -0
- package/dist/traceability/impact-pr-diff.d.ts +5 -0
- package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
- package/dist/traceability/impact-pr-diff.js +83 -0
- package/dist/traceability/impact-record-validation.d.ts +9 -0
- package/dist/traceability/impact-record-validation.d.ts.map +1 -0
- package/dist/traceability/impact-record-validation.js +113 -0
- package/dist/traceability/impact-review.d.ts +148 -0
- package/dist/traceability/impact-review.d.ts.map +1 -0
- package/dist/traceability/impact-review.js +494 -0
- package/dist/traceability/impact-review.schema.json +365 -0
- package/dist/traceability/impact-side-evidence.d.ts +13 -0
- package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
- package/dist/traceability/impact-side-evidence.js +240 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
- package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
- package/dist/traceability/snapshot-knowledge.d.ts +4 -0
- package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
- package/dist/traceability/snapshot-knowledge.js +98 -0
- package/dist/traceability/staged-diagnostics.d.ts +1 -1
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-entity-id-style.d.ts +12 -0
- package/dist/traceability/staged-entity-id-style.d.ts.map +1 -0
- package/dist/traceability/staged-entity-id-style.js +68 -0
- package/dist/traceability/staged-file-coverage.d.ts +23 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +2 -16
- package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +17 -6
- package/dist/traceability/symbol-extract.d.ts +3 -5
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +49 -34
- package/dist/traceability/temp-kb.d.ts +1 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +57 -13
- package/dist/traceability/trusted-pr-event.d.ts +13 -0
- package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
- package/dist/traceability/trusted-pr-event.js +105 -0
- package/dist/traceability/validate.js +1 -1
- package/dist/types/entities.d.ts +2 -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/canonical-path.d.ts +3 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +33 -0
- package/dist/utils/entity-id-style.d.ts +27 -0
- package/dist/utils/entity-id-style.d.ts.map +1 -0
- package/dist/utils/entity-id-style.js +81 -0
- package/dist/utils/git-repository-context.d.ts +50 -0
- package/dist/utils/git-repository-context.d.ts.map +1 -0
- package/dist/utils/git-repository-context.js +259 -0
- package/dist/utils/rule-registry.d.ts +5 -0
- package/dist/utils/rule-registry.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +37 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +44 -0
- package/dist/utils/strict-modeling.d.ts +7 -0
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +11 -0
- package/package.json +14 -5
- package/schema/entities.pl +60 -1
- package/schema/relationships.pl +17 -4
- package/schema/validation.pl +118 -20
- package/src/public/diagnostic-usage.ts +16 -24
- package/src/public/impact/analyzer.ts +88 -5
- package/src/public/impact/diagnostics.ts +7 -5
- package/src/public/impact/full-kb-quality.ts +4 -16
- package/src/public/impact/manifest.ts +14 -1
- package/src/public/impact/source-changes.ts +39 -34
- package/src/public/impact/types.ts +5 -0
- package/src/public/operations/catalog.ts +2 -0
- package/src/public/operations/check-executor.ts +12 -1
- package/src/public/operations/check-helpers.ts +27 -1
- package/src/public/operations/contracts.ts +404 -9
- package/src/public/operations/discovery-entities.ts +292 -23
- package/src/public/operations/discovery-executors.ts +91 -55
- package/src/public/operations/impact-review-preparation.ts +548 -0
- package/src/public/operations/index.ts +2 -0
- package/src/public/operations/migration-plan.ts +57 -0
- package/src/public/operations/node-ports.ts +1 -39
- package/src/public/operations/predicate-schema-conformance.ts +362 -0
- package/src/public/operations/prolog-json.ts +9 -3
- package/src/public/operations/proof-receipt-projection.ts +39 -0
- package/src/public/operations/result-envelope.ts +114 -2
- package/src/public/operations/runtime-types.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +8 -1
- package/src/public/operations/specs/discovery.ts +8 -1
- package/src/public/operations/specs/impact-review-preparation.ts +46 -0
- package/src/public/operations/specs/mutation-schemas.ts +23 -3
- package/src/public/operations/specs/reporting.ts +69 -22
- package/src/public/operations/specs/upsert.ts +1 -1
- package/src/public/operations/symbol-repair-plan.ts +13 -3
- package/src/public/operations/types.ts +1 -0
- package/src/public/schemas/entity.ts +22 -0
- package/src/public/schemas/relationship.ts +1 -0
- package/src/public/skills/kibi-usage/SKILL.md +7 -3
- package/src/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +1 -0
- package/src/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
- package/src/public/skills/kibi-usage/resources/source-authoring.md +36 -0
- package/src/public/skills/kibi-usage/resources/workflows.md +52 -1
- package/src/public/telemetry-acceptance.ts +37 -6
- package/src/schemas/entity.schema.json +32 -0
- package/src/schemas/relationship.schema.json +1 -0
- package/src/traceability/impact-policy.v1.schema.json +48 -0
- package/src/traceability/impact-review.schema.json +365 -0
- package/templates/github/kibi-badge.yml +0 -4
- package/templates/github/kibi-report.yml +0 -4
|
@@ -2,9 +2,11 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { isDeepStrictEqual } from "node:util";
|
|
5
6
|
import { dump as dumpYaml, load as loadYaml } from "js-yaml";
|
|
6
7
|
import { parseDocument, stringify } from "yaml";
|
|
7
8
|
import { OperationError } from "../../cli-errors.js";
|
|
9
|
+
import { canonicalFilesystemPath } from "../../utils/canonical-path.js";
|
|
8
10
|
import { CANONICAL_ENTITY_PATHS, isDerivedKbPath, } from "../../utils/kb-paths.js";
|
|
9
11
|
function digest(value) {
|
|
10
12
|
return createHash("sha256").update(value).digest("hex");
|
|
@@ -22,6 +24,26 @@ export function writePendingSourceReceipt(workspaceRoot, relativePath, afterHash
|
|
|
22
24
|
createdAt: new Date().toISOString(),
|
|
23
25
|
}, null, 2)}\n`, { mode: 0o600 });
|
|
24
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Retire the pending receipt of a source that a committed plan deleted. A
|
|
29
|
+
* receipt binds untracked input to exact bytes, so one left behind for a
|
|
30
|
+
* removed file makes every later sync fail on a missing pending source.
|
|
31
|
+
*/
|
|
32
|
+
// implements REQ-core-atomic-upsert-persistence, REQ-kibi-operation-interface-parity
|
|
33
|
+
export function retirePendingSourceReceipt(workspaceRoot, relativePath) {
|
|
34
|
+
try {
|
|
35
|
+
fs.unlinkSync(pendingReceiptPath(workspaceRoot, relativePath));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error.code !== "ENOENT")
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Authored YAML round-trips keep long scalars on one line, matching sync and
|
|
44
|
+
* coordinate refresh output, so editing one entry never refolds the others.
|
|
45
|
+
*/
|
|
46
|
+
const AUTHORED_YAML_OPTIONS = { lineWidth: 0 };
|
|
25
47
|
function authoredPath(value) {
|
|
26
48
|
if (typeof value !== "string" || !value.trim())
|
|
27
49
|
return undefined;
|
|
@@ -49,21 +71,24 @@ export function resolveContainedSourcePath(workspaceRoot, relative) {
|
|
|
49
71
|
throw new OperationError("SOURCE_PATH_INVALID", `document.path cannot target Kibi's derived state under ${workspaceRelative}: ${relative}`);
|
|
50
72
|
}
|
|
51
73
|
// A symlinked existing file or parent could otherwise escape the workspace.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
const real = fs.realpathSync.native(existing);
|
|
57
|
-
if (real !== root && !real.startsWith(`${root}${path.sep}`)) {
|
|
74
|
+
const realRoot = canonicalFilesystemPath(root);
|
|
75
|
+
const real = canonicalFilesystemPath(absolute);
|
|
76
|
+
if (real !== realRoot && !real.startsWith(`${realRoot}${path.sep}`)) {
|
|
58
77
|
throw new OperationError("SOURCE_PATH_INVALID", `document.path resolves outside the workspace: ${relative}`);
|
|
59
78
|
}
|
|
60
79
|
return absolute;
|
|
61
80
|
}
|
|
62
81
|
export function normalizeAuthoredSourcePath(workspaceRoot, source) {
|
|
63
82
|
const normalized = source.replaceAll("\\", "/");
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
83
|
+
const root = path.resolve(workspaceRoot);
|
|
84
|
+
let relative = normalized;
|
|
85
|
+
if (path.isAbsolute(normalized)) {
|
|
86
|
+
const absolute = path.resolve(normalized);
|
|
87
|
+
relative =
|
|
88
|
+
absolute === root || absolute.startsWith(`${root}${path.sep}`)
|
|
89
|
+
? path.relative(root, absolute)
|
|
90
|
+
: path.relative(canonicalFilesystemPath(root), canonicalFilesystemPath(absolute));
|
|
91
|
+
}
|
|
67
92
|
return path
|
|
68
93
|
.relative(path.resolve(workspaceRoot), resolveContainedSourcePath(workspaceRoot, relative))
|
|
69
94
|
.replaceAll(path.sep, "/");
|
|
@@ -226,13 +251,97 @@ export function manifestRelationships(item) {
|
|
|
226
251
|
: [];
|
|
227
252
|
});
|
|
228
253
|
}
|
|
229
|
-
|
|
254
|
+
// implements REQ-source-analysis-v2
|
|
255
|
+
function manifestRecord(item) {
|
|
256
|
+
if (item === null ||
|
|
257
|
+
typeof item !== "object" ||
|
|
258
|
+
!("toJSON" in item) ||
|
|
259
|
+
typeof item.toJSON !== "function") {
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
const value = item.toJSON();
|
|
263
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
264
|
+
? value
|
|
265
|
+
: undefined;
|
|
266
|
+
}
|
|
267
|
+
// implements REQ-source-analysis-v2
|
|
268
|
+
function failDuplicateConflict(entityId, field) {
|
|
269
|
+
throw new OperationError("SOURCE_DUPLICATE_CONFLICT", `Duplicate symbol ${entityId} has conflicting authored field "${field}"; no source was written`, false);
|
|
270
|
+
}
|
|
271
|
+
// implements REQ-source-analysis-v2
|
|
272
|
+
function mergeCompatibleManifestField(target, field, value, entityId, conflictField = field) {
|
|
273
|
+
if (Object.hasOwn(target, field)) {
|
|
274
|
+
if (!isDeepStrictEqual(target[field], value)) {
|
|
275
|
+
failDuplicateConflict(entityId, conflictField);
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
Object.defineProperty(target, field, {
|
|
280
|
+
configurable: true,
|
|
281
|
+
enumerable: true,
|
|
282
|
+
value,
|
|
283
|
+
writable: true,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
// implements REQ-source-analysis-v2
|
|
287
|
+
function mergeDuplicateManifestFields(records, entityId) {
|
|
288
|
+
const merged = Object.create(null);
|
|
289
|
+
for (const record of records) {
|
|
290
|
+
// Links and typed relationships are collections, so merge them separately
|
|
291
|
+
// instead of treating a difference as conflicting scalar metadata.
|
|
292
|
+
const authored = Object.fromEntries(Object.entries(symbolManifestRecord(record)).filter(([key]) => key !== "links"));
|
|
293
|
+
for (const [key, value] of Object.entries(authored)) {
|
|
294
|
+
mergeCompatibleManifestField(merged, key, value, entityId);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return merged;
|
|
298
|
+
}
|
|
299
|
+
// implements REQ-source-analysis-v2
|
|
300
|
+
function manifestRelationshipRecords(record, entityId) {
|
|
301
|
+
if (record.relationships === undefined)
|
|
302
|
+
return [];
|
|
303
|
+
if (!Array.isArray(record.relationships)) {
|
|
304
|
+
failDuplicateConflict(entityId, "relationships");
|
|
305
|
+
}
|
|
306
|
+
return record.relationships;
|
|
307
|
+
}
|
|
308
|
+
// implements REQ-source-analysis-v2
|
|
309
|
+
function mergeManifestRelationshipRecords(records, incoming, entityId) {
|
|
230
310
|
const merged = new Map();
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
311
|
+
const untyped = [];
|
|
312
|
+
for (const record of records) {
|
|
313
|
+
for (const row of manifestRelationshipRecords(record, entityId)) {
|
|
314
|
+
if (row === null || typeof row !== "object" || Array.isArray(row)) {
|
|
315
|
+
if (!untyped.some((value) => isDeepStrictEqual(value, row))) {
|
|
316
|
+
untyped.push(row);
|
|
317
|
+
}
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
const candidate = row;
|
|
321
|
+
const type = candidate.type;
|
|
322
|
+
const target = candidate.target ?? candidate.to;
|
|
323
|
+
if (typeof type !== "string" || typeof target !== "string") {
|
|
324
|
+
if (!untyped.some((value) => isDeepStrictEqual(value, row))) {
|
|
325
|
+
untyped.push(row);
|
|
326
|
+
}
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
const key = `${type}\u0000${target}`;
|
|
330
|
+
const normalized = {
|
|
331
|
+
...Object.fromEntries(Object.entries(candidate).filter(([key]) => key !== "to")),
|
|
332
|
+
type,
|
|
333
|
+
target,
|
|
334
|
+
};
|
|
335
|
+
const previous = merged.get(key);
|
|
336
|
+
if (previous) {
|
|
337
|
+
for (const [field, value] of Object.entries(normalized)) {
|
|
338
|
+
mergeCompatibleManifestField(previous, field, value, entityId, `relationship ${type} -> ${target}.${field}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
merged.set(key, normalized);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
236
345
|
}
|
|
237
346
|
for (const relationship of incoming) {
|
|
238
347
|
if (relationship.from !== entityId ||
|
|
@@ -240,19 +349,63 @@ function mergeManifestRelationships(existing, incoming, entityId) {
|
|
|
240
349
|
typeof relationship.to !== "string") {
|
|
241
350
|
continue;
|
|
242
351
|
}
|
|
243
|
-
const
|
|
244
|
-
|
|
352
|
+
const key = `${relationship.type}\u0000${relationship.to}`;
|
|
353
|
+
const normalized = {
|
|
354
|
+
...Object.fromEntries(Object.entries(relationship).filter(([key]) => key !== "from" && key !== "to")),
|
|
355
|
+
type: relationship.type,
|
|
356
|
+
target: relationship.to,
|
|
357
|
+
};
|
|
358
|
+
const previous = merged.get(key);
|
|
359
|
+
if (previous) {
|
|
360
|
+
for (const [field, value] of Object.entries(normalized)) {
|
|
361
|
+
mergeCompatibleManifestField(previous, field, value, entityId, `relationship ${relationship.type} -> ${relationship.to}.${field}`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
merged.set(key, normalized);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return [
|
|
369
|
+
...[...merged.values()].sort((left, right) => `${String(left.type)}\u0000${String(left.target)}`.localeCompare(`${String(right.type)}\u0000${String(right.target)}`)),
|
|
370
|
+
...untyped,
|
|
371
|
+
];
|
|
372
|
+
}
|
|
373
|
+
// implements REQ-source-analysis-v2
|
|
374
|
+
function mergeManifestLinks(records, entity) {
|
|
375
|
+
const values = [
|
|
376
|
+
...records.map((record) => record.links),
|
|
377
|
+
entity.links,
|
|
378
|
+
].filter((value) => value !== undefined);
|
|
379
|
+
if (values.length === 0)
|
|
380
|
+
return undefined;
|
|
381
|
+
const links = [];
|
|
382
|
+
for (const value of values) {
|
|
383
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
384
|
+
for (const entry of entries) {
|
|
385
|
+
if (!links.some((existing) => isDeepStrictEqual(existing, entry))) {
|
|
386
|
+
links.push(entry);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
245
389
|
}
|
|
246
|
-
return
|
|
390
|
+
return links;
|
|
391
|
+
}
|
|
392
|
+
/** Indexes of every manifest entry whose `id` equals `id`, in file order. */
|
|
393
|
+
function symbolManifestIndexes(items, id) {
|
|
394
|
+
return items.flatMap((item, index) => item &&
|
|
395
|
+
typeof item === "object" &&
|
|
396
|
+
"get" in item &&
|
|
397
|
+
String(item.get("id")) === id
|
|
398
|
+
? [index]
|
|
399
|
+
: []);
|
|
247
400
|
}
|
|
248
401
|
function renderSymbolManifest(entity, relationships, existingContent) {
|
|
249
402
|
if (existingContent === undefined) {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}));
|
|
255
|
-
return doc.toString();
|
|
403
|
+
const created = symbolManifestRecord(entity);
|
|
404
|
+
const rows = mergeManifestRelationshipRecords([], relationships, String(entity.id));
|
|
405
|
+
if (rows.length > 0)
|
|
406
|
+
created.relationships = rows;
|
|
407
|
+
const doc = parseDocument(stringify({ symbols: [created] }));
|
|
408
|
+
return doc.toString(AUTHORED_YAML_OPTIONS);
|
|
256
409
|
}
|
|
257
410
|
const doc = parseDocument(existingContent);
|
|
258
411
|
const symbols = doc.get("symbols", true);
|
|
@@ -261,31 +414,40 @@ function renderSymbolManifest(entity, relationships, existingContent) {
|
|
|
261
414
|
}
|
|
262
415
|
const items = symbols.items;
|
|
263
416
|
const id = String(entity.id);
|
|
264
|
-
const
|
|
417
|
+
const indices = items.flatMap((item, index) => {
|
|
265
418
|
if (!item || typeof item !== "object" || !("get" in item))
|
|
266
|
-
return
|
|
267
|
-
return String(item.get("id")) === id
|
|
419
|
+
return [];
|
|
420
|
+
return String(item.get("id")) === id
|
|
421
|
+
? [index]
|
|
422
|
+
: [];
|
|
268
423
|
});
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
424
|
+
const existingRecords = indices
|
|
425
|
+
.map((index) => manifestRecord(items[index]))
|
|
426
|
+
.filter((record) => record !== undefined);
|
|
427
|
+
if (existingRecords.length !== indices.length) {
|
|
428
|
+
failDuplicateConflict(id, "record");
|
|
429
|
+
}
|
|
430
|
+
const previous = mergeDuplicateManifestFields(existingRecords, id);
|
|
431
|
+
const next = { ...previous, ...symbolManifestRecord(entity) };
|
|
432
|
+
const mergedRelationships = mergeManifestRelationshipRecords(existingRecords, relationships, id);
|
|
433
|
+
if (mergedRelationships.length > 0) {
|
|
434
|
+
next.relationships = mergedRelationships;
|
|
435
|
+
}
|
|
436
|
+
const mergedLinks = mergeManifestLinks(existingRecords, entity);
|
|
437
|
+
if (mergedLinks !== undefined)
|
|
438
|
+
next.links = mergedLinks;
|
|
439
|
+
if (indices.length > 0) {
|
|
440
|
+
// Patch one canonical row and remove all redundant copies only after
|
|
441
|
+
// compatible authored fields and all links have been merged successfully.
|
|
442
|
+
doc.setIn(["symbols", indices[0]], next);
|
|
443
|
+
for (const duplicateIndex of indices.slice(1).reverse()) {
|
|
444
|
+
items.splice(duplicateIndex, 1);
|
|
282
445
|
}
|
|
283
|
-
doc.setIn(["symbols", index], next);
|
|
284
446
|
}
|
|
285
447
|
else {
|
|
286
448
|
doc.addIn(["symbols"], next);
|
|
287
449
|
}
|
|
288
|
-
return doc.toString();
|
|
450
|
+
return doc.toString(AUTHORED_YAML_OPTIONS);
|
|
289
451
|
}
|
|
290
452
|
export function renderSourceDeletion(sourcePathValue, entityId, entityType, existingContent) {
|
|
291
453
|
const extension = path.extname(sourcePathValue).toLowerCase();
|
|
@@ -306,16 +468,15 @@ export function renderSourceDeletion(sourcePathValue, entityId, entityType, exis
|
|
|
306
468
|
throw new OperationError("SOURCE_FORMAT_INVALID", "Symbol manifest must contain a symbols array");
|
|
307
469
|
}
|
|
308
470
|
const items = symbols.items;
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
return false;
|
|
312
|
-
return (String(item.get("id")) === entityId);
|
|
313
|
-
});
|
|
314
|
-
if (index < 0) {
|
|
471
|
+
const matches = symbolManifestIndexes(items, entityId);
|
|
472
|
+
if (matches.length === 0) {
|
|
315
473
|
throw new OperationError("SOURCE_ENTITY_MISMATCH", `Symbol manifest ${sourcePathValue} does not contain ${entityId}`);
|
|
316
474
|
}
|
|
317
|
-
|
|
318
|
-
|
|
475
|
+
// Delete every copy, last first so earlier indexes stay valid.
|
|
476
|
+
for (const match of [...matches].reverse()) {
|
|
477
|
+
doc.deleteIn(["symbols", match]);
|
|
478
|
+
}
|
|
479
|
+
return { mode: "write", body: doc.toString(AUTHORED_YAML_OPTIONS) };
|
|
319
480
|
}
|
|
320
481
|
throw new OperationError("SOURCE_FORMAT_UNSUPPORTED", `Unsupported authored source format: ${extension || "unknown"}`);
|
|
321
482
|
}
|
|
@@ -381,7 +542,7 @@ export function renderMarkdownRelationshipDeletion(sourcePathValue, existingCont
|
|
|
381
542
|
return { body: existingContent, removed: false };
|
|
382
543
|
const body = existingContent.slice(marker + "\n---".length);
|
|
383
544
|
return {
|
|
384
|
-
body: `---\n${frontmatter.toString()}---${body.startsWith("\n") ? "" : "\n"}${body}`,
|
|
545
|
+
body: `---\n${frontmatter.toString(AUTHORED_YAML_OPTIONS)}---${body.startsWith("\n") ? "" : "\n"}${body}`,
|
|
385
546
|
removed: true,
|
|
386
547
|
};
|
|
387
548
|
}
|
|
@@ -437,7 +598,7 @@ export function renderYamlRelationshipDeletion(sourcePathValue, existingContent,
|
|
|
437
598
|
}
|
|
438
599
|
}
|
|
439
600
|
return removed
|
|
440
|
-
? { body: doc.toString(), removed: true }
|
|
601
|
+
? { body: doc.toString(AUTHORED_YAML_OPTIONS), removed: true }
|
|
441
602
|
: { body: existingContent, removed: false };
|
|
442
603
|
}
|
|
443
604
|
function renderSourceDocument(input, entity, existingContent, relativePath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strict-fact.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/strict-fact.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAarD;AAGD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,MAAM,EAAE,CA+EV;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,OAAO,EACtB,aAAa,EAAE,OAAO,GACrB,IAAI,CAUN;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,IAAI,CAmDN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validateLogicIr } from "../../logic/ir.js";
|
|
2
|
+
import { predicateVocabularyErrors } from "../modeling/predicate-vocabulary.js";
|
|
2
3
|
const PROPERTY_VALUE_FIELDS = [
|
|
3
4
|
"value_string",
|
|
4
5
|
"value_int",
|
|
@@ -106,6 +107,10 @@ export function validateFactModelingShape(entity) {
|
|
|
106
107
|
if (hints.length > 0) {
|
|
107
108
|
throw new Error(`Entity validation failed: ${hints.join("; ")}`);
|
|
108
109
|
}
|
|
110
|
+
const vocabularyErrors = predicateVocabularyErrors(entity);
|
|
111
|
+
if (vocabularyErrors.length > 0) {
|
|
112
|
+
throw new Error(`Entity validation failed: ${vocabularyErrors.join("; ")}`);
|
|
113
|
+
}
|
|
109
114
|
if (entity.type === "fact" && entity.fact_kind === "rule") {
|
|
110
115
|
const validation = validateLogicIr(entity.rule_ir);
|
|
111
116
|
if (!validation.valid || !validation.semanticKey) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SemanticAdvisorReceipt } from "../semantic-advisor/types.js";
|
|
2
|
+
import type { SagaRollbackFailure } from "./saga.js";
|
|
2
3
|
export type RelationshipInput = Readonly<Record<string, unknown>>;
|
|
3
4
|
export type UpsertInput = {
|
|
4
5
|
readonly type: string;
|
|
@@ -48,6 +49,20 @@ export type UpsertPayload = {
|
|
|
48
49
|
readonly checked_req_id: string;
|
|
49
50
|
readonly strict_readiness: string;
|
|
50
51
|
};
|
|
52
|
+
readonly deferredCommit?: DeferredUpsertCommit;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Internal lifecycle for source writes prepared ahead of a batched Prolog
|
|
56
|
+
* commit. Finalization crosses the compiled commit boundary and permanently
|
|
57
|
+
* disables source rollback for that mutation.
|
|
58
|
+
*/
|
|
59
|
+
export type DeferredUpsertCommit = {
|
|
60
|
+
readonly entity: Readonly<Record<string, unknown>>;
|
|
61
|
+
readonly relationships: readonly RelationshipInput[];
|
|
62
|
+
readonly skipContradictionCheck: boolean;
|
|
63
|
+
readonly state: "prepared" | "rolling_back" | "rolled_back" | "committed";
|
|
64
|
+
readonly finalize: () => void;
|
|
65
|
+
readonly rollback: () => Promise<readonly SagaRollbackFailure[]>;
|
|
51
66
|
};
|
|
52
67
|
export type ValidateUpsertPayload = {
|
|
53
68
|
readonly valid: boolean;
|
|
@@ -74,6 +89,8 @@ export type DeletePayload = {
|
|
|
74
89
|
readonly error_codes?: readonly Readonly<Record<string, unknown>>[];
|
|
75
90
|
readonly relationship_results?: readonly Record<string, unknown>[];
|
|
76
91
|
readonly sync_required?: boolean;
|
|
92
|
+
/** Declared effects this call did not perform, such as a plan-only result. */
|
|
93
|
+
readonly skippedEffects?: readonly string[];
|
|
77
94
|
readonly sourceWrites?: readonly {
|
|
78
95
|
readonly path: string;
|
|
79
96
|
readonly mode?: "write" | "delete";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -18,6 +18,12 @@ export type UpsertExecutionOptions = Readonly<{
|
|
|
18
18
|
* entries. Everything else keeps the append-only invariant fail-closed.
|
|
19
19
|
*/
|
|
20
20
|
readonly allowReceiptsPrune?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Prepare source and validation, then return the commit payload without
|
|
23
|
+
* talking to Prolog. Proof ingest batches those payloads into one
|
|
24
|
+
* transaction.
|
|
25
|
+
*/
|
|
26
|
+
readonly deferCompiledCommit?: boolean;
|
|
21
27
|
}>;
|
|
22
28
|
export declare function executeUpsert(input: UpsertInput, context: OperationContext, options?: UpsertExecutionOptions): Promise<OperationResult<UpsertPayload>>;
|
|
23
29
|
//# sourceMappingURL=upsert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAqCxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoGhF,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAuBvC;AAmCD,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C;;;;;;OAMG;IAEH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC,CAAC;AAEH,wBAAsB,aAAa,CACjC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAshBzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { existsSync, readFileSync,
|
|
2
|
+
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { OperationError } from "../../cli-errors.js";
|
|
5
5
|
import { readManifestWithCoordinateOverlay } from "../../extractors/manifest.js";
|
|
@@ -9,11 +9,14 @@ import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
|
9
9
|
import { appendOnlyProofReceiptHistoryErrors } from "../../public/proof-receipt.js";
|
|
10
10
|
import { appendRelationship, computeShardPath, } from "../../relationships/shards.js";
|
|
11
11
|
import { resolveBranchAttachment } from "../../utils/branch-resolver.js";
|
|
12
|
+
import { canonicalFilesystemPath } from "../../utils/canonical-path.js";
|
|
13
|
+
import { entityIdStyleWarnings } from "../../utils/entity-id-style.js";
|
|
12
14
|
import { analyzeSemanticAdvisorInput } from "../semantic-advisor/analyze-prose.js";
|
|
13
15
|
import { assertLogicalGroundingClaimKeys, assertSemanticInventoryBoundary, } from "../semantic-advisor/ingestion-boundary.js";
|
|
14
16
|
import { buildUpsertCommitGoal, formatUpsertError } from "./contradictions.js";
|
|
17
|
+
import { assertPredicateArgumentVocabulary } from "./predicate-vocabulary-guard.js";
|
|
15
18
|
import { existingRelationships, validateLiveRelationshipTargets, validateRelationshipSources, validateStrictLanePairing, validateSupersedesSourceHistory, } from "./relationships.js";
|
|
16
|
-
import { MutationSaga } from "./saga.js";
|
|
19
|
+
import { MutationRollbackFailureError, MutationSaga } from "./saga.js";
|
|
17
20
|
import { writePendingSourceReceipt, writeSourceForUpsert, } from "./source-authoring.js";
|
|
18
21
|
import { acquireSymbolCompilerLock, releaseSymbolCompilerLock, } from "./symbol-compiler-lock.js";
|
|
19
22
|
import { validateSymbolGranularity } from "./symbol-granularity.js";
|
|
@@ -55,12 +58,9 @@ function assertRelationshipShardContained(workspaceRoot, shardPath) {
|
|
|
55
58
|
if (!absolute.startsWith(`${relationshipRoot}${path.sep}`)) {
|
|
56
59
|
throw new OperationError("SOURCE_PATH_INVALID", `Relationship shard escapes the canonical workspace lane: ${shardPath}`);
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
const real = realpathSync.native(existing);
|
|
63
|
-
if (real !== root && !real.startsWith(`${root}${path.sep}`)) {
|
|
61
|
+
const realRoot = canonicalFilesystemPath(root);
|
|
62
|
+
const real = canonicalFilesystemPath(absolute);
|
|
63
|
+
if (real !== realRoot && !real.startsWith(`${realRoot}${path.sep}`)) {
|
|
64
64
|
throw new OperationError("SOURCE_PATH_INVALID", `Relationship shard follows a symlink outside the workspace: ${shardPath}`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -220,6 +220,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
220
220
|
semanticAdvisor = semantic.receipt;
|
|
221
221
|
assertSemanticInventoryBoundary({ ...input, relationships }, relationships, semantic.receipt);
|
|
222
222
|
await assertLogicalGroundingClaimKeys(prolog, { ...input, relationships }, relationships);
|
|
223
|
+
await assertPredicateArgumentVocabulary(prolog, validated.entity);
|
|
223
224
|
if (context.fs !== undefined && context.sourceFirst !== false) {
|
|
224
225
|
const existingRows = await loadEntities(prolog, {
|
|
225
226
|
id: input.id,
|
|
@@ -329,6 +330,57 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
329
330
|
source: sourceWrite.receipt.path,
|
|
330
331
|
};
|
|
331
332
|
}
|
|
333
|
+
if (options.deferCompiledCommit === true) {
|
|
334
|
+
let deferredState = "prepared";
|
|
335
|
+
let rollbackPromise;
|
|
336
|
+
const deferredCommit = {
|
|
337
|
+
entity: commitEntity ?? validated.entity,
|
|
338
|
+
relationships: validated.relationships,
|
|
339
|
+
skipContradictionCheck: input._skipContradictionCheck === true,
|
|
340
|
+
get state() {
|
|
341
|
+
return deferredState;
|
|
342
|
+
},
|
|
343
|
+
finalize: () => {
|
|
344
|
+
if (deferredState !== "prepared") {
|
|
345
|
+
throw new Error(`Cannot finalize deferred upsert ${input.id} from state ${deferredState}`);
|
|
346
|
+
}
|
|
347
|
+
saga.markCommitted();
|
|
348
|
+
deferredState = "committed";
|
|
349
|
+
},
|
|
350
|
+
rollback: () => {
|
|
351
|
+
if (deferredState === "committed") {
|
|
352
|
+
return Promise.reject(new Error(`Cannot roll back deferred upsert ${input.id} after its compiled commit`));
|
|
353
|
+
}
|
|
354
|
+
if (deferredState === "rolled_back")
|
|
355
|
+
return Promise.resolve([]);
|
|
356
|
+
if (rollbackPromise !== undefined)
|
|
357
|
+
return rollbackPromise;
|
|
358
|
+
deferredState = "rolling_back";
|
|
359
|
+
rollbackPromise = saga.rollback().then((failures) => {
|
|
360
|
+
deferredState = "rolled_back";
|
|
361
|
+
return failures;
|
|
362
|
+
});
|
|
363
|
+
return rollbackPromise;
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
return {
|
|
367
|
+
content: [
|
|
368
|
+
{
|
|
369
|
+
type: "text",
|
|
370
|
+
text: `Prepared ${input.id} for a batched proof commit.`,
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
structuredContent: {
|
|
374
|
+
created: 0,
|
|
375
|
+
updated: 0,
|
|
376
|
+
relationships_created: validated.relationships.length,
|
|
377
|
+
warnings: semantic.warnings,
|
|
378
|
+
semanticAdvisor: semantic.receipt,
|
|
379
|
+
deferredCommit,
|
|
380
|
+
...(sourceWrite ? { sourceWrites: [sourceWrite.receipt] } : {}),
|
|
381
|
+
},
|
|
382
|
+
};
|
|
383
|
+
}
|
|
332
384
|
const transaction = buildUpsertCommitGoal({
|
|
333
385
|
entity: commitEntity ?? validated.entity,
|
|
334
386
|
relationships: validated.relationships,
|
|
@@ -349,6 +401,15 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
349
401
|
}
|
|
350
402
|
const coverage = await scenarioCoverageWarnings(prolog, validated.relationships, input.type, input.id);
|
|
351
403
|
const created = changeKind === "created" ? 1 : 0;
|
|
404
|
+
const idStyleWarnings = created === 1
|
|
405
|
+
? entityIdStyleWarnings({
|
|
406
|
+
id: input.id,
|
|
407
|
+
sourcePath: sourceWrite?.receipt.path ??
|
|
408
|
+
(typeof validated.entity.source === "string"
|
|
409
|
+
? validated.entity.source
|
|
410
|
+
: undefined),
|
|
411
|
+
})
|
|
412
|
+
: [];
|
|
352
413
|
const shardWarnings = [];
|
|
353
414
|
const relationshipSourceWrites = [];
|
|
354
415
|
for (const [shardPath, before] of relationshipShardBefore) {
|
|
@@ -382,7 +443,12 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
382
443
|
created,
|
|
383
444
|
updated: changeKind === "updated" ? 1 : 0,
|
|
384
445
|
relationships_created: validated.relationships.length,
|
|
385
|
-
warnings: [
|
|
446
|
+
warnings: [
|
|
447
|
+
...semantic.warnings,
|
|
448
|
+
...coverage,
|
|
449
|
+
...idStyleWarnings,
|
|
450
|
+
...shardWarnings,
|
|
451
|
+
],
|
|
386
452
|
semanticAdvisor: semantic.receipt,
|
|
387
453
|
...(shardWarnings.length > 0
|
|
388
454
|
? {
|
|
@@ -480,7 +546,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
480
546
|
}
|
|
481
547
|
const coordinateFailure = rollbackFailures.find((failure) => failure.step === "symbol-coordinates");
|
|
482
548
|
if (coordinateFailure !== undefined) {
|
|
483
|
-
const failure = new
|
|
549
|
+
const failure = new MutationRollbackFailureError([error, coordinateFailure.error], `Upsert failed and coordinate artifact rollback failed for ${input.id}`, rollbackFailures);
|
|
484
550
|
operationFailure = { error: failure };
|
|
485
551
|
throw failure;
|
|
486
552
|
}
|
|
@@ -489,7 +555,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
489
555
|
const rollbackMessage = sourceFailure.error instanceof Error
|
|
490
556
|
? sourceFailure.error.message
|
|
491
557
|
: String(sourceFailure.error);
|
|
492
|
-
const failure = new
|
|
558
|
+
const failure = new MutationRollbackFailureError([error, sourceFailure.error], `Upsert failed and authored source rollback failed for ${input.id}: ${rollbackMessage}`, rollbackFailures);
|
|
493
559
|
operationFailure = { error: failure };
|
|
494
560
|
throw failure;
|
|
495
561
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/validate-upsert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAcxE,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAerE,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAoGjD"}
|