@agent-teams/engineering-foundation 0.15.0 → 0.16.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/README.md +66 -8
- package/dist/capability-runtime.d.ts +2 -1
- package/dist/capability-runtime.d.ts.map +1 -1
- package/dist/capability-runtime.js +1 -1
- package/dist/capability-runtime.js.map +1 -1
- package/dist/check-contract.d.ts +2 -1
- package/dist/check-contract.d.ts.map +1 -1
- package/dist/check-runner.d.ts.map +1 -1
- package/dist/check-runner.js +6 -2
- package/dist/check-runner.js.map +1 -1
- package/dist/cli-arguments.d.ts +6 -0
- package/dist/cli-arguments.d.ts.map +1 -1
- package/dist/cli-arguments.js +179 -49
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli.js +16 -10
- package/dist/cli.js.map +1 -1
- package/dist/command-error.d.ts +14 -0
- package/dist/command-error.d.ts.map +1 -0
- package/dist/command-error.js +98 -0
- package/dist/command-error.js.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.d.ts +5 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.d.ts.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.js +36 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-failure.js.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.d.ts +6 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.d.ts.map +1 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.js +127 -0
- package/dist/document-authoring/adapters/inbound/cli/document-command-renderer.js.map +1 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts +4 -2
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js +129 -2
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.d.ts +17 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.js +49 -0
- package/dist/document-authoring/adapters/node/node-document-environment-inspector.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.js +183 -0
- package/dist/document-authoring/adapters/node/node-document-file-state.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.js +18 -0
- package/dist/document-authoring/adapters/node/node-document-journal-slot.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.d.ts +36 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-faults.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store-private.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.d.ts +22 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.js +339 -0
- package/dist/document-authoring/adapters/node/node-document-journal-store.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js +3 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-publisher-private.d.ts +2 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.js +2 -0
- package/dist/document-authoring/adapters/node/node-document-publisher-private.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts +54 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.js +252 -0
- package/dist/document-authoring/adapters/node/node-document-publisher.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts +17 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.js +43 -0
- package/dist/document-authoring/adapters/node/node-document-reachability-projector.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.js +80 -0
- package/dist/document-authoring/adapters/node/node-document-structure-verifier.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.d.ts +21 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js +89 -0
- package/dist/document-authoring/adapters/node/node-document-transaction-coordinator.js.map +1 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts +16 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js +89 -0
- package/dist/document-authoring/adapters/node/recapture-document-publication-paths.js.map +1 -0
- package/dist/document-authoring/application/model/document-command.d.ts +69 -0
- package/dist/document-authoring/application/model/document-command.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-command.js +2 -0
- package/dist/document-authoring/application/model/document-command.js.map +1 -0
- package/dist/document-authoring/application/model/document-physical-identity.d.ts +10 -0
- package/dist/document-authoring/application/model/document-physical-identity.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-physical-identity.js +29 -0
- package/dist/document-authoring/application/model/document-physical-identity.js.map +1 -0
- package/dist/document-authoring/application/model/document-planning.d.ts +11 -0
- package/dist/document-authoring/application/model/document-planning.d.ts.map +1 -1
- package/dist/document-authoring/application/model/document-receipt.d.ts +74 -0
- package/dist/document-authoring/application/model/document-receipt.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-receipt.js +2 -0
- package/dist/document-authoring/application/model/document-receipt.js.map +1 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts +43 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.js +2 -0
- package/dist/document-authoring/application/model/document-transaction-inspection.js.map +1 -0
- package/dist/document-authoring/application/model/document-transaction.d.ts +81 -0
- package/dist/document-authoring/application/model/document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-transaction.js +2 -0
- package/dist/document-authoring/application/model/document-transaction.js.map +1 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts +5 -1
- package/dist/document-authoring/application/policies/authoring-profile-semantics.d.ts.map +1 -1
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js +7 -0
- package/dist/document-authoring/application/policies/authoring-profile-semantics.js.map +1 -1
- package/dist/document-authoring/application/policies/classify-document-recovery.d.ts +81 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.js +138 -0
- package/dist/document-authoring/application/policies/classify-document-recovery.js.map +1 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.d.ts +2 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.js +15 -0
- package/dist/document-authoring/application/policies/document-command-consumer-root.js.map +1 -0
- package/dist/document-authoring/application/policies/document-command-projection.d.ts +20 -0
- package/dist/document-authoring/application/policies/document-command-projection.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-command-projection.js +90 -0
- package/dist/document-authoring/application/policies/document-command-projection.js.map +1 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts +5 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.js +53 -0
- package/dist/document-authoring/application/policies/document-receipt-policy.js.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts +5 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.js +12 -0
- package/dist/document-authoring/application/policies/document-transaction-digests.js.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.d.ts +4 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js +118 -0
- package/dist/document-authoring/application/policies/document-transaction-envelope-policy.js.map +1 -0
- package/dist/document-authoring/application/policies/project-document-reachability.d.ts +14 -0
- package/dist/document-authoring/application/policies/project-document-reachability.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/project-document-reachability.js +57 -0
- package/dist/document-authoring/application/policies/project-document-reachability.js.map +1 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.d.ts +4 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.js +17 -0
- package/dist/document-authoring/application/policies/project-similar-document-advice.js.map +1 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts +19 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.js +2 -0
- package/dist/document-authoring/application/ports/document-authority-recompiler.js.map +1 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.d.ts +12 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.js +2 -0
- package/dist/document-authoring/application/ports/document-environment-inspector.js.map +1 -0
- package/dist/document-authoring/application/ports/document-file-state.d.ts +55 -0
- package/dist/document-authoring/application/ports/document-file-state.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-file-state.js +2 -0
- package/dist/document-authoring/application/ports/document-file-state.js.map +1 -0
- package/dist/document-authoring/application/ports/document-journal-store.d.ts +31 -0
- package/dist/document-authoring/application/ports/document-journal-store.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-journal-store.js +2 -0
- package/dist/document-authoring/application/ports/document-journal-store.js.map +1 -0
- package/dist/document-authoring/application/ports/document-publisher.d.ts +38 -0
- package/dist/document-authoring/application/ports/document-publisher.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-publisher.js +2 -0
- package/dist/document-authoring/application/ports/document-publisher.js.map +1 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts +13 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.js +2 -0
- package/dist/document-authoring/application/ports/document-reachability-projector.js.map +1 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts +17 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.js +2 -0
- package/dist/document-authoring/application/ports/document-structure-verifier.js.map +1 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.d.ts +21 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.js +2 -0
- package/dist/document-authoring/application/ports/document-transaction-coordinator.js.map +1 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.d.ts +17 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.js +2 -0
- package/dist/document-authoring/application/ports/similar-document-advisor.js.map +1 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts +16 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.js +215 -0
- package/dist/document-authoring/application/use-cases/apply-document-plan.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.d.ts +18 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.js +90 -0
- package/dist/document-authoring/application/use-cases/document-journal-reconciliation.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts +59 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js +360 -0
- package/dist/document-authoring/application/use-cases/document-transaction-continuation.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.d.ts +5 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.js +9 -0
- package/dist/document-authoring/application/use-cases/document-transaction-error.js.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.d.ts +9 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.js +40 -0
- package/dist/document-authoring/application/use-cases/document-transaction-execution.js.map +1 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts +10 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js +233 -0
- package/dist/document-authoring/application/use-cases/recover-document-transaction.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts +18 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.js +171 -0
- package/dist/document-authoring/application/use-cases/run-document-doctor.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts +30 -0
- package/dist/document-authoring/application/use-cases/run-document-new.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-new.js +221 -0
- package/dist/document-authoring/application/use-cases/run-document-new.js.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts +21 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.js +126 -0
- package/dist/document-authoring/application/use-cases/run-document-recover.js.map +1 -0
- package/dist/document-authoring/composition/document-command-cli.d.ts +7 -0
- package/dist/document-authoring/composition/document-command-cli.d.ts.map +1 -0
- package/dist/document-authoring/composition/document-command-cli.js +32 -0
- package/dist/document-authoring/composition/document-command-cli.js.map +1 -0
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts +8 -0
- package/dist/document-authoring/composition/inspect-document-transaction.d.ts.map +1 -0
- package/dist/document-authoring/composition/inspect-document-transaction.js +177 -0
- package/dist/document-authoring/composition/inspect-document-transaction.js.map +1 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts +11 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.js +62 -0
- package/dist/document-authoring/composition/node-document-authority-recompiler.js.map +1 -0
- package/dist/document-authoring/composition/node-document-commands.d.ts +10 -0
- package/dist/document-authoring/composition/node-document-commands.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-commands.js +68 -0
- package/dist/document-authoring/composition/node-document-commands.js.map +1 -0
- package/dist/document-authoring/composition/node-document-planning.d.ts +7 -0
- package/dist/document-authoring/composition/node-document-planning.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-planning.js +77 -0
- package/dist/document-authoring/composition/node-document-planning.js.map +1 -0
- package/dist/document-authoring/composition/node-document-writing-private.d.ts +15 -0
- package/dist/document-authoring/composition/node-document-writing-private.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-writing-private.js +52 -0
- package/dist/document-authoring/composition/node-document-writing-private.js.map +1 -0
- package/dist/document-authoring/composition/node-document-writing.d.ts +8 -0
- package/dist/document-authoring/composition/node-document-writing.d.ts.map +1 -0
- package/dist/document-authoring/composition/node-document-writing.js +10 -0
- package/dist/document-authoring/composition/node-document-writing.js.map +1 -0
- package/dist/document-authoring/index.d.ts +13 -1
- package/dist/document-authoring/index.d.ts.map +1 -1
- package/dist/document-authoring/index.js +12 -65
- package/dist/document-authoring/index.js.map +1 -1
- package/dist/document-command.d.ts +9 -0
- package/dist/document-command.d.ts.map +1 -1
- package/dist/document-command.js +64 -3
- package/dist/document-command.js.map +1 -1
- package/dist/foundation-state-contract.d.ts +1 -0
- package/dist/foundation-state-contract.d.ts.map +1 -1
- package/dist/foundation-state-contract.js +1 -0
- package/dist/foundation-state-contract.js.map +1 -1
- package/dist/local-mode/inspection.d.ts.map +1 -1
- package/dist/local-mode/inspection.js +51 -3
- package/dist/local-mode/inspection.js.map +1 -1
- package/dist/package-self-check.d.ts +2 -1
- package/dist/package-self-check.d.ts.map +1 -1
- package/dist/package-self-check.js +30 -7
- package/dist/package-self-check.js.map +1 -1
- package/dist/report-renderer.d.ts.map +1 -1
- package/dist/report-renderer.js +1 -0
- package/dist/report-renderer.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.d.ts +19 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.js +74 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication-private.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts +2 -0
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js +56 -154
- package/dist/repository-mutation/adapters/node/node-absent-file-publication.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.d.ts +26 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js +151 -0
- package/dist/repository-mutation/adapters/node/node-cleanup-owned-temporary.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts +6 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.d.ts.map +1 -1
- package/dist/repository-mutation/adapters/node/node-directory-durability.js +15 -0
- package/dist/repository-mutation/adapters/node/node-directory-durability.js.map +1 -1
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts +14 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js +26 -0
- package/dist/repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.d.ts +28 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.js +47 -0
- package/dist/repository-mutation/adapters/node/node-publish-prepared-absent-file.js.map +1 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.d.ts +22 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.d.ts.map +1 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.js +59 -0
- package/dist/repository-mutation/adapters/node/node-terminal-evidence-directory.js.map +1 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.d.ts +7 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.d.ts.map +1 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.js +2 -0
- package/dist/repository-mutation/application/ports/owned-temporary-cleanup-transition.js.map +1 -0
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js +74 -53
- package/dist/scaffolding/adapters/node/filesystem-authority-workspace.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts +9 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-finalization.js +34 -6
- package/dist/scaffolding/adapters/node/filesystem-finalization.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js +2 -1
- package/dist/scaffolding/adapters/node/filesystem-journal-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts +13 -5
- package/dist/scaffolding/adapters/node/filesystem-journal.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-journal.js +112 -74
- package/dist/scaffolding/adapters/node/filesystem-journal.js.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts +10 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.d.ts.map +1 -1
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js +40 -2
- package/dist/scaffolding/adapters/node/filesystem-operation-state.js.map +1 -1
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.d.ts +35 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.js +137 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-evidence.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.d.ts +11 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.js +95 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-gateway.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.d.ts +15 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.js +29 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-reconciliation.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.d.ts +46 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.js +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store-faults.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.d.ts +19 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.js +288 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-store.js.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.d.ts +2 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.d.ts.map +1 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.js +34 -0
- package/dist/scaffolding/adapters/node/node-scaffold-journal-transaction-evidence.js.map +1 -0
- package/dist/schema-catalog.d.ts.map +1 -1
- package/dist/schema-catalog.js +4 -0
- package/dist/schema-catalog.js.map +1 -1
- package/dist/schema-ids.d.ts +1 -1
- package/dist/schema-ids.d.ts.map +1 -1
- package/dist/schema-ids.js +3 -0
- package/dist/schema-ids.js.map +1 -1
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.d.ts.map +1 -1
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js +17 -10
- package/dist/source-inventory/adapters/outbound/filesystem/filesystem-source-tree-reader.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts +22 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js +123 -0
- package/dist/transaction-coordination/adapters/node/document-envelope-bindings.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts +2 -2
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js +4 -4
- package/dist/transaction-coordination/adapters/node/document-temporary-identity.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.d.ts +4 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.js +58 -0
- package/dist/transaction-coordination/adapters/node/foundation-transition-evidence.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.d.ts +17 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.d.ts.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.js +79 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-cleanup-transition.js.map +1 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.d.ts +9 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js +34 -11
- package/dist/transaction-coordination/adapters/node/node-foundation-operation-lock.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.d.ts +7 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.js +15 -0
- package/dist/transaction-coordination/adapters/node/node-foundation-state-directory.js.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts +2 -2
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.d.ts.map +1 -1
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js +123 -140
- package/dist/transaction-coordination/adapters/node/node-foundation-transaction-slot.js.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.d.ts +5 -4
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.d.ts.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js +14 -1
- package/dist/transaction-coordination/application/foundation-transaction-coordinator.js.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-error.d.ts +4 -3
- package/dist/transaction-coordination/application/foundation-transaction-error.d.ts.map +1 -1
- package/dist/transaction-coordination/application/foundation-transaction-error.js.map +1 -1
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts +26 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.d.ts.map +1 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.js +2 -0
- package/dist/transaction-coordination/application/model/internal-transaction-status.js.map +1 -0
- package/dist/transaction-coordination/application/ports/foundation-transaction-slot.d.ts +2 -2
- package/dist/transaction-coordination/application/ports/foundation-transaction-slot.d.ts.map +1 -1
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.d.ts.map +1 -1
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js +13 -9
- package/dist/workspace-inventory/adapters/outbound/pnpm/pnpm-workspace-inventory-reader.js.map +1 -1
- package/package.json +12 -3
- package/schemas/document-authoring-profile/v1.schema.json +31 -1
- package/schemas/document-command-envelope/v2.schema.json +205 -0
- package/schemas/foundation-check-report/v1.schema.json +1 -1
- package/schemas/foundation-command-error/v1.schema.json +24 -0
- package/schemas/foundation-transaction-envelope/v3.schema.json +169 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { link, open, rm } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { cleanupIdentityMatchingOwnedTemporary } from "../../../repository-mutation/adapters/node/node-cleanup-owned-temporary.js";
|
|
5
|
+
import { syncDirectoryDurably, syncDirectoryStrictly } from "../../../repository-mutation/adapters/node/node-directory-durability.js";
|
|
6
|
+
import { prepareExactSiblingTemporary } from "../../../repository-mutation/adapters/node/node-prepare-exact-sibling-temporary.js";
|
|
7
|
+
import { publishPreparedAbsentFile } from "../../../repository-mutation/adapters/node/node-publish-prepared-absent-file.js";
|
|
8
|
+
import { readBoundedRegularFile } from "../../../repository-mutation/adapters/node/node-bounded-regular-file.js";
|
|
9
|
+
import { assertDocumentPhysicalIdentity, assertNonzeroDocumentPhysicalIdentity } from "../../application/model/document-physical-identity.js";
|
|
10
|
+
import { documentTemporaryPath } from "../../application/policies/document-temporary-path.js";
|
|
11
|
+
import { recaptureDocumentPublicationPaths, sameDocumentAncestry, sameDocumentPhysicalIdentity } from "./recapture-document-publication-paths.js";
|
|
12
|
+
function postimage(plan) {
|
|
13
|
+
return {
|
|
14
|
+
bytes: Buffer.from(plan.output.contentBase64, "base64"),
|
|
15
|
+
digest: plan.output.digest,
|
|
16
|
+
mode: 0o644,
|
|
17
|
+
size: plan.output.size
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function wireIdentity(identity, authorityRequired) {
|
|
21
|
+
const result = {
|
|
22
|
+
adapter: "node-filesystem",
|
|
23
|
+
version: 1,
|
|
24
|
+
dev: identity.dev.toString(10),
|
|
25
|
+
ino: identity.ino.toString(10),
|
|
26
|
+
birthtimeNs: identity.birthtimeNs.toString(10)
|
|
27
|
+
};
|
|
28
|
+
assertDocumentPhysicalIdentity(result);
|
|
29
|
+
if (authorityRequired) {
|
|
30
|
+
assertNonzeroDocumentPhysicalIdentity(result);
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
function physicalIdentity(temporary) {
|
|
35
|
+
const value = temporary.identity;
|
|
36
|
+
assertNonzeroDocumentPhysicalIdentity(value);
|
|
37
|
+
const result = {
|
|
38
|
+
dev: BigInt(value.dev),
|
|
39
|
+
ino: BigInt(value.ino),
|
|
40
|
+
birthtimeNs: BigInt(value.birthtimeNs)
|
|
41
|
+
};
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
async function readExactPublicationIdentity(destinationPath, plan) {
|
|
45
|
+
const observed = await readBoundedRegularFile(destinationPath, plan.output.size);
|
|
46
|
+
if (observed.outcome !== "read" ||
|
|
47
|
+
observed.bytes.byteLength !== plan.output.size ||
|
|
48
|
+
`sha256:${createHash("sha256").update(observed.bytes).digest("hex")}` !== plan.output.digest ||
|
|
49
|
+
(process.platform !== "win32" && (observed.mode & 0o777) !== 0o644)) {
|
|
50
|
+
throw new Error("Published document identity could not be verified.");
|
|
51
|
+
}
|
|
52
|
+
return wireIdentity(observed.identity, true);
|
|
53
|
+
}
|
|
54
|
+
function assertTemporaryBinding(plan, temporary) {
|
|
55
|
+
if (temporary.path !== documentTemporaryPath(plan.destination, plan.planDigest) ||
|
|
56
|
+
temporary.digest !== plan.output.digest) {
|
|
57
|
+
throw new Error("Document temporary is not exactly bound to the supplied Plan.");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export class NodeDocumentPublisher {
|
|
61
|
+
#operations;
|
|
62
|
+
constructor(operations = {}) {
|
|
63
|
+
this.#operations = {
|
|
64
|
+
link: operations.link ?? link,
|
|
65
|
+
open: operations.open ?? open,
|
|
66
|
+
remove: operations.remove ?? rm,
|
|
67
|
+
syncDirectoryDurably: operations.syncDirectoryDurably ?? syncDirectoryDurably,
|
|
68
|
+
syncDirectoryStrictly: operations.syncDirectoryStrictly ?? syncDirectoryStrictly,
|
|
69
|
+
...(operations.faultInjector === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: { faultInjector: operations.faultInjector })
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async prepare(request) {
|
|
75
|
+
request.signal?.throwIfAborted();
|
|
76
|
+
const paths = await recaptureDocumentPublicationPaths({
|
|
77
|
+
consumerRoot: request.consumerRoot,
|
|
78
|
+
destination: request.plan.destination
|
|
79
|
+
});
|
|
80
|
+
const temporaryPath = documentTemporaryPath(request.plan.destination, request.plan.planDigest);
|
|
81
|
+
const temporaryAbsolutePath = join(paths.root, ...temporaryPath.split("/"));
|
|
82
|
+
await recaptureDocumentPublicationPaths({
|
|
83
|
+
consumerRoot: request.consumerRoot,
|
|
84
|
+
destination: temporaryPath
|
|
85
|
+
});
|
|
86
|
+
await this.#operations.syncDirectoryStrictly(paths.parent);
|
|
87
|
+
const recaptured = await recaptureDocumentPublicationPaths({
|
|
88
|
+
consumerRoot: request.consumerRoot,
|
|
89
|
+
destination: request.plan.destination
|
|
90
|
+
});
|
|
91
|
+
if (!sameDocumentAncestry(paths.ancestryIdentities, recaptured.ancestryIdentities)) {
|
|
92
|
+
throw new Error("Document publication parent changed during durability preflight.");
|
|
93
|
+
}
|
|
94
|
+
request.signal?.throwIfAborted();
|
|
95
|
+
const captured = await prepareExactSiblingTemporary({
|
|
96
|
+
displayPath: temporaryPath,
|
|
97
|
+
faultInjector: undefined,
|
|
98
|
+
onIdentityCaptured() { },
|
|
99
|
+
open: this.#operations.open,
|
|
100
|
+
postimage: postimage(request.plan),
|
|
101
|
+
temporaryPath: temporaryAbsolutePath
|
|
102
|
+
});
|
|
103
|
+
await this.#operations.syncDirectoryStrictly(recaptured.parent);
|
|
104
|
+
await this.#operations.faultInjector?.({ phase: "after-temporary-synced" });
|
|
105
|
+
const temporary = {
|
|
106
|
+
path: temporaryPath,
|
|
107
|
+
digest: request.plan.output.digest,
|
|
108
|
+
identity: wireIdentity(captured, false)
|
|
109
|
+
};
|
|
110
|
+
return Object.freeze({
|
|
111
|
+
...temporary,
|
|
112
|
+
identity: Object.freeze(temporary.identity)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async publishPrepared(request) {
|
|
116
|
+
request.signal?.throwIfAborted();
|
|
117
|
+
assertTemporaryBinding(request.plan, request.temporary);
|
|
118
|
+
const expectedIdentity = physicalIdentity(request.temporary);
|
|
119
|
+
const before = await recaptureDocumentPublicationPaths({
|
|
120
|
+
consumerRoot: request.consumerRoot,
|
|
121
|
+
destination: request.plan.destination
|
|
122
|
+
});
|
|
123
|
+
await this.#operations.syncDirectoryStrictly(before.parent);
|
|
124
|
+
const paths = await recaptureDocumentPublicationPaths({
|
|
125
|
+
consumerRoot: request.consumerRoot,
|
|
126
|
+
destination: request.plan.destination
|
|
127
|
+
});
|
|
128
|
+
if (!sameDocumentAncestry(before.ancestryIdentities, paths.ancestryIdentities)) {
|
|
129
|
+
throw new Error("Document publication parent changed during durability preflight.");
|
|
130
|
+
}
|
|
131
|
+
const temporaryPath = join(paths.root, ...request.temporary.path.split("/"));
|
|
132
|
+
request.signal?.throwIfAborted();
|
|
133
|
+
// No cancellation observation is allowed after this point: link may have
|
|
134
|
+
// succeeded even when a caller aborts while publication is in flight.
|
|
135
|
+
const outcome = await publishPreparedAbsentFile({
|
|
136
|
+
allowUnsupportedDirectoryDurability: false,
|
|
137
|
+
classifyBoundedRegularFile: readBoundedRegularFile,
|
|
138
|
+
destinationPath: paths.destinationPath,
|
|
139
|
+
displayPath: request.plan.destination,
|
|
140
|
+
expectedIdentity,
|
|
141
|
+
faultInjector: async () => this.#operations.faultInjector?.({
|
|
142
|
+
phase: "after-hard-link"
|
|
143
|
+
}),
|
|
144
|
+
link: this.#operations.link,
|
|
145
|
+
parent: paths.parent,
|
|
146
|
+
postimage: postimage(request.plan),
|
|
147
|
+
readBoundedRegularFile,
|
|
148
|
+
syncDirectory: this.#operations.syncDirectoryDurably,
|
|
149
|
+
temporaryPath
|
|
150
|
+
});
|
|
151
|
+
await this.#operations.faultInjector?.({ phase: "after-publication-synced" });
|
|
152
|
+
if (outcome === "published") {
|
|
153
|
+
return Object.freeze({
|
|
154
|
+
outcome,
|
|
155
|
+
publicationIdentity: Object.freeze(wireIdentity(expectedIdentity, true)),
|
|
156
|
+
identityEvidence: "owned-temporary"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return Object.freeze({
|
|
160
|
+
outcome,
|
|
161
|
+
publicationIdentity: Object.freeze(await readExactPublicationIdentity(paths.destinationPath, request.plan))
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
async completePublication(request) {
|
|
165
|
+
request.signal?.throwIfAborted();
|
|
166
|
+
assertTemporaryBinding(request.plan, request.temporary);
|
|
167
|
+
const expectedIdentity = physicalIdentity(request.temporary);
|
|
168
|
+
const before = await recaptureDocumentPublicationPaths({
|
|
169
|
+
consumerRoot: request.consumerRoot,
|
|
170
|
+
destination: request.plan.destination
|
|
171
|
+
});
|
|
172
|
+
const temporaryPath = join(before.root, ...request.temporary.path.split("/"));
|
|
173
|
+
request.signal?.throwIfAborted();
|
|
174
|
+
// From this point recovery completion is cancellation-masked: publication
|
|
175
|
+
// may already exist and its durability must reach a verified postcondition.
|
|
176
|
+
const publicationIdentity = await readExactPublicationIdentity(before.destinationPath, request.plan);
|
|
177
|
+
if (!sameDocumentPhysicalIdentity({
|
|
178
|
+
dev: BigInt(publicationIdentity.dev),
|
|
179
|
+
ino: BigInt(publicationIdentity.ino),
|
|
180
|
+
birthtimeNs: BigInt(publicationIdentity.birthtimeNs)
|
|
181
|
+
}, expectedIdentity)) {
|
|
182
|
+
throw new Error("Published document does not match its bound temporary identity.");
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const observedTemporary = await readBoundedRegularFile(temporaryPath, request.plan.output.size);
|
|
186
|
+
if (observedTemporary.outcome !== "read" ||
|
|
187
|
+
!sameDocumentPhysicalIdentity(observedTemporary.identity, expectedIdentity) ||
|
|
188
|
+
`sha256:${createHash("sha256").update(observedTemporary.bytes).digest("hex")}` !== request.plan.output.digest ||
|
|
189
|
+
(process.platform !== "win32" && (observedTemporary.mode & 0o777) !== 0o644)) {
|
|
190
|
+
throw new Error("Bound document temporary changed during publication completion.");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
if (!(error instanceof Error && "code" in error &&
|
|
195
|
+
error.code === "ENOENT")) {
|
|
196
|
+
throw error;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
await this.#operations.syncDirectoryStrictly(before.parent);
|
|
200
|
+
const after = await recaptureDocumentPublicationPaths({
|
|
201
|
+
consumerRoot: request.consumerRoot,
|
|
202
|
+
destination: request.plan.destination
|
|
203
|
+
});
|
|
204
|
+
if (!sameDocumentAncestry(before.ancestryIdentities, after.ancestryIdentities)) {
|
|
205
|
+
throw new Error("Document publication parent changed during completion.");
|
|
206
|
+
}
|
|
207
|
+
const verifiedIdentity = await readExactPublicationIdentity(after.destinationPath, request.plan);
|
|
208
|
+
if (verifiedIdentity.dev !== publicationIdentity.dev ||
|
|
209
|
+
verifiedIdentity.ino !== publicationIdentity.ino ||
|
|
210
|
+
verifiedIdentity.birthtimeNs !== publicationIdentity.birthtimeNs) {
|
|
211
|
+
throw new Error("Published document identity changed during completion.");
|
|
212
|
+
}
|
|
213
|
+
return Object.freeze({
|
|
214
|
+
publicationIdentity: Object.freeze(verifiedIdentity)
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
async removeOwnedTemporary(request) {
|
|
218
|
+
request.signal?.throwIfAborted();
|
|
219
|
+
const expectedIdentity = physicalIdentity(request.temporary);
|
|
220
|
+
const paths = await recaptureDocumentPublicationPaths({
|
|
221
|
+
consumerRoot: request.consumerRoot,
|
|
222
|
+
destination: request.temporary.path
|
|
223
|
+
});
|
|
224
|
+
await this.#operations.syncDirectoryStrictly(paths.parent);
|
|
225
|
+
const recaptured = await recaptureDocumentPublicationPaths({
|
|
226
|
+
consumerRoot: request.consumerRoot,
|
|
227
|
+
destination: request.temporary.path
|
|
228
|
+
});
|
|
229
|
+
if (!sameDocumentAncestry(paths.ancestryIdentities, recaptured.ancestryIdentities)) {
|
|
230
|
+
throw new Error("Document temporary parent changed during durability preflight.");
|
|
231
|
+
}
|
|
232
|
+
request.signal?.throwIfAborted();
|
|
233
|
+
// Cleanup is an identity-authorized mutation. Once started, finish without
|
|
234
|
+
// observing cancellation so callers cannot receive a false pre-mutation view.
|
|
235
|
+
const outcome = await cleanupIdentityMatchingOwnedTemporary({
|
|
236
|
+
allowUnsupportedDirectoryDurability: false,
|
|
237
|
+
displayPath: request.temporary.path,
|
|
238
|
+
expectedIdentity,
|
|
239
|
+
parent: recaptured.parent,
|
|
240
|
+
rm: this.#operations.remove,
|
|
241
|
+
syncDirectory: this.#operations.syncDirectoryDurably,
|
|
242
|
+
temporaryPath: recaptured.destinationPath
|
|
243
|
+
});
|
|
244
|
+
if (outcome === "different") {
|
|
245
|
+
throw new Error("Document temporary was replaced and was preserved.");
|
|
246
|
+
}
|
|
247
|
+
await this.#operations.faultInjector?.({
|
|
248
|
+
phase: "after-temporary-cleanup-synced"
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=node-document-publisher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-publisher.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,qCAAqC,EAAE,MAAM,4EAA4E,CAAC;AACnI,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,yEAAyE,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,oFAAoF,CAAC;AAClI,OAAO,EAAE,yBAAyB,EAAE,MAAM,iFAAiF,CAAC;AAC5H,OA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AAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI;SACpC,CAAC,CAAC;QACH,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACnF,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QACjC,2EAA2E;QAC3E,8EAA8E;QAC9E,MAAM,OAAO,GAAG,MAAM,qCAAqC,CAAC;YAC1D,mCAAmC,EAAE,KAAK;YAC1C,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI;YACnC,gBAAgB;YAChB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM;YAC3B,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,oBAAoB;YACpD,aAAa,EAAE,UAAU,CAAC,eAAe;SAC1C,CAAC,CAAC;QACH,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;YACrC,KAAK,EAAE,gCAAgC;SACxC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DocumentReachabilityProjection } from "../../application/model/document-command.js";
|
|
2
|
+
import type { DocumentPlan } from "../../application/model/document-planning.js";
|
|
3
|
+
import type { DocumentPlanningProfileReader } from "../../application/ports/document-planning-profile-reader.js";
|
|
4
|
+
import type { DocumentReachabilityProjector } from "../../application/ports/document-reachability-projector.js";
|
|
5
|
+
/**
|
|
6
|
+
* Projects the manual reachability action from the exact profile authority
|
|
7
|
+
* captured by the plan. It never infers a profile from repository layout.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NodeDocumentReachabilityProjector implements DocumentReachabilityProjector {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(profiles: DocumentPlanningProfileReader);
|
|
12
|
+
project(input: {
|
|
13
|
+
readonly consumerRoot: string;
|
|
14
|
+
readonly plan: DocumentPlan;
|
|
15
|
+
}): Promise<DocumentReachabilityProjection>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=node-document-reachability-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-reachability-projector.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-reachability-projector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAIlG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AACjH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4DAA4D,CAAC;AAqBhH;;;GAGG;AACH,qBAAa,iCACb,YAAW,6BAA6B;;IAGtC,YAAY,QAAQ,EAAE,6BAA6B,EAElD;IAEK,OAAO,CAAC,KAAK,EAAE;QACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;KAC7B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAwB1C;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { projectDocumentReachability } from "../../application/policies/project-document-reachability.js";
|
|
2
|
+
import { selectDocumentArtifact } from "../../application/policies/resolve-document-authoring.js";
|
|
3
|
+
import { DocumentPlanningError } from "../../document-planning-error.js";
|
|
4
|
+
function sameEvidence(observed, planned) {
|
|
5
|
+
return observed.path === planned.path &&
|
|
6
|
+
observed.digest === planned.digest &&
|
|
7
|
+
observed.size === planned.size;
|
|
8
|
+
}
|
|
9
|
+
function authorityMismatch(message) {
|
|
10
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_AUTHORITY_CHANGED", message);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Projects the manual reachability action from the exact profile authority
|
|
14
|
+
* captured by the plan. It never infers a profile from repository layout.
|
|
15
|
+
*/
|
|
16
|
+
export class NodeDocumentReachabilityProjector {
|
|
17
|
+
#profiles;
|
|
18
|
+
constructor(profiles) {
|
|
19
|
+
this.#profiles = profiles;
|
|
20
|
+
}
|
|
21
|
+
async project(input) {
|
|
22
|
+
const profile = await this.#profiles.read({
|
|
23
|
+
consumerRoot: input.consumerRoot,
|
|
24
|
+
path: input.plan.authority.profile.path,
|
|
25
|
+
});
|
|
26
|
+
if (!sameEvidence(profile.evidence, input.plan.authority.profile)) {
|
|
27
|
+
authorityMismatch("Document authoring profile changed after the plan was compiled.");
|
|
28
|
+
}
|
|
29
|
+
if (profile.projectId !== input.plan.projectId) {
|
|
30
|
+
authorityMismatch("Document authoring profile no longer identifies the planned project.");
|
|
31
|
+
}
|
|
32
|
+
const artifact = selectDocumentArtifact(profile, input.plan.intent.type);
|
|
33
|
+
const heading = artifact.heading.kind === "title"
|
|
34
|
+
? input.plan.intent.title
|
|
35
|
+
: `${input.plan.intent.id}: ${input.plan.intent.title}`;
|
|
36
|
+
return projectDocumentReachability({
|
|
37
|
+
artifact,
|
|
38
|
+
destination: input.plan.destination,
|
|
39
|
+
heading,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=node-document-reachability-projector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-reachability-projector.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-reachability-projector.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAE,qBAAqB,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AAC,KAAK;YACzB,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1D,OAAO,2BAA2B,CAAC;YACjC,QAAQ;YACR,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW;YACnC,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DocumentPlan } from "../../application/model/document-planning.js";
|
|
2
|
+
import type { DocumentStructureDiagnostic, DocumentStructureVerifier } from "../../application/ports/document-structure-verifier.js";
|
|
3
|
+
import type { DocumentPlanningProfileReader } from "../../application/ports/document-planning-profile-reader.js";
|
|
4
|
+
import type { DocumentationCatalogReader } from "../../application/ports/documentation-catalog-reader.js";
|
|
5
|
+
/** Rebuilds the catalog and proves that the applied document has one exact descriptor. */
|
|
6
|
+
export declare class NodeDocumentStructureVerifier implements DocumentStructureVerifier {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(dependencies: {
|
|
9
|
+
readonly catalog: DocumentationCatalogReader;
|
|
10
|
+
readonly profiles: DocumentPlanningProfileReader;
|
|
11
|
+
});
|
|
12
|
+
verify(input: {
|
|
13
|
+
readonly consumerRoot: string;
|
|
14
|
+
readonly plan: DocumentPlan;
|
|
15
|
+
readonly signal?: AbortSignal;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
readonly diagnostics: readonly DocumentStructureDiagnostic[];
|
|
18
|
+
readonly valid: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=node-document-structure-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-structure-verifier.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-structure-verifier.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AACjH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AAuE1G,0FAA0F;AAC1F,qBAAa,6BAA8B,YAAW,yBAAyB;;IAI7E,YAAY,YAAY,EAAE;QACxB,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;QAC7C,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;KAClD,EAGA;IAEK,MAAM,CAAC,KAAK,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;QAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC;QACV,QAAQ,CAAC,WAAW,EAAE,SAAS,2BAA2B,EAAE,CAAC;QAC7D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;KACzB,CAAC,CAwDD;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { selectDocumentArtifact } from "../../application/policies/resolve-document-authoring.js";
|
|
2
|
+
function diagnostic(ruleId, subject, message) {
|
|
3
|
+
return Object.freeze({ ruleId, subject, message });
|
|
4
|
+
}
|
|
5
|
+
function sameEvidence(observed, planned) {
|
|
6
|
+
return observed.path === planned.path &&
|
|
7
|
+
observed.digest === planned.digest &&
|
|
8
|
+
observed.size === planned.size;
|
|
9
|
+
}
|
|
10
|
+
function authorityDiagnostics(catalog, plan) {
|
|
11
|
+
const diagnostics = [];
|
|
12
|
+
if (!sameEvidence(catalog.authority.profile, plan.authority.profile)) {
|
|
13
|
+
diagnostics.push(diagnostic("document.new.profile-authority-mismatch", plan.authority.profile.path, "The catalog profile authority does not match the applied plan."));
|
|
14
|
+
}
|
|
15
|
+
if (!sameEvidence(catalog.authority.metadataSchema, plan.authority.metadataSchema)) {
|
|
16
|
+
diagnostics.push(diagnostic("document.new.metadata-authority-mismatch", plan.authority.metadataSchema.path, "The catalog metadata authority does not match the applied plan."));
|
|
17
|
+
}
|
|
18
|
+
if (!sameEvidence(catalog.authority.ownerCatalog, plan.authority.ownerCatalog)) {
|
|
19
|
+
diagnostics.push(diagnostic("document.new.owner-authority-mismatch", plan.authority.ownerCatalog.path, "The catalog owner authority does not match the applied plan."));
|
|
20
|
+
}
|
|
21
|
+
if (catalog.projectId !== plan.projectId) {
|
|
22
|
+
diagnostics.push(diagnostic("document.new.project-mismatch", plan.destination, "The rebuilt catalog does not identify the planned project."));
|
|
23
|
+
}
|
|
24
|
+
return diagnostics;
|
|
25
|
+
}
|
|
26
|
+
function descriptorMatches(descriptor, plan, initialStatus, expectedTitle) {
|
|
27
|
+
return descriptor.id === plan.intent.id &&
|
|
28
|
+
descriptor.repositoryPath === plan.destination &&
|
|
29
|
+
descriptor.type === plan.intent.type &&
|
|
30
|
+
descriptor.title === expectedTitle &&
|
|
31
|
+
descriptor.owner === plan.intent.owner &&
|
|
32
|
+
descriptor.summary === plan.intent.summary &&
|
|
33
|
+
descriptor.status === initialStatus;
|
|
34
|
+
}
|
|
35
|
+
/** Rebuilds the catalog and proves that the applied document has one exact descriptor. */
|
|
36
|
+
export class NodeDocumentStructureVerifier {
|
|
37
|
+
#catalog;
|
|
38
|
+
#profiles;
|
|
39
|
+
constructor(dependencies) {
|
|
40
|
+
this.#catalog = dependencies.catalog;
|
|
41
|
+
this.#profiles = dependencies.profiles;
|
|
42
|
+
}
|
|
43
|
+
async verify(input) {
|
|
44
|
+
const request = {
|
|
45
|
+
consumerRoot: input.consumerRoot,
|
|
46
|
+
profilePath: input.plan.authority.profile.path,
|
|
47
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
48
|
+
};
|
|
49
|
+
const [catalog, profile] = await Promise.all([
|
|
50
|
+
this.#catalog.execute(request),
|
|
51
|
+
this.#profiles.read({
|
|
52
|
+
consumerRoot: input.consumerRoot,
|
|
53
|
+
path: input.plan.authority.profile.path,
|
|
54
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
55
|
+
}),
|
|
56
|
+
]);
|
|
57
|
+
const diagnostics = [...authorityDiagnostics(catalog, input.plan)];
|
|
58
|
+
if (!sameEvidence(profile.evidence, input.plan.authority.profile)) {
|
|
59
|
+
diagnostics.push(diagnostic("document.new.profile-authority-mismatch", input.plan.authority.profile.path, "The planning profile authority does not match the applied plan."));
|
|
60
|
+
}
|
|
61
|
+
if (catalog.status !== "complete") {
|
|
62
|
+
diagnostics.push(diagnostic("document.new.catalog-partial", input.plan.destination, "The post-apply documentation catalog is partial."));
|
|
63
|
+
}
|
|
64
|
+
const artifact = selectDocumentArtifact(profile, input.plan.intent.type);
|
|
65
|
+
const expectedTitle = artifact.heading.kind === "title"
|
|
66
|
+
? input.plan.intent.title
|
|
67
|
+
: `${input.plan.intent.id}: ${input.plan.intent.title}`;
|
|
68
|
+
const candidates = catalog.documents.filter((entry) => entry.id === input.plan.intent.id ||
|
|
69
|
+
entry.repositoryPath === input.plan.destination);
|
|
70
|
+
if (candidates.length !== 1 ||
|
|
71
|
+
!descriptorMatches(candidates[0], input.plan, artifact.initialStatus, expectedTitle)) {
|
|
72
|
+
diagnostics.push(diagnostic("document.new.descriptor-mismatch", input.plan.destination, "The rebuilt catalog does not contain exactly the planned document descriptor."));
|
|
73
|
+
}
|
|
74
|
+
return Object.freeze({
|
|
75
|
+
diagnostics: Object.freeze(diagnostics),
|
|
76
|
+
valid: diagnostics.length === 0,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=node-document-structure-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-structure-verifier.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-structure-verifier.ts"],"names":[],"mappings":"AAYA,OAAO,EAA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I,CAAC,MAAM,CAAC,KAAK;YACzB,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACpD,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACjC,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,IAAI,CAAC,WAAW,CAChD,CAAC;QACF,IACE,UAAU,CAAC,MAAM,KAAK,CAAC;YACvB,CAAC,iBAAiB,CAChB,UAAU,CAAC,CAAC,CAAE,EACd,KAAK,CAAC,IAAI,EACV,QAAQ,CAAC,aAAa,EACtB,aAAa,CACd,EACD,CAAC;YACD,WAAW,CAAC,IAAI,CAAC,UAAU,CACzB,kCAAkC,EAClC,KAAK,CAAC,IAAI,CAAC,WAAW,EACtB,+EAA+E,CAChF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YACvC,KAAK,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DocumentTransactionCoordinator, DocumentTransactionLease, DocumentTransactionStatus } from "../../application/ports/document-transaction-coordinator.js";
|
|
2
|
+
import type { FoundationTransactionLease } from "../../../transaction-coordination/application/foundation-transaction-coordinator.js";
|
|
3
|
+
import type { InternalFoundationTransactionStatus } from "../../../transaction-coordination/application/model/internal-transaction-status.js";
|
|
4
|
+
interface FoundationCoordinator {
|
|
5
|
+
inspect(): Promise<InternalFoundationTransactionStatus>;
|
|
6
|
+
acquire(options: {
|
|
7
|
+
readonly requestedMutation: "document-authoring";
|
|
8
|
+
readonly allowRecoveryOf?: "document-authoring";
|
|
9
|
+
}): Promise<FoundationTransactionLease>;
|
|
10
|
+
}
|
|
11
|
+
export declare class NodeDocumentTransactionCoordinator implements DocumentTransactionCoordinator {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(coordinator: FoundationCoordinator);
|
|
14
|
+
inspect(): Promise<DocumentTransactionStatus>;
|
|
15
|
+
acquire(request: {
|
|
16
|
+
readonly mode: "apply" | "recover";
|
|
17
|
+
}): Promise<DocumentTransactionLease>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createNodeDocumentTransactionCoordinator(consumerRoot: string): Promise<DocumentTransactionCoordinator>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=node-document-transaction-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-transaction-coordinator.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-transaction-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,6DAA6D,CAAC;AAErE,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,qFAAqF,CAAC;AAC7F,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oFAAoF,CAAC;AAE9I,UAAU,qBAAqB;IAC7B,OAAO,IAAI,OAAO,CAAC,mCAAmC,CAAC,CAAC;IACxD,OAAO,CAAC,OAAO,EAAE;QACf,QAAQ,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;QACjD,QAAQ,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACjD,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACzC;AAmFD,qBAAa,kCACX,YAAW,8BAA8B;;IAGzC,YAAY,WAAW,EAAE,qBAAqB,EAE7C;IAEK,OAAO,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAElD;IAEK,OAAO,CAAC,OAAO,EAAE;QACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;KACpC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAuBpC;CACF;AAED,wBAAsB,wCAAwC,CAC5D,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,8BAA8B,CAAC,CAIzC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createNodeFoundationTransactionCoordinator } from "../../../transaction-coordination/adapters/node/node-foundation-transaction-coordinator.js";
|
|
2
|
+
function observedProperty(value, property) {
|
|
3
|
+
return Reflect.get(value, property);
|
|
4
|
+
}
|
|
5
|
+
function isExactDocumentRecovery(status) {
|
|
6
|
+
return (status.state === "pending" &&
|
|
7
|
+
status.operationKind === "document-authoring" &&
|
|
8
|
+
observedProperty(status, "format") === "document-authoring-envelope-v3" &&
|
|
9
|
+
observedProperty(status.recovery, "commandId") === "docs-recover" &&
|
|
10
|
+
status.recovery.exactFoundationVersion === status.foundationVersion &&
|
|
11
|
+
status.recovery.exactFoundationBuildIdentity ===
|
|
12
|
+
status.foundationBuildIdentity &&
|
|
13
|
+
!status.diagnostics.some(({ code }) => code === "FOUNDATION_TRANSACTION_VERSION_MISMATCH"));
|
|
14
|
+
}
|
|
15
|
+
function manualReason(status) {
|
|
16
|
+
if (status.state === "manual-recovery-required") {
|
|
17
|
+
return status.reason;
|
|
18
|
+
}
|
|
19
|
+
return (status.diagnostics[0]?.message ??
|
|
20
|
+
`A ${status.operationKind} Foundation transaction blocks document authoring.`);
|
|
21
|
+
}
|
|
22
|
+
function toDocumentStatus(status) {
|
|
23
|
+
if (status.state === "idle") {
|
|
24
|
+
return { state: "idle" };
|
|
25
|
+
}
|
|
26
|
+
return isExactDocumentRecovery(status)
|
|
27
|
+
? { state: "recoverable" }
|
|
28
|
+
: { state: "manual-recovery-required", reason: manualReason(status) };
|
|
29
|
+
}
|
|
30
|
+
function combinedReleaseFailure(inspectionError, releaseError) {
|
|
31
|
+
return new Error("Document transaction inspection and barrier retention both failed.", {
|
|
32
|
+
cause: new AggregateError([inspectionError, releaseError], "Transaction evidence inspection and operation-lock release failed.")
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function releaseSafely(options) {
|
|
36
|
+
let status;
|
|
37
|
+
try {
|
|
38
|
+
status = await options.coordinator.inspect();
|
|
39
|
+
}
|
|
40
|
+
catch (inspectionError) {
|
|
41
|
+
try {
|
|
42
|
+
await options.lease.release({ retainTransactionBarrier: true });
|
|
43
|
+
}
|
|
44
|
+
catch (releaseError) {
|
|
45
|
+
throw combinedReleaseFailure(inspectionError, releaseError);
|
|
46
|
+
}
|
|
47
|
+
throw inspectionError;
|
|
48
|
+
}
|
|
49
|
+
await options.lease.release({
|
|
50
|
+
retainTransactionBarrier: options.retainRequested || status.state !== "idle"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export class NodeDocumentTransactionCoordinator {
|
|
54
|
+
#coordinator;
|
|
55
|
+
constructor(coordinator) {
|
|
56
|
+
this.#coordinator = coordinator;
|
|
57
|
+
}
|
|
58
|
+
async inspect() {
|
|
59
|
+
return toDocumentStatus(await this.#coordinator.inspect());
|
|
60
|
+
}
|
|
61
|
+
async acquire(request) {
|
|
62
|
+
const lease = await this.#coordinator.acquire({
|
|
63
|
+
requestedMutation: "document-authoring",
|
|
64
|
+
...(request.mode === "recover"
|
|
65
|
+
? { allowRecoveryOf: "document-authoring" }
|
|
66
|
+
: {})
|
|
67
|
+
});
|
|
68
|
+
let held = true;
|
|
69
|
+
return {
|
|
70
|
+
status: toDocumentStatus(lease.status),
|
|
71
|
+
release: async (releaseOptions) => {
|
|
72
|
+
if (!held) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
await releaseSafely({
|
|
76
|
+
coordinator: this.#coordinator,
|
|
77
|
+
lease,
|
|
78
|
+
retainRequested: releaseOptions?.retainTransactionBarrier === true
|
|
79
|
+
});
|
|
80
|
+
held = false;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function createNodeDocumentTransactionCoordinator(consumerRoot) {
|
|
86
|
+
const coordinator = await createNodeFoundationTransactionCoordinator(consumerRoot);
|
|
87
|
+
return new NodeDocumentTransactionCoordinator(coordinator);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=node-document-transaction-coordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-transaction-coordinator.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-transaction-coordinator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0CAA0C,EAAE,MAAM,4FAA4F,CAAC;AAexJ,SAAS,gBAAgB,CAAC,KAAa,EAAE,QAAgB;IACvD,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAY,CAAC;AACjD,CAAC;AAED,SAAS,uBAAuB,CAC9B,MAA2C;IAE3C,OAAO,CACL,MAAM,CAAC,KAAK,KAAK,SAAS;QAC1B,MAAM,CAAC,aAAa,KAAK,oBAAoB;QAC7C,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,gCAAgC;QACvE,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,cAAc;QACjE,MAAM,CAAC,QAAQ,CAAC,sBAAsB,KAAK,MAAM,CAAC,iBAAiB;QACnE,MAAM,CAAC,QAAQ,CAAC,4BAA4B;YAC1C,MAAM,CAAC,uBAAuB;QAChC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CACtB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,yCAAyC,CACjE,CACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,MAEpB;IACA,IAAI,MAAM,CAAC,KAAK,KAAK,0BAA0B,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,OAAO,CACL,MAAM,CAAC,WAAW,C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ACL,CAAC;AAED,MAAM,OAAO,kCAAkC;IAEpC,YAAY,CAAwB;IAE7C,YAAY,WAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,gBAAgB,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAEb;QACC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;YAC5C,iBAAiB,EAAE,oBAAoB;YACvC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS;gBAC5B,CAAC,CAAC,EAAE,eAAe,EAAE,oBAA6B,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;QACH,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,OAAO;YACL,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;YACtC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;gBAChC,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;gBACT,CAAC;gBACD,MAAM,aAAa,CAAC;oBAClB,WAAW,EAAE,IAAI,CAAC,YAAY;oBAC9B,KAAK;oBACL,eAAe,EACb,cAAc,EAAE,wBAAwB,KAAK,IAAI;iBACpD,CAAC,CAAC;gBACH,IAAI,GAAG,KAAK,CAAC;YACf,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,wCAAwC,CAC5D,YAAoB;IAEpB,MAAM,WAAW,GACf,MAAM,0CAA0C,CAAC,YAAY,CAAC,CAAC;IACjE,OAAO,IAAI,kCAAkC,CAAC,WAAW,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PortablePathIdentity } from "../../../repository-mutation/application/model/path-identity.js";
|
|
2
|
+
export interface RecapturedDocumentPublicationPaths {
|
|
3
|
+
readonly ancestryIdentities: readonly PortablePathIdentity[];
|
|
4
|
+
readonly destinationPath: string;
|
|
5
|
+
readonly parent: string;
|
|
6
|
+
readonly parentIdentity: PortablePathIdentity;
|
|
7
|
+
readonly root: string;
|
|
8
|
+
}
|
|
9
|
+
/** Recaptures strict real-directory ancestry; the result is valid only for the immediate operation. */
|
|
10
|
+
export declare function recaptureDocumentPublicationPaths(request: {
|
|
11
|
+
readonly consumerRoot: string;
|
|
12
|
+
readonly destination: string;
|
|
13
|
+
}): Promise<RecapturedDocumentPublicationPaths>;
|
|
14
|
+
export declare function sameDocumentPhysicalIdentity(left: PortablePathIdentity, right: PortablePathIdentity): boolean;
|
|
15
|
+
export declare function sameDocumentAncestry(left: readonly PortablePathIdentity[], right: readonly PortablePathIdentity[]): boolean;
|
|
16
|
+
//# sourceMappingURL=recapture-document-publication-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recapture-document-publication-paths.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/recapture-document-publication-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAI5G,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAgDD,uGAAuG;AACvG,wBAAsB,iCAAiC,CAAC,OAAO,EAAE;IAC/D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,GAAG,OAAO,CAAC,kCAAkC,CAAC,CA0C9C;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,oBAAoB,EAC1B,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAIT;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,oBAAoB,EAAE,EACrC,KAAK,EAAE,SAAS,oBAAoB,EAAE,GACrC,OAAO,CAIT"}
|