@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,703 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { findIntroducedDanglingUiInstanceReferences, mergeDocumentCompositions, mergeUiInstanceTrees } from '@software-dlc/graph/computation';
|
|
3
|
+
import { c4NodeTypeIssuesOnChangedNodes, portable_graph_schema } from '@software-dlc/graph/schema';
|
|
4
|
+
import { canonicalizePortableGraph, stringifyCanonicalGraph, stringifyCanonicalJson } from './canonical.js';
|
|
5
|
+
import { validateProjectionGraph } from './projection.js';
|
|
6
|
+
import { differsOnlyInSignFields, pickSignedReference } from '@software-dlc/graph/schema';
|
|
7
|
+
import { entityObjectHash } from './workspace-evidence-status.js';
|
|
8
|
+
import { packageUsesByKey } from './workspace-scope.js';
|
|
9
|
+
const MISSING_VALUE = Symbol('missing');
|
|
10
|
+
function isRecord(value) {
|
|
11
|
+
return (value !== MISSING_VALUE &&
|
|
12
|
+
value !== null &&
|
|
13
|
+
typeof value === 'object' &&
|
|
14
|
+
!Array.isArray(value));
|
|
15
|
+
}
|
|
16
|
+
function valuesEqual(left, right) {
|
|
17
|
+
if (left === MISSING_VALUE || right === MISSING_VALUE)
|
|
18
|
+
return left === right;
|
|
19
|
+
return stringifyCanonicalJson(left) === stringifyCanonicalJson(right);
|
|
20
|
+
}
|
|
21
|
+
function fieldPath(parent_path, key) {
|
|
22
|
+
const escaped_key = key.replaceAll('~', '~0').replaceAll('/', '~1');
|
|
23
|
+
return `${parent_path}/${escaped_key}`;
|
|
24
|
+
}
|
|
25
|
+
const UI_SURFACE_PATHS = new Set([
|
|
26
|
+
'/data/data/ui_frame',
|
|
27
|
+
'/data/data/ui_component_definition'
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Merges a UI surface whose authored instance tree both sides edited by
|
|
31
|
+
* stable instance id instead of as one atomic `children` array. Returns
|
|
32
|
+
* undefined to fall back to the generic merge (and its existing conflict
|
|
33
|
+
* coordinates) when the tree is template-backed, conflicts by instance id, or
|
|
34
|
+
* the merge would break a slot or binding reference.
|
|
35
|
+
*/
|
|
36
|
+
function mergeUiSurfaceByInstanceId(input) {
|
|
37
|
+
if (input.entity_kind !== 'node' ||
|
|
38
|
+
!UI_SURFACE_PATHS.has(input.field_path) ||
|
|
39
|
+
!isRecord(input.base) ||
|
|
40
|
+
!isRecord(input.ours) ||
|
|
41
|
+
!isRecord(input.theirs)) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const { base, ours, theirs } = input;
|
|
45
|
+
// Template deltas can only be expanded against the app template catalog.
|
|
46
|
+
const deltas = (surface) => surface.authored_tree_changes ?? MISSING_VALUE;
|
|
47
|
+
if (!valuesEqual(deltas(base), deltas(ours)) ||
|
|
48
|
+
!valuesEqual(deltas(base), deltas(theirs))) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const trees = [base, ours, theirs].map((surface) => surface.root_instance_tree);
|
|
52
|
+
if (!trees.every((tree) => isRecord(tree)))
|
|
53
|
+
return undefined;
|
|
54
|
+
const [base_tree, ours_tree, theirs_tree] = trees;
|
|
55
|
+
if (valuesEqual(base_tree, ours_tree) ||
|
|
56
|
+
valuesEqual(base_tree, theirs_tree)) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
const tree_merge = mergeUiInstanceTrees(base_tree, ours_tree, theirs_tree);
|
|
60
|
+
if (!tree_merge.tree)
|
|
61
|
+
return undefined;
|
|
62
|
+
const withoutTree = ({ root_instance_tree: _tree, ...rest }) => rest;
|
|
63
|
+
const conflict_count = input.conflicts.length;
|
|
64
|
+
const rest = mergeValue({
|
|
65
|
+
...input,
|
|
66
|
+
base: withoutTree(base),
|
|
67
|
+
ours: withoutTree(ours),
|
|
68
|
+
theirs: withoutTree(theirs)
|
|
69
|
+
});
|
|
70
|
+
const introduced = findIntroducedDanglingUiInstanceReferences({
|
|
71
|
+
merged: { owner: rest, tree: tree_merge.tree },
|
|
72
|
+
target: { owner: ours, tree: ours_tree },
|
|
73
|
+
source: { owner: theirs, tree: theirs_tree }
|
|
74
|
+
});
|
|
75
|
+
if (introduced.length) {
|
|
76
|
+
input.conflicts.splice(conflict_count);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return { ...rest, root_instance_tree: tree_merge.tree };
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Merges a Document whose composition both sides edited by block id instead of
|
|
83
|
+
* as one atomic `blocks` array. Returns undefined to fall back to the generic
|
|
84
|
+
* merge and its existing conflict coordinates when blocks conflict by id or
|
|
85
|
+
* the merged composition would be invalid.
|
|
86
|
+
*/
|
|
87
|
+
function mergeDocumentByBlockId(input) {
|
|
88
|
+
if (input.entity_kind !== 'node' ||
|
|
89
|
+
input.field_path !== '/data/data/document' ||
|
|
90
|
+
!isRecord(input.base) ||
|
|
91
|
+
!isRecord(input.ours) ||
|
|
92
|
+
!isRecord(input.theirs)) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const { base, ours, theirs } = input;
|
|
96
|
+
const compositions = [base, ours, theirs].map((document) => document.composition);
|
|
97
|
+
if (!compositions.every((composition) => isRecord(composition))) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const [base_composition, ours_composition, theirs_composition] = compositions;
|
|
101
|
+
if (valuesEqual(base_composition, ours_composition) ||
|
|
102
|
+
valuesEqual(base_composition, theirs_composition)) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const merged = mergeDocumentCompositions(base_composition, ours_composition, theirs_composition);
|
|
106
|
+
if (!merged.composition)
|
|
107
|
+
return undefined;
|
|
108
|
+
const withoutComposition = ({ composition: _composition, ...rest }) => rest;
|
|
109
|
+
const rest = mergeValue({
|
|
110
|
+
...input,
|
|
111
|
+
base: withoutComposition(base),
|
|
112
|
+
ours: withoutComposition(ours),
|
|
113
|
+
theirs: withoutComposition(theirs)
|
|
114
|
+
});
|
|
115
|
+
return { ...rest, composition: merged.composition };
|
|
116
|
+
}
|
|
117
|
+
const ACCEPTANCE_CRITERIA_PATH = '/data/data/acceptance_criteria';
|
|
118
|
+
/** The criteria of one side by id, or undefined when they are not a list keyed by unique string ids. */
|
|
119
|
+
function criteriaById(value) {
|
|
120
|
+
const list = value === MISSING_VALUE ? [] : value;
|
|
121
|
+
if (!Array.isArray(list) ||
|
|
122
|
+
!list.every((criterion) => isRecord(criterion) && typeof criterion.id === 'string')) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
const byId = new Map(list.map((criterion) => [
|
|
126
|
+
criterion.id,
|
|
127
|
+
criterion
|
|
128
|
+
]));
|
|
129
|
+
return byId.size === list.length ? byId : undefined;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Merges a node's acceptance criteria that both sides changed by criterion
|
|
133
|
+
* id instead of as one atomic array, as Documents merge by block id: two plans
|
|
134
|
+
* that change different criteria of one story both land, and only the same
|
|
135
|
+
* criterion changed on both sides conflicts, at
|
|
136
|
+
* `/data/data/acceptance_criteria/<id>`. Kept criteria take the order of the
|
|
137
|
+
* side that reordered them; new ones follow, the coordinator's first. Returns
|
|
138
|
+
* undefined to fall back to the generic merge when a side is not a list keyed
|
|
139
|
+
* by unique ids, or both sides reordered differently.
|
|
140
|
+
*/
|
|
141
|
+
function mergeAcceptanceCriteriaById(input) {
|
|
142
|
+
if (input.entity_kind !== 'node' ||
|
|
143
|
+
input.field_path !== ACCEPTANCE_CRITERIA_PATH ||
|
|
144
|
+
input.ours === MISSING_VALUE ||
|
|
145
|
+
input.theirs === MISSING_VALUE) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
const base = criteriaById(input.base);
|
|
149
|
+
const ours = criteriaById(input.ours);
|
|
150
|
+
const theirs = criteriaById(input.theirs);
|
|
151
|
+
if (!base || !ours || !theirs)
|
|
152
|
+
return undefined;
|
|
153
|
+
const keptOrder = (side) => [...side.keys()].filter((id) => base.has(id));
|
|
154
|
+
const base_order = [...base.keys()];
|
|
155
|
+
const kept = base_order.filter((id) => ours.has(id) && theirs.has(id));
|
|
156
|
+
const relative = (order) => order.filter((id) => kept.includes(id));
|
|
157
|
+
const ours_order = relative(keptOrder(ours));
|
|
158
|
+
const theirs_order = relative(keptOrder(theirs));
|
|
159
|
+
const base_relative = relative(base_order);
|
|
160
|
+
const same = (a, b) => a.length === b.length && a.every((id, index) => id === b[index]);
|
|
161
|
+
let order;
|
|
162
|
+
if (same(ours_order, base_relative))
|
|
163
|
+
order = theirs_order;
|
|
164
|
+
else if (same(theirs_order, base_relative) || same(ours_order, theirs_order))
|
|
165
|
+
order = ours_order;
|
|
166
|
+
else
|
|
167
|
+
return undefined;
|
|
168
|
+
// Criteria one side removed are merged too, so a removal against an edit conflicts.
|
|
169
|
+
const removed = base_order.filter((id) => !kept.includes(id));
|
|
170
|
+
const added = [
|
|
171
|
+
...[...ours.keys()].filter((id) => !base.has(id)),
|
|
172
|
+
...[...theirs.keys()].filter((id) => !base.has(id) && !ours.has(id))
|
|
173
|
+
];
|
|
174
|
+
const merged = [];
|
|
175
|
+
for (const id of [...order, ...removed, ...added]) {
|
|
176
|
+
const value = mergeValue({
|
|
177
|
+
...input,
|
|
178
|
+
base: base.get(id) ?? MISSING_VALUE,
|
|
179
|
+
ours: ours.get(id) ?? MISSING_VALUE,
|
|
180
|
+
theirs: theirs.get(id) ?? MISSING_VALUE,
|
|
181
|
+
field_path: fieldPath(ACCEPTANCE_CRITERIA_PATH, id)
|
|
182
|
+
});
|
|
183
|
+
if (value !== MISSING_VALUE)
|
|
184
|
+
merged.push(value);
|
|
185
|
+
}
|
|
186
|
+
return merged;
|
|
187
|
+
}
|
|
188
|
+
const EVIDENCE_PATH = '/data/meta/evidence';
|
|
189
|
+
/**
|
|
190
|
+
* Merges an evidence set both sides changed per reference, by reference_id
|
|
191
|
+
* (docs/specs/evidence-claim-freshness.md, Merging signed evidence). Two
|
|
192
|
+
* versions of a reference that differ only in the fields sign writes do not
|
|
193
|
+
* conflict; the side kept is chosen after the entity merges, from its merged
|
|
194
|
+
* hash. Any other difference on one reference conflicts at that reference.
|
|
195
|
+
* Returns undefined to fall back to the generic merge when a set is not a
|
|
196
|
+
* reference list keyed by unique ids.
|
|
197
|
+
*/
|
|
198
|
+
function mergeEvidenceByReference(input) {
|
|
199
|
+
if ((input.entity_kind !== 'node' && input.entity_kind !== 'edge') ||
|
|
200
|
+
input.field_path !== EVIDENCE_PATH ||
|
|
201
|
+
!isRecord(input.ours) ||
|
|
202
|
+
!isRecord(input.theirs) ||
|
|
203
|
+
!(isRecord(input.base) || input.base === MISSING_VALUE)) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
const sides = [
|
|
207
|
+
isRecord(input.base) ? input.base : { references: [] },
|
|
208
|
+
input.ours,
|
|
209
|
+
input.theirs
|
|
210
|
+
];
|
|
211
|
+
const lists = sides.map((side) => side.references);
|
|
212
|
+
if (!lists.every((list) => Array.isArray(list) &&
|
|
213
|
+
list.every((reference) => isRecord(reference) && typeof reference.reference_id === 'string') &&
|
|
214
|
+
new Set(list.map((reference) => reference.reference_id)).size ===
|
|
215
|
+
list.length)) {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
const [base, ours, theirs] = lists.map((list) => new Map(list.map((reference) => [reference.reference_id, reference])));
|
|
219
|
+
const withoutReferences = ({ references: _references, symbolic_ref: _symbolic_ref, ...rest }) => rest;
|
|
220
|
+
const rest = mergeValue({
|
|
221
|
+
...input,
|
|
222
|
+
base: isRecord(input.base) ? withoutReferences(input.base) : MISSING_VALUE,
|
|
223
|
+
ours: withoutReferences(input.ours),
|
|
224
|
+
theirs: withoutReferences(input.theirs)
|
|
225
|
+
});
|
|
226
|
+
// The importer's identity is one value: keys from two sides never combine.
|
|
227
|
+
const symbolicRef = (side) => isRecord(side) && side.symbolic_ref !== undefined
|
|
228
|
+
? side.symbolic_ref
|
|
229
|
+
: MISSING_VALUE;
|
|
230
|
+
const [symbolic_before, symbolic_ours, symbolic_theirs] = [
|
|
231
|
+
input.base,
|
|
232
|
+
input.ours,
|
|
233
|
+
input.theirs
|
|
234
|
+
].map(symbolicRef);
|
|
235
|
+
let symbolic_ref;
|
|
236
|
+
if (valuesEqual(symbolic_ours, symbolic_theirs))
|
|
237
|
+
symbolic_ref = symbolic_ours;
|
|
238
|
+
else if (valuesEqual(symbolic_ours, symbolic_before))
|
|
239
|
+
symbolic_ref = symbolic_theirs;
|
|
240
|
+
else if (valuesEqual(symbolic_theirs, symbolic_before))
|
|
241
|
+
symbolic_ref = symbolic_ours;
|
|
242
|
+
else
|
|
243
|
+
symbolic_ref = recordConflict({
|
|
244
|
+
...input,
|
|
245
|
+
base: symbolic_before,
|
|
246
|
+
ours: symbolic_ours,
|
|
247
|
+
theirs: symbolic_theirs,
|
|
248
|
+
field_path: `${EVIDENCE_PATH}/symbolic_ref`
|
|
249
|
+
});
|
|
250
|
+
// Base order first, then additions by id, so both merge directions order alike.
|
|
251
|
+
const order = [
|
|
252
|
+
...base.keys(),
|
|
253
|
+
...[...new Set([...ours.keys(), ...theirs.keys()])]
|
|
254
|
+
.filter((id) => !base.has(id))
|
|
255
|
+
.sort()
|
|
256
|
+
];
|
|
257
|
+
const references = [];
|
|
258
|
+
for (const reference_id of order) {
|
|
259
|
+
const before = base.get(reference_id) ?? MISSING_VALUE;
|
|
260
|
+
const left = ours.get(reference_id) ?? MISSING_VALUE;
|
|
261
|
+
const right = theirs.get(reference_id) ?? MISSING_VALUE;
|
|
262
|
+
let merged;
|
|
263
|
+
if (valuesEqual(left, right))
|
|
264
|
+
merged = left;
|
|
265
|
+
else if (valuesEqual(left, before))
|
|
266
|
+
merged = right;
|
|
267
|
+
else if (valuesEqual(right, before))
|
|
268
|
+
merged = left;
|
|
269
|
+
else if (isRecord(left) &&
|
|
270
|
+
isRecord(right) &&
|
|
271
|
+
differsOnlyInSignFields(left, right)) {
|
|
272
|
+
merged = pickSignedReference(left, right, null);
|
|
273
|
+
input.sign_ties?.push({
|
|
274
|
+
entity_id: input.entity_id,
|
|
275
|
+
references,
|
|
276
|
+
index: references.length,
|
|
277
|
+
ours: left,
|
|
278
|
+
theirs: right
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
merged = recordConflict({
|
|
283
|
+
...input,
|
|
284
|
+
base: before,
|
|
285
|
+
ours: left,
|
|
286
|
+
theirs: right,
|
|
287
|
+
field_path: `${EVIDENCE_PATH}/references/${reference_id}`
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (merged !== MISSING_VALUE)
|
|
291
|
+
references.push(merged);
|
|
292
|
+
}
|
|
293
|
+
return {
|
|
294
|
+
...(isRecord(rest) ? rest : {}),
|
|
295
|
+
...(symbolic_ref === MISSING_VALUE ? {} : { symbolic_ref }),
|
|
296
|
+
references
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function mergeValue(input) {
|
|
300
|
+
if (valuesEqual(input.ours, input.theirs))
|
|
301
|
+
return input.ours;
|
|
302
|
+
if (valuesEqual(input.ours, input.base))
|
|
303
|
+
return input.theirs;
|
|
304
|
+
if (valuesEqual(input.theirs, input.base))
|
|
305
|
+
return input.ours;
|
|
306
|
+
const ui_surface = mergeUiSurfaceByInstanceId(input);
|
|
307
|
+
if (ui_surface)
|
|
308
|
+
return ui_surface;
|
|
309
|
+
const document = mergeDocumentByBlockId(input);
|
|
310
|
+
if (document)
|
|
311
|
+
return document;
|
|
312
|
+
const evidence = mergeEvidenceByReference(input);
|
|
313
|
+
if (evidence)
|
|
314
|
+
return evidence;
|
|
315
|
+
const criteria = mergeAcceptanceCriteriaById(input);
|
|
316
|
+
if (criteria)
|
|
317
|
+
return criteria;
|
|
318
|
+
if (isRecord(input.ours) &&
|
|
319
|
+
isRecord(input.theirs) &&
|
|
320
|
+
(isRecord(input.base) || input.base === MISSING_VALUE)) {
|
|
321
|
+
const base = isRecord(input.base) ? input.base : {};
|
|
322
|
+
const keys = new Set([
|
|
323
|
+
...Object.keys(base),
|
|
324
|
+
...Object.keys(input.ours),
|
|
325
|
+
...Object.keys(input.theirs)
|
|
326
|
+
]);
|
|
327
|
+
const merged = {};
|
|
328
|
+
for (const key of [...keys].sort()) {
|
|
329
|
+
const value = mergeValue({
|
|
330
|
+
base: Object.hasOwn(base, key) ? base[key] : MISSING_VALUE,
|
|
331
|
+
ours: Object.hasOwn(input.ours, key) ? input.ours[key] : MISSING_VALUE,
|
|
332
|
+
theirs: Object.hasOwn(input.theirs, key)
|
|
333
|
+
? input.theirs[key]
|
|
334
|
+
: MISSING_VALUE,
|
|
335
|
+
entity_kind: input.entity_kind,
|
|
336
|
+
entity_id: input.entity_id,
|
|
337
|
+
field_path: fieldPath(input.field_path, key),
|
|
338
|
+
conflicts: input.conflicts,
|
|
339
|
+
resolutions: input.resolutions,
|
|
340
|
+
used_resolution_keys: input.used_resolution_keys,
|
|
341
|
+
sign_ties: input.sign_ties
|
|
342
|
+
});
|
|
343
|
+
if (value !== MISSING_VALUE) {
|
|
344
|
+
Object.defineProperty(merged, key, {
|
|
345
|
+
value,
|
|
346
|
+
enumerable: true,
|
|
347
|
+
configurable: true,
|
|
348
|
+
writable: true
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return merged;
|
|
353
|
+
}
|
|
354
|
+
return recordConflict(input);
|
|
355
|
+
}
|
|
356
|
+
/** Records a conflict at the input's coordinate, or applies the resolution given for it. */
|
|
357
|
+
function recordConflict(input) {
|
|
358
|
+
const conflict = {
|
|
359
|
+
entity_kind: input.entity_kind,
|
|
360
|
+
entity_id: input.entity_id,
|
|
361
|
+
field_path: input.field_path || '/',
|
|
362
|
+
reason: input.ours === MISSING_VALUE || input.theirs === MISSING_VALUE
|
|
363
|
+
? 'delete_edit'
|
|
364
|
+
: 'both_modified'
|
|
365
|
+
};
|
|
366
|
+
const resolution_key = conflictKey(conflict);
|
|
367
|
+
const resolution = input.resolutions?.get(resolution_key);
|
|
368
|
+
if (resolution) {
|
|
369
|
+
input.used_resolution_keys?.add(resolution_key);
|
|
370
|
+
if (resolution.action === 'use_base')
|
|
371
|
+
return input.base;
|
|
372
|
+
if (resolution.action === 'use_coordinator')
|
|
373
|
+
return input.ours;
|
|
374
|
+
if (resolution.action === 'use_child')
|
|
375
|
+
return input.theirs;
|
|
376
|
+
if (resolution.action === 'delete')
|
|
377
|
+
return MISSING_VALUE;
|
|
378
|
+
if (resolution.action === 'set')
|
|
379
|
+
return resolution.value;
|
|
380
|
+
throw new Error('Unsupported graph merge resolution action.');
|
|
381
|
+
}
|
|
382
|
+
input.conflicts.push(conflict);
|
|
383
|
+
return input.ours;
|
|
384
|
+
}
|
|
385
|
+
function pinOf(use) {
|
|
386
|
+
if (!isRecord(use))
|
|
387
|
+
return '';
|
|
388
|
+
return `${String(use.version)}\u0000${String(use.content_hash)}`;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Merges package uses by package (and governed project): each use merges
|
|
392
|
+
* field by field, so two sides that change different uses both land, and an
|
|
393
|
+
* ordered override list both sides changed is one conflict at
|
|
394
|
+
* /package_uses/<key>/overrides. Overrides are written against the pin, so a
|
|
395
|
+
* use one side moved to another version (an accepted upgrade proposal, which
|
|
396
|
+
* rebased its overrides) and the other side changed too is one conflict at
|
|
397
|
+
* /package_uses/<key>: merged field by field, the moved pin could meet
|
|
398
|
+
* overrides written for the old one. No uses left means no key at all.
|
|
399
|
+
*/
|
|
400
|
+
function mergePackageUses(input) {
|
|
401
|
+
const base = packageUsesByKey(input.base);
|
|
402
|
+
const ours = packageUsesByKey(input.ours);
|
|
403
|
+
const theirs = packageUsesByKey(input.theirs);
|
|
404
|
+
const keys = new Set([
|
|
405
|
+
...Object.keys(base),
|
|
406
|
+
...Object.keys(ours),
|
|
407
|
+
...Object.keys(theirs)
|
|
408
|
+
]);
|
|
409
|
+
const uses = [];
|
|
410
|
+
for (const key of [...keys].sort()) {
|
|
411
|
+
const side = {
|
|
412
|
+
base: Object.hasOwn(base, key) ? base[key] : MISSING_VALUE,
|
|
413
|
+
ours: Object.hasOwn(ours, key) ? ours[key] : MISSING_VALUE,
|
|
414
|
+
theirs: Object.hasOwn(theirs, key) ? theirs[key] : MISSING_VALUE,
|
|
415
|
+
entity_kind: 'graph_metadata',
|
|
416
|
+
entity_id: 'package_uses',
|
|
417
|
+
field_path: fieldPath('/package_uses', key),
|
|
418
|
+
conflicts: input.conflicts,
|
|
419
|
+
resolutions: input.resolutions,
|
|
420
|
+
used_resolution_keys: input.used_resolution_keys
|
|
421
|
+
};
|
|
422
|
+
const both_changed = side.base !== MISSING_VALUE &&
|
|
423
|
+
side.ours !== MISSING_VALUE &&
|
|
424
|
+
side.theirs !== MISSING_VALUE &&
|
|
425
|
+
!valuesEqual(side.ours, side.base) &&
|
|
426
|
+
!valuesEqual(side.theirs, side.base) &&
|
|
427
|
+
!valuesEqual(side.ours, side.theirs);
|
|
428
|
+
const pin_moved = pinOf(side.ours) !== pinOf(side.base) ||
|
|
429
|
+
pinOf(side.theirs) !== pinOf(side.base);
|
|
430
|
+
const merged = both_changed && pin_moved ? recordConflict(side) : mergeValue(side);
|
|
431
|
+
if (merged !== MISSING_VALUE)
|
|
432
|
+
uses.push(merged);
|
|
433
|
+
}
|
|
434
|
+
return uses.length > 0 ? { package_uses: uses } : {};
|
|
435
|
+
}
|
|
436
|
+
function mergeEntityCollection(input) {
|
|
437
|
+
const base = new Map(input.base.map((entity) => [entity.id, entity]));
|
|
438
|
+
const ours = new Map(input.ours.map((entity) => [entity.id, entity]));
|
|
439
|
+
const theirs = new Map(input.theirs.map((entity) => [entity.id, entity]));
|
|
440
|
+
const entity_ids = new Set([
|
|
441
|
+
...base.keys(),
|
|
442
|
+
...ours.keys(),
|
|
443
|
+
...theirs.keys()
|
|
444
|
+
]);
|
|
445
|
+
const merged = [];
|
|
446
|
+
for (const entity_id of [...entity_ids].sort()) {
|
|
447
|
+
const conflicts_before = input.conflicts.length;
|
|
448
|
+
const sign_ties = [];
|
|
449
|
+
const value = mergeValue({
|
|
450
|
+
base: base.get(entity_id) ?? MISSING_VALUE,
|
|
451
|
+
ours: ours.get(entity_id) ?? MISSING_VALUE,
|
|
452
|
+
theirs: theirs.get(entity_id) ?? MISSING_VALUE,
|
|
453
|
+
entity_kind: input.entity_kind,
|
|
454
|
+
entity_id,
|
|
455
|
+
field_path: '',
|
|
456
|
+
conflicts: input.conflicts,
|
|
457
|
+
resolutions: input.resolutions,
|
|
458
|
+
used_resolution_keys: input.used_resolution_keys,
|
|
459
|
+
sign_ties
|
|
460
|
+
});
|
|
461
|
+
// A signed reference is kept by the entity's merged hash, known only now;
|
|
462
|
+
// when the entity conflicts, the rule's first step is skipped.
|
|
463
|
+
if (sign_ties.length &&
|
|
464
|
+
value !== MISSING_VALUE &&
|
|
465
|
+
input.conflicts.length === conflicts_before &&
|
|
466
|
+
(input.entity_kind === 'node' || input.entity_kind === 'edge')) {
|
|
467
|
+
const merged_hash = entityObjectHash(input.entity_kind, value);
|
|
468
|
+
for (const tie of sign_ties) {
|
|
469
|
+
tie.references[tie.index] = pickSignedReference(tie.ours, tie.theirs, merged_hash);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (value !== MISSING_VALUE)
|
|
473
|
+
merged.push(value);
|
|
474
|
+
}
|
|
475
|
+
return merged;
|
|
476
|
+
}
|
|
477
|
+
function graphRootHash(graph) {
|
|
478
|
+
return `sha256:${createHash('sha256')
|
|
479
|
+
.update(stringifyCanonicalGraph(graph))
|
|
480
|
+
.digest('hex')}`;
|
|
481
|
+
}
|
|
482
|
+
const NODE_PARENT_CODES = new Set([
|
|
483
|
+
'GRAPH_NODE_PARENT_NOT_FOUND',
|
|
484
|
+
'GRAPH_NODE_PARENT_TYPE_NOT_ALLOWED'
|
|
485
|
+
]);
|
|
486
|
+
/**
|
|
487
|
+
* The merged graph's broken issues, with node parents checked. A parent issue
|
|
488
|
+
* one side already had is left out: a graph from a hosted branch may hold
|
|
489
|
+
* older pairs on nodes the merge does not touch, which a hosted apply accepts.
|
|
490
|
+
*/
|
|
491
|
+
export function introducedBrokenIssues(graph, inputs, graph_issues = validateProjectionGraph(graph, { node_parents: true }).issues) {
|
|
492
|
+
const broken = graph_issues
|
|
493
|
+
.filter((issue) => issue.status === 'broken')
|
|
494
|
+
.map((issue) => ({ code: issue.code, message: issue.message }));
|
|
495
|
+
if (!broken.some((issue) => NODE_PARENT_CODES.has(issue.code))) {
|
|
496
|
+
return broken;
|
|
497
|
+
}
|
|
498
|
+
const known = new Set(inputs.flatMap((input) => validateProjectionGraph(input, { node_parents: true })
|
|
499
|
+
.issues.filter((issue) => NODE_PARENT_CODES.has(issue.code))
|
|
500
|
+
.map((issue) => `${issue.code}\u0000${issue.message}`)));
|
|
501
|
+
return broken.filter((issue) => !NODE_PARENT_CODES.has(issue.code) ||
|
|
502
|
+
!known.has(`${issue.code}\u0000${issue.message}`));
|
|
503
|
+
}
|
|
504
|
+
const INTRODUCED_WARNING_LIMIT = 20;
|
|
505
|
+
/** The strings a warning's details hold: the ids of the entities it names. */
|
|
506
|
+
function detailStrings(value, into = new Set()) {
|
|
507
|
+
if (typeof value === 'string')
|
|
508
|
+
into.add(value);
|
|
509
|
+
else if (Array.isArray(value))
|
|
510
|
+
value.forEach((item) => detailStrings(item, into));
|
|
511
|
+
else if (value && typeof value === 'object') {
|
|
512
|
+
Object.values(value).forEach((item) => detailStrings(item, into));
|
|
513
|
+
}
|
|
514
|
+
return into;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* The validation warnings a hosted save of `graph` would report that `base`
|
|
518
|
+
* did not, as `CODE: message` lines: a commit lists what it introduces, not
|
|
519
|
+
* what its base already had. A base warning of the same code and path covers
|
|
520
|
+
* one whose details name only entities it named, so renaming a node or
|
|
521
|
+
* resolving part of a group does not list it again; a warning without
|
|
522
|
+
* details is matched by its message. Past the limit, one line counts the rest.
|
|
523
|
+
* `graph_issues` reuses a validation of `graph` the caller already ran.
|
|
524
|
+
*/
|
|
525
|
+
export function introducedValidationWarnings(graph, base, graph_issues) {
|
|
526
|
+
const warnings = (issues) => issues.filter((issue) => issue.status === 'warning');
|
|
527
|
+
const site = (issue) => `${issue.code}\u0000${issue.path ?? ''}`;
|
|
528
|
+
const known = new Map();
|
|
529
|
+
for (const issue of warnings(validateProjectionGraph(base, { node_parents: true }).issues)) {
|
|
530
|
+
known.set(site(issue), [...(known.get(site(issue)) ?? []), issue]);
|
|
531
|
+
}
|
|
532
|
+
const covered = (issue) => (known.get(site(issue)) ?? []).some((prior) => {
|
|
533
|
+
if (!issue.details || !prior.details)
|
|
534
|
+
return prior.message === issue.message;
|
|
535
|
+
const named = detailStrings(prior.details);
|
|
536
|
+
return [...detailStrings(issue.details)].every((value) => named.has(value));
|
|
537
|
+
});
|
|
538
|
+
const introduced = warnings(graph_issues ?? validateProjectionGraph(graph, { node_parents: true }).issues)
|
|
539
|
+
.filter((issue) => !covered(issue))
|
|
540
|
+
.map((issue) => `${issue.code}: ${issue.message}`);
|
|
541
|
+
if (introduced.length <= INTRODUCED_WARNING_LIMIT)
|
|
542
|
+
return introduced;
|
|
543
|
+
return [
|
|
544
|
+
...introduced.slice(0, INTRODUCED_WARNING_LIMIT),
|
|
545
|
+
`and ${introduced.length - INTRODUCED_WARNING_LIMIT} more validation warnings this commit introduces.`
|
|
546
|
+
];
|
|
547
|
+
}
|
|
548
|
+
export function mergeLocalPortableGraphs(input) {
|
|
549
|
+
return mergePortableGraphsInternal(input);
|
|
550
|
+
}
|
|
551
|
+
function conflictKey(conflict) {
|
|
552
|
+
return [
|
|
553
|
+
conflict.entity_kind,
|
|
554
|
+
conflict.entity_id,
|
|
555
|
+
conflict.field_path,
|
|
556
|
+
conflict.reason
|
|
557
|
+
].join('\u0000');
|
|
558
|
+
}
|
|
559
|
+
function mergePortableGraphsInternal(input) {
|
|
560
|
+
const base_graph = canonicalizePortableGraph(portable_graph_schema.parse(input.base_graph));
|
|
561
|
+
const coordinator_graph = canonicalizePortableGraph(portable_graph_schema.parse(input.coordinator_graph));
|
|
562
|
+
const child_graph = canonicalizePortableGraph(portable_graph_schema.parse(input.child_graph));
|
|
563
|
+
const input_roots = {
|
|
564
|
+
base_root_hash: graphRootHash(base_graph),
|
|
565
|
+
coordinator_root_hash: graphRootHash(coordinator_graph),
|
|
566
|
+
child_root_hash: graphRootHash(child_graph)
|
|
567
|
+
};
|
|
568
|
+
const conflicts = [];
|
|
569
|
+
const resolutions = input.resolutions
|
|
570
|
+
? new Map(input.resolutions.map((resolution) => [
|
|
571
|
+
conflictKey(resolution),
|
|
572
|
+
resolution
|
|
573
|
+
]))
|
|
574
|
+
: undefined;
|
|
575
|
+
const used_resolution_keys = new Set();
|
|
576
|
+
const graph_input = {
|
|
577
|
+
nodes: mergeEntityCollection({
|
|
578
|
+
base: base_graph.nodes,
|
|
579
|
+
ours: coordinator_graph.nodes,
|
|
580
|
+
theirs: child_graph.nodes,
|
|
581
|
+
entity_kind: 'node',
|
|
582
|
+
conflicts,
|
|
583
|
+
resolutions,
|
|
584
|
+
used_resolution_keys
|
|
585
|
+
}),
|
|
586
|
+
edges: mergeEntityCollection({
|
|
587
|
+
base: base_graph.edges,
|
|
588
|
+
ours: coordinator_graph.edges,
|
|
589
|
+
theirs: child_graph.edges,
|
|
590
|
+
entity_kind: 'edge',
|
|
591
|
+
conflicts,
|
|
592
|
+
resolutions,
|
|
593
|
+
used_resolution_keys
|
|
594
|
+
}),
|
|
595
|
+
paths: mergeEntityCollection({
|
|
596
|
+
base: base_graph.paths ?? [],
|
|
597
|
+
ours: coordinator_graph.paths ?? [],
|
|
598
|
+
theirs: child_graph.paths ?? [],
|
|
599
|
+
entity_kind: 'path',
|
|
600
|
+
conflicts,
|
|
601
|
+
resolutions,
|
|
602
|
+
used_resolution_keys
|
|
603
|
+
}),
|
|
604
|
+
path_relations: mergeEntityCollection({
|
|
605
|
+
base: base_graph.path_relations ?? [],
|
|
606
|
+
ours: coordinator_graph.path_relations ?? [],
|
|
607
|
+
theirs: child_graph.path_relations ?? [],
|
|
608
|
+
entity_kind: 'path_relation',
|
|
609
|
+
conflicts,
|
|
610
|
+
resolutions,
|
|
611
|
+
used_resolution_keys
|
|
612
|
+
}),
|
|
613
|
+
tags: mergeValue({
|
|
614
|
+
base: base_graph.tags ?? [],
|
|
615
|
+
ours: coordinator_graph.tags ?? [],
|
|
616
|
+
theirs: child_graph.tags ?? [],
|
|
617
|
+
entity_kind: 'graph_metadata',
|
|
618
|
+
entity_id: 'tags',
|
|
619
|
+
field_path: '/tags',
|
|
620
|
+
conflicts,
|
|
621
|
+
resolutions,
|
|
622
|
+
used_resolution_keys
|
|
623
|
+
}),
|
|
624
|
+
...mergePackageUses({
|
|
625
|
+
base: base_graph.package_uses,
|
|
626
|
+
ours: coordinator_graph.package_uses,
|
|
627
|
+
theirs: child_graph.package_uses,
|
|
628
|
+
conflicts,
|
|
629
|
+
resolutions,
|
|
630
|
+
used_resolution_keys
|
|
631
|
+
})
|
|
632
|
+
};
|
|
633
|
+
if (conflicts.length > 0) {
|
|
634
|
+
return {
|
|
635
|
+
version: 1,
|
|
636
|
+
status: 'blocked_conflict',
|
|
637
|
+
...input_roots,
|
|
638
|
+
conflicts
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
if (resolutions && used_resolution_keys.size !== resolutions.size) {
|
|
642
|
+
throw new Error('Resolution output contains a non-conflict coordinate.');
|
|
643
|
+
}
|
|
644
|
+
const graph = canonicalizePortableGraph(portable_graph_schema.parse(graph_input));
|
|
645
|
+
const root_hash = graphRootHash(graph);
|
|
646
|
+
// A field-level merge can break the node-type rules with a node neither side
|
|
647
|
+
// holds, as a type from one and acceptance criteria from the other
|
|
648
|
+
// (iss-477). A node equal to either side's version is that side's history,
|
|
649
|
+
// which reconcile and upstream integrate take in as it stands.
|
|
650
|
+
const changed_from_child = new Set(c4NodeTypeIssuesOnChangedNodes({ previous: child_graph, next: graph }).map((issue) => issue.node_id));
|
|
651
|
+
const issues = [
|
|
652
|
+
...introducedBrokenIssues(graph, [coordinator_graph, child_graph]),
|
|
653
|
+
...c4NodeTypeIssuesOnChangedNodes({
|
|
654
|
+
previous: coordinator_graph,
|
|
655
|
+
next: graph
|
|
656
|
+
})
|
|
657
|
+
.filter((issue) => changed_from_child.has(issue.node_id))
|
|
658
|
+
.map((issue) => ({
|
|
659
|
+
code: 'node_type_rule',
|
|
660
|
+
message: `node ${issue.node_id} at ${issue.path}: ${issue.message}`
|
|
661
|
+
}))
|
|
662
|
+
];
|
|
663
|
+
if (issues.length > 0) {
|
|
664
|
+
return {
|
|
665
|
+
version: 1,
|
|
666
|
+
status: 'blocked_validation',
|
|
667
|
+
...input_roots,
|
|
668
|
+
graph,
|
|
669
|
+
root_hash,
|
|
670
|
+
issues
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
return {
|
|
674
|
+
version: 1,
|
|
675
|
+
status: 'clean',
|
|
676
|
+
...input_roots,
|
|
677
|
+
graph,
|
|
678
|
+
root_hash
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
export function resolveLocalPortableGraphMerge(input) {
|
|
682
|
+
const initial = mergePortableGraphsInternal({
|
|
683
|
+
base_graph: input.base_graph,
|
|
684
|
+
coordinator_graph: input.coordinator_graph,
|
|
685
|
+
child_graph: input.child_graph
|
|
686
|
+
});
|
|
687
|
+
if (initial.status !== 'blocked_conflict') {
|
|
688
|
+
throw new Error('Graph merge has no conflicts to resolve.');
|
|
689
|
+
}
|
|
690
|
+
const expected_keys = new Set(initial.conflicts.map(conflictKey));
|
|
691
|
+
const received_keys = input.resolutions.map(conflictKey);
|
|
692
|
+
if (received_keys.length !== expected_keys.size ||
|
|
693
|
+
new Set(received_keys).size !== received_keys.length ||
|
|
694
|
+
received_keys.some((key) => !expected_keys.has(key))) {
|
|
695
|
+
throw new Error('Resolution output must contain exactly one decision for every conflict.');
|
|
696
|
+
}
|
|
697
|
+
const resolved = mergePortableGraphsInternal({ ...input });
|
|
698
|
+
if (resolved.status === 'blocked_conflict') {
|
|
699
|
+
throw new Error('Resolution output left conflicts unresolved.');
|
|
700
|
+
}
|
|
701
|
+
return resolved;
|
|
702
|
+
}
|
|
703
|
+
//# sourceMappingURL=workspace-merge.js.map
|