@bastani/atomic 0.10.11-alpha.2 → 0.10.11-alpha.3
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 +99 -0
- package/README.md +5 -8
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +6 -6
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +5 -5
- package/dist/_shared/mode-shared-2QJSCUM6.js +6 -6
- package/dist/_shared/p0-cli-BB45ZQY6.js +46 -67
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +7 -8
- package/dist/_shared/p1a-prewarm-XIU57JHF.js.map +1 -1
- package/dist/_shared/{p1b-elig-ENCUPKKJ.js → p1b-elig-TVB5CBLL.js} +14 -2
- package/dist/_shared/{p1b-elig-ENCUPKKJ.js.map → p1b-elig-TVB5CBLL.js.map} +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +3 -3
- package/dist/_shared/{sdk-IQMULKFU.js → sdk-B5LEWGGI.js} +340 -163
- package/dist/_shared/sdk-B5LEWGGI.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/{startup-0-0-3IXNMFM2.js → startup-0-0-EZUKEP4Q.js} +48 -40
- package/dist/_shared/startup-0-0-EZUKEP4Q.js.map +1 -0
- package/dist/_shared/{startup-0-1-7T2IAE7J.js → startup-0-1-RTOHJFDJ.js} +195 -42
- package/dist/_shared/startup-0-1-RTOHJFDJ.js.map +1 -0
- package/dist/_shared/startup-0-2-5QHPCEON.js +33 -43
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -1
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +5 -5
- package/dist/_shared/startup-0-4-ZMJV547D.js +12 -7
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +1 -1
- package/dist/_shared/startup-0-5-YDW47QX6.js +7 -7
- package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +6 -6
- package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
- package/dist/_shared/startup-14-0-MLX36RBG.js +4 -5
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +4 -4
- package/dist/_shared/startup-15-1-4S7FLMNG.js +19 -27
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +39 -23
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-X32CYSXB.js → startup-8-1-LZFXSD3Z.js} +90 -1176
- package/dist/_shared/startup-8-1-LZFXSD3Z.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +186 -35
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/storage-status-K7PX2RXA.js +557 -0
- package/dist/_shared/storage-status-K7PX2RXA.js.map +1 -0
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +376 -0
- package/dist/_shared/team-DOQKICG2.js.map +1 -0
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +23 -0
- package/dist/builtin/intercom/README.md +2 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +913 -289
- package/dist/builtin/intercom/broker/database-wake-up-bus.ts +243 -64
- package/dist/builtin/intercom/broker/multinode-router.ts +154 -22
- package/dist/builtin/intercom/broker/multinode-state-store.ts +30 -3
- package/dist/builtin/intercom/broker/open-broker-state.ts +14 -0
- package/dist/builtin/intercom/broker/sql-add-column.ts +29 -5
- package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +3 -2
- package/dist/builtin/intercom/broker/sql-held-send-store.ts +2 -2
- package/dist/builtin/intercom/broker/sql-known-session-store.ts +43 -19
- package/dist/builtin/intercom/broker/sql-lease-store.ts +170 -74
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +298 -47
- package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +8 -5
- package/dist/builtin/intercom/broker/sql-released-ask-store.ts +12 -5
- package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +24 -7
- package/dist/builtin/intercom/broker/sql-retention.ts +141 -0
- package/dist/builtin/intercom/broker/sql-schema.ts +136 -19
- package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +74 -19
- package/dist/builtin/intercom/broker/wake-up-bus.ts +6 -0
- package/dist/builtin/intercom/index.bundle.mjs +2 -3
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +2 -10
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/bundled-sqlite.js +41 -0
- package/dist/bun/bundled-sqlite.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +4 -4
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.code.js.map +1 -1
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +3 -3
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +19 -113
- package/dist/cli/team-command.code.js.map +1 -1
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +5 -18
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-rehydrate-errors.d.ts +4 -9
- package/dist/core/compaction/compactor.d.ts +3 -3
- package/dist/core/debug.code.js +1 -1
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +2 -2
- package/dist/core/intercom-broker-control-host.code.js +2 -2
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.code.js +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/process-start-token.d.ts +8 -0
- package/dist/core/process-tree-containment.d.ts +16 -0
- package/dist/core/sdk-types.d.ts +1 -2
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.code.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +5 -5
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +1 -1
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.code.js +1 -1
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-schema.d.ts +0 -3
- package/dist/core/storage/added-exports-0-10-11.js +19 -0
- package/dist/core/storage/added-exports-0-10-11.js.map +1 -0
- package/dist/core/storage/creation-time.js +105 -0
- package/dist/core/storage/creation-time.js.map +1 -0
- package/dist/core/storage/database.d.ts +19 -5
- package/dist/core/storage/database.js.map +1 -1
- package/dist/core/storage/dialect.d.ts +1 -1
- package/dist/core/storage/dialect.js +1 -1
- package/dist/core/storage/dialect.js.map +1 -1
- package/dist/core/storage/errors.d.ts +13 -13
- package/dist/core/storage/errors.js +10 -16
- package/dist/core/storage/errors.js.map +1 -1
- package/dist/core/storage/fenced-paths.d.ts +11 -0
- package/dist/core/storage/fenced-paths.js +11 -0
- package/dist/core/storage/fenced-paths.js.map +1 -1
- package/dist/core/storage/file-identity.d.ts +2 -0
- package/dist/core/storage/file-identity.js +24 -8
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +3 -2
- package/dist/core/storage/index.js +5 -3
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/libsql-removed.d.ts +71 -0
- package/dist/core/storage/libsql-removed.js +123 -0
- package/dist/core/storage/libsql-removed.js.map +1 -0
- package/dist/core/storage/migrations.d.ts +78 -14
- package/dist/core/storage/migrations.js +375 -49
- package/dist/core/storage/migrations.js.map +1 -1
- package/dist/core/storage/node-sqlite-file-gate.js +0 -15
- package/dist/core/storage/node-sqlite-file-gate.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +8 -13
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +51 -3
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/prefix.d.ts +1 -1
- package/dist/core/storage/prefix.js +9 -2
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/process-selection.d.ts +5 -5
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +7 -8
- package/dist/core/storage/schema-catalog.js +8 -8
- package/dist/core/storage/schema-catalog.js.map +1 -1
- package/dist/core/storage/selection.d.ts +7 -82
- package/dist/core/storage/selection.js +20 -235
- package/dist/core/storage/selection.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +3 -3
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +4 -7
- package/dist/core/storage/session/fork-staging.code.js.map +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +3 -3
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.d.ts +5 -1
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/session-search-index.d.ts +43 -4
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +3 -3
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +48 -11
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/sqlite-facade.d.ts +6 -1
- package/dist/core/storage/sqlite-facade.js +1 -0
- package/dist/core/storage/sqlite-facade.js.map +1 -1
- package/dist/core/storage/storage-status.code.js +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.code.js +1 -1
- package/dist/core/storage/team.d.ts +26 -115
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.code.js +1 -1
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/history-tasks.d.ts +3 -2
- package/dist/core/tools/read-url.code.js +4 -4
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.d.ts +40 -3
- package/dist/core/worktree-snapshot/blob-store.js +414 -21
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +2 -2
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/fork-blob-guard.js +81 -0
- package/dist/core/worktree-snapshot/fork-blob-guard.js.map +1 -0
- package/dist/core/worktree-snapshot/fork-snapshot-index.js +79 -38
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.code.js +4 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +3 -3
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -5
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/main.js +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +1 -1
- package/dist/modes/print-mode.js +1 -1
- package/dist/package-manager-cli.code.js +6 -6
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/2.js +2 -4
- package/dist/startup-stages/3.js +1 -3
- package/dist/startup-stages/4.js +1 -2
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/6.js +5 -7
- package/dist/startup-stages/7.js +3 -10
- package/dist/startup-stages/8.js +7 -2
- package/dist/startup-stages/9.js +1 -7
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/compile-cache-deferral.js +8 -13
- package/dist/utils/compile-cache-deferral.js.map +1 -1
- package/dist/utils/compile-cache-warmup-host.js +3 -4
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/compile-cache.js +12 -100
- package/dist/utils/compile-cache.js.map +1 -1
- package/dist/utils/startup-database-spare.code.js +2 -2
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/dist/utils/worker-threads.js +2 -15
- package/dist/utils/worker-threads.js.map +1 -1
- package/docs/build.md +3 -3
- package/docs/changelog.mdx +1421 -69
- package/docs/compaction/reference.md +5 -5
- package/docs/compaction.md +7 -9
- package/docs/containerization.md +2 -2
- package/docs/custom-provider/api-reference.md +1 -1
- package/docs/docs.json +37 -10
- package/docs/environment-variables.md +0 -2
- package/docs/extensions/api-reference.md +4 -4
- package/docs/getting-started/installation.md +3 -0
- package/docs/guides/configuration.md +1 -1
- package/docs/guides/non-interactive.md +1 -1
- package/docs/guides/resume-on-any-machine.md +14 -22
- package/docs/guides/team-setup.md +56 -83
- package/docs/guides.md +2 -4
- package/docs/herdr.md +1 -1
- package/docs/index.md +1 -1
- package/docs/intercom/operations.md +26 -21
- package/docs/intercom/reference.md +2 -2
- package/docs/intercom.md +1 -1
- package/docs/libraries/storage-postgres.md +9 -9
- package/docs/libraries.md +2 -3
- package/docs/models-configuration.md +2 -2
- package/docs/models.md +2 -3
- package/docs/packages/authoring.md +7 -7
- package/docs/packages.md +1 -1
- package/docs/programmatic.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/reference/cli.md +6 -11
- package/docs/reference.md +2 -2
- package/docs/rpc/extension-ui.md +2 -2
- package/docs/sdk/reference.md +5 -4
- package/docs/sdk/storage.md +8 -92
- package/docs/sdk/structured-decisions.md +1 -1
- package/docs/sdk/web-server.md +3 -3
- package/docs/sdk.md +14 -4
- package/docs/security.md +1 -1
- package/docs/session-format.md +5 -5
- package/docs/sessions.md +29 -49
- package/docs/settings.md +7 -8
- package/docs/storage/custom-adapters.md +255 -0
- package/docs/storage/jsonl.md +117 -0
- package/docs/{guides/postgres-pgbouncer.md → storage/postgres/pgbouncer.md} +66 -68
- package/docs/storage/postgres/tuning.md +337 -0
- package/docs/storage/postgres.md +556 -0
- package/docs/storage/sqlite.md +99 -0
- package/docs/storage.md +326 -990
- package/docs/subagents/authoring.md +1 -1
- package/docs/subagents.md +2 -2
- package/docs/tools.md +1 -1
- package/docs/worktree-snapshots.md +2 -2
- package/package.json +9 -9
- package/schemas/models.schema.json +2 -2
- package/schemas/settings.schema.json +0 -14
- package/dist/_shared/sdk-IQMULKFU.js.map +0 -1
- package/dist/_shared/startup-0-0-3IXNMFM2.js.map +0 -1
- package/dist/_shared/startup-0-1-7T2IAE7J.js.map +0 -1
- package/dist/_shared/startup-8-1-X32CYSXB.js.map +0 -1
- package/dist/core/intercom-broker-control.d.ts +0 -129
- package/dist/startup-stages/13.js +0 -1
- package/docs/guides/postgres-tuning.md +0 -311
- package/docs/libraries/storage-libsql.md +0 -97
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fenced-paths.js","sourceRoot":"","sources":["../../../src/core/storage/fenced-paths.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,YAAY,GAAG;IACpB,gIAAgI;IAChI,YAAY,EAAE;QACb,MAAM,EAAE;YACP,8BAA8B;YAC9B,2CAA2C;YAC3C,uCAAuC;SACvC;QACD,WAAW,EAAE,6FAA6F;KAC1G;IACD,oHAAoH;IACpH,gBAAgB,EAAE;QACjB,MAAM,EAAE,CAAC,8BAA8B,EAAE,+BAA+B,EAAE,uBAAuB,CAAC;QAClG,WAAW,EAAE,6FAA6F;KAC1G;IACD,qHAAqH;IACrH,aAAa,EAAE;QACd,MAAM,EAAE;YACP,oHAAoH;YACpH,8BAA8B;YAC9B,+BAA+B;YAC/B,yGAAyG;YACzG,uBAAuB;SACvB;QACD,WAAW,EAAE,8EAA8E;KAC3F;IACD,0EAA0E;IAC1E,eAAe,EAAE;QAChB,MAAM,EAAE;YACP,8BAA8B;YAC9B,+BAA+B;YAC/B,2CAA2C;SAC3C;QACD,WAAW,EAAE,6FAA6F;KAC1G;IACD;;;;;;;OAOG;IACH,gBAAgB,EAAE;QACjB,MAAM,EAAE;YACP,4GAA4G;YAC5G,2EAA2E;SAC3E;QACD,WAAW,EACV,6JAA6J;KAC9J;IACD;;;;;OAKG;IACH,sBAAsB,EAAE;QACvB,MAAM,EAAE,CAAC,gDAAgD,CAAC;QAC1D,WAAW,EAAE,oFAAoF;KACjG;IACD;;;;;;;;OAQG;IACH,qBAAqB,EAAE;QACtB,MAAM,EAAE;YACP,kHAAkH;YAClH,mEAAmE;SACnE;QACD,WAAW,EACV,+JAA+J;KAChK;IACD;;;;;;;OAOG;IACH,oBAAoB,EAAE;QACrB,MAAM,EAAE,CAAC,4FAA4F,CAAC;QACtG,WAAW,EACV,6GAA6G;KAC9G;IACD;;;OAGG;IACH,aAAa,EAAE;QACd,MAAM,EAAE,CAAC,gDAAgD,CAAC;QAC1D,WAAW,EAAE,iGAAiG;KAC9G;CAC4D,CAAC;AAI/D,yCAAyC;AACzC,MAAM,UAAU,eAAe,CAAC,IAAoB;IACnD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,UAAU,CAAC,IAAoB;IAC9C,OAAO,IAAoB,CAAC;AAC7B,CAAC","sourcesContent":["import type { FencedPathId } from \"./database.js\";\n\n/** What makes a fenced write path correct without the domain's serial lock. */\nexport interface FencedPathAudit {\n\t/** The rows the path locks, in the order it locks them (the same order on every fenced path, so none deadlock). */\n\treadonly fences: readonly string[];\n\t/** The conformance test that runs the path concurrently on every backend. */\n\treadonly conformance: string;\n}\n\n/**\n * Every audited path that may run a `fenced` transaction. A path is added here, with its fences and its test, in the\n * change that makes it fenced; nothing else can name one.\n */\nconst FENCED_PATHS = {\n\t/** `SqlPoolQueue.claim`: one `UPDATE … WHERE id = (SELECT … FOR UPDATE SKIP LOCKED)`, so claimers never wait on one another. */\n\t\"pool-claim\": {\n\t\tfences: [\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"root run row FOR SHARE, then pool control\",\n\t\t\t\"ready work row FOR UPDATE SKIP LOCKED\",\n\t\t],\n\t\tconformance: \"many hosts claim, commit and complete concurrently: no double claim, no lost settle (#5102)\",\n\t},\n\t/** `SqlPoolQueue.renew`, `extend` and `heartbeat`: the attempt's lease, its claim confirmation and usage report. */\n\t\"pool-heartbeat\": {\n\t\tfences: [\"root lease row FOR KEY SHARE\", \"attempt's work row FOR UPDATE\", \"root usage totals row\"],\n\t\tconformance: \"claim, commit, heartbeat, complete and takeover run concurrently without a deadlock (#5102)\",\n\t},\n\t/** `SqlPoolQueue.commit` of a checkpoint or a session: the event takes the run's next sequence under its run row. */\n\t\"pool-commit\": {\n\t\tfences: [\n\t\t\t\"the database-wide serial lock, shared, only when the checkpoint records worktree snapshots (before every row lock)\",\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"attempt's work row FOR UPDATE\",\n\t\t\t\"root run row FOR UPDATE (FOR SHARE without an event), then pool control and the snapshots' stored blobs\",\n\t\t\t\"root usage totals row\",\n\t\t],\n\t\tconformance: \"32 concurrent writers commit one event per key with a dense sequence (#5102)\",\n\t},\n\t/** `SqlPoolQueue.complete`: the result and the work row's final state. */\n\t\"pool-complete\": {\n\t\tfences: [\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"attempt's work row FOR UPDATE\",\n\t\t\t\"root run row FOR SHARE, then pool control\",\n\t\t],\n\t\tconformance: \"many hosts claim, commit and complete concurrently: no double claim, no lost settle (#5102)\",\n\t},\n\t/**\n\t * Intercom's broker leases (`openSqlBrokerLeaseStore`): `acquire` is one upsert whose guard takes the row only while\n\t * it is free, stale or the acquirer's own, `renew` and `release` one `UPDATE` guarded by holder and fencing token, and\n\t * `renewMany` those updates in (kind, key) order. Each decides on its own row lock, never on an earlier read (#6560).\n\t * On PostgreSQL a first acquisition takes its order from the lease order sequence, which waits for nothing; where\n\t * `atomic storage migrate` has not created it yet, `acquire`'s statement first upserts the acquisition-order counter\n\t * row instead, which no other path locks.\n\t */\n\t\"intercom-lease\": {\n\t\tfences: [\n\t\t\t\"acquire only, without the order sequence: the acquisition-order counter row, by the statement's own upsert\",\n\t\t\t\"each lease row, by its own guarded upsert or UPDATE, in (kind, key) order\",\n\t\t],\n\t\tconformance:\n\t\t\t\"many brokers acquire, renew and release one lease concurrently: never two holders, fencing tokens strictly increase, a stale holder's renewal fails (#6560)\",\n\t},\n\t/**\n\t * Intercom's wake-up hint log (`intercom_wakeups`): a hint is a row inserted once and deleted by its id or its age,\n\t * and no write reads the log to decide what to write, so its writers take no lock domain: the bus's `publish`\n\t * inserts a hint and notifies in one transaction that commits both, an outbox enqueue inserts one inside its own\n\t * transaction, and the bus's poll and pruning delete rows in single statements (#6560).\n\t */\n\t\"intercom-wakeup-hint\": {\n\t\tfences: [\"none: the new hint row only, by its own INSERT\"],\n\t\tconformance: \"delivers each hint published at once from several connections exactly once (#6560)\",\n\t},\n\t/**\n\t * Intercom's outbox rows and sent-message reservations (`openSqlOutboxStore`, `openSqlSentMessageAuthority`), which\n\t * left the outbox's one lock domain (#6560). A claim reads its recipient's undelivered rows `FOR UPDATE` in sequence\n\t * order, then claims them; a claim's renewal, saving report, release and settlement are each one `UPDATE` guarded by\n\t * message id, claimant, token and state; expiry and `releaseClaimsOf` lock their rows in sequence order in a\n\t * subquery; a reservation, an acceptance and a forget are each one statement on the message's row, guarded by its\n\t * digest. Each decides on the rows it locks, never on an earlier read. They exclude the database-wide transactions an\n\t * older broker runs on these tables (`excludesSerial`). A send itself is a serial transaction of its recipient's domain.\n\t */\n\t\"intercom-outbox-row\": {\n\t\tfences: [\n\t\t\t\"outbox rows, FOR UPDATE in sequence order (claim, expiry, releaseClaimsOf), or one row by its own guarded UPDATE\",\n\t\t\t\"one sent-message row, by its own guarded INSERT, UPDATE or DELETE\",\n\t\t],\n\t\tconformance:\n\t\t\t\"a send to one recipient does not wait while another recipient's claim holds its rows; sends to one recipient keep their order and suppress duplicates (#6560)\",\n\t},\n\t/**\n\t * A cleanup's claim of a lapsed fork staging transfer (`cleanupForkStaging`): it reads one lapsed lease row `FOR\n\t * UPDATE SKIP LOCKED`, then takes it over with one `UPDATE` guarded by the lease still being lapsed, so it never waits\n\t * for a live transfer whose writer or publication holds its lease, and two claims never take one transfer. Any lapsed\n\t * transfer may be claimed in any order. The claim names no transfer before it reads, so it takes no lock domain; the\n\t * owner's writes and the cleanup's removals are serial transactions of the transfer's own domain, and each decides on\n\t * the lease row it locks by its token first (#6560).\n\t */\n\t\"fork-staging-claim\": {\n\t\tfences: [\"one lapsed lease row of the staging table, FOR UPDATE SKIP LOCKED, then its guarded UPDATE\"],\n\t\tconformance:\n\t\t\t\"concurrent cleanups take each lapsed transfer over once and never a live one, beside staging clones (#6560)\",\n\t},\n\t/**\n\t * `SqlRateBuckets.acquire` and `cooldown`: one `UPDATE … RETURNING` (or upsert) of the scope's bucket row, which locks\n\t * no pool row, so it orders after none of them (#4768).\n\t */\n\t\"rate-bucket\": {\n\t\tfences: [\"the scope's rate bucket row, by its own UPDATE\"],\n\t\tconformance: \"many hosts acquire from one rate bucket concurrently and never take more than it allows (#4768)\",\n\t},\n} as const satisfies Readonly<Record<string, FencedPathAudit>>;\n\nexport type FencedPathName = keyof typeof FENCED_PATHS;\n\n/** The audit record of a fenced path. */\nexport function fencedPathAudit(name: FencedPathName): FencedPathAudit {\n\treturn FENCED_PATHS[name];\n}\n\n/** The `FencedPathId` that lets an audited path run `{ kind: \"fenced\", audit }` transactions. */\nexport function fencedPath(name: FencedPathName): FencedPathId {\n\treturn name as FencedPathId;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fenced-paths.js","sourceRoot":"","sources":["../../../src/core/storage/fenced-paths.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,YAAY,GAAG;IACpB,gIAAgI;IAChI,YAAY,EAAE;QACb,MAAM,EAAE;YACP,8BAA8B;YAC9B,2CAA2C;YAC3C,uCAAuC;SACvC;QACD,WAAW,EAAE,6FAA6F;KAC1G;IACD,oHAAoH;IACpH,gBAAgB,EAAE;QACjB,MAAM,EAAE,CAAC,8BAA8B,EAAE,+BAA+B,EAAE,uBAAuB,CAAC;QAClG,WAAW,EAAE,6FAA6F;KAC1G;IACD,qHAAqH;IACrH,aAAa,EAAE;QACd,MAAM,EAAE;YACP,oHAAoH;YACpH,8BAA8B;YAC9B,+BAA+B;YAC/B,yGAAyG;YACzG,uBAAuB;SACvB;QACD,WAAW,EAAE,8EAA8E;KAC3F;IACD,0EAA0E;IAC1E,eAAe,EAAE;QAChB,MAAM,EAAE;YACP,8BAA8B;YAC9B,+BAA+B;YAC/B,2CAA2C;SAC3C;QACD,WAAW,EAAE,6FAA6F;KAC1G;IACD;;;;;;;OAOG;IACH,gBAAgB,EAAE;QACjB,MAAM,EAAE;YACP,4GAA4G;YAC5G,2EAA2E;SAC3E;QACD,WAAW,EACV,6JAA6J;KAC9J;IACD;;;;;OAKG;IACH,sBAAsB,EAAE;QACvB,MAAM,EAAE,CAAC,gDAAgD,CAAC;QAC1D,WAAW,EAAE,oFAAoF;KACjG;IACD;;;;;;;;OAQG;IACH,qBAAqB,EAAE;QACtB,MAAM,EAAE;YACP,kHAAkH;YAClH,mEAAmE;SACnE;QACD,WAAW,EACV,+JAA+J;KAChK;IACD;;;;;;;OAOG;IACH,oBAAoB,EAAE;QACrB,MAAM,EAAE,CAAC,4FAA4F,CAAC;QACtG,WAAW,EACV,6GAA6G;KAC9G;IACD;;;;;;OAMG;IACH,cAAc,EAAE;QACf,MAAM,EAAE,CAAC,8EAA8E,CAAC;QACxF,WAAW,EACV,8HAA8H;KAC/H;IACD;;;OAGG;IACH,aAAa,EAAE;QACd,MAAM,EAAE,CAAC,gDAAgD,CAAC;QAC1D,WAAW,EAAE,iGAAiG;KAC9G;CAC4D,CAAC;AAI/D,yCAAyC;AACzC,MAAM,UAAU,eAAe,CAAC,IAAoB;IACnD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,UAAU,CAAC,IAAoB;IAC9C,OAAO,IAAoB,CAAC;AAC7B,CAAC","sourcesContent":["import type { FencedPathId } from \"./database.js\";\n\n/** What makes a fenced write path correct without the domain's serial lock. */\nexport interface FencedPathAudit {\n\t/** The rows the path locks, in the order it locks them (the same order on every fenced path, so none deadlock). */\n\treadonly fences: readonly string[];\n\t/** The conformance test that runs the path concurrently on every backend. */\n\treadonly conformance: string;\n}\n\n/**\n * Every audited path that may run a `fenced` transaction. A path is added here, with its fences and its test, in the\n * change that makes it fenced; nothing else can name one.\n */\nconst FENCED_PATHS = {\n\t/** `SqlPoolQueue.claim`: one `UPDATE … WHERE id = (SELECT … FOR UPDATE SKIP LOCKED)`, so claimers never wait on one another. */\n\t\"pool-claim\": {\n\t\tfences: [\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"root run row FOR SHARE, then pool control\",\n\t\t\t\"ready work row FOR UPDATE SKIP LOCKED\",\n\t\t],\n\t\tconformance: \"many hosts claim, commit and complete concurrently: no double claim, no lost settle (#5102)\",\n\t},\n\t/** `SqlPoolQueue.renew`, `extend` and `heartbeat`: the attempt's lease, its claim confirmation and usage report. */\n\t\"pool-heartbeat\": {\n\t\tfences: [\"root lease row FOR KEY SHARE\", \"attempt's work row FOR UPDATE\", \"root usage totals row\"],\n\t\tconformance: \"claim, commit, heartbeat, complete and takeover run concurrently without a deadlock (#5102)\",\n\t},\n\t/** `SqlPoolQueue.commit` of a checkpoint or a session: the event takes the run's next sequence under its run row. */\n\t\"pool-commit\": {\n\t\tfences: [\n\t\t\t\"the database-wide serial lock, shared, only when the checkpoint records worktree snapshots (before every row lock)\",\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"attempt's work row FOR UPDATE\",\n\t\t\t\"root run row FOR UPDATE (FOR SHARE without an event), then pool control and the snapshots' stored blobs\",\n\t\t\t\"root usage totals row\",\n\t\t],\n\t\tconformance: \"32 concurrent writers commit one event per key with a dense sequence (#5102)\",\n\t},\n\t/** `SqlPoolQueue.complete`: the result and the work row's final state. */\n\t\"pool-complete\": {\n\t\tfences: [\n\t\t\t\"root lease row FOR KEY SHARE\",\n\t\t\t\"attempt's work row FOR UPDATE\",\n\t\t\t\"root run row FOR SHARE, then pool control\",\n\t\t],\n\t\tconformance: \"many hosts claim, commit and complete concurrently: no double claim, no lost settle (#5102)\",\n\t},\n\t/**\n\t * Intercom's broker leases (`openSqlBrokerLeaseStore`): `acquire` is one upsert whose guard takes the row only while\n\t * it is free, stale or the acquirer's own, `renew` and `release` one `UPDATE` guarded by holder and fencing token, and\n\t * `renewMany` those updates in (kind, key) order. Each decides on its own row lock, never on an earlier read (#6560).\n\t * On PostgreSQL a first acquisition takes its order from the lease order sequence, which waits for nothing; where\n\t * `atomic storage migrate` has not created it yet, `acquire`'s statement first upserts the acquisition-order counter\n\t * row instead, which no other path locks.\n\t */\n\t\"intercom-lease\": {\n\t\tfences: [\n\t\t\t\"acquire only, without the order sequence: the acquisition-order counter row, by the statement's own upsert\",\n\t\t\t\"each lease row, by its own guarded upsert or UPDATE, in (kind, key) order\",\n\t\t],\n\t\tconformance:\n\t\t\t\"many brokers acquire, renew and release one lease concurrently: never two holders, fencing tokens strictly increase, a stale holder's renewal fails (#6560)\",\n\t},\n\t/**\n\t * Intercom's wake-up hint log (`intercom_wakeups`): a hint is a row inserted once and deleted by its id or its age,\n\t * and no write reads the log to decide what to write, so its writers take no lock domain: the bus's `publish`\n\t * inserts a hint and notifies in one transaction that commits both, an outbox enqueue inserts one inside its own\n\t * transaction, and the bus's poll and pruning delete rows in single statements (#6560).\n\t */\n\t\"intercom-wakeup-hint\": {\n\t\tfences: [\"none: the new hint row only, by its own INSERT\"],\n\t\tconformance: \"delivers each hint published at once from several connections exactly once (#6560)\",\n\t},\n\t/**\n\t * Intercom's outbox rows and sent-message reservations (`openSqlOutboxStore`, `openSqlSentMessageAuthority`), which\n\t * left the outbox's one lock domain (#6560). A claim reads its recipient's undelivered rows `FOR UPDATE` in sequence\n\t * order, then claims them; a claim's renewal, saving report, release and settlement are each one `UPDATE` guarded by\n\t * message id, claimant, token and state; expiry and `releaseClaimsOf` lock their rows in sequence order in a\n\t * subquery; a reservation, an acceptance and a forget are each one statement on the message's row, guarded by its\n\t * digest. Each decides on the rows it locks, never on an earlier read. They exclude the database-wide transactions an\n\t * older broker runs on these tables (`excludesSerial`). A send itself is a serial transaction of its recipient's domain.\n\t */\n\t\"intercom-outbox-row\": {\n\t\tfences: [\n\t\t\t\"outbox rows, FOR UPDATE in sequence order (claim, expiry, releaseClaimsOf), or one row by its own guarded UPDATE\",\n\t\t\t\"one sent-message row, by its own guarded INSERT, UPDATE or DELETE\",\n\t\t],\n\t\tconformance:\n\t\t\t\"a send to one recipient does not wait while another recipient's claim holds its rows; sends to one recipient keep their order and suppress duplicates (#6560)\",\n\t},\n\t/**\n\t * A cleanup's claim of a lapsed fork staging transfer (`cleanupForkStaging`): it reads one lapsed lease row `FOR\n\t * UPDATE SKIP LOCKED`, then takes it over with one `UPDATE` guarded by the lease still being lapsed, so it never waits\n\t * for a live transfer whose writer or publication holds its lease, and two claims never take one transfer. Any lapsed\n\t * transfer may be claimed in any order. The claim names no transfer before it reads, so it takes no lock domain; the\n\t * owner's writes and the cleanup's removals are serial transactions of the transfer's own domain, and each decides on\n\t * the lease row it locks by its token first (#6560).\n\t */\n\t\"fork-staging-claim\": {\n\t\tfences: [\"one lapsed lease row of the staging table, FOR UPDATE SKIP LOCKED, then its guarded UPDATE\"],\n\t\tconformance:\n\t\t\t\"concurrent cleanups take each lapsed transfer over once and never a live one, beside staging clones (#6560)\",\n\t},\n\t/**\n\t * A schema setup that hosts opening a new database at once run once (`setUpStorageOnce`): its first statement tries,\n\t * without waiting, the advisory locks every setup of the same objects takes (the prefix's setup lock, and for a\n\t * domain's migration that domain's lock and the database's, shared, as an earlier build's migration takes them), and\n\t * the setup runs only where it took them all. A process that finds one taken waits outside any transaction until the\n\t * setup is recorded, so the hosts never queue for the lock (#6560).\n\t */\n\t\"schema-setup\": {\n\t\tfences: [\"the setup's advisory locks, all tried by its first statement without waiting\"],\n\t\tconformance:\n\t\t\t\"many hosts open a new database at once: each schema is set up once, every host opens, and none waits in a lock queue (#6560)\",\n\t},\n\t/**\n\t * `SqlRateBuckets.acquire` and `cooldown`: one `UPDATE … RETURNING` (or upsert) of the scope's bucket row, which locks\n\t * no pool row, so it orders after none of them (#4768).\n\t */\n\t\"rate-bucket\": {\n\t\tfences: [\"the scope's rate bucket row, by its own UPDATE\"],\n\t\tconformance: \"many hosts acquire from one rate bucket concurrently and never take more than it allows (#4768)\",\n\t},\n} as const satisfies Readonly<Record<string, FencedPathAudit>>;\n\nexport type FencedPathName = keyof typeof FENCED_PATHS;\n\n/** The audit record of a fenced path. */\nexport function fencedPathAudit(name: FencedPathName): FencedPathAudit {\n\treturn FENCED_PATHS[name];\n}\n\n/** The `FencedPathId` that lets an audited path run `{ kind: \"fenced\", audit }` transactions. */\nexport function fencedPath(name: FencedPathName): FencedPathId {\n\treturn name as FencedPathId;\n}\n"]}
|
|
@@ -42,6 +42,8 @@ interface StorageIo {
|
|
|
42
42
|
remove(path: string): void;
|
|
43
43
|
mkdir(path: string): void;
|
|
44
44
|
sleep(ms: number): void;
|
|
45
|
+
/** Learns whether the file system of `directory` keeps creation times; see `creation-time.ts`. */
|
|
46
|
+
learnCreationTime(directory: string): void;
|
|
45
47
|
}
|
|
46
48
|
type StorageIoOp = keyof StorageIo;
|
|
47
49
|
type StorageIoRequest = {
|
|
@@ -6,6 +6,7 @@ import { homedir, constants as osConstants } from "node:os";
|
|
|
6
6
|
import { basename, dirname, isAbsolute, join, normalize, parse, posix, relative, resolve, sep, win32 } from "node:path";
|
|
7
7
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { fileGenerationOf, learnCreationTime, learnCreationTimeSync, legacyFileGenerationOf } from "./creation-time.js";
|
|
9
10
|
const CONFIG_DIR_NAME = ".atomic";
|
|
10
11
|
const ENV_AGENT_DIR = "ATOMIC_CODING_AGENT_DIR";
|
|
11
12
|
const LEGACY_ENV_AGENT_DIR = "PI_CODING_AGENT_DIR";
|
|
@@ -178,6 +179,7 @@ const syncIo = {
|
|
|
178
179
|
sleep: (ms) => {
|
|
179
180
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
180
181
|
},
|
|
182
|
+
learnCreationTime: (directory) => learnCreationTimeSync(directory),
|
|
181
183
|
};
|
|
182
184
|
const asyncIo = {
|
|
183
185
|
stat: async (path) => fileStat(await stat(path, { bigint: true })),
|
|
@@ -224,6 +226,7 @@ const asyncIo = {
|
|
|
224
226
|
await mkdir(path, { recursive: true });
|
|
225
227
|
},
|
|
226
228
|
sleep: (ms) => sleep(ms),
|
|
229
|
+
learnCreationTime: (directory) => learnCreationTime(directory),
|
|
227
230
|
};
|
|
228
231
|
function* io(op, ...args) {
|
|
229
232
|
return (yield { op, args });
|
|
@@ -1580,22 +1583,32 @@ function containsPath(directory, target) {
|
|
|
1580
1583
|
const inside = relative(directory, target);
|
|
1581
1584
|
return inside !== ".." && !inside.startsWith(`..${sep}`) && !isAbsolute(inside);
|
|
1582
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* The claim files of `target`: by its path, and by the file itself, so another path to the same file finds the same
|
|
1588
|
+
* owner. `older` are the claims an older build named by the file with its creation time in it, where this build leaves
|
|
1589
|
+
* that out: they are read, and never made.
|
|
1590
|
+
*/
|
|
1583
1591
|
function* targetClaimFilesSteps(agentPath, home, target) {
|
|
1584
1592
|
const containers = [dirname(yield* canonicalPathSteps(agentPath))];
|
|
1585
1593
|
const decisionHome = yield* canonicalPathSteps(home);
|
|
1586
1594
|
if (!pathsEqual(containers[0], decisionHome))
|
|
1587
1595
|
containers.push(decisionHome);
|
|
1588
|
-
const
|
|
1596
|
+
const physical = yield* canonicalPathSteps(target);
|
|
1597
|
+
const identities = [getPathComparisonKey(physical)];
|
|
1598
|
+
const older = [];
|
|
1589
1599
|
try {
|
|
1590
1600
|
const stats = yield* io("stat", target);
|
|
1591
|
-
if (stats.ino !== 0n)
|
|
1592
|
-
|
|
1601
|
+
if (stats.ino !== 0n) {
|
|
1602
|
+
yield* io("learnCreationTime", dirname(physical));
|
|
1603
|
+
const generation = fileGenerationOf(stats);
|
|
1604
|
+
identities.push(`file:${generation}`);
|
|
1605
|
+
if (generation !== legacyFileGenerationOf(stats))
|
|
1606
|
+
older.push(`file:${legacyFileGenerationOf(stats)}`);
|
|
1607
|
+
}
|
|
1593
1608
|
}
|
|
1594
1609
|
catch { }
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
return join(container, `.atomic-storage-target-${key}`);
|
|
1598
|
-
}));
|
|
1610
|
+
const claimFiles = (identity) => containers.map((container) => join(container, `.atomic-storage-target-${createHash("sha256").update(identity).digest("hex")}`));
|
|
1611
|
+
return { claims: identities.flatMap(claimFiles), older: older.flatMap(claimFiles) };
|
|
1599
1612
|
}
|
|
1600
1613
|
function* preferredTargetOwnerSteps(agentPath, parent, target) {
|
|
1601
1614
|
const physical = yield* canonicalPathSteps(target);
|
|
@@ -1770,8 +1783,11 @@ function* applyStorageTargetDecisionSteps(targetDecision, settings, entryFresh =
|
|
|
1770
1783
|
const claims = version !== undefined && cached?.version === version
|
|
1771
1784
|
? cached.claims
|
|
1772
1785
|
: yield* targetClaimFilesSteps(agentPath, decision.home, selected);
|
|
1773
|
-
|
|
1786
|
+
const older = new Set(claims.older);
|
|
1787
|
+
for (const claim of [...claims.claims, ...claims.older]) {
|
|
1774
1788
|
let owner = yield* readStorageOwnerSteps(claim);
|
|
1789
|
+
if (owner === undefined && older.has(claim))
|
|
1790
|
+
continue;
|
|
1775
1791
|
if (owner === undefined && settings !== undefined && (yield* io("isDirectory", agentPath))) {
|
|
1776
1792
|
yield* io("mkdir", dirname(claim));
|
|
1777
1793
|
yield* claimFileAtomicallySteps(claim, `${JSON.stringify(yield* storageOwnerSteps(decision.parentOwner, dirname(claim)))}\n`);
|