@software-dlc/cli 0.157.2
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/CHANGELOG.md +11 -0
- package/LICENSE +105 -0
- package/README.md +31 -0
- package/dist/checkout.d.ts +43 -0
- package/dist/checkout.d.ts.map +1 -0
- package/dist/checkout.js +92 -0
- package/dist/checkout.js.map +1 -0
- package/dist/cli-arguments.d.ts +13 -0
- package/dist/cli-arguments.d.ts.map +1 -0
- package/dist/cli-arguments.js +67 -0
- package/dist/cli-arguments.js.map +1 -0
- package/dist/cli-branch-history.d.ts +48 -0
- package/dist/cli-branch-history.d.ts.map +1 -0
- package/dist/cli-branch-history.js +319 -0
- package/dist/cli-branch-history.js.map +1 -0
- package/dist/cli-branches.d.ts +22 -0
- package/dist/cli-branches.d.ts.map +1 -0
- package/dist/cli-branches.js +59 -0
- package/dist/cli-branches.js.map +1 -0
- package/dist/cli-deploy.d.ts +14 -0
- package/dist/cli-deploy.d.ts.map +1 -0
- package/dist/cli-deploy.js +164 -0
- package/dist/cli-deploy.js.map +1 -0
- package/dist/cli-health.d.ts +3 -0
- package/dist/cli-health.d.ts.map +1 -0
- package/dist/cli-health.js +73 -0
- package/dist/cli-health.js.map +1 -0
- package/dist/cli-help.d.ts +21 -0
- package/dist/cli-help.d.ts.map +1 -0
- package/dist/cli-help.js +176 -0
- package/dist/cli-help.js.map +1 -0
- package/dist/cli-login.d.ts +76 -0
- package/dist/cli-login.d.ts.map +1 -0
- package/dist/cli-login.js +634 -0
- package/dist/cli-login.js.map +1 -0
- package/dist/cli-operation.d.ts +2 -0
- package/dist/cli-operation.d.ts.map +1 -0
- package/dist/cli-operation.js +66 -0
- package/dist/cli-operation.js.map +1 -0
- package/dist/cli-org.d.ts +12 -0
- package/dist/cli-org.d.ts.map +1 -0
- package/dist/cli-org.js +218 -0
- package/dist/cli-org.js.map +1 -0
- package/dist/cli-rebuild.d.ts +20 -0
- package/dist/cli-rebuild.d.ts.map +1 -0
- package/dist/cli-rebuild.js +29 -0
- package/dist/cli-rebuild.js.map +1 -0
- package/dist/cli-reset.d.ts +27 -0
- package/dist/cli-reset.d.ts.map +1 -0
- package/dist/cli-reset.js +44 -0
- package/dist/cli-reset.js.map +1 -0
- package/dist/cli-snapshot.d.ts +398 -0
- package/dist/cli-snapshot.d.ts.map +1 -0
- package/dist/cli-snapshot.js +45 -0
- package/dist/cli-snapshot.js.map +1 -0
- package/dist/cli-task-context.d.ts +3 -0
- package/dist/cli-task-context.d.ts.map +1 -0
- package/dist/cli-task-context.js +112 -0
- package/dist/cli-task-context.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1004 -0
- package/dist/cli.js.map +1 -0
- package/dist/graph-packages-lock.d.ts +169 -0
- package/dist/graph-packages-lock.d.ts.map +1 -0
- package/dist/graph-packages-lock.js +503 -0
- package/dist/graph-packages-lock.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/local/aggregate-preflight.d.ts +12 -0
- package/dist/local/aggregate-preflight.d.ts.map +1 -0
- package/dist/local/aggregate-preflight.js +22 -0
- package/dist/local/aggregate-preflight.js.map +1 -0
- package/dist/local/allow-mcp.d.ts +77 -0
- package/dist/local/allow-mcp.d.ts.map +1 -0
- package/dist/local/allow-mcp.js +394 -0
- package/dist/local/allow-mcp.js.map +1 -0
- package/dist/local/api-client.d.ts +15 -0
- package/dist/local/api-client.d.ts.map +1 -0
- package/dist/local/api-client.js +87 -0
- package/dist/local/api-client.js.map +1 -0
- package/dist/local/app-contract-readers.d.ts +229 -0
- package/dist/local/app-contract-readers.d.ts.map +1 -0
- package/dist/local/app-contract-readers.js +450 -0
- package/dist/local/app-contract-readers.js.map +1 -0
- package/dist/local/app-org-reader.d.ts +21 -0
- package/dist/local/app-org-reader.d.ts.map +1 -0
- package/dist/local/app-org-reader.js +66 -0
- package/dist/local/app-org-reader.js.map +1 -0
- package/dist/local/app-shell-readers.d.ts +96 -0
- package/dist/local/app-shell-readers.d.ts.map +1 -0
- package/dist/local/app-shell-readers.js +381 -0
- package/dist/local/app-shell-readers.js.map +1 -0
- package/dist/local/app-tasks-read.d.ts +202 -0
- package/dist/local/app-tasks-read.d.ts.map +1 -0
- package/dist/local/app-tasks-read.js +290 -0
- package/dist/local/app-tasks-read.js.map +1 -0
- package/dist/local/app-worktrees.d.ts +69 -0
- package/dist/local/app-worktrees.d.ts.map +1 -0
- package/dist/local/app-worktrees.js +554 -0
- package/dist/local/app-worktrees.js.map +1 -0
- package/dist/local/base-sync-manifest.d.ts +12 -0
- package/dist/local/base-sync-manifest.d.ts.map +1 -0
- package/dist/local/base-sync-manifest.js +57 -0
- package/dist/local/base-sync-manifest.js.map +1 -0
- package/dist/local/blast-radius.d.ts +191 -0
- package/dist/local/blast-radius.d.ts.map +1 -0
- package/dist/local/blast-radius.js +585 -0
- package/dist/local/blast-radius.js.map +1 -0
- package/dist/local/canonical.d.ts +2 -0
- package/dist/local/canonical.d.ts.map +1 -0
- package/dist/local/canonical.js +2 -0
- package/dist/local/canonical.js.map +1 -0
- package/dist/local/config.d.ts +22 -0
- package/dist/local/config.d.ts.map +1 -0
- package/dist/local/config.js +57 -0
- package/dist/local/config.js.map +1 -0
- package/dist/local/document-commands.d.ts +163 -0
- package/dist/local/document-commands.d.ts.map +1 -0
- package/dist/local/document-commands.js +620 -0
- package/dist/local/document-commands.js.map +1 -0
- package/dist/local/document-embeds.d.ts +21 -0
- package/dist/local/document-embeds.d.ts.map +1 -0
- package/dist/local/document-embeds.js +38 -0
- package/dist/local/document-embeds.js.map +1 -0
- package/dist/local/environment-context.d.ts +39 -0
- package/dist/local/environment-context.d.ts.map +1 -0
- package/dist/local/environment-context.js +193 -0
- package/dist/local/environment-context.js.map +1 -0
- package/dist/local/environment-exclude.d.ts +7 -0
- package/dist/local/environment-exclude.d.ts.map +1 -0
- package/dist/local/environment-exclude.js +82 -0
- package/dist/local/environment-exclude.js.map +1 -0
- package/dist/local/environment-sidecar.d.ts +126 -0
- package/dist/local/environment-sidecar.d.ts.map +1 -0
- package/dist/local/environment-sidecar.js +442 -0
- package/dist/local/environment-sidecar.js.map +1 -0
- package/dist/local/environment-switch.d.ts +22 -0
- package/dist/local/environment-switch.d.ts.map +1 -0
- package/dist/local/environment-switch.js +385 -0
- package/dist/local/environment-switch.js.map +1 -0
- package/dist/local/exact-remote-projection.d.ts +17 -0
- package/dist/local/exact-remote-projection.d.ts.map +1 -0
- package/dist/local/exact-remote-projection.js +53 -0
- package/dist/local/exact-remote-projection.js.map +1 -0
- package/dist/local/experimental/path-object-store.d.ts +66 -0
- package/dist/local/experimental/path-object-store.d.ts.map +1 -0
- package/dist/local/experimental/path-object-store.js +135 -0
- package/dist/local/experimental/path-object-store.js.map +1 -0
- package/dist/local/external-worktree-binding.d.ts +21 -0
- package/dist/local/external-worktree-binding.d.ts.map +1 -0
- package/dist/local/external-worktree-binding.js +56 -0
- package/dist/local/external-worktree-binding.js.map +1 -0
- package/dist/local/folder-members.d.ts +34 -0
- package/dist/local/folder-members.d.ts.map +1 -0
- package/dist/local/folder-members.js +168 -0
- package/dist/local/folder-members.js.map +1 -0
- package/dist/local/git-ref-authority.d.ts +11 -0
- package/dist/local/git-ref-authority.d.ts.map +1 -0
- package/dist/local/git-ref-authority.js +76 -0
- package/dist/local/git-ref-authority.js.map +1 -0
- package/dist/local/git.d.ts +88 -0
- package/dist/local/git.d.ts.map +1 -0
- package/dist/local/git.js +413 -0
- package/dist/local/git.js.map +1 -0
- package/dist/local/graph-read.d.ts +168 -0
- package/dist/local/graph-read.d.ts.map +1 -0
- package/dist/local/graph-read.js +360 -0
- package/dist/local/graph-read.js.map +1 -0
- package/dist/local/graph-sync.d.ts +39 -0
- package/dist/local/graph-sync.d.ts.map +1 -0
- package/dist/local/graph-sync.js +186 -0
- package/dist/local/graph-sync.js.map +1 -0
- package/dist/local/guide-commands.d.ts +79 -0
- package/dist/local/guide-commands.d.ts.map +1 -0
- package/dist/local/guide-commands.js +247 -0
- package/dist/local/guide-commands.js.map +1 -0
- package/dist/local/health-files.d.ts +24 -0
- package/dist/local/health-files.d.ts.map +1 -0
- package/dist/local/health-files.js +133 -0
- package/dist/local/health-files.js.map +1 -0
- package/dist/local/health-inspection.d.ts +12 -0
- package/dist/local/health-inspection.d.ts.map +1 -0
- package/dist/local/health-inspection.js +407 -0
- package/dist/local/health-inspection.js.map +1 -0
- package/dist/local/health-policy.d.ts +11 -0
- package/dist/local/health-policy.d.ts.map +1 -0
- package/dist/local/health-policy.js +257 -0
- package/dist/local/health-policy.js.map +1 -0
- package/dist/local/health-projection.d.ts +14 -0
- package/dist/local/health-projection.d.ts.map +1 -0
- package/dist/local/health-projection.js +102 -0
- package/dist/local/health-projection.js.map +1 -0
- package/dist/local/health-schema.d.ts +338 -0
- package/dist/local/health-schema.d.ts.map +1 -0
- package/dist/local/health-schema.js +213 -0
- package/dist/local/health-schema.js.map +1 -0
- package/dist/local/health-store.d.ts +61 -0
- package/dist/local/health-store.d.ts.map +1 -0
- package/dist/local/health-store.js +218 -0
- package/dist/local/health-store.js.map +1 -0
- package/dist/local/index.d.ts +66 -0
- package/dist/local/index.d.ts.map +1 -0
- package/dist/local/index.js +66 -0
- package/dist/local/index.js.map +1 -0
- package/dist/local/journey-commands.d.ts +65 -0
- package/dist/local/journey-commands.d.ts.map +1 -0
- package/dist/local/journey-commands.js +138 -0
- package/dist/local/journey-commands.js.map +1 -0
- package/dist/local/local-org-store.d.ts +46 -0
- package/dist/local/local-org-store.d.ts.map +1 -0
- package/dist/local/local-org-store.js +132 -0
- package/dist/local/local-org-store.js.map +1 -0
- package/dist/local/local-org.d.ts +389 -0
- package/dist/local/local-org.d.ts.map +1 -0
- package/dist/local/local-org.js +855 -0
- package/dist/local/local-org.js.map +1 -0
- package/dist/local/media-upload.d.ts +5 -0
- package/dist/local/media-upload.d.ts.map +1 -0
- package/dist/local/media-upload.js +41 -0
- package/dist/local/media-upload.js.map +1 -0
- package/dist/local/operation.d.ts +155 -0
- package/dist/local/operation.d.ts.map +1 -0
- package/dist/local/operation.js +340 -0
- package/dist/local/operation.js.map +1 -0
- package/dist/local/ownership-reader-schema.d.ts +117 -0
- package/dist/local/ownership-reader-schema.d.ts.map +1 -0
- package/dist/local/ownership-reader-schema.js +105 -0
- package/dist/local/ownership-reader-schema.js.map +1 -0
- package/dist/local/ownership-reader-worker.d.ts +2 -0
- package/dist/local/ownership-reader-worker.d.ts.map +1 -0
- package/dist/local/ownership-reader-worker.js +341 -0
- package/dist/local/ownership-reader-worker.js.map +1 -0
- package/dist/local/ownership-reader.d.ts +10 -0
- package/dist/local/ownership-reader.d.ts.map +1 -0
- package/dist/local/ownership-reader.js +93 -0
- package/dist/local/ownership-reader.js.map +1 -0
- package/dist/local/package-uses-check.d.ts +33 -0
- package/dist/local/package-uses-check.d.ts.map +1 -0
- package/dist/local/package-uses-check.js +62 -0
- package/dist/local/package-uses-check.js.map +1 -0
- package/dist/local/pending-recovery.d.ts +22 -0
- package/dist/local/pending-recovery.d.ts.map +1 -0
- package/dist/local/pending-recovery.js +171 -0
- package/dist/local/pending-recovery.js.map +1 -0
- package/dist/local/portable-commit-store.d.ts +28 -0
- package/dist/local/portable-commit-store.d.ts.map +1 -0
- package/dist/local/portable-commit-store.js +187 -0
- package/dist/local/portable-commit-store.js.map +1 -0
- package/dist/local/portable-commit.d.ts +109 -0
- package/dist/local/portable-commit.d.ts.map +1 -0
- package/dist/local/portable-commit.js +209 -0
- package/dist/local/portable-commit.js.map +1 -0
- package/dist/local/portable-remote.d.ts +432 -0
- package/dist/local/portable-remote.d.ts.map +1 -0
- package/dist/local/portable-remote.js +280 -0
- package/dist/local/portable-remote.js.map +1 -0
- package/dist/local/project-deleted.d.ts +4 -0
- package/dist/local/project-deleted.d.ts.map +1 -0
- package/dist/local/project-deleted.js +13 -0
- package/dist/local/project-deleted.js.map +1 -0
- package/dist/local/projection.d.ts +166 -0
- package/dist/local/projection.d.ts.map +1 -0
- package/dist/local/projection.js +709 -0
- package/dist/local/projection.js.map +1 -0
- package/dist/local/read-operation.d.ts +3 -0
- package/dist/local/read-operation.d.ts.map +1 -0
- package/dist/local/read-operation.js +19 -0
- package/dist/local/read-operation.js.map +1 -0
- package/dist/local/rebuild.d.ts +11 -0
- package/dist/local/rebuild.d.ts.map +1 -0
- package/dist/local/rebuild.js +42 -0
- package/dist/local/rebuild.js.map +1 -0
- package/dist/local/remote-base.d.ts +25 -0
- package/dist/local/remote-base.d.ts.map +1 -0
- package/dist/local/remote-base.js +68 -0
- package/dist/local/remote-base.js.map +1 -0
- package/dist/local/save-layout-worker.d.ts +19 -0
- package/dist/local/save-layout-worker.d.ts.map +1 -0
- package/dist/local/save-layout-worker.js +28 -0
- package/dist/local/save-layout-worker.js.map +1 -0
- package/dist/local/save-layout.d.ts +84 -0
- package/dist/local/save-layout.d.ts.map +1 -0
- package/dist/local/save-layout.js +221 -0
- package/dist/local/save-layout.js.map +1 -0
- package/dist/local/scope-impact.d.ts +31 -0
- package/dist/local/scope-impact.d.ts.map +1 -0
- package/dist/local/scope-impact.js +32 -0
- package/dist/local/scope-impact.js.map +1 -0
- package/dist/local/source-evidence/filesystem-worker.d.ts +2 -0
- package/dist/local/source-evidence/filesystem-worker.d.ts.map +1 -0
- package/dist/local/source-evidence/filesystem-worker.js +139 -0
- package/dist/local/source-evidence/filesystem-worker.js.map +1 -0
- package/dist/local/source-evidence/processes.d.ts +20 -0
- package/dist/local/source-evidence/processes.d.ts.map +1 -0
- package/dist/local/source-evidence/processes.js +133 -0
- package/dist/local/source-evidence/processes.js.map +1 -0
- package/dist/local/source-evidence/protocol.d.ts +52 -0
- package/dist/local/source-evidence/protocol.d.ts.map +1 -0
- package/dist/local/source-evidence/protocol.js +72 -0
- package/dist/local/source-evidence/protocol.js.map +1 -0
- package/dist/local/source-evidence/reader.d.ts +14 -0
- package/dist/local/source-evidence/reader.d.ts.map +1 -0
- package/dist/local/source-evidence/reader.js +308 -0
- package/dist/local/source-evidence/reader.js.map +1 -0
- package/dist/local/source-evidence/schema.d.ts +2504 -0
- package/dist/local/source-evidence/schema.d.ts.map +1 -0
- package/dist/local/source-evidence/schema.js +99 -0
- package/dist/local/source-evidence/schema.js.map +1 -0
- package/dist/local/source-policy/loader.d.ts +29 -0
- package/dist/local/source-policy/loader.d.ts.map +1 -0
- package/dist/local/source-policy/loader.js +209 -0
- package/dist/local/source-policy/loader.js.map +1 -0
- package/dist/local/source-policy/process.d.ts +7 -0
- package/dist/local/source-policy/process.d.ts.map +1 -0
- package/dist/local/source-policy/process.js +53 -0
- package/dist/local/source-policy/process.js.map +1 -0
- package/dist/local/source-policy/protocol.d.ts +27 -0
- package/dist/local/source-policy/protocol.d.ts.map +1 -0
- package/dist/local/source-policy/protocol.js +48 -0
- package/dist/local/source-policy/protocol.js.map +1 -0
- package/dist/local/source-policy/worker.d.ts +2 -0
- package/dist/local/source-policy/worker.d.ts.map +1 -0
- package/dist/local/source-policy/worker.js +100 -0
- package/dist/local/source-policy/worker.js.map +1 -0
- package/dist/local/state-directory.d.ts +17 -0
- package/dist/local/state-directory.d.ts.map +1 -0
- package/dist/local/state-directory.js +68 -0
- package/dist/local/state-directory.js.map +1 -0
- package/dist/local/store-database.d.ts +13 -0
- package/dist/local/store-database.d.ts.map +1 -0
- package/dist/local/store-database.js +187 -0
- package/dist/local/store-database.js.map +1 -0
- package/dist/local/store.d.ts +181 -0
- package/dist/local/store.d.ts.map +1 -0
- package/dist/local/store.js +585 -0
- package/dist/local/store.js.map +1 -0
- package/dist/local/sync.d.ts +47 -0
- package/dist/local/sync.d.ts.map +1 -0
- package/dist/local/sync.js +518 -0
- package/dist/local/sync.js.map +1 -0
- package/dist/local/task-context-inspection.d.ts +23 -0
- package/dist/local/task-context-inspection.d.ts.map +1 -0
- package/dist/local/task-context-inspection.js +165 -0
- package/dist/local/task-context-inspection.js.map +1 -0
- package/dist/local/task-context-observations.d.ts +9553 -0
- package/dist/local/task-context-observations.d.ts.map +1 -0
- package/dist/local/task-context-observations.js +232 -0
- package/dist/local/task-context-observations.js.map +1 -0
- package/dist/local/task-context-provider.d.ts +18 -0
- package/dist/local/task-context-provider.d.ts.map +1 -0
- package/dist/local/task-context-provider.js +231 -0
- package/dist/local/task-context-provider.js.map +1 -0
- package/dist/local/task-context-schema.d.ts +847 -0
- package/dist/local/task-context-schema.d.ts.map +1 -0
- package/dist/local/task-context-schema.js +305 -0
- package/dist/local/task-context-schema.js.map +1 -0
- package/dist/local/task-context-source.d.ts +16 -0
- package/dist/local/task-context-source.d.ts.map +1 -0
- package/dist/local/task-context-source.js +45 -0
- package/dist/local/task-context-source.js.map +1 -0
- package/dist/local/task-context.d.ts +14 -0
- package/dist/local/task-context.d.ts.map +1 -0
- package/dist/local/task-context.js +570 -0
- package/dist/local/task-context.js.map +1 -0
- package/dist/local/test-commands.d.ts +71 -0
- package/dist/local/test-commands.d.ts.map +1 -0
- package/dist/local/test-commands.js +292 -0
- package/dist/local/test-commands.js.map +1 -0
- package/dist/local/tree-save.d.ts +117 -0
- package/dist/local/tree-save.d.ts.map +1 -0
- package/dist/local/tree-save.js +615 -0
- package/dist/local/tree-save.js.map +1 -0
- package/dist/local/variants.d.ts +125 -0
- package/dist/local/variants.d.ts.map +1 -0
- package/dist/local/variants.js +267 -0
- package/dist/local/variants.js.map +1 -0
- package/dist/local/workspace-admission.d.ts +61 -0
- package/dist/local/workspace-admission.d.ts.map +1 -0
- package/dist/local/workspace-admission.js +112 -0
- package/dist/local/workspace-admission.js.map +1 -0
- package/dist/local/workspace-authority-guard.d.ts +18 -0
- package/dist/local/workspace-authority-guard.d.ts.map +1 -0
- package/dist/local/workspace-authority-guard.js +69 -0
- package/dist/local/workspace-authority-guard.js.map +1 -0
- package/dist/local/workspace-authority.d.ts +33 -0
- package/dist/local/workspace-authority.d.ts.map +1 -0
- package/dist/local/workspace-authority.js +33 -0
- package/dist/local/workspace-authority.js.map +1 -0
- package/dist/local/workspace-branch-runtime.d.ts +61 -0
- package/dist/local/workspace-branch-runtime.d.ts.map +1 -0
- package/dist/local/workspace-branch-runtime.js +216 -0
- package/dist/local/workspace-branch-runtime.js.map +1 -0
- package/dist/local/workspace-built-content.d.ts +137 -0
- package/dist/local/workspace-built-content.d.ts.map +1 -0
- package/dist/local/workspace-built-content.js +393 -0
- package/dist/local/workspace-built-content.js.map +1 -0
- package/dist/local/workspace-claim-status-read.d.ts +53 -0
- package/dist/local/workspace-claim-status-read.d.ts.map +1 -0
- package/dist/local/workspace-claim-status-read.js +118 -0
- package/dist/local/workspace-claim-status-read.js.map +1 -0
- package/dist/local/workspace-claim-status.d.ts +172 -0
- package/dist/local/workspace-claim-status.d.ts.map +1 -0
- package/dist/local/workspace-claim-status.js +721 -0
- package/dist/local/workspace-claim-status.js.map +1 -0
- package/dist/local/workspace-claim-views.d.ts +45 -0
- package/dist/local/workspace-claim-views.d.ts.map +1 -0
- package/dist/local/workspace-claim-views.js +45 -0
- package/dist/local/workspace-claim-views.js.map +1 -0
- package/dist/local/workspace-cli.d.ts +46 -0
- package/dist/local/workspace-cli.d.ts.map +1 -0
- package/dist/local/workspace-cli.js +1524 -0
- package/dist/local/workspace-cli.js.map +1 -0
- package/dist/local/workspace-commit-resolver.d.ts +19 -0
- package/dist/local/workspace-commit-resolver.d.ts.map +1 -0
- package/dist/local/workspace-commit-resolver.js +47 -0
- package/dist/local/workspace-commit-resolver.js.map +1 -0
- package/dist/local/workspace-decision-store.d.ts +184 -0
- package/dist/local/workspace-decision-store.d.ts.map +1 -0
- package/dist/local/workspace-decision-store.js +510 -0
- package/dist/local/workspace-decision-store.js.map +1 -0
- package/dist/local/workspace-environment-runtime.d.ts +107 -0
- package/dist/local/workspace-environment-runtime.d.ts.map +1 -0
- package/dist/local/workspace-environment-runtime.js +135 -0
- package/dist/local/workspace-environment-runtime.js.map +1 -0
- package/dist/local/workspace-evidence-drop.d.ts +21 -0
- package/dist/local/workspace-evidence-drop.d.ts.map +1 -0
- package/dist/local/workspace-evidence-drop.js +58 -0
- package/dist/local/workspace-evidence-drop.js.map +1 -0
- package/dist/local/workspace-evidence-sign-tool.d.ts +20 -0
- package/dist/local/workspace-evidence-sign-tool.d.ts.map +1 -0
- package/dist/local/workspace-evidence-sign-tool.js +85 -0
- package/dist/local/workspace-evidence-sign-tool.js.map +1 -0
- package/dist/local/workspace-evidence-status.d.ts +89 -0
- package/dist/local/workspace-evidence-status.d.ts.map +1 -0
- package/dist/local/workspace-evidence-status.js +141 -0
- package/dist/local/workspace-evidence-status.js.map +1 -0
- package/dist/local/workspace-evidence.d.ts +145 -0
- package/dist/local/workspace-evidence.d.ts.map +1 -0
- package/dist/local/workspace-evidence.js +347 -0
- package/dist/local/workspace-evidence.js.map +1 -0
- package/dist/local/workspace-graph-store.d.ts +32 -0
- package/dist/local/workspace-graph-store.d.ts.map +1 -0
- package/dist/local/workspace-graph-store.js +249 -0
- package/dist/local/workspace-graph-store.js.map +1 -0
- package/dist/local/workspace-handoff.d.ts +32 -0
- package/dist/local/workspace-handoff.d.ts.map +1 -0
- package/dist/local/workspace-handoff.js +144 -0
- package/dist/local/workspace-handoff.js.map +1 -0
- package/dist/local/workspace-history-journal.d.ts +70 -0
- package/dist/local/workspace-history-journal.d.ts.map +1 -0
- package/dist/local/workspace-history-journal.js +131 -0
- package/dist/local/workspace-history-journal.js.map +1 -0
- package/dist/local/workspace-history-store.d.ts +98 -0
- package/dist/local/workspace-history-store.d.ts.map +1 -0
- package/dist/local/workspace-history-store.js +632 -0
- package/dist/local/workspace-history-store.js.map +1 -0
- package/dist/local/workspace-history-types.d.ts +307 -0
- package/dist/local/workspace-history-types.d.ts.map +1 -0
- package/dist/local/workspace-history-types.js +2 -0
- package/dist/local/workspace-history-types.js.map +1 -0
- package/dist/local/workspace-integration-runtime.d.ts +48 -0
- package/dist/local/workspace-integration-runtime.d.ts.map +1 -0
- package/dist/local/workspace-integration-runtime.js +419 -0
- package/dist/local/workspace-integration-runtime.js.map +1 -0
- package/dist/local/workspace-lock.d.ts +7 -0
- package/dist/local/workspace-lock.d.ts.map +1 -0
- package/dist/local/workspace-lock.js +211 -0
- package/dist/local/workspace-lock.js.map +1 -0
- package/dist/local/workspace-merge.d.ts +77 -0
- package/dist/local/workspace-merge.d.ts.map +1 -0
- package/dist/local/workspace-merge.js +703 -0
- package/dist/local/workspace-merge.js.map +1 -0
- package/dist/local/workspace-mixed-history.d.ts +33 -0
- package/dist/local/workspace-mixed-history.d.ts.map +1 -0
- package/dist/local/workspace-mixed-history.js +107 -0
- package/dist/local/workspace-mixed-history.js.map +1 -0
- package/dist/local/workspace-overlap-allocation.d.ts +33 -0
- package/dist/local/workspace-overlap-allocation.d.ts.map +1 -0
- package/dist/local/workspace-overlap-allocation.js +69 -0
- package/dist/local/workspace-overlap-allocation.js.map +1 -0
- package/dist/local/workspace-overlap-impact.d.ts +46 -0
- package/dist/local/workspace-overlap-impact.d.ts.map +1 -0
- package/dist/local/workspace-overlap-impact.js +162 -0
- package/dist/local/workspace-overlap-impact.js.map +1 -0
- package/dist/local/workspace-overlap.d.ts +109 -0
- package/dist/local/workspace-overlap.d.ts.map +1 -0
- package/dist/local/workspace-overlap.js +327 -0
- package/dist/local/workspace-overlap.js.map +1 -0
- package/dist/local/workspace-paths.d.ts +4 -0
- package/dist/local/workspace-paths.d.ts.map +1 -0
- package/dist/local/workspace-paths.js +8 -0
- package/dist/local/workspace-paths.js.map +1 -0
- package/dist/local/workspace-pick-runtime.d.ts +70 -0
- package/dist/local/workspace-pick-runtime.d.ts.map +1 -0
- package/dist/local/workspace-pick-runtime.js +177 -0
- package/dist/local/workspace-pick-runtime.js.map +1 -0
- package/dist/local/workspace-pick-store.d.ts +33 -0
- package/dist/local/workspace-pick-store.d.ts.map +1 -0
- package/dist/local/workspace-pick-store.js +43 -0
- package/dist/local/workspace-pick-store.js.map +1 -0
- package/dist/local/workspace-pick.d.ts +73 -0
- package/dist/local/workspace-pick.d.ts.map +1 -0
- package/dist/local/workspace-pick.js +253 -0
- package/dist/local/workspace-pick.js.map +1 -0
- package/dist/local/workspace-portable-authoring.d.ts +43 -0
- package/dist/local/workspace-portable-authoring.d.ts.map +1 -0
- package/dist/local/workspace-portable-authoring.js +128 -0
- package/dist/local/workspace-portable-authoring.js.map +1 -0
- package/dist/local/workspace-prune.d.ts +63 -0
- package/dist/local/workspace-prune.d.ts.map +1 -0
- package/dist/local/workspace-prune.js +267 -0
- package/dist/local/workspace-prune.js.map +1 -0
- package/dist/local/workspace-remote-fetch.d.ts +82 -0
- package/dist/local/workspace-remote-fetch.d.ts.map +1 -0
- package/dist/local/workspace-remote-fetch.js +409 -0
- package/dist/local/workspace-remote-fetch.js.map +1 -0
- package/dist/local/workspace-remote-provider.d.ts +97 -0
- package/dist/local/workspace-remote-provider.d.ts.map +1 -0
- package/dist/local/workspace-remote-provider.js +400 -0
- package/dist/local/workspace-remote-provider.js.map +1 -0
- package/dist/local/workspace-remote-pull-request-journal.d.ts +49 -0
- package/dist/local/workspace-remote-pull-request-journal.d.ts.map +1 -0
- package/dist/local/workspace-remote-pull-request-journal.js +63 -0
- package/dist/local/workspace-remote-pull-request-journal.js.map +1 -0
- package/dist/local/workspace-remote-pull-request.d.ts +36 -0
- package/dist/local/workspace-remote-pull-request.d.ts.map +1 -0
- package/dist/local/workspace-remote-pull-request.js +158 -0
- package/dist/local/workspace-remote-pull-request.js.map +1 -0
- package/dist/local/workspace-remote-push.d.ts +88 -0
- package/dist/local/workspace-remote-push.d.ts.map +1 -0
- package/dist/local/workspace-remote-push.js +297 -0
- package/dist/local/workspace-remote-push.js.map +1 -0
- package/dist/local/workspace-remote-topic-journal.d.ts +56 -0
- package/dist/local/workspace-remote-topic-journal.d.ts.map +1 -0
- package/dist/local/workspace-remote-topic-journal.js +121 -0
- package/dist/local/workspace-remote-topic-journal.js.map +1 -0
- package/dist/local/workspace-remote-topic.d.ts +45 -0
- package/dist/local/workspace-remote-topic.d.ts.map +1 -0
- package/dist/local/workspace-remote-topic.js +204 -0
- package/dist/local/workspace-remote-topic.js.map +1 -0
- package/dist/local/workspace-remote-transfer.d.ts +76 -0
- package/dist/local/workspace-remote-transfer.d.ts.map +1 -0
- package/dist/local/workspace-remote-transfer.js +270 -0
- package/dist/local/workspace-remote-transfer.js.map +1 -0
- package/dist/local/workspace-resolution.d.ts +145 -0
- package/dist/local/workspace-resolution.d.ts.map +1 -0
- package/dist/local/workspace-resolution.js +479 -0
- package/dist/local/workspace-resolution.js.map +1 -0
- package/dist/local/workspace-resolver-provider.d.ts +72 -0
- package/dist/local/workspace-resolver-provider.d.ts.map +1 -0
- package/dist/local/workspace-resolver-provider.js +312 -0
- package/dist/local/workspace-resolver-provider.js.map +1 -0
- package/dist/local/workspace-runtime-handoff.d.ts +52 -0
- package/dist/local/workspace-runtime-handoff.d.ts.map +1 -0
- package/dist/local/workspace-runtime-handoff.js +237 -0
- package/dist/local/workspace-runtime-handoff.js.map +1 -0
- package/dist/local/workspace-runtime-lease.d.ts +26 -0
- package/dist/local/workspace-runtime-lease.d.ts.map +1 -0
- package/dist/local/workspace-runtime-lease.js +123 -0
- package/dist/local/workspace-runtime-lease.js.map +1 -0
- package/dist/local/workspace-runtime.d.ts +690 -0
- package/dist/local/workspace-runtime.d.ts.map +1 -0
- package/dist/local/workspace-runtime.js +2124 -0
- package/dist/local/workspace-runtime.js.map +1 -0
- package/dist/local/workspace-scope.d.ts +70 -0
- package/dist/local/workspace-scope.d.ts.map +1 -0
- package/dist/local/workspace-scope.js +206 -0
- package/dist/local/workspace-scope.js.map +1 -0
- package/dist/local/workspace-sources.d.ts +159 -0
- package/dist/local/workspace-sources.d.ts.map +1 -0
- package/dist/local/workspace-sources.js +570 -0
- package/dist/local/workspace-sources.js.map +1 -0
- package/dist/local/workspace-store-database.d.ts +5 -0
- package/dist/local/workspace-store-database.d.ts.map +1 -0
- package/dist/local/workspace-store-database.js +726 -0
- package/dist/local/workspace-store-database.js.map +1 -0
- package/dist/local/workspace-store.d.ts +261 -0
- package/dist/local/workspace-store.d.ts.map +1 -0
- package/dist/local/workspace-store.js +831 -0
- package/dist/local/workspace-store.js.map +1 -0
- package/dist/local/workspace-topology-runtime.d.ts +27 -0
- package/dist/local/workspace-topology-runtime.d.ts.map +1 -0
- package/dist/local/workspace-topology-runtime.js +396 -0
- package/dist/local/workspace-topology-runtime.js.map +1 -0
- package/dist/local/workspace-topology.d.ts +140 -0
- package/dist/local/workspace-topology.d.ts.map +1 -0
- package/dist/local/workspace-topology.js +359 -0
- package/dist/local/workspace-topology.js.map +1 -0
- package/dist/local/workspace-upstream-inspection.d.ts +60 -0
- package/dist/local/workspace-upstream-inspection.d.ts.map +1 -0
- package/dist/local/workspace-upstream-inspection.js +189 -0
- package/dist/local/workspace-upstream-inspection.js.map +1 -0
- package/dist/local/workspace-upstream-runtime.d.ts +91 -0
- package/dist/local/workspace-upstream-runtime.d.ts.map +1 -0
- package/dist/local/workspace-upstream-runtime.js +270 -0
- package/dist/local/workspace-upstream-runtime.js.map +1 -0
- package/dist/local/workspace-upstream-store.d.ts +51 -0
- package/dist/local/workspace-upstream-store.d.ts.map +1 -0
- package/dist/local/workspace-upstream-store.js +475 -0
- package/dist/local/workspace-upstream-store.js.map +1 -0
- package/dist/local/workspace-viewer-server.d.ts +136 -0
- package/dist/local/workspace-viewer-server.d.ts.map +1 -0
- package/dist/local/workspace-viewer-server.js +1097 -0
- package/dist/local/workspace-viewer-server.js.map +1 -0
- package/dist/local/workspace-viewer-snapshot.d.ts +49 -0
- package/dist/local/workspace-viewer-snapshot.d.ts.map +1 -0
- package/dist/local/workspace-viewer-snapshot.js +91 -0
- package/dist/local/workspace-viewer-snapshot.js.map +1 -0
- package/dist/local/worktree-projection.d.ts +76 -0
- package/dist/local/worktree-projection.d.ts.map +1 -0
- package/dist/local/worktree-projection.js +470 -0
- package/dist/local/worktree-projection.js.map +1 -0
- package/dist/mcp/client-identity.d.ts +8 -0
- package/dist/mcp/client-identity.d.ts.map +1 -0
- package/dist/mcp/client-identity.js +33 -0
- package/dist/mcp/client-identity.js.map +1 -0
- package/dist/mcp/graph-to-code.d.ts +53 -0
- package/dist/mcp/graph-to-code.d.ts.map +1 -0
- package/dist/mcp/graph-to-code.js +1624 -0
- package/dist/mcp/graph-to-code.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/stdio/graph-to-code.d.ts +3 -0
- package/dist/mcp/stdio/graph-to-code.d.ts.map +1 -0
- package/dist/mcp/stdio/graph-to-code.js +55 -0
- package/dist/mcp/stdio/graph-to-code.js.map +1 -0
- package/dist/mcp/stdio/worktree.d.ts +3 -0
- package/dist/mcp/stdio/worktree.d.ts.map +1 -0
- package/dist/mcp/stdio/worktree.js +67 -0
- package/dist/mcp/stdio/worktree.js.map +1 -0
- package/dist/mcp/worktree-claim-status.d.ts +162 -0
- package/dist/mcp/worktree-claim-status.d.ts.map +1 -0
- package/dist/mcp/worktree-claim-status.js +113 -0
- package/dist/mcp/worktree-claim-status.js.map +1 -0
- package/dist/mcp/worktree-dispatch.d.ts +13 -0
- package/dist/mcp/worktree-dispatch.d.ts.map +1 -0
- package/dist/mcp/worktree-dispatch.js +52 -0
- package/dist/mcp/worktree-dispatch.js.map +1 -0
- package/dist/mcp/worktree-errors.d.ts +15 -0
- package/dist/mcp/worktree-errors.d.ts.map +1 -0
- package/dist/mcp/worktree-errors.js +17 -0
- package/dist/mcp/worktree-errors.js.map +1 -0
- package/dist/mcp/worktree-health.d.ts +12 -0
- package/dist/mcp/worktree-health.d.ts.map +1 -0
- package/dist/mcp/worktree-health.js +32 -0
- package/dist/mcp/worktree-health.js.map +1 -0
- package/dist/mcp/worktree-results.d.ts +15 -0
- package/dist/mcp/worktree-results.d.ts.map +1 -0
- package/dist/mcp/worktree-results.js +12 -0
- package/dist/mcp/worktree-results.js.map +1 -0
- package/dist/mcp/worktree-task-context.d.ts +57 -0
- package/dist/mcp/worktree-task-context.d.ts.map +1 -0
- package/dist/mcp/worktree-task-context.js +45 -0
- package/dist/mcp/worktree-task-context.js.map +1 -0
- package/dist/mcp/worktree-tools.d.ts +2648 -0
- package/dist/mcp/worktree-tools.d.ts.map +1 -0
- package/dist/mcp/worktree-tools.js +192 -0
- package/dist/mcp/worktree-tools.js.map +1 -0
- package/dist/mcp/worktree.d.ts +33 -0
- package/dist/mcp/worktree.d.ts.map +1 -0
- package/dist/mcp/worktree.js +551 -0
- package/dist/mcp/worktree.js.map +1 -0
- package/dist/own-package.d.ts +13 -0
- package/dist/own-package.d.ts.map +1 -0
- package/dist/own-package.js +32 -0
- package/dist/own-package.js.map +1 -0
- package/dist/packages-browse.d.ts +107 -0
- package/dist/packages-browse.d.ts.map +1 -0
- package/dist/packages-browse.js +646 -0
- package/dist/packages-browse.js.map +1 -0
- package/dist/packages-cli.d.ts +8 -0
- package/dist/packages-cli.d.ts.map +1 -0
- package/dist/packages-cli.js +184 -0
- package/dist/packages-cli.js.map +1 -0
- package/dist/packages-uses.d.ts +46 -0
- package/dist/packages-uses.d.ts.map +1 -0
- package/dist/packages-uses.js +737 -0
- package/dist/packages-uses.js.map +1 -0
- package/dist/portable.d.ts +7 -0
- package/dist/portable.d.ts.map +1 -0
- package/dist/portable.js +14 -0
- package/dist/portable.js.map +1 -0
- package/dist/quiet-warnings.d.ts +3 -0
- package/dist/quiet-warnings.d.ts.map +1 -0
- package/dist/quiet-warnings.js +21 -0
- package/dist/quiet-warnings.js.map +1 -0
- package/dist/view-seam.d.ts +62 -0
- package/dist/view-seam.d.ts.map +1 -0
- package/dist/view-seam.js +70 -0
- package/dist/view-seam.js.map +1 -0
- package/generated/graph-packages/index.json +5 -0
- package/graph-packages.lock.json +4 -0
- package/package.json +81 -0
- package/viewer/assets/index-BZKGDARF.css +1 -0
- package/viewer/assets/index-DWu0CbZZ.js +272 -0
- package/viewer/index.html +13 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { introducedDanglingDocumentEmbeds } from './document-embeds.js';
|
|
2
|
+
import { composeGraphProjection } from './projection.js';
|
|
3
|
+
import { graphClaimChanges, readBuiltView } from './workspace-built-content.js';
|
|
4
|
+
import { localGraphRootHash } from './workspace-graph-store.js';
|
|
5
|
+
import { withWorkspaceOperationLock } from './workspace-lock.js';
|
|
6
|
+
import { mergeLocalPortableGraphs } from './workspace-merge.js';
|
|
7
|
+
import { workspaceControlDirectory, workspaceProjectionDirectory } from './workspace-paths.js';
|
|
8
|
+
import { resolveLocalGraphConflicts } from './workspace-resolution.js';
|
|
9
|
+
import { assertGraphChangesWithinTaskScope, assertNodeTypeRulesOnChangedNodes, assertNoRetiredKeysOnChangedNodes } from './workspace-scope.js';
|
|
10
|
+
import { assertIntroducedVocabularyAdmitted } from './workspace-admission.js';
|
|
11
|
+
export class LocalWorkspaceIntegrationRuntime {
|
|
12
|
+
store;
|
|
13
|
+
graphs;
|
|
14
|
+
authority;
|
|
15
|
+
commits;
|
|
16
|
+
materialize_projection;
|
|
17
|
+
constructor(store, graphs, authority, commits, materialize_projection) {
|
|
18
|
+
this.store = store;
|
|
19
|
+
this.graphs = graphs;
|
|
20
|
+
this.authority = authority;
|
|
21
|
+
this.commits = commits;
|
|
22
|
+
this.materialize_projection = materialize_projection;
|
|
23
|
+
}
|
|
24
|
+
async enqueue(input) {
|
|
25
|
+
const { workspace: coordinator } = await this.authority.requireCurrent(input.actor_workspace_id);
|
|
26
|
+
const child = this.requireWorkspace(input.child_workspace_id);
|
|
27
|
+
const refusal = this.store.decisions.integrationRefusal(child.id);
|
|
28
|
+
if (refusal)
|
|
29
|
+
throw new Error(refusal);
|
|
30
|
+
const child_commit_id = input.child_commit_id ?? child.head_sdlc_commit_id;
|
|
31
|
+
const base_graph = await this.commits.readGraph(this.store.history.findMergeBase(coordinator.head_sdlc_commit_id, child_commit_id));
|
|
32
|
+
const child_graph = await this.commits.readGraph(child_commit_id);
|
|
33
|
+
assertGraphChangesWithinTaskScope({
|
|
34
|
+
base_graph,
|
|
35
|
+
current_graph: child_graph,
|
|
36
|
+
task_scope: this.store.getWorkspaceTaskScope(child.id)
|
|
37
|
+
});
|
|
38
|
+
assertNoRetiredKeysOnChangedNodes({
|
|
39
|
+
base_graph,
|
|
40
|
+
current_graph: child_graph
|
|
41
|
+
});
|
|
42
|
+
assertNodeTypeRulesOnChangedNodes({
|
|
43
|
+
base_graph,
|
|
44
|
+
current_graph: child_graph
|
|
45
|
+
});
|
|
46
|
+
assertIntroducedVocabularyAdmitted({
|
|
47
|
+
base_graph,
|
|
48
|
+
graph: child_graph,
|
|
49
|
+
admission: this.store.admissions.get()
|
|
50
|
+
});
|
|
51
|
+
const queue_entry = this.store.history.enqueueChildCommit({
|
|
52
|
+
actor_workspace_id: coordinator.id,
|
|
53
|
+
child_workspace_id: child.id,
|
|
54
|
+
child_commit_id
|
|
55
|
+
});
|
|
56
|
+
if (input.gate) {
|
|
57
|
+
if (queue_entry.status !== 'queued' &&
|
|
58
|
+
!this.store.built_content.queueGate(queue_entry.id)) {
|
|
59
|
+
throw new Error('This commit already integrated without a gate; a gate merge needs a later commit.');
|
|
60
|
+
}
|
|
61
|
+
this.store.built_content.setQueueGate(queue_entry.id, input.gate);
|
|
62
|
+
}
|
|
63
|
+
else if (this.store.built_content.queueGate(queue_entry.id)) {
|
|
64
|
+
if (queue_entry.status !== 'integrated') {
|
|
65
|
+
throw new Error('This commit is already queued under a gate; run the integration before landing it.');
|
|
66
|
+
}
|
|
67
|
+
// A plan often lands with no commit after its gate: the same commit
|
|
68
|
+
// queues again, as a landing.
|
|
69
|
+
this.store.built_content.requeueAsLanding(queue_entry.id);
|
|
70
|
+
return this.store.history
|
|
71
|
+
.listIntegrationQueue(coordinator.id)
|
|
72
|
+
.find((entry) => entry.id === queue_entry.id);
|
|
73
|
+
}
|
|
74
|
+
return queue_entry;
|
|
75
|
+
}
|
|
76
|
+
/** The coordinator's graph as built (see workspace-built-content.ts). */
|
|
77
|
+
async readBuiltView(input) {
|
|
78
|
+
const coordinator = this.requireWorkspace(input.coordinator_workspace_id);
|
|
79
|
+
return readBuiltView({
|
|
80
|
+
graph: await this.commits.readGraph(coordinator.head_sdlc_commit_id),
|
|
81
|
+
pending: this.store.built_content.listPendingClaimContent(coordinator.id),
|
|
82
|
+
readGraph: (commit_id) => this.commits.readGraph(commit_id)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async integrate(input) {
|
|
86
|
+
const { workspace: coordinator } = await this.authority.requireCurrent(input.actor_workspace_id);
|
|
87
|
+
const max_retries = this.retryBudget(input.max_retries, 'Integration');
|
|
88
|
+
return withWorkspaceOperationLock({
|
|
89
|
+
control_dir: workspaceControlDirectory(coordinator),
|
|
90
|
+
operation: 'integrate',
|
|
91
|
+
run: async () => {
|
|
92
|
+
// Claims recorded before the store kept their content get it once, so
|
|
93
|
+
// the built view stops reading their commits' graphs.
|
|
94
|
+
await this.store.built_content.fillPendingClaimContent({
|
|
95
|
+
coordinator_workspace_id: coordinator.id,
|
|
96
|
+
readGraph: (commit_id) => this.commits.readGraph(commit_id)
|
|
97
|
+
});
|
|
98
|
+
for (let attempt = 0; attempt <= max_retries; attempt += 1) {
|
|
99
|
+
const result = await this.integrateAttempt(coordinator.id, input);
|
|
100
|
+
if (result.status === 'retrying' && attempt < max_retries)
|
|
101
|
+
continue;
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
throw new Error('Integration retry loop exited unexpectedly.');
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async reconcile(input) {
|
|
109
|
+
const { workspace: coordinator } = await this.authority.requireCurrent(input.actor_workspace_id);
|
|
110
|
+
const max_retries = this.retryBudget(input.max_retries, 'Reconciliation');
|
|
111
|
+
if (coordinator.source_workspace_id !== input.source_workspace_id) {
|
|
112
|
+
throw new Error('Source must match the recorded source workspace.');
|
|
113
|
+
}
|
|
114
|
+
return withWorkspaceOperationLock({
|
|
115
|
+
control_dir: workspaceControlDirectory(coordinator),
|
|
116
|
+
operation: 'reconcile-source',
|
|
117
|
+
run: async () => {
|
|
118
|
+
for (let attempt = 0; attempt <= max_retries; attempt += 1) {
|
|
119
|
+
const result = await this.reconcileAttempt(coordinator.id, input);
|
|
120
|
+
if (result.status === 'retrying' && attempt < max_retries)
|
|
121
|
+
continue;
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
throw new Error('Reconciliation retry loop exited unexpectedly.');
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async integrateAttempt(coordinator_id, input) {
|
|
129
|
+
const coordinator = this.requireWorkspace(coordinator_id);
|
|
130
|
+
await this.assertProjectionClean(coordinator);
|
|
131
|
+
// An entry queued before its workspace joined a Decision waits for the
|
|
132
|
+
// Selection without holding up the rest of the queue.
|
|
133
|
+
const candidates = this.store.history
|
|
134
|
+
.listIntegrationQueue(coordinator.id)
|
|
135
|
+
.filter((entry) => entry.status === 'queued' &&
|
|
136
|
+
!this.store.decisions.integrationRefusal(entry.child_workspace_id));
|
|
137
|
+
if (!candidates.length)
|
|
138
|
+
return { version: 1, status: 'empty' };
|
|
139
|
+
const coordinator_graph = await this.commits.readGraph(coordinator.head_sdlc_commit_id);
|
|
140
|
+
// Likewise an entry the vocabulary admission gate refuses: every publish
|
|
141
|
+
// turn rewrites the record, so it may refuse what it admitted at enqueue.
|
|
142
|
+
// The entry waits, queued, for its capability; the first refusal is thrown
|
|
143
|
+
// only when no entry can go.
|
|
144
|
+
const admission = this.store.admissions.get();
|
|
145
|
+
let picked = null;
|
|
146
|
+
let refusal = null;
|
|
147
|
+
for (const entry of candidates) {
|
|
148
|
+
// A plan reconciled with the coordinator shares the work it took in; its
|
|
149
|
+
// own changes are those since that point, not since it first forked.
|
|
150
|
+
const merge_base_commit_id = this.store.history.findMergeBase(coordinator.head_sdlc_commit_id, entry.child_commit_id);
|
|
151
|
+
const base_graph = await this.commits.readGraph(merge_base_commit_id);
|
|
152
|
+
const child_graph = await this.commits.readGraph(entry.child_commit_id);
|
|
153
|
+
// What the plan itself introduces, against its merge base: a mismatch
|
|
154
|
+
// that only merging with another plan creates stays the validator's
|
|
155
|
+
// warning.
|
|
156
|
+
// An entry queued before the node-type rule waits the same way, so it
|
|
157
|
+
// never holds the plans behind it (iss-477).
|
|
158
|
+
try {
|
|
159
|
+
assertIntroducedVocabularyAdmitted({
|
|
160
|
+
base_graph,
|
|
161
|
+
graph: child_graph,
|
|
162
|
+
admission
|
|
163
|
+
});
|
|
164
|
+
assertNodeTypeRulesOnChangedNodes({
|
|
165
|
+
base_graph,
|
|
166
|
+
current_graph: child_graph
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
refusal ??= error;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
picked = {
|
|
174
|
+
queue_entry: entry,
|
|
175
|
+
merge_base_commit_id,
|
|
176
|
+
base_graph,
|
|
177
|
+
child_graph
|
|
178
|
+
};
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
if (!picked)
|
|
182
|
+
throw refusal;
|
|
183
|
+
const { queue_entry, merge_base_commit_id, base_graph, child_graph } = picked;
|
|
184
|
+
const child = this.requireWorkspace(queue_entry.child_workspace_id);
|
|
185
|
+
const task_scope = this.store.getWorkspaceTaskScope(child.id);
|
|
186
|
+
assertGraphChangesWithinTaskScope({
|
|
187
|
+
base_graph,
|
|
188
|
+
current_graph: child_graph,
|
|
189
|
+
task_scope
|
|
190
|
+
});
|
|
191
|
+
assertNoRetiredKeysOnChangedNodes({
|
|
192
|
+
base_graph,
|
|
193
|
+
current_graph: child_graph
|
|
194
|
+
});
|
|
195
|
+
const deterministic_merge_result = mergeLocalPortableGraphs({
|
|
196
|
+
base_graph,
|
|
197
|
+
coordinator_graph,
|
|
198
|
+
child_graph
|
|
199
|
+
});
|
|
200
|
+
let merge_result = deterministic_merge_result;
|
|
201
|
+
let resolution_attempts = [];
|
|
202
|
+
if (deterministic_merge_result.status === 'blocked_conflict' &&
|
|
203
|
+
input.conflict_resolver) {
|
|
204
|
+
const resolution_result = await resolveLocalGraphConflicts({
|
|
205
|
+
base_graph,
|
|
206
|
+
coordinator_graph,
|
|
207
|
+
child_graph,
|
|
208
|
+
merge_result: deterministic_merge_result,
|
|
209
|
+
task_scope,
|
|
210
|
+
resolver: input.conflict_resolver,
|
|
211
|
+
budget: input.resolution_budget,
|
|
212
|
+
allow_network_resolver: input.allow_network_resolver,
|
|
213
|
+
persist_candidate_graph: (graph) => this.graphs.writeGraph(graph)
|
|
214
|
+
});
|
|
215
|
+
resolution_attempts = resolution_result.attempts;
|
|
216
|
+
if (resolution_result.status !== 'blocked_conflict') {
|
|
217
|
+
merge_result = resolution_result.merge_result;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (merge_result.status !== 'blocked_conflict') {
|
|
221
|
+
await this.graphs.writeGraph(merge_result.graph);
|
|
222
|
+
}
|
|
223
|
+
// Embeds neither side left dangling but the merge does: one plan removed
|
|
224
|
+
// an entity that the other plan's Document embeds. Reported, never refused.
|
|
225
|
+
const embed_warnings = merge_result.status === 'clean'
|
|
226
|
+
? introducedDanglingDocumentEmbeds({
|
|
227
|
+
base_graph: coordinator_graph,
|
|
228
|
+
graph: merge_result.graph
|
|
229
|
+
}).filter((warning) => introducedDanglingDocumentEmbeds({
|
|
230
|
+
base_graph: child_graph,
|
|
231
|
+
graph: merge_result.graph
|
|
232
|
+
}).some((other) => other.node_id === warning.node_id &&
|
|
233
|
+
other.block_id === warning.block_id))
|
|
234
|
+
: [];
|
|
235
|
+
const gate = this.store.built_content.queueGate(queue_entry.id);
|
|
236
|
+
const claim_changes = gate && merge_result.status === 'clean'
|
|
237
|
+
? graphClaimChanges({
|
|
238
|
+
before_graph: coordinator_graph,
|
|
239
|
+
after_graph: merge_result.graph
|
|
240
|
+
})
|
|
241
|
+
: [];
|
|
242
|
+
const result = this.store.history.integrateNext({
|
|
243
|
+
actor_workspace_id: coordinator.id,
|
|
244
|
+
expected_head_commit_id: coordinator.head_sdlc_commit_id,
|
|
245
|
+
expected_queue_entry_id: queue_entry.id,
|
|
246
|
+
merge_base_commit_id,
|
|
247
|
+
merge_result,
|
|
248
|
+
resolution_attempts,
|
|
249
|
+
// A gate merge leaves its claims pending; a landing builds them.
|
|
250
|
+
in_transaction: (commit) => {
|
|
251
|
+
if (gate) {
|
|
252
|
+
this.store.built_content.recordGateMerge({
|
|
253
|
+
coordinator_workspace_id: coordinator.id,
|
|
254
|
+
work_stream_workspace_id: child.id,
|
|
255
|
+
gate,
|
|
256
|
+
before_commit_id: coordinator.head_sdlc_commit_id,
|
|
257
|
+
before_graph: coordinator_graph,
|
|
258
|
+
gate_commit_id: commit.id,
|
|
259
|
+
gate_graph: merge_result.status === 'clean'
|
|
260
|
+
? merge_result.graph
|
|
261
|
+
: coordinator_graph,
|
|
262
|
+
changes: claim_changes
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
this.store.built_content.completeLanding({
|
|
267
|
+
coordinator_workspace_id: coordinator.id,
|
|
268
|
+
work_stream_workspace_id: child.id
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
validation_evidence: [
|
|
273
|
+
'complete graph validation passed',
|
|
274
|
+
...(resolution_attempts.length > 0
|
|
275
|
+
? ['bounded conflict resolution firewall passed']
|
|
276
|
+
: []),
|
|
277
|
+
...(embed_warnings.length > 0
|
|
278
|
+
? [
|
|
279
|
+
`Document embeds left dangling by this integration: ${embed_warnings
|
|
280
|
+
.map((w) => `${w.node_id}#${w.block_id} -> ${w.entity_kind} ${w.entity_id}`)
|
|
281
|
+
.join(', ')}`
|
|
282
|
+
]
|
|
283
|
+
: [])
|
|
284
|
+
]
|
|
285
|
+
});
|
|
286
|
+
if (result.status === 'integrated' && embed_warnings.length > 0) {
|
|
287
|
+
result.document_embed_warnings = embed_warnings;
|
|
288
|
+
}
|
|
289
|
+
if (result.status === 'integrated') {
|
|
290
|
+
// A gate merge is not a landing: the Decision stays selected until the
|
|
291
|
+
// winner's code lands.
|
|
292
|
+
if (!gate) {
|
|
293
|
+
this.store.decisions.markLanded({
|
|
294
|
+
workspace_id: child.id,
|
|
295
|
+
landed_commit_id: result.commit.id
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
await this.materialize_projection({
|
|
299
|
+
projection_dir: workspaceProjectionDirectory(coordinator),
|
|
300
|
+
graph: merge_result.status === 'clean'
|
|
301
|
+
? merge_result.graph
|
|
302
|
+
: coordinator_graph
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
return result;
|
|
306
|
+
}
|
|
307
|
+
async reconcileAttempt(coordinator_id, input) {
|
|
308
|
+
const coordinator = this.requireWorkspace(coordinator_id);
|
|
309
|
+
const source = this.requireWorkspace(input.source_workspace_id);
|
|
310
|
+
await this.assertProjectionClean(coordinator);
|
|
311
|
+
const last_observed_source_commit_id = this.store.history.lastReconciledSourceCommit(coordinator.id) ??
|
|
312
|
+
coordinator.fork_sdlc_commit_id;
|
|
313
|
+
if (!this.store.history.isAncestor(last_observed_source_commit_id, source.head_sdlc_commit_id)) {
|
|
314
|
+
throw new Error('Source workspace history diverged from the last observed source commit.');
|
|
315
|
+
}
|
|
316
|
+
if (this.store.history.isAncestor(source.head_sdlc_commit_id, coordinator.head_sdlc_commit_id)) {
|
|
317
|
+
return {
|
|
318
|
+
version: 1,
|
|
319
|
+
status: 'current',
|
|
320
|
+
source_commit_id: source.head_sdlc_commit_id,
|
|
321
|
+
child_commit_id: coordinator.head_sdlc_commit_id
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const merge_base_commit_id = this.store.history.findMergeBase(coordinator.head_sdlc_commit_id, source.head_sdlc_commit_id);
|
|
325
|
+
const base_graph = await this.commits.readGraph(merge_base_commit_id);
|
|
326
|
+
const coordinator_graph = await this.commits.readGraph(coordinator.head_sdlc_commit_id);
|
|
327
|
+
const source_graph = await this.commits.readGraph(source.head_sdlc_commit_id);
|
|
328
|
+
const task_scope = this.store.getWorkspaceTaskScope(coordinator.id);
|
|
329
|
+
assertGraphChangesWithinTaskScope({
|
|
330
|
+
base_graph,
|
|
331
|
+
current_graph: coordinator_graph,
|
|
332
|
+
task_scope
|
|
333
|
+
});
|
|
334
|
+
const deterministic_merge_result = mergeLocalPortableGraphs({
|
|
335
|
+
base_graph,
|
|
336
|
+
coordinator_graph,
|
|
337
|
+
child_graph: source_graph
|
|
338
|
+
});
|
|
339
|
+
let merge_result = deterministic_merge_result;
|
|
340
|
+
let resolution_attempts = [];
|
|
341
|
+
if (deterministic_merge_result.status === 'blocked_conflict' &&
|
|
342
|
+
input.conflict_resolver) {
|
|
343
|
+
const resolution_result = await resolveLocalGraphConflicts({
|
|
344
|
+
base_graph,
|
|
345
|
+
coordinator_graph,
|
|
346
|
+
child_graph: source_graph,
|
|
347
|
+
merge_result: deterministic_merge_result,
|
|
348
|
+
task_scope,
|
|
349
|
+
scope_base_graph: source_graph,
|
|
350
|
+
resolver: input.conflict_resolver,
|
|
351
|
+
budget: input.resolution_budget,
|
|
352
|
+
allow_network_resolver: input.allow_network_resolver,
|
|
353
|
+
persist_candidate_graph: (graph) => this.graphs.writeGraph(graph)
|
|
354
|
+
});
|
|
355
|
+
resolution_attempts = resolution_result.attempts;
|
|
356
|
+
if (resolution_result.status !== 'blocked_conflict') {
|
|
357
|
+
merge_result = resolution_result.merge_result;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (merge_result.status !== 'blocked_conflict') {
|
|
361
|
+
assertGraphChangesWithinTaskScope({
|
|
362
|
+
base_graph: source_graph,
|
|
363
|
+
current_graph: merge_result.graph,
|
|
364
|
+
task_scope
|
|
365
|
+
});
|
|
366
|
+
await this.graphs.writeGraph(merge_result.graph);
|
|
367
|
+
}
|
|
368
|
+
const result = this.store.history.reconcileSource({
|
|
369
|
+
actor_workspace_id: coordinator.id,
|
|
370
|
+
source_workspace_id: source.id,
|
|
371
|
+
expected_child_commit_id: coordinator.head_sdlc_commit_id,
|
|
372
|
+
expected_source_commit_id: source.head_sdlc_commit_id,
|
|
373
|
+
merge_base_commit_id,
|
|
374
|
+
merge_result,
|
|
375
|
+
resolution_attempts,
|
|
376
|
+
validation_evidence: resolution_attempts.length > 0
|
|
377
|
+
? [
|
|
378
|
+
'complete graph validation passed',
|
|
379
|
+
'bounded conflict resolution firewall passed',
|
|
380
|
+
'source-relative task scope passed'
|
|
381
|
+
]
|
|
382
|
+
: [
|
|
383
|
+
'complete graph validation passed',
|
|
384
|
+
'source-relative task scope passed'
|
|
385
|
+
]
|
|
386
|
+
});
|
|
387
|
+
if (result.status === 'reconciled') {
|
|
388
|
+
if (merge_result.status !== 'clean') {
|
|
389
|
+
throw new Error('Reconciled history result did not retain a clean graph candidate.');
|
|
390
|
+
}
|
|
391
|
+
await this.materialize_projection({
|
|
392
|
+
projection_dir: workspaceProjectionDirectory(coordinator),
|
|
393
|
+
graph: merge_result.graph
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
retryBudget(value, operation) {
|
|
399
|
+
const budget = value ?? 3;
|
|
400
|
+
if (!Number.isInteger(budget) || budget < 0 || budget > 16) {
|
|
401
|
+
throw new Error(`${operation} retry budget must be from 0 through 16.`);
|
|
402
|
+
}
|
|
403
|
+
return budget;
|
|
404
|
+
}
|
|
405
|
+
requireWorkspace(workspace_id) {
|
|
406
|
+
const workspace = this.store.getWorkspace(workspace_id);
|
|
407
|
+
if (!workspace)
|
|
408
|
+
throw new Error('Local workspace was not found.');
|
|
409
|
+
return workspace;
|
|
410
|
+
}
|
|
411
|
+
async assertProjectionClean(workspace) {
|
|
412
|
+
const { graph } = await composeGraphProjection(workspaceProjectionDirectory(workspace), undefined, { base: () => this.commits.readGraph(workspace.head_sdlc_commit_id) });
|
|
413
|
+
if (localGraphRootHash(graph) !==
|
|
414
|
+
this.commits.root(workspace.head_sdlc_commit_id)) {
|
|
415
|
+
throw new Error('Workspace projection has uncommitted changes; commit them before this operation.');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
//# sourceMappingURL=workspace-integration-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-integration-runtime.js","sourceRoot":"","sources":["../../src/local/workspace-integration-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,aAAa,EAGd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAEL,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAI3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAE9E,MAAM,OAAO,gCAAgC;IAExB;IACA;IACA;IACA;IACA;IALnB,YACmB,KAA0B,EAC1B,MAAgC,EAChC,SAAuC,EACvC,OAAqC,EACrC,sBAAyD;QAJzD,UAAK,GAAL,KAAK,CAAqB;QAC1B,WAAM,GAAN,MAAM,CAA0B;QAChC,cAAS,GAAT,SAAS,CAA8B;QACvC,YAAO,GAAP,OAAO,CAA8B;QACrC,2BAAsB,GAAtB,sBAAsB,CAAmC;IACzE,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,KAMb;QACC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,MAAM,IA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M,sBAAsB,CAC5C,4BAA4B,CAAC,SAAS,CAAC,EACvC,SAAS,EACT,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CACtE,CAAC;QACF,IACE,kBAAkB,CAAC,KAAK,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAChD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-lock.d.ts","sourceRoot":"","sources":["../../src/local/workspace-lock.ts"],"names":[],"mappings":"AAqKA,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,KAAK,EAAE;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgGb"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { checkOperation, setOperationPhase, currentOperation, OperationError } from './operation.js';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { link, mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
|
+
const LOCK_TOKEN_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
7
|
+
const CLAIM_FILE_PATTERN = new RegExp(`^\\.workspace-operation-(${LOCK_TOKEN_PATTERN.source.slice(1, -1)})\\.lock$`);
|
|
8
|
+
const RECOVERY_FILE_PATTERN = new RegExp(`^\\.workspace-operation-recovery-(${LOCK_TOKEN_PATTERN.source.slice(1, -1)})\\.lock$`);
|
|
9
|
+
function parseLockMetadata(value) {
|
|
10
|
+
let parsed;
|
|
11
|
+
try {
|
|
12
|
+
parsed = JSON.parse(value);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (typeof parsed !== 'object' ||
|
|
18
|
+
parsed === null ||
|
|
19
|
+
!('version' in parsed) ||
|
|
20
|
+
parsed.version !== 1 ||
|
|
21
|
+
!('token' in parsed) ||
|
|
22
|
+
typeof parsed.token !== 'string' ||
|
|
23
|
+
!('pid' in parsed) ||
|
|
24
|
+
typeof parsed.pid !== 'number' ||
|
|
25
|
+
!Number.isInteger(parsed.pid) ||
|
|
26
|
+
!('operation' in parsed) ||
|
|
27
|
+
typeof parsed.operation !== 'string' ||
|
|
28
|
+
!('created_at' in parsed) ||
|
|
29
|
+
typeof parsed.created_at !== 'string') {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
function processIsAlive(pid) {
|
|
35
|
+
try {
|
|
36
|
+
process.kill(pid, 0);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const code = typeof error === 'object' && error !== null && 'code' in error
|
|
41
|
+
? error.code
|
|
42
|
+
: null;
|
|
43
|
+
return code !== 'ESRCH';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function readLockMetadata(path) {
|
|
47
|
+
try {
|
|
48
|
+
return parseLockMetadata(await readFile(path, 'utf8'));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function removeOwnedLock(lock_path, token) {
|
|
55
|
+
const metadata = await readLockMetadata(lock_path);
|
|
56
|
+
if (metadata?.token === token)
|
|
57
|
+
await rm(lock_path, { force: true });
|
|
58
|
+
}
|
|
59
|
+
async function recoveryIsActive(control_dir) {
|
|
60
|
+
const entries = await readdir(control_dir, { withFileTypes: true });
|
|
61
|
+
let active = false;
|
|
62
|
+
for (const entry of entries) {
|
|
63
|
+
if (!RECOVERY_FILE_PATTERN.test(entry.name))
|
|
64
|
+
continue;
|
|
65
|
+
if (!entry.isFile()) {
|
|
66
|
+
active = true;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const recovery_path = join(control_dir, entry.name);
|
|
70
|
+
const metadata = await readLockMetadata(recovery_path);
|
|
71
|
+
if (!metadata || processIsAlive(metadata.pid)) {
|
|
72
|
+
active = true;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
await rm(recovery_path, { force: true });
|
|
76
|
+
}
|
|
77
|
+
return active;
|
|
78
|
+
}
|
|
79
|
+
async function removeDeadClaims(control_dir) {
|
|
80
|
+
const entries = await readdir(control_dir, { withFileTypes: true });
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
if (!entry.isFile() || !CLAIM_FILE_PATTERN.test(entry.name))
|
|
83
|
+
continue;
|
|
84
|
+
const claim_path = join(control_dir, entry.name);
|
|
85
|
+
const metadata = await readLockMetadata(claim_path);
|
|
86
|
+
if (metadata && !processIsAlive(metadata.pid)) {
|
|
87
|
+
await rm(claim_path, { force: true });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async function removeDeadLock(input) {
|
|
92
|
+
if (processIsAlive(input.observed.pid))
|
|
93
|
+
return false;
|
|
94
|
+
const recovery_token = randomUUID();
|
|
95
|
+
const recovery_path = join(input.control_dir, `.workspace-operation-recovery-${recovery_token}.lock`);
|
|
96
|
+
const recovery_metadata = {
|
|
97
|
+
version: 1,
|
|
98
|
+
token: recovery_token,
|
|
99
|
+
pid: process.pid,
|
|
100
|
+
operation: `recover:${input.operation}`,
|
|
101
|
+
created_at: new Date().toISOString()
|
|
102
|
+
};
|
|
103
|
+
await writeFile(recovery_path, JSON.stringify(recovery_metadata), {
|
|
104
|
+
encoding: 'utf8',
|
|
105
|
+
mode: 0o600,
|
|
106
|
+
flag: 'wx'
|
|
107
|
+
});
|
|
108
|
+
try {
|
|
109
|
+
const current = await readLockMetadata(input.lock_path);
|
|
110
|
+
if (!current ||
|
|
111
|
+
current.token !== input.observed.token ||
|
|
112
|
+
processIsAlive(current.pid)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
await rm(input.lock_path, { force: true });
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
await rm(recovery_path, { force: true });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export async function withWorkspaceOperationLock(input) {
|
|
123
|
+
setOperationPhase('lock_wait');
|
|
124
|
+
const context = currentOperation();
|
|
125
|
+
const timeout_ms = input.timeout_ms ?? 5_000;
|
|
126
|
+
if (!Number.isInteger(timeout_ms) || timeout_ms < 0 || timeout_ms > 60_000) {
|
|
127
|
+
throw new Error('Workspace lock timeout must be from 0 through 60000 ms.');
|
|
128
|
+
}
|
|
129
|
+
await mkdir(input.control_dir, { recursive: true, mode: 0o700 });
|
|
130
|
+
const lock_path = join(input.control_dir, 'workspace-operation.lock');
|
|
131
|
+
const token = randomUUID();
|
|
132
|
+
const claim_path = join(input.control_dir, `.workspace-operation-${token}.lock`);
|
|
133
|
+
const metadata = {
|
|
134
|
+
version: 1,
|
|
135
|
+
token,
|
|
136
|
+
pid: process.pid,
|
|
137
|
+
operation: input.operation,
|
|
138
|
+
created_at: new Date().toISOString()
|
|
139
|
+
};
|
|
140
|
+
await writeFile(claim_path, JSON.stringify(metadata), {
|
|
141
|
+
encoding: 'utf8',
|
|
142
|
+
mode: 0o600,
|
|
143
|
+
flag: 'wx'
|
|
144
|
+
});
|
|
145
|
+
const started_at = Date.now();
|
|
146
|
+
try {
|
|
147
|
+
await removeDeadClaims(input.control_dir);
|
|
148
|
+
while (true) {
|
|
149
|
+
checkOperation();
|
|
150
|
+
if (await recoveryIsActive(input.control_dir)) {
|
|
151
|
+
if (Date.now() - started_at >= timeout_ms) {
|
|
152
|
+
throw context
|
|
153
|
+
? new OperationError('lock_busy', context.operation)
|
|
154
|
+
: new Error(`Workspace is busy with another operation: ${input.operation}`);
|
|
155
|
+
}
|
|
156
|
+
await delay(25, undefined, { signal: context?.signal });
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
await link(claim_path, lock_path);
|
|
161
|
+
if (await recoveryIsActive(input.control_dir)) {
|
|
162
|
+
await removeOwnedLock(lock_path, token);
|
|
163
|
+
if (Date.now() - started_at >= timeout_ms) {
|
|
164
|
+
throw context
|
|
165
|
+
? new OperationError('lock_busy', context.operation)
|
|
166
|
+
: new Error(`Workspace is busy with another operation: ${input.operation}`);
|
|
167
|
+
}
|
|
168
|
+
await delay(25, undefined, { signal: context?.signal });
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
const code = typeof error === 'object' && error !== null && 'code' in error
|
|
175
|
+
? error.code
|
|
176
|
+
: null;
|
|
177
|
+
if (code !== 'EEXIST')
|
|
178
|
+
throw error;
|
|
179
|
+
const observed = await readLockMetadata(lock_path);
|
|
180
|
+
if (observed &&
|
|
181
|
+
(await removeDeadLock({
|
|
182
|
+
control_dir: input.control_dir,
|
|
183
|
+
lock_path,
|
|
184
|
+
observed,
|
|
185
|
+
operation: input.operation
|
|
186
|
+
}))) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (Date.now() - started_at >= timeout_ms) {
|
|
190
|
+
throw context
|
|
191
|
+
? new OperationError('lock_busy', context.operation)
|
|
192
|
+
: new Error(`Workspace is busy with another operation: ${input.operation}`);
|
|
193
|
+
}
|
|
194
|
+
await delay(25, undefined, { signal: context?.signal });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
await rm(claim_path, { force: true });
|
|
198
|
+
setOperationPhase('local');
|
|
199
|
+
return await input.run();
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
await rm(claim_path, { force: true });
|
|
203
|
+
try {
|
|
204
|
+
await removeOwnedLock(lock_path, token);
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
// A missing lock is already released; a replacement lock is never removed.
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=workspace-lock.js.map
|