@amalgm/shell 0.1.164-preview.36072132286 → 0.1.164-preview.36809057014
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/PURPOSE.md +642 -128
- package/README.md +10 -8
- package/dist/accepted-tail.d.ts +26 -0
- package/dist/accepted-tail.js +37 -0
- package/dist/accepted-tail.js.map +1 -0
- package/dist/agent-execution.d.ts +16 -1
- package/dist/agent-execution.js +13 -5
- package/dist/agent-execution.js.map +1 -1
- package/dist/apply-cleanup.d.ts +28 -0
- package/dist/apply-cleanup.js +166 -0
- package/dist/apply-cleanup.js.map +1 -0
- package/dist/apply-recovery.d.ts +47 -0
- package/dist/apply-recovery.js +99 -0
- package/dist/apply-recovery.js.map +1 -0
- package/dist/apply-rows.d.ts +72 -0
- package/dist/apply-rows.js +150 -0
- package/dist/apply-rows.js.map +1 -0
- package/dist/apply-saves.d.ts +85 -0
- package/dist/apply-saves.js +238 -0
- package/dist/apply-saves.js.map +1 -0
- package/dist/boot.js +2 -1
- package/dist/boot.js.map +1 -1
- package/dist/capture-work.d.ts +8 -0
- package/dist/capture-work.js +67 -0
- package/dist/capture-work.js.map +1 -0
- package/dist/cargo-group.d.ts +45 -0
- package/dist/cargo-group.js +88 -0
- package/dist/cargo-group.js.map +1 -0
- package/dist/channel-session.d.ts +4 -2
- package/dist/channel-session.js +4 -3
- package/dist/channel-session.js.map +1 -1
- package/dist/chat-composition.d.ts +2 -0
- package/dist/chat-composition.js +1 -0
- package/dist/chat-composition.js.map +1 -1
- package/dist/cli.js +20 -1
- package/dist/cli.js.map +1 -1
- package/dist/construct-apply-host.d.ts +4 -2
- package/dist/construct-apply-host.js +8 -3
- package/dist/construct-apply-host.js.map +1 -1
- package/dist/construct-door.js +1 -1
- package/dist/construct-door.js.map +1 -1
- package/dist/construct-ledger.d.ts +6 -1
- package/dist/construct-ledger.js +21 -33
- package/dist/construct-ledger.js.map +1 -1
- package/dist/content-cache-collection.d.ts +18 -0
- package/dist/content-cache-collection.js +99 -0
- package/dist/content-cache-collection.js.map +1 -0
- package/dist/content-cache-host.d.ts +83 -17
- package/dist/content-cache-host.js +335 -95
- package/dist/content-cache-host.js.map +1 -1
- package/dist/content-cache-namespace.d.ts +59 -0
- package/dist/content-cache-namespace.js +210 -0
- package/dist/content-cache-namespace.js.map +1 -0
- package/dist/content-cache-ownership.d.ts +13 -0
- package/dist/content-cache-ownership.js +75 -0
- package/dist/content-cache-ownership.js.map +1 -0
- package/dist/content-cache-retention.d.ts +23 -0
- package/dist/content-cache-retention.js +195 -0
- package/dist/content-cache-retention.js.map +1 -0
- package/dist/content-capture-pool.d.ts +287 -0
- package/dist/content-capture-pool.js +461 -0
- package/dist/content-capture-pool.js.map +1 -0
- package/dist/content-capture-worker.d.ts +8 -0
- package/dist/content-capture-worker.js +109 -0
- package/dist/content-capture-worker.js.map +1 -0
- package/dist/content-clock.d.ts +42 -0
- package/dist/content-clock.js +166 -0
- package/dist/content-clock.js.map +1 -0
- package/dist/content-direct.d.ts +2 -0
- package/dist/content-direct.js +12 -0
- package/dist/content-direct.js.map +1 -1
- package/dist/content-failure.d.ts +18 -0
- package/dist/content-failure.js +38 -0
- package/dist/content-failure.js.map +1 -0
- package/dist/content-stream-thread.d.ts +60 -0
- package/dist/content-stream-thread.js +95 -0
- package/dist/content-stream-thread.js.map +1 -0
- package/dist/content-stream-worker.d.ts +7 -0
- package/dist/content-stream-worker.js +52 -0
- package/dist/content-stream-worker.js.map +1 -0
- package/dist/declaration-absorption.d.ts +37 -0
- package/dist/declaration-absorption.js +119 -0
- package/dist/declaration-absorption.js.map +1 -0
- package/dist/declaration-chain.d.ts +36 -0
- package/dist/declaration-chain.js +96 -0
- package/dist/declaration-chain.js.map +1 -0
- package/dist/declaration-commit.d.ts +31 -0
- package/dist/declaration-commit.js +49 -0
- package/dist/declaration-commit.js.map +1 -0
- package/dist/declaration-hold.d.ts +22 -0
- package/dist/declaration-hold.js +24 -0
- package/dist/declaration-hold.js.map +1 -0
- package/dist/declaration-journal.d.ts +62 -0
- package/dist/declaration-journal.js +99 -0
- package/dist/declaration-journal.js.map +1 -0
- package/dist/declaration-save.d.ts +31 -0
- package/dist/declaration-save.js +134 -0
- package/dist/declaration-save.js.map +1 -0
- package/dist/detection/accepted-result.d.ts +19 -1
- package/dist/detection/accepted-result.js +36 -5
- package/dist/detection/accepted-result.js.map +1 -1
- package/dist/detection/admission-save.d.ts +55 -0
- package/dist/detection/admission-save.js +48 -0
- package/dist/detection/admission-save.js.map +1 -0
- package/dist/detection/admission-units.d.ts +66 -0
- package/dist/detection/admission-units.js +322 -0
- package/dist/detection/admission-units.js.map +1 -0
- package/dist/detection/alias-discovery.d.ts +12 -0
- package/dist/detection/alias-discovery.js +80 -0
- package/dist/detection/alias-discovery.js.map +1 -0
- package/dist/detection/alias-examination.d.ts +30 -0
- package/dist/detection/alias-examination.js +49 -0
- package/dist/detection/alias-examination.js.map +1 -0
- package/dist/detection/apply-ownership.d.ts +81 -0
- package/dist/detection/apply-ownership.js +232 -0
- package/dist/detection/apply-ownership.js.map +1 -0
- package/dist/detection/basis-advanced.d.ts +11 -0
- package/dist/detection/basis-advanced.js +26 -0
- package/dist/detection/basis-advanced.js.map +1 -0
- package/dist/detection/capture-outcome.d.ts +16 -0
- package/dist/detection/capture-outcome.js +92 -0
- package/dist/detection/capture-outcome.js.map +1 -0
- package/dist/detection/container-membership.d.ts +32 -0
- package/dist/detection/container-membership.js +49 -0
- package/dist/detection/container-membership.js.map +1 -0
- package/dist/detection/detect-cancelled.d.ts +6 -0
- package/dist/detection/detect-cancelled.js +10 -0
- package/dist/detection/detect-cancelled.js.map +1 -0
- package/dist/detection/directory-proof.d.ts +47 -0
- package/dist/detection/directory-proof.js +77 -0
- package/dist/detection/directory-proof.js.map +1 -0
- package/dist/detection/disposition-rows.d.ts +18 -0
- package/dist/detection/disposition-rows.js +29 -0
- package/dist/detection/disposition-rows.js.map +1 -0
- package/dist/detection/dispositions.d.ts +130 -0
- package/dist/detection/dispositions.js +248 -0
- package/dist/detection/dispositions.js.map +1 -0
- package/dist/detection/git-notice.d.ts +88 -0
- package/dist/detection/git-notice.js +444 -0
- package/dist/detection/git-notice.js.map +1 -0
- package/dist/detection/ground-proof.d.ts +130 -0
- package/dist/detection/ground-proof.js +274 -0
- package/dist/detection/ground-proof.js.map +1 -0
- package/dist/detection/ground-reader.d.ts +29 -0
- package/dist/detection/ground-reader.js +102 -0
- package/dist/detection/ground-reader.js.map +1 -0
- package/dist/detection/held-territory.d.ts +51 -0
- package/dist/detection/held-territory.js +205 -0
- package/dist/detection/held-territory.js.map +1 -0
- package/dist/detection/identity-discovery.d.ts +45 -0
- package/dist/detection/identity-discovery.js +287 -0
- package/dist/detection/identity-discovery.js.map +1 -0
- package/dist/detection/maintenance-sweep.d.ts +108 -0
- package/dist/detection/maintenance-sweep.js +325 -0
- package/dist/detection/maintenance-sweep.js.map +1 -0
- package/dist/detection/name-reach.d.ts +12 -0
- package/dist/detection/name-reach.js +28 -0
- package/dist/detection/name-reach.js.map +1 -0
- package/dist/detection/notebook-basis.d.ts +5 -7
- package/dist/detection/notebook-basis.js +6 -7
- package/dist/detection/notebook-basis.js.map +1 -1
- package/dist/detection/owed-selection.d.ts +51 -0
- package/dist/detection/owed-selection.js +169 -0
- package/dist/detection/owed-selection.js.map +1 -0
- package/dist/detection/portable.d.ts +34 -34
- package/dist/detection/portable.js +67 -93
- package/dist/detection/portable.js.map +1 -1
- package/dist/detection/reconciliation-coverage.d.ts +7 -0
- package/dist/detection/reconciliation-coverage.js +16 -0
- package/dist/detection/reconciliation-coverage.js.map +1 -0
- package/dist/detection/repository-publication.d.ts +20 -0
- package/dist/detection/repository-publication.js +79 -0
- package/dist/detection/repository-publication.js.map +1 -0
- package/dist/detection/repository-routes.d.ts +43 -0
- package/dist/detection/repository-routes.js +97 -0
- package/dist/detection/repository-routes.js.map +1 -0
- package/dist/detection/root-examination.d.ts +94 -0
- package/dist/detection/root-examination.js +523 -0
- package/dist/detection/root-examination.js.map +1 -0
- package/dist/detection/runtime.d.ts +131 -64
- package/dist/detection/runtime.js +808 -1103
- package/dist/detection/runtime.js.map +1 -1
- package/dist/detection/scoped-identity-port.d.ts +34 -0
- package/dist/detection/scoped-identity-port.js +81 -0
- package/dist/detection/scoped-identity-port.js.map +1 -0
- package/dist/detection/seal-law.d.ts +66 -0
- package/dist/detection/seal-law.js +116 -0
- package/dist/detection/seal-law.js.map +1 -0
- package/dist/detection/sharing-policy.d.ts +11 -0
- package/dist/detection/sharing-policy.js +32 -0
- package/dist/detection/sharing-policy.js.map +1 -0
- package/dist/detection/thread-database.d.ts +4 -0
- package/dist/detection/thread-database.js +30 -0
- package/dist/detection/thread-database.js.map +1 -0
- package/dist/detection/unreadable.d.ts +11 -0
- package/dist/detection/unreadable.js +9 -0
- package/dist/detection/unreadable.js.map +1 -0
- package/dist/detection/verified-content.d.ts +6 -0
- package/dist/detection/verified-content.js +12 -0
- package/dist/detection/verified-content.js.map +1 -0
- package/dist/detection/walk-law.d.ts +34 -0
- package/dist/detection/walk-law.js +55 -0
- package/dist/detection/walk-law.js.map +1 -0
- package/dist/development/fly-guest.js +2 -1
- package/dist/development/fly-guest.js.map +1 -1
- package/dist/entity-apply-host.d.ts +29 -13
- package/dist/entity-apply-host.js +1426 -461
- package/dist/entity-apply-host.js.map +1 -1
- package/dist/entity-apply-store.d.ts +77 -30
- package/dist/entity-apply-store.js +221 -516
- package/dist/entity-apply-store.js.map +1 -1
- package/dist/entity-record-observability.js +2 -0
- package/dist/entity-record-observability.js.map +1 -1
- package/dist/entity-record-saves.d.ts +20 -0
- package/dist/entity-record-saves.js +91 -0
- package/dist/entity-record-saves.js.map +1 -0
- package/dist/entity-record-store.d.ts +15 -7
- package/dist/entity-record-store.js +57 -117
- package/dist/entity-record-store.js.map +1 -1
- package/dist/files-register-host.d.ts +22 -3
- package/dist/files-register-host.js +70 -31
- package/dist/files-register-host.js.map +1 -1
- package/dist/filesystem.js +3 -2
- package/dist/filesystem.js.map +1 -1
- package/dist/git-binding.d.ts +65 -0
- package/dist/git-binding.js +220 -0
- package/dist/git-binding.js.map +1 -0
- package/dist/git-capture.d.ts +39 -0
- package/dist/git-capture.js +86 -0
- package/dist/git-capture.js.map +1 -0
- package/dist/git-card.d.ts +12 -0
- package/dist/git-card.js +123 -0
- package/dist/git-card.js.map +1 -0
- package/dist/git-checkpoint-construction.d.ts +41 -0
- package/dist/git-checkpoint-construction.js +96 -0
- package/dist/git-checkpoint-construction.js.map +1 -0
- package/dist/git-checkpoint-preparation.d.ts +37 -0
- package/dist/git-checkpoint-preparation.js +145 -0
- package/dist/git-checkpoint-preparation.js.map +1 -0
- package/dist/git-command.d.ts +61 -8
- package/dist/git-command.js +217 -63
- package/dist/git-command.js.map +1 -1
- package/dist/git-configuration.d.ts +40 -0
- package/dist/git-configuration.js +217 -0
- package/dist/git-configuration.js.map +1 -0
- package/dist/git-evidence.d.ts +61 -0
- package/dist/git-evidence.js +181 -0
- package/dist/git-evidence.js.map +1 -0
- package/dist/git-index-entries.d.ts +15 -0
- package/dist/git-index-entries.js +44 -0
- package/dist/git-index-entries.js.map +1 -0
- package/dist/git-index-format.d.ts +35 -0
- package/dist/git-index-format.js +293 -0
- package/dist/git-index-format.js.map +1 -0
- package/dist/git-index-witness.d.ts +33 -0
- package/dist/git-index-witness.js +69 -0
- package/dist/git-index-witness.js.map +1 -0
- package/dist/git-literal-host.d.ts +82 -0
- package/dist/git-literal-host.js +172 -0
- package/dist/git-literal-host.js.map +1 -0
- package/dist/git-literal-read.d.ts +88 -0
- package/dist/git-literal-read.js +170 -0
- package/dist/git-literal-read.js.map +1 -0
- package/dist/git-literal-replay.d.ts +33 -0
- package/dist/git-literal-replay.js +268 -0
- package/dist/git-literal-replay.js.map +1 -0
- package/dist/git-native-file.d.ts +42 -0
- package/dist/git-native-file.js +145 -0
- package/dist/git-native-file.js.map +1 -0
- package/dist/git-native-index.d.ts +21 -0
- package/dist/git-native-index.js +44 -0
- package/dist/git-native-index.js.map +1 -0
- package/dist/git-operation-host.d.ts +48 -0
- package/dist/git-operation-host.js +127 -0
- package/dist/git-operation-host.js.map +1 -0
- package/dist/git-private-index.d.ts +11 -0
- package/dist/git-private-index.js +42 -0
- package/dist/git-private-index.js.map +1 -0
- package/dist/git-private-repository.d.ts +4 -0
- package/dist/git-private-repository.js +69 -0
- package/dist/git-private-repository.js.map +1 -0
- package/dist/git-private-view.d.ts +39 -0
- package/dist/git-private-view.js +162 -0
- package/dist/git-private-view.js.map +1 -0
- package/dist/git-ref-store.d.ts +12 -0
- package/dist/git-ref-store.js +68 -0
- package/dist/git-ref-store.js.map +1 -0
- package/dist/git-registration-host.d.ts +20 -30
- package/dist/git-registration-host.js +86 -249
- package/dist/git-registration-host.js.map +1 -1
- package/dist/git-repository-host.d.ts +148 -22
- package/dist/git-repository-host.js +633 -650
- package/dist/git-repository-host.js.map +1 -1
- package/dist/git-worktree-host.d.ts +2 -0
- package/dist/git-worktree-host.js +16 -0
- package/dist/git-worktree-host.js.map +1 -0
- package/dist/graph-publication.d.ts +75 -0
- package/dist/graph-publication.js +203 -0
- package/dist/graph-publication.js.map +1 -0
- package/dist/ground-basis.d.ts +242 -0
- package/dist/ground-basis.js +1023 -0
- package/dist/ground-basis.js.map +1 -0
- package/dist/ground-checkpoint-worker.d.ts +1 -0
- package/dist/ground-checkpoint-worker.js +84 -0
- package/dist/ground-checkpoint-worker.js.map +1 -0
- package/dist/ground-checkpoints.d.ts +16 -0
- package/dist/ground-checkpoints.js +45 -0
- package/dist/ground-checkpoints.js.map +1 -0
- package/dist/ground-coordination.d.ts +107 -3
- package/dist/ground-coordination.js +249 -24
- package/dist/ground-coordination.js.map +1 -1
- package/dist/ground-database.d.ts +42 -0
- package/dist/ground-database.js +290 -0
- package/dist/ground-database.js.map +1 -0
- package/dist/ground-differences.d.ts +23 -0
- package/dist/ground-differences.js +47 -0
- package/dist/ground-differences.js.map +1 -0
- package/dist/ground-holders.d.ts +4 -0
- package/dist/ground-holders.js +15 -0
- package/dist/ground-holders.js.map +1 -0
- package/dist/ground-initialization-worker.d.ts +1 -0
- package/dist/ground-initialization-worker.js +20 -0
- package/dist/ground-initialization-worker.js.map +1 -0
- package/dist/ground-initialization.d.ts +35 -0
- package/dist/ground-initialization.js +102 -0
- package/dist/ground-initialization.js.map +1 -0
- package/dist/ground-install-saves.d.ts +63 -0
- package/dist/ground-install-saves.js +139 -0
- package/dist/ground-install-saves.js.map +1 -0
- package/dist/ground-inventory-schema.d.ts +18 -0
- package/dist/ground-inventory-schema.js +168 -0
- package/dist/ground-inventory-schema.js.map +1 -0
- package/dist/ground-profile.d.ts +7 -0
- package/dist/ground-profile.js +52 -0
- package/dist/ground-profile.js.map +1 -0
- package/dist/ground-root-index.d.ts +2 -1
- package/dist/ground-root-index.js +16 -14
- package/dist/ground-root-index.js.map +1 -1
- package/dist/ground-row.d.ts +62 -0
- package/dist/ground-row.js +70 -0
- package/dist/ground-row.js.map +1 -0
- package/dist/ground-save-ops.d.ts +44 -0
- package/dist/ground-save-ops.js +41 -0
- package/dist/ground-save-ops.js.map +1 -0
- package/dist/ground-saver-worker.d.ts +1 -0
- package/dist/ground-saver-worker.js +156 -0
- package/dist/ground-saver-worker.js.map +1 -0
- package/dist/ground-saver.d.ts +75 -0
- package/dist/ground-saver.js +216 -0
- package/dist/ground-saver.js.map +1 -0
- package/dist/ground-store.d.ts +84 -0
- package/dist/ground-store.js +473 -0
- package/dist/ground-store.js.map +1 -0
- package/dist/ground-territory.d.ts +130 -0
- package/dist/ground-territory.js +511 -0
- package/dist/ground-territory.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/installation/ownership.d.ts +0 -2
- package/dist/installation/ownership.js +3 -15
- package/dist/installation/ownership.js.map +1 -1
- package/dist/machine-host.d.ts +3 -2
- package/dist/machine-host.js +28 -16
- package/dist/machine-host.js.map +1 -1
- package/dist/materialized-graph.d.ts +7 -7
- package/dist/materialized-graph.js +11 -23
- package/dist/materialized-graph.js.map +1 -1
- package/dist/module-thread.d.ts +9 -0
- package/dist/module-thread.js +10 -0
- package/dist/module-thread.js.map +1 -0
- package/dist/native/fsevents-stream.node +0 -0
- package/dist/physical-path-witness.d.ts +64 -0
- package/dist/physical-path-witness.js +168 -0
- package/dist/physical-path-witness.js.map +1 -0
- package/dist/register-upload-fusion.d.ts +5 -4
- package/dist/register-upload-fusion.js +9 -6
- package/dist/register-upload-fusion.js.map +1 -1
- package/dist/registry-graph.d.ts +3 -2
- package/dist/registry-graph.js +9 -6
- package/dist/registry-graph.js.map +1 -1
- package/dist/registry-page-cache.d.ts +5 -2
- package/dist/registry-page-cache.js.map +1 -1
- package/dist/repository-identity-steps.d.ts +5 -0
- package/dist/repository-identity-steps.js +33 -0
- package/dist/repository-identity-steps.js.map +1 -0
- package/dist/runtime-node-flags.d.ts +10 -0
- package/dist/runtime-node-flags.js +11 -0
- package/dist/runtime-node-flags.js.map +1 -0
- package/dist/service/adapter.d.ts +1 -1
- package/dist/service/adapter.js +1 -1
- package/dist/service/adapter.js.map +1 -1
- package/dist/service/cli.js +16 -20
- package/dist/service/cli.js.map +1 -1
- package/dist/service/control.d.ts +2 -2
- package/dist/service/keepalive.d.ts +4 -11
- package/dist/service/keepalive.js +65 -118
- package/dist/service/keepalive.js.map +1 -1
- package/dist/service/policy.d.ts +36 -0
- package/dist/service/policy.js +25 -0
- package/dist/service/policy.js.map +1 -0
- package/dist/service/portable.d.ts +1 -1
- package/dist/service/portable.js +1 -1
- package/dist/service/portable.js.map +1 -1
- package/dist/service/recovery.d.ts +10 -9
- package/dist/service/recovery.js +29 -19
- package/dist/service/recovery.js.map +1 -1
- package/dist/service/windows-action.d.ts +5 -3
- package/dist/service/windows-action.js +6 -9
- package/dist/service/windows-action.js.map +1 -1
- package/dist/service/windows-task.js +5 -5
- package/dist/service/windows-task.js.map +1 -1
- package/dist/sharing-admission.d.ts +17 -0
- package/dist/sharing-admission.js +128 -0
- package/dist/sharing-admission.js.map +1 -0
- package/dist/snapshot-delivery-baseline.d.ts +12 -3
- package/dist/snapshot-delivery-baseline.js +41 -42
- package/dist/snapshot-delivery-baseline.js.map +1 -1
- package/dist/source-proof.d.ts +36 -0
- package/dist/source-proof.js +70 -0
- package/dist/source-proof.js.map +1 -0
- package/dist/source-signature.d.ts +56 -0
- package/dist/source-signature.js +56 -0
- package/dist/source-signature.js.map +1 -0
- package/dist/source-witness.d.ts +15 -0
- package/dist/source-witness.js +29 -0
- package/dist/source-witness.js.map +1 -0
- package/dist/sqlite-durability.d.ts +31 -0
- package/dist/sqlite-durability.js +28 -0
- package/dist/sqlite-durability.js.map +1 -0
- package/dist/sqlite.d.ts +8 -2
- package/dist/sqlite.js +27 -4
- package/dist/sqlite.js.map +1 -1
- package/dist/sync-address.d.ts +19 -0
- package/dist/sync-address.js +52 -0
- package/dist/sync-address.js.map +1 -0
- package/dist/sync-setting.d.ts +15 -0
- package/dist/sync-setting.js +13 -0
- package/dist/sync-setting.js.map +1 -1
- package/dist/turns.d.ts +42 -0
- package/dist/turns.js +112 -0
- package/dist/turns.js.map +1 -0
- package/dist/updates/bootstrap.d.ts +53 -7
- package/dist/updates/bootstrap.js +224 -137
- package/dist/updates/bootstrap.js.map +1 -1
- package/dist/updates/controller.d.ts +8 -0
- package/dist/updates/controller.js +27 -3
- package/dist/updates/controller.js.map +1 -1
- package/dist/updates/store.d.ts +3 -0
- package/dist/updates/store.js +12 -0
- package/dist/updates/store.js.map +1 -1
- package/dist/user-ground-host.d.ts +364 -69
- package/dist/user-ground-host.js +5231 -3366
- package/dist/user-ground-host.js.map +1 -1
- package/dist/watching/fsevents.d.ts +52 -1
- package/dist/watching/fsevents.js +60 -25
- package/dist/watching/fsevents.js.map +1 -1
- package/dist/watching/host.d.ts +129 -5
- package/dist/watching/host.js +433 -80
- package/dist/watching/host.js.map +1 -1
- package/dist/watching/index.d.ts +1 -1
- package/dist/wire-binary.d.ts +3 -2
- package/dist/wire-binary.js +10 -8
- package/dist/wire-binary.js.map +1 -1
- package/dist/wire-client.d.ts +3 -4
- package/dist/wire-client.js +18 -44
- package/dist/wire-client.js.map +1 -1
- package/dist/wire-outbox.d.ts +34 -0
- package/dist/wire-outbox.js +127 -0
- package/dist/wire-outbox.js.map +1 -0
- package/dist/workspace-host.d.ts +4 -0
- package/dist/workspace-host.js +12 -1
- package/dist/workspace-host.js.map +1 -1
- package/examinations/fixtures/private-wire-authority.js +133 -10
- package/npm-shrinkwrap.json +43 -56
- package/package.json +26 -13
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/** One Detect pass admits in independent units. A unit is the smallest set of
|
|
2
|
+
* changed identities whose writes and reads cannot be separated: no fact one
|
|
3
|
+
* unit's admission reads is stamped by another unit of the same pass, so
|
|
4
|
+
* units admit in any order and one unit's churn defers only itself.
|
|
5
|
+
*
|
|
6
|
+
* Two identities share a unit when one's write stamps a fact the other reads:
|
|
7
|
+
* - a namespace change (placement, name, type, lifecycle, address, presence)
|
|
8
|
+
* joins the identity to its old and new parent, whose membership it is;
|
|
9
|
+
* - a shared address slot, or a physical object within one root, before or
|
|
10
|
+
* after, joins; identity continuity is root-local, so an object's names
|
|
11
|
+
* in different roots are aliases, each examined in its own root, and a
|
|
12
|
+
* freed inode reused in another root joins nothing;
|
|
13
|
+
* - a member joins its nearest repository, whose Card + Checkpoint it is,
|
|
14
|
+
* unless it is a nested repository whose own head alone changed; a unit
|
|
15
|
+
* admitting a repository consumes that repository's whole territory as
|
|
16
|
+
* one fact, never its unchanged rows one by one;
|
|
17
|
+
* - an identity joins each changed ancestor on its old or new route;
|
|
18
|
+
* - a root whose selection withheld a result for a cross-entity reason
|
|
19
|
+
* (parent, ownership, address, cycle) is one unit.
|
|
20
|
+
* A failed identity stays in its unit, and that whole unit waits.
|
|
21
|
+
*
|
|
22
|
+
* Ground a pass could not examine is a gap, never absence. A unit waits for a
|
|
23
|
+
* gap only when it needs a fact the gap hides: an address at or beneath it,
|
|
24
|
+
* or an identity decision (create, removal, move, lifecycle) that an unlisted
|
|
25
|
+
* directory in its root could contradict. In a complete domain any gap may
|
|
26
|
+
* hide where a missing identity went, so absence there waits too. Identity
|
|
27
|
+
* continuity is root-local, so an arrival takes nothing from another root's
|
|
28
|
+
* gap. A stable identity edited in place needs no hidden fact and admits. */
|
|
29
|
+
import { dirname } from "node:path";
|
|
30
|
+
import { repositoryHeadOnly, repositoryOwners } from "../ground-basis.js";
|
|
31
|
+
import { activeRepository as repository } from "../ground-territory.js";
|
|
32
|
+
import { PhysicalKeySet } from "../ground-coordination.js";
|
|
33
|
+
const INVENTORIES = ["entities", "detection_notebook"];
|
|
34
|
+
const namespaceOf = (row) => row === undefined ? "" : JSON.stringify([
|
|
35
|
+
row.resourceId, row.rootUUID, row.parentUUID, row.name, row.type, row.status, row.relativePath, row.absolutePath
|
|
36
|
+
]);
|
|
37
|
+
const structureOf = (inventory, row) => row === undefined ? ""
|
|
38
|
+
: `${namespaceOf(row)}${inventory === "entities" ? `:${row.physicalKey}:${(row.filesystemMode ?? 0) & 0o170000}` : ""}`;
|
|
39
|
+
const container = (row) => row?.type === "workspace" || row?.type === "folder";
|
|
40
|
+
/** Ancestors by parent link, nearest first, until a missing row or a cycle. */
|
|
41
|
+
function route(lookup, row) {
|
|
42
|
+
const found = [];
|
|
43
|
+
const seen = new Set(row ? [row.uuid] : []);
|
|
44
|
+
for (let parent = row?.parentUUID ?? null; parent !== null && !seen.has(parent);) {
|
|
45
|
+
const next = lookup(parent);
|
|
46
|
+
if (!next)
|
|
47
|
+
break;
|
|
48
|
+
seen.add(parent);
|
|
49
|
+
found.push(parent);
|
|
50
|
+
parent = next.parentUUID;
|
|
51
|
+
}
|
|
52
|
+
return found;
|
|
53
|
+
}
|
|
54
|
+
/** The directory an absolute row address resolves under, and its root. */
|
|
55
|
+
const rootDirectory = (row) => row.relativePath === "" ? row.absolutePath
|
|
56
|
+
: row.absolutePath.slice(0, row.absolutePath.length - row.relativePath.length - 1);
|
|
57
|
+
function ancestorDirectories(row) {
|
|
58
|
+
const root = rootDirectory(row);
|
|
59
|
+
const found = [];
|
|
60
|
+
for (let directory = dirname(row.absolutePath); row.relativePath !== "" && directory.length >= root.length;) {
|
|
61
|
+
found.push(directory);
|
|
62
|
+
if (directory === root)
|
|
63
|
+
break;
|
|
64
|
+
directory = dirname(directory);
|
|
65
|
+
}
|
|
66
|
+
return found;
|
|
67
|
+
}
|
|
68
|
+
const present = (row) => row !== undefined && row.status === "active";
|
|
69
|
+
export function admissionUnits(pass) {
|
|
70
|
+
const { before, writes } = pass;
|
|
71
|
+
const written = { entities: new Map(), detection_notebook: new Map() };
|
|
72
|
+
for (const row of writes.materialized)
|
|
73
|
+
written.entities.set(row.uuid, row);
|
|
74
|
+
for (const uuid of writes.materializedRemovals)
|
|
75
|
+
if (!written.entities.has(uuid))
|
|
76
|
+
written.entities.set(uuid, undefined);
|
|
77
|
+
for (const row of writes.notebook)
|
|
78
|
+
written.detection_notebook.set(row.uuid, row);
|
|
79
|
+
const beforeOf = (inventory) => uuid => before[inventory].get(uuid);
|
|
80
|
+
const afterOf = (inventory) => uuid => written[inventory].has(uuid) ? written[inventory].get(uuid) : before[inventory].get(uuid);
|
|
81
|
+
const graphs = INVENTORIES.flatMap(inventory => [
|
|
82
|
+
{ inventory, lookup: beforeOf(inventory), owner: repositoryOwners(beforeOf(inventory)) },
|
|
83
|
+
{ inventory, lookup: afterOf(inventory), owner: repositoryOwners(afterOf(inventory)) },
|
|
84
|
+
]);
|
|
85
|
+
const changed = new Set([
|
|
86
|
+
...written.entities.keys(), ...written.detection_notebook.keys(),
|
|
87
|
+
...writes.proposals.map(proposal => proposal.entityId),
|
|
88
|
+
...writes.settled.map(proposal => proposal.entityId),
|
|
89
|
+
...writes.repositoryObservations.map(pair => pair.uuid),
|
|
90
|
+
...writes.seals.map(seal => seal.uuid),
|
|
91
|
+
...pass.failed,
|
|
92
|
+
]);
|
|
93
|
+
const parents = new Map();
|
|
94
|
+
const find = (node) => {
|
|
95
|
+
let top = node;
|
|
96
|
+
for (let next = parents.get(top); next !== undefined && next !== top; next = parents.get(top))
|
|
97
|
+
top = next;
|
|
98
|
+
for (let current = node; current !== top;) {
|
|
99
|
+
const next = parents.get(current);
|
|
100
|
+
parents.set(current, top);
|
|
101
|
+
current = next;
|
|
102
|
+
}
|
|
103
|
+
return top;
|
|
104
|
+
};
|
|
105
|
+
const join = (left, right) => {
|
|
106
|
+
const a = find(left), b = find(right);
|
|
107
|
+
if (a !== b)
|
|
108
|
+
parents.set(a, b);
|
|
109
|
+
};
|
|
110
|
+
const occupants = new Map();
|
|
111
|
+
const share = (key, uuid) => {
|
|
112
|
+
const first = occupants.get(key);
|
|
113
|
+
if (first === undefined)
|
|
114
|
+
occupants.set(key, uuid);
|
|
115
|
+
else
|
|
116
|
+
join(first, uuid);
|
|
117
|
+
};
|
|
118
|
+
for (const uuid of changed) {
|
|
119
|
+
for (const inventory of INVENTORIES) {
|
|
120
|
+
const x0 = beforeOf(inventory)(uuid), x1 = afterOf(inventory)(uuid);
|
|
121
|
+
if (namespaceOf(x0) !== namespaceOf(x1)) {
|
|
122
|
+
for (const row of [x0, x1])
|
|
123
|
+
if (row?.parentUUID)
|
|
124
|
+
join(uuid, row.parentUUID);
|
|
125
|
+
}
|
|
126
|
+
for (const row of [x0, x1])
|
|
127
|
+
if (row)
|
|
128
|
+
share(JSON.stringify([inventory, row.rootUUID, row.relativePath]), uuid);
|
|
129
|
+
for (const [lookup, row] of [[beforeOf(inventory), x0], [afterOf(inventory), x1]]) {
|
|
130
|
+
for (const ancestor of route(lookup, row)) {
|
|
131
|
+
if (changed.has(ancestor) && structureOf(inventory, beforeOf(inventory)(ancestor))
|
|
132
|
+
!== structureOf(inventory, afterOf(inventory)(ancestor)))
|
|
133
|
+
join(uuid, ancestor);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
for (const row of [beforeOf("entities")(uuid), afterOf("entities")(uuid)]) {
|
|
138
|
+
if (row)
|
|
139
|
+
share(JSON.stringify(["physical", row.rootUUID, row.physicalKey]), uuid);
|
|
140
|
+
}
|
|
141
|
+
for (const { inventory, lookup, owner } of graphs) {
|
|
142
|
+
const row = lookup(uuid);
|
|
143
|
+
if (!row || repositoryHeadOnly(beforeOf(inventory)(uuid), afterOf(inventory)(uuid)))
|
|
144
|
+
continue;
|
|
145
|
+
const repositoryUUID = owner(uuid);
|
|
146
|
+
if (repositoryUUID !== null)
|
|
147
|
+
join(uuid, repositoryUUID);
|
|
148
|
+
}
|
|
149
|
+
for (const inventory of INVENTORIES)
|
|
150
|
+
for (const row of [beforeOf(inventory)(uuid), afterOf(inventory)(uuid)]) {
|
|
151
|
+
if (row && pass.wholeRoots.has(row.rootUUID))
|
|
152
|
+
join(uuid, `root:${row.rootUUID}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const groups = new Map();
|
|
156
|
+
for (const uuid of changed) {
|
|
157
|
+
const top = find(uuid);
|
|
158
|
+
const group = groups.get(top) ?? [];
|
|
159
|
+
group.push(uuid);
|
|
160
|
+
groups.set(top, group);
|
|
161
|
+
}
|
|
162
|
+
const unitOf = new Map();
|
|
163
|
+
for (const [top, group] of groups)
|
|
164
|
+
for (const uuid of group)
|
|
165
|
+
unitOf.set(uuid, top);
|
|
166
|
+
const partition = (items, uuid) => {
|
|
167
|
+
const byUnit = new Map();
|
|
168
|
+
for (const item of items) {
|
|
169
|
+
const top = unitOf.get(uuid(item));
|
|
170
|
+
const list = byUnit.get(top) ?? [];
|
|
171
|
+
list.push(item);
|
|
172
|
+
byUnit.set(top, list);
|
|
173
|
+
}
|
|
174
|
+
return byUnit;
|
|
175
|
+
};
|
|
176
|
+
const materialized = partition(writes.materialized, row => row.uuid);
|
|
177
|
+
const materializedRemovals = partition(writes.materializedRemovals, uuid => uuid);
|
|
178
|
+
const notebook = partition(writes.notebook, row => row.uuid);
|
|
179
|
+
const proposals = partition(writes.proposals, proposal => proposal.entityId);
|
|
180
|
+
const settled = partition(writes.settled, proposal => proposal.entityId);
|
|
181
|
+
const observations = partition(writes.repositoryObservations, pair => pair.uuid);
|
|
182
|
+
const seals = partition(writes.seals, seal => seal.uuid);
|
|
183
|
+
return [...groups].map(([top, group]) => {
|
|
184
|
+
group.sort();
|
|
185
|
+
const rows = (uuid) => INVENTORIES.map(inventory => ({ inventory, x0: beforeOf(inventory)(uuid), x1: afterOf(inventory)(uuid) }));
|
|
186
|
+
const addresses = new Set();
|
|
187
|
+
for (const uuid of group)
|
|
188
|
+
for (const { x0, x1 } of rows(uuid))
|
|
189
|
+
for (const row of [x0, x1])
|
|
190
|
+
if (row)
|
|
191
|
+
addresses.add(row.absolutePath);
|
|
192
|
+
const repositories = group.filter(uuid => repository(afterOf("entities")(uuid)) || repository(beforeOf("entities")(uuid)));
|
|
193
|
+
return {
|
|
194
|
+
members: group,
|
|
195
|
+
writes: {
|
|
196
|
+
materialized: materialized.get(top) ?? [], materializedRemovals: materializedRemovals.get(top) ?? [],
|
|
197
|
+
notebook: notebook.get(top) ?? [],
|
|
198
|
+
proposals: proposals.get(top) ?? [], settled: settled.get(top) ?? [], repositoryObservations: observations.get(top) ?? [], seals: seals.get(top) ?? [],
|
|
199
|
+
},
|
|
200
|
+
failed: group.filter(uuid => pass.failed.has(uuid)),
|
|
201
|
+
addresses: [...addresses].sort(),
|
|
202
|
+
repositories,
|
|
203
|
+
scope(keys) {
|
|
204
|
+
for (const uuid of group) {
|
|
205
|
+
for (const { inventory, x0, x1 } of rows(uuid)) {
|
|
206
|
+
keys.entity(inventory, uuid, x0);
|
|
207
|
+
for (const row of [x0, x1])
|
|
208
|
+
if (row)
|
|
209
|
+
keys.path(inventory, row.rootUUID, row.relativePath);
|
|
210
|
+
if (container(x0) || container(x1))
|
|
211
|
+
keys.namespace(inventory, uuid);
|
|
212
|
+
if (namespaceOf(x0) !== namespaceOf(x1)) {
|
|
213
|
+
for (const row of [x0, x1])
|
|
214
|
+
if (row?.parentUUID)
|
|
215
|
+
keys.namespace(inventory, row.parentUUID);
|
|
216
|
+
}
|
|
217
|
+
for (const ancestor of route(beforeOf(inventory), x0))
|
|
218
|
+
keys.structure(inventory, ancestor);
|
|
219
|
+
for (const ancestor of route(afterOf(inventory), x1))
|
|
220
|
+
keys.structure(inventory, ancestor);
|
|
221
|
+
}
|
|
222
|
+
for (const row of [beforeOf("entities")(uuid), afterOf("entities")(uuid)]) {
|
|
223
|
+
if (row)
|
|
224
|
+
keys.physical("entities", row.rootUUID, row.physicalKey);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
for (const uuid of repositories)
|
|
228
|
+
for (const inventory of INVENTORIES)
|
|
229
|
+
keys.territory(inventory, uuid);
|
|
230
|
+
},
|
|
231
|
+
reads(physicalReads, repositoryPhysical, discoveries) {
|
|
232
|
+
const entries = new Set(), routes = new Set(), namespaces = new Set(), physical = new Set();
|
|
233
|
+
// A discovery read its whole scope, whatever this unit concluded from it.
|
|
234
|
+
for (const discovery of discoveries)
|
|
235
|
+
for (const entry of discovery.entries)
|
|
236
|
+
entries.add(entry);
|
|
237
|
+
for (const uuid of group) {
|
|
238
|
+
for (const { x0, x1 } of rows(uuid)) {
|
|
239
|
+
for (const row of [x0, x1]) {
|
|
240
|
+
if (!row)
|
|
241
|
+
continue;
|
|
242
|
+
// A container's result is its entry list; a repository or a
|
|
243
|
+
// leaf is read whole, including everything beneath it.
|
|
244
|
+
(container(row) ? namespaces : entries).add(row.absolutePath);
|
|
245
|
+
for (const directory of ancestorDirectories(row))
|
|
246
|
+
routes.add(directory);
|
|
247
|
+
}
|
|
248
|
+
if (namespaceOf(x0) !== namespaceOf(x1))
|
|
249
|
+
for (const row of [x0, x1])
|
|
250
|
+
if (row)
|
|
251
|
+
namespaces.add(dirname(row.absolutePath));
|
|
252
|
+
// An identity found nowhere is absent on its root's whole
|
|
253
|
+
// namespace, so any effect beneath that root crosses it, whether
|
|
254
|
+
// or not a discovery named the scope.
|
|
255
|
+
if (present(x0) && !present(x1))
|
|
256
|
+
entries.add(rootDirectory(x0));
|
|
257
|
+
}
|
|
258
|
+
const observed = afterOf("entities")(uuid);
|
|
259
|
+
if (observed && physicalReads.has(observed.physicalKey))
|
|
260
|
+
physical.add(observed.physicalKey);
|
|
261
|
+
for (const key of repositoryPhysical.get(uuid) ?? [])
|
|
262
|
+
physical.add(key);
|
|
263
|
+
}
|
|
264
|
+
return { entries, routes, namespaces, physical: new PhysicalKeySet(physical) };
|
|
265
|
+
},
|
|
266
|
+
unsettled(closureOf, closures) {
|
|
267
|
+
const check = (address, answer) => {
|
|
268
|
+
const closure = closureOf(address);
|
|
269
|
+
return closure?.observes(address) && !answer(closure) ? address : null;
|
|
270
|
+
};
|
|
271
|
+
for (const uuid of group) {
|
|
272
|
+
const o0 = beforeOf("entities")(uuid), o1 = afterOf("entities")(uuid);
|
|
273
|
+
if (o1) {
|
|
274
|
+
const changedAt = check(o1.absolutePath, closure => closure.settled(o1.absolutePath))
|
|
275
|
+
?? ancestorDirectories(o1).map(directory => check(directory, closure => closure.routes(directory))).find(Boolean)
|
|
276
|
+
?? null;
|
|
277
|
+
if (changedAt)
|
|
278
|
+
return `${changedAt} changed after its walk`;
|
|
279
|
+
if (repository(o1)) {
|
|
280
|
+
const closure = closureOf(o1.absolutePath);
|
|
281
|
+
if (closure && !closure.settledUnder(o1.absolutePath))
|
|
282
|
+
return `${o1.absolutePath} changed beneath its repository walk`;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (namespaceOf(o0) !== namespaceOf(o1)) {
|
|
286
|
+
for (const row of [o0, o1]) {
|
|
287
|
+
const directory = row && dirname(row.absolutePath);
|
|
288
|
+
if (directory && check(directory, closure => closure.settled(directory)))
|
|
289
|
+
return `${directory} changed after its walk`;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// An identity the walk did not find is absent only if no walked
|
|
293
|
+
// entry list moved while it was read.
|
|
294
|
+
const unsettled = o0 && !o1 ? closures.map(closure => closure.unsettledDirectory).find(Boolean) : null;
|
|
295
|
+
if (unsettled)
|
|
296
|
+
return `${o0.absolutePath} was not found while walked directory ${unsettled} changed`;
|
|
297
|
+
}
|
|
298
|
+
return null;
|
|
299
|
+
},
|
|
300
|
+
unexamined(gaps) {
|
|
301
|
+
for (const address of addresses) {
|
|
302
|
+
const reason = gaps.unread(address);
|
|
303
|
+
if (reason)
|
|
304
|
+
return reason;
|
|
305
|
+
}
|
|
306
|
+
for (const uuid of group)
|
|
307
|
+
for (const { x0, x1 } of rows(uuid)) {
|
|
308
|
+
if (x0 && x1 && x0.absolutePath === x1.absolutePath && present(x0) === present(x1))
|
|
309
|
+
continue;
|
|
310
|
+
// Only an identity gone missing may have gone into ground nobody
|
|
311
|
+
// read; a new one takes nothing from it.
|
|
312
|
+
const reason = [x0, x1].map(row => row && gaps.namespace(row.rootUUID)).find(Boolean)
|
|
313
|
+
?? (present(x0) && !present(x1) ? gaps.domain : undefined);
|
|
314
|
+
if (reason)
|
|
315
|
+
return reason;
|
|
316
|
+
}
|
|
317
|
+
return null;
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
//# sourceMappingURL=admission-units.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission-units.js","sourceRoot":"","sources":["../../src/detection/admission-units.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;6EA2B6E;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAA0C,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAwC,MAAM,2BAA2B,CAAC;AAIjG,MAAM,WAAW,GAA+B,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;AA2BnF,MAAM,WAAW,GAAG,CAAC,GAA0B,EAAU,EAAE,CAAC,GAAG,KAAK,S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KAAK,OAAO,CAAC,EAAE,CAAC;4BAAE,SAAS;wBAC7F,iEAAiE;wBACjE,yCAAyC;wBACzC,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;+BAChF,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;wBAC7D,IAAI,MAAM;4BAAE,OAAO,MAAM,CAAC;oBAC5B,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GroundSnapshotReader } from "../ground-basis.js";
|
|
2
|
+
import type { WatchObservation } from "../watching/host.js";
|
|
3
|
+
export type GroundRead = <T>(operation: (reader: GroundSnapshotReader) => T) => T;
|
|
4
|
+
/** The names alias hints owe, or the hinted address that owes the domain. */
|
|
5
|
+
export type AliasDiscovery = {
|
|
6
|
+
readonly names: readonly string[];
|
|
7
|
+
} | {
|
|
8
|
+
readonly domain: string;
|
|
9
|
+
};
|
|
10
|
+
/** Reads ground only for hints that name their objects, so a cut without
|
|
11
|
+
* such hints costs none. */
|
|
12
|
+
export declare function aliasDiscovery(observations: readonly WatchObservation[], read: GroundRead): Promise<AliasDiscovery>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** Native hard-link evidence names the object a change reached through one
|
|
2
|
+
* name: FSEvents records each event's file ID, the inode of the object that
|
|
3
|
+
* name held within its own filesystem. An object's change is a change at
|
|
4
|
+
* every one of its names (alias-examination.ts), so each object a hint saw
|
|
5
|
+
* owes an examination of every name the materialized inventory knows for it,
|
|
6
|
+
* in whichever root it lies. The hinted name keeps its own obligations, a
|
|
7
|
+
* name the cut already examines owes nothing more, a name no inventory knows
|
|
8
|
+
* rang where it was added, and Git storage belongs to its repository owner.
|
|
9
|
+
* A hint that cannot bound its objects owes one domain examination: native
|
|
10
|
+
* evidence reported none, other names coalesced into it, or its objects
|
|
11
|
+
* outgrew their bound. So does one whose filesystem cannot be placed now,
|
|
12
|
+
* because its directory is gone or its address resolves elsewhere. */
|
|
13
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import { suspectScope } from "@amalgm/live";
|
|
16
|
+
import { objectNames } from "./alias-examination.js";
|
|
17
|
+
/** Reads ground only for hints that name their objects, so a cut without
|
|
18
|
+
* such hints costs none. */
|
|
19
|
+
export async function aliasDiscovery(observations, read) {
|
|
20
|
+
const hints = [];
|
|
21
|
+
for (const { directory, suspicion, domain } of observations) {
|
|
22
|
+
// A domain proof already examines every root.
|
|
23
|
+
if (domain)
|
|
24
|
+
continue;
|
|
25
|
+
if (suspicion.aliases === null)
|
|
26
|
+
return { domain: directory };
|
|
27
|
+
for (const { path, objects } of suspicion.aliases) {
|
|
28
|
+
const segments = path.split("/");
|
|
29
|
+
if (segments.includes(".git"))
|
|
30
|
+
continue;
|
|
31
|
+
if (objects === null)
|
|
32
|
+
return { domain: join(directory, ...segments) };
|
|
33
|
+
hints.push({ root: directory, parent: segments.slice(0, -1), objects });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (hints.length === 0)
|
|
37
|
+
return { names: [] };
|
|
38
|
+
const place = placement();
|
|
39
|
+
const devices = await Promise.all(hints.map(hint => place(hint.root, hint.parent)));
|
|
40
|
+
const unplaced = devices.indexOf(null);
|
|
41
|
+
if (unplaced !== -1)
|
|
42
|
+
return { domain: join(hints[unplaced].root, ...hints[unplaced].parent) };
|
|
43
|
+
return { names: read(reader => {
|
|
44
|
+
const examined = observations.map(({ directory, suspicion }) => ({
|
|
45
|
+
roots: new Set(reader.rootsAtPath("entities", directory).map(root => root.rootUUID)),
|
|
46
|
+
scope: suspectScope(suspicion.paths),
|
|
47
|
+
}));
|
|
48
|
+
const inventory = { objectRows: (key) => reader.objectRows("entities", key),
|
|
49
|
+
physical: (uuid) => reader.physical(uuid) };
|
|
50
|
+
const owed = new Set();
|
|
51
|
+
hints.forEach(({ objects }, index) => {
|
|
52
|
+
for (const object of objects)
|
|
53
|
+
for (const name of objectNames(inventory, `${devices[index]}:${object}`)) {
|
|
54
|
+
if (!examined.some(cut => cut.roots.has(name.rootUUID) && cut.scope.covers(name.relativePath))) {
|
|
55
|
+
owed.add(name.absolutePath);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return [...owed];
|
|
60
|
+
}) };
|
|
61
|
+
}
|
|
62
|
+
/** The device of the directory a hinted name was reported in, while that
|
|
63
|
+
* address still resolves to itself; null when it cannot be placed. Each
|
|
64
|
+
* address is read once, and every read runs at once. */
|
|
65
|
+
function placement() {
|
|
66
|
+
const reads = new Map();
|
|
67
|
+
const once = (key, read) => {
|
|
68
|
+
if (!reads.has(key))
|
|
69
|
+
reads.set(key, read());
|
|
70
|
+
return reads.get(key);
|
|
71
|
+
};
|
|
72
|
+
const real = (address) => once(`real:${address}`, () => realpath(address).catch(() => null));
|
|
73
|
+
return (root, parent) => once(`device:${join(root, ...parent)}`, async () => {
|
|
74
|
+
const [top, here] = await Promise.all([real(root), real(join(root, ...parent))]);
|
|
75
|
+
if (top === null || here === null || here !== join(top, ...parent))
|
|
76
|
+
return null;
|
|
77
|
+
return lstat(here, { bigint: true }).then(stats => stats.dev, () => null);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=alias-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias-discovery.js","sourceRoot":"","sources":["../../src/detection/alias-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;sEAWsE;AACtE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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACjF,IAAI,GAAG,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC;QAChF,OAAO,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** An object's change is a change at every one of its names. A hard link gives
|
|
2
|
+
* one object several names, possibly in different roots, and native evidence
|
|
3
|
+
* names only the one it was changed through. So each committed name owes an
|
|
4
|
+
* examination of every other name the materialized inventory knows for:
|
|
5
|
+
* - the object it now names, when it changed there and that object has
|
|
6
|
+
* another name: each alias not already recorded at the committed stat;
|
|
7
|
+
* - the object it left, when that object had another name: each alias, since
|
|
8
|
+
* losing a name changed that object at a stat nothing here recorded.
|
|
9
|
+
* A link count of one proves there is no other name; a name added later is
|
|
10
|
+
* heard where it was added. An alias already at the committed stat owes
|
|
11
|
+
* nothing, and an examined alias found unchanged commits no change, so the
|
|
12
|
+
* fan-out ends. Identity stays root-local: an alias is examined in its own
|
|
13
|
+
* root, and no UUID is ever paired across names. */
|
|
14
|
+
import { type GroundRow } from "../ground-row.js";
|
|
15
|
+
export interface AliasChange {
|
|
16
|
+
readonly before: GroundRow | null | undefined;
|
|
17
|
+
readonly after: GroundRow | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** The materialized inventory the changes were committed against, or into. */
|
|
20
|
+
export interface AliasInventory {
|
|
21
|
+
/** Every row naming one filesystem object, in any root. */
|
|
22
|
+
objectRows(physicalKey: string): readonly GroundRow[];
|
|
23
|
+
physical(uuid: string): GroundRow | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Every name the inventory knows for one object that can hold its bytes now:
|
|
26
|
+
* an effectively active leaf. */
|
|
27
|
+
export declare function objectNames(inventory: AliasInventory, physicalKey: string): GroundRow[];
|
|
28
|
+
/** The addresses of every alias one commit's changes owe, in change order;
|
|
29
|
+
* the commit's own names are recorded at their committed stat already. */
|
|
30
|
+
export declare function aliasExaminations(changes: readonly AliasChange[], inventory: AliasInventory): string[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** An object's change is a change at every one of its names. A hard link gives
|
|
2
|
+
* one object several names, possibly in different roots, and native evidence
|
|
3
|
+
* names only the one it was changed through. So each committed name owes an
|
|
4
|
+
* examination of every other name the materialized inventory knows for:
|
|
5
|
+
* - the object it now names, when it changed there and that object has
|
|
6
|
+
* another name: each alias not already recorded at the committed stat;
|
|
7
|
+
* - the object it left, when that object had another name: each alias, since
|
|
8
|
+
* losing a name changed that object at a stat nothing here recorded.
|
|
9
|
+
* A link count of one proves there is no other name; a name added later is
|
|
10
|
+
* heard where it was added. An alias already at the committed stat owes
|
|
11
|
+
* nothing, and an examined alias found unchanged commits no change, so the
|
|
12
|
+
* fan-out ends. Identity stays root-local: an alias is examined in its own
|
|
13
|
+
* root, and no UUID is ever paired across names. */
|
|
14
|
+
import { effectivelyActive } from "../ground-row.js";
|
|
15
|
+
import { signedLinks } from "../source-signature.js";
|
|
16
|
+
const LEAVES = new Set(["file.text", "file.binary", "link"]);
|
|
17
|
+
const leaf = (row) => row && LEAVES.has(row.type) && row.status === "active" ? row : undefined;
|
|
18
|
+
/** An unsigned object may have any number of names. */
|
|
19
|
+
const named = (row) => (signedLinks(row.sourceSignature) ?? 2n) > 1n;
|
|
20
|
+
/** Every name the inventory knows for one object that can hold its bytes now:
|
|
21
|
+
* an effectively active leaf. */
|
|
22
|
+
export function objectNames(inventory, physicalKey) {
|
|
23
|
+
return inventory.objectRows(physicalKey)
|
|
24
|
+
.filter(row => leaf(row) && effectivelyActive(row, uuid => inventory.physical(uuid)));
|
|
25
|
+
}
|
|
26
|
+
/** The addresses of every alias one commit's changes owe, in change order;
|
|
27
|
+
* the commit's own names are recorded at their committed stat already. */
|
|
28
|
+
export function aliasExaminations(changes, inventory) {
|
|
29
|
+
const committed = new Set(changes.flatMap(({ before, after }) => [before?.uuid, after?.uuid]));
|
|
30
|
+
const owed = new Map();
|
|
31
|
+
const owe = (physicalKey, current) => {
|
|
32
|
+
for (const other of objectNames(inventory, physicalKey)) {
|
|
33
|
+
if (!committed.has(other.uuid) && (current === null || other.sourceSignature !== current)) {
|
|
34
|
+
owed.set(other.uuid, other.absolutePath);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
for (const change of changes) {
|
|
39
|
+
const was = leaf(change.before), is = leaf(change.after);
|
|
40
|
+
if (was && is && was.physicalKey === is.physicalKey && was.sourceSignature === is.sourceSignature)
|
|
41
|
+
continue;
|
|
42
|
+
if (is && named(is))
|
|
43
|
+
owe(is.physicalKey, is.sourceSignature);
|
|
44
|
+
if (was && was.physicalKey !== is?.physicalKey && named(was))
|
|
45
|
+
owe(was.physicalKey, null);
|
|
46
|
+
}
|
|
47
|
+
return [...owed.values()];
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=alias-examination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias-examination.js","sourceRoot":"","sources":["../../src/detection/alias-examination.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;oDAYoD;AACpD,OAAO,EAAE,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAcrD,MAAM,MAAM,GAAmC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7F,MAAM,IAAI,GAAG,C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,CAAC;gBAC1F,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,CAAC,WAAW,KAAK,EAAE,CAAC,WAAW,IAAI,GAAG,CAAC,eAAe,KAAK,EAAE,CAAC,eAAe;YAAE,SAAS;QAC5G,IAAI,EAAE,IAAI,KAAK,CAAC,EAAE,CAAC;YAAE,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC;QAC7D,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,KAAK,EAAE,EAAE,WAAW,IAAI,KAAK,CAAC,GAAG,CAAC;YAAE,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type ApplyGuard, type EntityApplyIntent } from "@amalgm/live";
|
|
2
|
+
import type Database from "better-sqlite3";
|
|
3
|
+
import { type ApplyRecovery } from "../apply-recovery.js";
|
|
4
|
+
import { type UnavailableRoot } from "./unreadable.js";
|
|
5
|
+
/** Addresses are compared by containment; identities and owned objects by
|
|
6
|
+
* membership, looked up from each owner's side, so a scope costs nothing per
|
|
7
|
+
* member it names. A scope is held as given until its answer is sealed. */
|
|
8
|
+
export interface AttributionScope {
|
|
9
|
+
readonly entries?: readonly string[];
|
|
10
|
+
readonly subtrees?: readonly string[];
|
|
11
|
+
readonly uuids?: ReadonlySet<string>;
|
|
12
|
+
/** Objects named by ownedObject. */
|
|
13
|
+
readonly physical?: ReadonlySet<string>;
|
|
14
|
+
}
|
|
15
|
+
/** An object an Apply may own, named within the root that holds it. An owner
|
|
16
|
+
* protects its objects so that one moved outside its cones keeps its identity
|
|
17
|
+
* question for the Apply. Identity continuity is root-local, so an object
|
|
18
|
+
* that leaves its root is a new identity wherever it lands, Apply or not, and
|
|
19
|
+
* an inode number the Apply freed and the filesystem gave a file in another
|
|
20
|
+
* root names nothing this Apply owns. */
|
|
21
|
+
export declare const ownedObject: (root: string, physicalKey: string) => string;
|
|
22
|
+
export interface ApplyOwnershipBlocker {
|
|
23
|
+
readonly intent: EntityApplyIntent;
|
|
24
|
+
readonly receipt: string;
|
|
25
|
+
readonly control: string;
|
|
26
|
+
readonly cones: readonly string[];
|
|
27
|
+
readonly uuids: readonly string[];
|
|
28
|
+
/** Objects named by ownedObject within this owner's binding. */
|
|
29
|
+
readonly physical: readonly string[];
|
|
30
|
+
/** The bound directory cannot be inspected now. The durable intent and
|
|
31
|
+
* its receipt's expected location stay known; nothing proves the receipt
|
|
32
|
+
* present or usable, nor the binding gone or replaced. Once access
|
|
33
|
+
* returns, recovery reads and validates both before acting. */
|
|
34
|
+
readonly inaccessible?: UnavailableRoot;
|
|
35
|
+
/** The binding resolves to another object, or reading it faulted. This
|
|
36
|
+
* owner cannot lawfully resume here. */
|
|
37
|
+
readonly unsafe?: string;
|
|
38
|
+
}
|
|
39
|
+
export type ApplyOwnershipWait = Extract<ApplyGuard, {
|
|
40
|
+
kind: "dependency";
|
|
41
|
+
}>;
|
|
42
|
+
/** What an Apply attempt waits on while other unfinished operations own its
|
|
43
|
+
* scope. An attempt that already holds bound effects cannot simply wait: the
|
|
44
|
+
* overlap needs explicit repair. */
|
|
45
|
+
export declare function ownershipWait(owners: readonly ApplyOwnershipBlocker[], bound: boolean): ApplyOwnershipWait | null;
|
|
46
|
+
export interface ApplyOwnershipBasis {
|
|
47
|
+
assertCurrent(): void;
|
|
48
|
+
}
|
|
49
|
+
export declare class ApplyAttributionDeferred extends Error {
|
|
50
|
+
readonly owners: readonly ApplyOwnershipBlocker[];
|
|
51
|
+
readonly moving: readonly string[];
|
|
52
|
+
readonly unavailable: readonly UnavailableRoot[];
|
|
53
|
+
/** `moving` and `unavailable` name roots the same attempt found still
|
|
54
|
+
* moving or could not read: separate causes that travel with the owners
|
|
55
|
+
* and are never erased by them. */
|
|
56
|
+
constructor(owners: readonly ApplyOwnershipBlocker[], moving?: readonly string[], unavailable?: readonly UnavailableRoot[]);
|
|
57
|
+
}
|
|
58
|
+
/** Shared by Detect admission and the host's post-terminal wake. Original
|
|
59
|
+
* receipt participants remain known even if a row already moved or vanished. */
|
|
60
|
+
export declare function applyRecoveryFootprint(recovery: ApplyRecovery): Pick<ApplyOwnershipBlocker, "cones" | "uuids">;
|
|
61
|
+
export interface ApplyOwnershipReader {
|
|
62
|
+
read(): readonly ApplyOwnershipBlocker[];
|
|
63
|
+
incarnation(): string;
|
|
64
|
+
}
|
|
65
|
+
/** One host adapter reads bound, nonterminal receipts. Unbound preparation
|
|
66
|
+
* owns no effects; terminal cleanup owns no live filesystem attribution. */
|
|
67
|
+
export declare function sqliteApplyOwnership(database: Database.Database): ApplyOwnershipReader;
|
|
68
|
+
/** One ownership collection serves every scope in an observation. Admission
|
|
69
|
+
* rechecks complete intersecting answers, including the initially empty set.
|
|
70
|
+
* Unrelated owners do not invalidate this scope. Source/SQL/lease proof is
|
|
71
|
+
* still required: active-owner equality alone cannot prove an effect-free gap. */
|
|
72
|
+
export declare class ApplyOwnershipSnapshot {
|
|
73
|
+
#private;
|
|
74
|
+
constructor(reader: ApplyOwnershipReader, excluding?: EntityApplyIntent);
|
|
75
|
+
use(input: AttributionScope): readonly ApplyOwnershipBlocker[];
|
|
76
|
+
/** Owners of one object (ownedObject), collected once, including negative
|
|
77
|
+
* answers. A protected directory moved outside its old cone cannot become a
|
|
78
|
+
* new UUID in its root. */
|
|
79
|
+
physical(object: string): readonly ApplyOwnershipBlocker[];
|
|
80
|
+
seal(): ApplyOwnershipBasis;
|
|
81
|
+
}
|