@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,169 @@
|
|
|
1
|
+
import { createUserGroundEnrollmentPolicy, materializableRecords, PublicationScopeExceeded, selectPublication } from "@amalgm/live";
|
|
2
|
+
import { heldDeclarations } from "../declaration-hold.js";
|
|
3
|
+
import { groundDifferences } from "../ground-differences.js";
|
|
4
|
+
import { GROUND_ROW_PROJECTION, portableGroundRecord } from "../ground-row.js";
|
|
5
|
+
import { cachedStatement } from "../sqlite.js";
|
|
6
|
+
import { readSealedRepositoryEvidence, sealDerives } from "./seal-law.js";
|
|
7
|
+
import { heldPaths } from "./walk-law.js";
|
|
8
|
+
const CONTAINER_TYPES = new Set(["workspace", "folder", "repo.git"]);
|
|
9
|
+
/** `observed` and `shared` are one root's O and B rows, each addressed in
|
|
10
|
+
* that root's frame; `includes` answers policy and holds for an address. */
|
|
11
|
+
export function owedSelection(database, input) {
|
|
12
|
+
const { rootUUID } = input;
|
|
13
|
+
const observed = materializable(input.observed, rootUUID), shared = materializable(input.shared, rootUUID);
|
|
14
|
+
return unrooted(rootUUID, observed, shared) ?? owedOf(database, rootUUID, selectPublication({
|
|
15
|
+
before: nodes(shared.values(), rootUUID), observed: nodes(observed.values(), rootUUID), includes: input.includes,
|
|
16
|
+
}), observed, shared, shared.values());
|
|
17
|
+
}
|
|
18
|
+
/** One root's owed addresses under `policy`, outermost only, read in one
|
|
19
|
+
* committed transaction. `bindings` are the materialized workspace bindings,
|
|
20
|
+
* whose unpublished declarations selection holds back. */
|
|
21
|
+
export function owedAddresses(database, input) {
|
|
22
|
+
const { rootUUID } = input;
|
|
23
|
+
const policy = createUserGroundEnrollmentPolicy(input.policy);
|
|
24
|
+
return database.transaction(() => {
|
|
25
|
+
const held = heldDeclarations(database, input.bindings);
|
|
26
|
+
const withheld = new Set(held.size ? heldPaths(cachedStatement(database, `SELECT ${GROUND_ROW_PROJECTION}
|
|
27
|
+
FROM entities WHERE root_uuid = ? AND type = 'reference'`).all(rootUUID), held) : []);
|
|
28
|
+
const includes = path => policy(path) && !withheld.has(path);
|
|
29
|
+
let owed;
|
|
30
|
+
try {
|
|
31
|
+
owed = scopedOwed(database, rootUUID, includes);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (!(error instanceof PublicationScopeExceeded))
|
|
35
|
+
throw error;
|
|
36
|
+
const rows = (inventory) => cachedStatement(database, `SELECT ${GROUND_ROW_PROJECTION} FROM ${inventory} WHERE root_uuid = ?`).all(rootUUID);
|
|
37
|
+
owed = owedSelection(database, { rootUUID, observed: rows("entities"), shared: rows("detection_notebook"), includes });
|
|
38
|
+
}
|
|
39
|
+
return outermostAddresses(owed.map(identity => identity.path));
|
|
40
|
+
})();
|
|
41
|
+
}
|
|
42
|
+
/** Selection over the differences as targets. Its context is, in each
|
|
43
|
+
* inventory, the root, every container on the ancestry of either of a
|
|
44
|
+
* target's places and every target container, each with its complete active
|
|
45
|
+
* child group: exactly the structure a target's address reads. Every such
|
|
46
|
+
* row outside the targets is one O and B hold alike. Ancestry is climbed to
|
|
47
|
+
* the root, so containment answers each row's lifecycle as the whole root
|
|
48
|
+
* would. Throws PublicationScopeExceeded when selection would move an
|
|
49
|
+
* address beyond it. */
|
|
50
|
+
function scopedOwed(database, rootUUID, includes) {
|
|
51
|
+
const targets = new Set(groundDifferences(database, rootUUID));
|
|
52
|
+
if (targets.size === 0)
|
|
53
|
+
return [];
|
|
54
|
+
const statements = (inventory) => ({
|
|
55
|
+
byUuid: cachedStatement(database, `SELECT ${GROUND_ROW_PROJECTION} FROM ${inventory} WHERE uuid = ? AND root_uuid = ?`),
|
|
56
|
+
// A group is found by its parent; the root only filters it, so the unary
|
|
57
|
+
// plus keeps the root test off the root/path index, which would read the
|
|
58
|
+
// whole root to find one group.
|
|
59
|
+
members: cachedStatement(database, `SELECT ${GROUND_ROW_PROJECTION} FROM ${inventory}
|
|
60
|
+
WHERE parent_uuid = ? AND +root_uuid = ? AND status = 'active'`),
|
|
61
|
+
});
|
|
62
|
+
const targetRows = (inventory) => {
|
|
63
|
+
const { byUuid } = statements(inventory);
|
|
64
|
+
return [...targets].flatMap(uuid => byUuid.get(uuid, rootUUID) ?? []);
|
|
65
|
+
};
|
|
66
|
+
const differing = { entities: targetRows("entities"), detection_notebook: targetRows("detection_notebook") };
|
|
67
|
+
const places = new Set([...differing.entities, ...differing.detection_notebook]
|
|
68
|
+
.flatMap(row => row.uuid === rootUUID || row.parentUUID === null ? [] : [row.parentUUID]));
|
|
69
|
+
const read = (inventory) => {
|
|
70
|
+
const { byUuid, members } = statements(inventory);
|
|
71
|
+
const rows = new Map(), grouped = new Set(), climbed = new Set();
|
|
72
|
+
const group = (uuid) => {
|
|
73
|
+
if (grouped.has(uuid))
|
|
74
|
+
return;
|
|
75
|
+
grouped.add(uuid);
|
|
76
|
+
for (const child of members.all(uuid, rootUUID))
|
|
77
|
+
rows.set(child.uuid, child);
|
|
78
|
+
};
|
|
79
|
+
const climb = (uuid) => {
|
|
80
|
+
while (uuid !== null && !climbed.has(uuid)) {
|
|
81
|
+
climbed.add(uuid);
|
|
82
|
+
const row = byUuid.get(uuid, rootUUID);
|
|
83
|
+
// Incomplete ancestry: containment drops whatever hangs from it.
|
|
84
|
+
if (!row)
|
|
85
|
+
return;
|
|
86
|
+
rows.set(uuid, row);
|
|
87
|
+
group(uuid);
|
|
88
|
+
uuid = uuid === rootUUID ? null : row.parentUUID;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
climb(rootUUID);
|
|
92
|
+
for (const parent of places)
|
|
93
|
+
climb(parent);
|
|
94
|
+
for (const row of differing[inventory]) {
|
|
95
|
+
rows.set(row.uuid, row);
|
|
96
|
+
if (CONTAINER_TYPES.has(row.type))
|
|
97
|
+
group(row.uuid);
|
|
98
|
+
}
|
|
99
|
+
return materializable([...rows.values()], rootUUID);
|
|
100
|
+
};
|
|
101
|
+
const observed = read("entities"), shared = read("detection_notebook");
|
|
102
|
+
const rooted = unrooted(rootUUID, observed, shared);
|
|
103
|
+
if (rooted)
|
|
104
|
+
return rooted;
|
|
105
|
+
const split = (rows, target) => [...rows.values()].filter(row => targets.has(row.uuid) === target);
|
|
106
|
+
const sharedTargets = split(shared, true);
|
|
107
|
+
return owedOf(database, rootUUID, selectPublication({
|
|
108
|
+
before: nodes(sharedTargets, rootUUID), observed: nodes(split(observed, true), rootUUID), includes,
|
|
109
|
+
context: { before: nodes(split(shared, false), rootUUID), observed: nodes(split(observed, false), rootUUID) },
|
|
110
|
+
}), observed, shared, sharedTargets);
|
|
111
|
+
}
|
|
112
|
+
/** The rows containment keeps active beneath the root, by UUID. */
|
|
113
|
+
function materializable(rows, rootUUID) {
|
|
114
|
+
const byUuid = new Map(rows.map(row => [row.uuid, row]));
|
|
115
|
+
return new Map(materializableRecords(rows.map(portableGroundRecord), rootUUID)
|
|
116
|
+
.map(record => [record.uuid, byUuid.get(record.uuid)]));
|
|
117
|
+
}
|
|
118
|
+
/** A root either inventory lacks is owed whole. */
|
|
119
|
+
function unrooted(rootUUID, observed, shared) {
|
|
120
|
+
if (observed.has(rootUUID) && shared.has(rootUUID))
|
|
121
|
+
return null;
|
|
122
|
+
const root = observed.get(rootUUID) ?? shared.get(rootUUID);
|
|
123
|
+
return root ? [{ path: "", row: root, reason: "unshared" }] : [];
|
|
124
|
+
}
|
|
125
|
+
/** A materialization boundary's portable parent lies outside its root. */
|
|
126
|
+
const nodes = (rows, rootUUID) => [...rows].map(row => ({
|
|
127
|
+
uuid: row.uuid, type: row.type, parentUUID: row.uuid === rootUUID ? null : row.parentUUID,
|
|
128
|
+
name: row.name, relativePath: row.relativePath,
|
|
129
|
+
}));
|
|
130
|
+
/** What `selection` owes, given the active rows it read from each inventory
|
|
131
|
+
* and the B rows whose results it decided. */
|
|
132
|
+
function owedOf(database, rootUUID, selection, observed, shared, decided) {
|
|
133
|
+
const placed = (o, b) => b.type === o.type && b.name === o.name
|
|
134
|
+
&& (o.uuid === rootUUID || b.parentUUID === o.parentUUID);
|
|
135
|
+
const stands = (o, b) => o.type === "workspace" || o.type === "folder" || o.version === b.version
|
|
136
|
+
|| (o.type === "repo.git" && sealDerives(readSealedRepositoryEvidence(database, o.uuid), o, b));
|
|
137
|
+
const owed = [];
|
|
138
|
+
for (const { uuid } of selection.selected) {
|
|
139
|
+
if (selection.sources.get(uuid) !== "observed")
|
|
140
|
+
continue;
|
|
141
|
+
const o = observed.get(uuid), b = shared.get(uuid);
|
|
142
|
+
if (b && placed(o, b)) {
|
|
143
|
+
if (!stands(o, b))
|
|
144
|
+
owed.push({ path: o.relativePath, row: o, reason: "owed" });
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
owed.push({ path: o.relativePath, row: o, reason: "unshared" });
|
|
148
|
+
if (b && b.relativePath !== o.relativePath)
|
|
149
|
+
owed.push({ path: b.relativePath, row: b, reason: "unshared" });
|
|
150
|
+
}
|
|
151
|
+
const kept = new Set(selection.selected.map(row => row.uuid));
|
|
152
|
+
for (const b of decided)
|
|
153
|
+
if (!kept.has(b.uuid))
|
|
154
|
+
owed.push({ path: b.relativePath, row: b, reason: "unshared" });
|
|
155
|
+
return owed;
|
|
156
|
+
}
|
|
157
|
+
/** The outermost of some root-relative addresses: beneath one, its proof
|
|
158
|
+
* covers the rest. */
|
|
159
|
+
function outermostAddresses(paths) {
|
|
160
|
+
const sorted = [...new Set(paths)].sort();
|
|
161
|
+
const outermost = [];
|
|
162
|
+
for (const path of sorted) {
|
|
163
|
+
const last = outermost.at(-1);
|
|
164
|
+
if (last === undefined || !(last === "" || path === last || path.startsWith(`${last}/`)))
|
|
165
|
+
outermost.push(path);
|
|
166
|
+
}
|
|
167
|
+
return outermost;
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=owed-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owed-selection.js","sourceRoot":"","sources":["../../src/detection/owed-selection.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,gCAAgC,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,iBAAiB,EAC1D,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAkB,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAe1C,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAE1F;4EAC4E;AAC5E,MAAM,UAAU,aAAa,CAAC,QAA2B,EAAE,KAK1D;IACC,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3G,OAAO,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC;QAC1F,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE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AAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAChH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;sBACsB;AACtB,SAAS,kBAAkB,CAAC,KAAuB;IACjD,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;YAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The one host seam between Node filesystem evidence and Live's portable
|
|
3
3
|
* Detect laws. This file owns no watcher, scanner, database, or transport.
|
|
4
|
-
* It
|
|
5
|
-
* plan the exact Watch generation that Record may accept.
|
|
4
|
+
* It binds cached replay evidence and asks Live to plan the exact Watch generation that Record may accept.
|
|
6
5
|
*/
|
|
7
|
-
import { type CloudEntityRecord, type DetectionBatchPlan, type
|
|
6
|
+
import { type CloudEntityRecord, type DetectionBatchPlan, type LinkReplay, type ReplayInstruction, type Steps, type SuspicionSnapshot, type TextReplay } from "@amalgm/live";
|
|
7
|
+
/** A replay whose instruction carries sealed cache bytes themselves. The
|
|
8
|
+
* base is the payload head of the record it replaces, or null when the
|
|
9
|
+
* result replays whole. */
|
|
10
|
+
export interface CachedReplayRequest {
|
|
11
|
+
readonly entityId: string;
|
|
12
|
+
readonly type: "file.text" | "link";
|
|
13
|
+
readonly basePayloadVersion: string | null;
|
|
14
|
+
readonly resultPayloadVersion: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The replay of one sealed text or link result, read from the machine
|
|
18
|
+
* content cache and verified against its head. Only a content thread runs
|
|
19
|
+
* this: a cache read can wait behind the cache directory's flush, and the
|
|
20
|
+
* hashes and the diff grow with the file. A text base counts only when it
|
|
21
|
+
* names content, as Live's proposal law reads it; a base the cache no longer
|
|
22
|
+
* holds selects the verified snapshot. A delta's inserted bytes own their
|
|
23
|
+
* buffer, so the answer carries exactly them and never the whole file.
|
|
24
|
+
*/
|
|
25
|
+
export declare function cachedReplay(cacheDir: string, request: CachedReplayRequest): Promise<TextReplay | LinkReplay>;
|
|
8
26
|
/**
|
|
9
27
|
* Choose an exact text replay from cache evidence. The notebook's base head
|
|
10
28
|
* is logical history; cached base bytes are only an optional delta input.
|
|
@@ -19,48 +37,30 @@ export declare function exactTextReplay(input: {
|
|
|
19
37
|
readonly resultBytes: Uint8Array;
|
|
20
38
|
readonly sha256Hex: (bytes: Uint8Array | string) => string;
|
|
21
39
|
}): TextReplay;
|
|
22
|
-
export interface IdentityRow {
|
|
23
|
-
readonly uuid: string;
|
|
24
|
-
readonly type: EntityType;
|
|
25
|
-
readonly relativePath: string;
|
|
26
|
-
readonly deviceNumber: number;
|
|
27
|
-
readonly inode: number;
|
|
28
|
-
/** False when the notebook retained missing evidence from an earlier batch.
|
|
29
|
-
* Such a row may still claim its exact address, but inode reuse cannot prove
|
|
30
|
-
* a new move from ground that was already absent before this observation. */
|
|
31
|
-
readonly physicalContinuity?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface IdentityEntry {
|
|
34
|
-
/** Stable only for this observation; never leaves the host. */
|
|
35
|
-
readonly key: string;
|
|
36
|
-
readonly type: EntityType;
|
|
37
|
-
readonly relativePath: string;
|
|
38
|
-
readonly deviceNumber: number;
|
|
39
|
-
readonly inode: number;
|
|
40
|
-
/** A deliberate Register/Add boundary already owns this UUID. */
|
|
41
|
-
readonly fixedUUID?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Resolve one observation against the last notebook. Directories claim by
|
|
45
|
-
* unique physical continuity first; files and links claim their address
|
|
46
|
-
* first, then unique physical continuity rescues a move. Equal bytes are not
|
|
47
|
-
* an input and therefore can never create identity.
|
|
48
|
-
*/
|
|
49
|
-
export declare function reconcileGroundUUIDs(rows: readonly IdentityRow[], entries: readonly IdentityEntry[]): ReadonlyMap<string, string>;
|
|
50
40
|
export interface DetectedGroundRow {
|
|
51
41
|
readonly record: CloudEntityRecord;
|
|
52
42
|
readonly relativePath: string;
|
|
53
43
|
readonly replay?: ReplayInstruction;
|
|
44
|
+
readonly lifecycleAuthorization?: "trash";
|
|
54
45
|
}
|
|
55
46
|
/**
|
|
56
47
|
* Turn one real Watch observation and its settled before/after graph into the
|
|
57
48
|
* portable Detect plan. Ordinary descendants owned by a repository do not
|
|
58
49
|
* publish independent records; the nearest repository's Card + Checkpoint
|
|
59
|
-
* proposal owns them.
|
|
50
|
+
* proposal owns them. Which records travel is a property of each complete
|
|
51
|
+
* graph (`travelingRecordUUIDs`), read once by the caller: a record left out
|
|
52
|
+
* of this plan still holds its place in the graph its neighbours stand on.
|
|
60
53
|
*/
|
|
61
|
-
export declare function
|
|
54
|
+
export declare function planGroundDetectionSteps(input: {
|
|
62
55
|
readonly rootId: string;
|
|
63
56
|
readonly suspicion: SuspicionSnapshot;
|
|
64
57
|
readonly before: readonly CloudEntityRecord[];
|
|
65
58
|
readonly after: readonly DetectedGroundRow[];
|
|
66
|
-
|
|
59
|
+
/** Publication membership of the complete before and after graphs: the
|
|
60
|
+
* repository law itself, nested repository spines included. Enclosure
|
|
61
|
+
* alone is insufficient because a spine is enclosed but still travels. */
|
|
62
|
+
readonly traveling: {
|
|
63
|
+
readonly before: ReadonlySet<string>;
|
|
64
|
+
readonly after: ReadonlySet<string>;
|
|
65
|
+
};
|
|
66
|
+
}): Steps<DetectionBatchPlan>;
|
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The one host seam between Node filesystem evidence and Live's portable
|
|
3
3
|
* Detect laws. This file owns no watcher, scanner, database, or transport.
|
|
4
|
-
* It
|
|
5
|
-
* plan the exact Watch generation that Record may accept.
|
|
4
|
+
* It binds cached replay evidence and asks Live to plan the exact Watch generation that Record may accept.
|
|
6
5
|
*/
|
|
7
|
-
import {
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { captureTextChange, detectionBatch, eachStep, planDetectionBatchSteps, } from "@amalgm/live";
|
|
9
|
+
import { contentFile } from "../content-cache-host.js";
|
|
10
|
+
const sha256Hex = (input) => createHash("sha256").update(input).digest("hex");
|
|
11
|
+
/** Cache names are content hashes; nothing else names a cache file. */
|
|
12
|
+
const CONTENT_HASH = /^[0-9a-f]{64}$/;
|
|
13
|
+
/**
|
|
14
|
+
* The replay of one sealed text or link result, read from the machine
|
|
15
|
+
* content cache and verified against its head. Only a content thread runs
|
|
16
|
+
* this: a cache read can wait behind the cache directory's flush, and the
|
|
17
|
+
* hashes and the diff grow with the file. A text base counts only when it
|
|
18
|
+
* names content, as Live's proposal law reads it; a base the cache no longer
|
|
19
|
+
* holds selects the verified snapshot. A delta's inserted bytes own their
|
|
20
|
+
* buffer, so the answer carries exactly them and never the whole file.
|
|
21
|
+
*/
|
|
22
|
+
export async function cachedReplay(cacheDir, request) {
|
|
23
|
+
const { entityId, type, resultPayloadVersion } = request;
|
|
24
|
+
if (!CONTENT_HASH.test(resultPayloadVersion))
|
|
25
|
+
throw new Error(`${type} result ${entityId} names no cache entry`);
|
|
26
|
+
const resultBytes = await readFile(contentFile(cacheDir, resultPayloadVersion));
|
|
27
|
+
if (type === "link") {
|
|
28
|
+
if (sha256Hex(resultBytes) !== resultPayloadVersion) {
|
|
29
|
+
throw new Error("link result cache does not match its declared content head");
|
|
30
|
+
}
|
|
31
|
+
return { kind: "link", resultPayloadVersion, target: resultBytes.toString("utf8") };
|
|
32
|
+
}
|
|
33
|
+
const basePayloadVersion = request.basePayloadVersion !== null && CONTENT_HASH.test(request.basePayloadVersion)
|
|
34
|
+
? request.basePayloadVersion : null;
|
|
35
|
+
const baseBytes = basePayloadVersion === null ? null
|
|
36
|
+
: await readFile(contentFile(cacheDir, basePayloadVersion)).catch((error) => {
|
|
37
|
+
if (error.code === "ENOENT")
|
|
38
|
+
return null;
|
|
39
|
+
throw error;
|
|
40
|
+
});
|
|
41
|
+
const replay = exactTextReplay({ entityId, basePayloadVersion, baseBytes, resultPayloadVersion, resultBytes, sha256Hex });
|
|
42
|
+
return replay.delta ? { ...replay, delta: { ...replay.delta, insert: new Uint8Array(replay.delta.insert) } } : replay;
|
|
43
|
+
}
|
|
8
44
|
/**
|
|
9
45
|
* Choose an exact text replay from cache evidence. The notebook's base head
|
|
10
46
|
* is logical history; cached base bytes are only an optional delta input.
|
|
@@ -33,123 +69,61 @@ export function exactTextReplay(input) {
|
|
|
33
69
|
delta: null,
|
|
34
70
|
};
|
|
35
71
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Resolve one observation against the last notebook. Directories claim by
|
|
38
|
-
* unique physical continuity first; files and links claim their address
|
|
39
|
-
* first, then unique physical continuity rescues a move. Equal bytes are not
|
|
40
|
-
* an input and therefore can never create identity.
|
|
41
|
-
*/
|
|
42
|
-
export function reconcileGroundUUIDs(rows, entries) {
|
|
43
|
-
const resolved = new Map();
|
|
44
|
-
const claimed = new Set();
|
|
45
|
-
const claim = (entry, uuid) => {
|
|
46
|
-
if (resolved.has(entry.key))
|
|
47
|
-
throw new Error(`detection entry ${entry.key} claimed twice`);
|
|
48
|
-
if (claimed.has(uuid))
|
|
49
|
-
throw new Error(`detection UUID ${uuid} claimed twice`);
|
|
50
|
-
resolved.set(entry.key, uuid);
|
|
51
|
-
claimed.add(uuid);
|
|
52
|
-
};
|
|
53
|
-
for (const entry of entries) {
|
|
54
|
-
if (entry.fixedUUID)
|
|
55
|
-
claim(entry, entry.fixedUUID);
|
|
56
|
-
}
|
|
57
|
-
const availableRows = () => rows.filter((row) => !claimed.has(row.uuid));
|
|
58
|
-
const availableEntries = () => entries.filter((entry) => !resolved.has(entry.key));
|
|
59
|
-
const directoryRows = availableRows().filter((row) => CONTAINERS.has(row.type) && row.physicalContinuity !== false);
|
|
60
|
-
const directoryEntries = availableEntries().filter((entry) => CONTAINERS.has(entry.type));
|
|
61
|
-
const directoryEntryByPath = new Map(directoryEntries.map((entry) => [entry.relativePath, entry]));
|
|
62
|
-
const directories = diffDirState(directoryRows.map((row) => ({
|
|
63
|
-
dirId: row.uuid,
|
|
64
|
-
relPath: row.relativePath,
|
|
65
|
-
device: row.deviceNumber,
|
|
66
|
-
inode: row.inode,
|
|
67
|
-
})), directoryEntries.map((entry) => ({
|
|
68
|
-
entry,
|
|
69
|
-
relPath: entry.relativePath,
|
|
70
|
-
device: entry.deviceNumber,
|
|
71
|
-
inode: entry.inode,
|
|
72
|
-
})));
|
|
73
|
-
for (const match of [...directories.renames, ...directories.retags]) {
|
|
74
|
-
const entry = directoryEntryByPath.get(match.entry.relPath);
|
|
75
|
-
if (!entry)
|
|
76
|
-
throw new Error(`detection directory ${match.entry.relPath} disappeared from its observation`);
|
|
77
|
-
claim(entry, match.row.dirId);
|
|
78
|
-
}
|
|
79
|
-
const rowsByPath = new Map(availableRows().map((row) => [row.relativePath, row]));
|
|
80
|
-
for (const entry of availableEntries().filter((candidate) => !CONTAINERS.has(candidate.type))) {
|
|
81
|
-
const row = rowsByPath.get(entry.relativePath);
|
|
82
|
-
if (row)
|
|
83
|
-
claim(entry, row.uuid);
|
|
84
|
-
}
|
|
85
|
-
const physicalRows = availableRows().filter((row) => !CONTAINERS.has(row.type) && row.physicalContinuity !== false);
|
|
86
|
-
const physicalEntries = availableEntries().filter((entry) => !CONTAINERS.has(entry.type));
|
|
87
|
-
for (const match of matchByInode(physicalRows.map((row) => ({
|
|
88
|
-
row,
|
|
89
|
-
device: row.deviceNumber,
|
|
90
|
-
inode: row.inode,
|
|
91
|
-
})), physicalEntries.map((entry) => ({
|
|
92
|
-
entry,
|
|
93
|
-
device: entry.deviceNumber,
|
|
94
|
-
inode: entry.inode,
|
|
95
|
-
})))) {
|
|
96
|
-
claim(match.entry.entry, match.row.row.uuid);
|
|
97
|
-
}
|
|
98
|
-
return resolved;
|
|
99
|
-
}
|
|
100
72
|
/**
|
|
101
73
|
* Turn one real Watch observation and its settled before/after graph into the
|
|
102
74
|
* portable Detect plan. Ordinary descendants owned by a repository do not
|
|
103
75
|
* publish independent records; the nearest repository's Card + Checkpoint
|
|
104
|
-
* proposal owns them.
|
|
76
|
+
* proposal owns them. Which records travel is a property of each complete
|
|
77
|
+
* graph (`travelingRecordUUIDs`), read once by the caller: a record left out
|
|
78
|
+
* of this plan still holds its place in the graph its neighbours stand on.
|
|
105
79
|
*/
|
|
106
|
-
export function
|
|
80
|
+
export function* planGroundDetectionSteps(input) {
|
|
107
81
|
const batch = detectionBatch(input.rootId, input.suspicion);
|
|
108
|
-
const beforeByUuid = new Map(
|
|
109
|
-
|
|
110
|
-
const afterByUuid = new Map(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
// enclosed but deliberately still travels.
|
|
114
|
-
const beforeTraveling = travelingRecordUUIDs(input.before);
|
|
115
|
-
const afterTraveling = travelingRecordUUIDs(afterRecords);
|
|
82
|
+
const beforeByUuid = new Map();
|
|
83
|
+
yield* eachStep(input.before, record => beforeByUuid.set(record.uuid, record));
|
|
84
|
+
const afterByUuid = new Map();
|
|
85
|
+
yield* eachStep(input.after, row => afterByUuid.set(row.record.uuid, row));
|
|
86
|
+
const { before: beforeTraveling, after: afterTraveling } = input.traveling;
|
|
116
87
|
const transitions = [];
|
|
117
88
|
const visibilityBarriers = [];
|
|
118
|
-
|
|
89
|
+
const transitionOf = (uuid) => {
|
|
119
90
|
const base = beforeByUuid.get(uuid) ?? null;
|
|
120
91
|
const current = afterByUuid.get(uuid) ?? null;
|
|
121
92
|
if ((current === null && !beforeTraveling.has(uuid))
|
|
122
93
|
|| (current !== null && !afterTraveling.has(uuid)))
|
|
123
|
-
|
|
94
|
+
return;
|
|
124
95
|
if (current === null) {
|
|
125
96
|
transitions.push({ truth: "absent", base });
|
|
126
|
-
|
|
97
|
+
return;
|
|
127
98
|
}
|
|
128
|
-
|
|
129
|
-
|
|
99
|
+
// Leaving a parcel republishes active results only; an inactive result
|
|
100
|
+
// travels solely through a real lifecycle change.
|
|
101
|
+
const becameTraveling = !beforeTraveling.has(uuid) && afterTraveling.has(uuid)
|
|
102
|
+
&& current.record.status === "active";
|
|
103
|
+
const present = {
|
|
130
104
|
truth: "present",
|
|
131
105
|
relPath: current.relativePath,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
base: becameTraveling ? null : base,
|
|
106
|
+
base,
|
|
107
|
+
requirePublication: becameTraveling,
|
|
135
108
|
result: current.record,
|
|
136
109
|
replay: current.replay ?? { kind: "structure" },
|
|
110
|
+
...(current.lifecycleAuthorization ? { lifecycleAuthorization: current.lifecycleAuthorization } : {}),
|
|
137
111
|
};
|
|
138
112
|
if (base !== null
|
|
139
113
|
&& base.type !== current.record.type
|
|
140
114
|
&& (current.record.type === "workspace" || current.record.type === "folder")) {
|
|
141
|
-
visibilityBarriers.push(
|
|
115
|
+
visibilityBarriers.push(present);
|
|
142
116
|
}
|
|
143
117
|
else {
|
|
144
|
-
transitions.push(
|
|
118
|
+
transitions.push(present);
|
|
145
119
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
transitions.push(
|
|
120
|
+
};
|
|
121
|
+
yield* eachStep(beforeByUuid.keys(), transitionOf);
|
|
122
|
+
yield* eachStep(afterByUuid.keys(), uuid => { if (!beforeByUuid.has(uuid))
|
|
123
|
+
transitionOf(uuid); });
|
|
124
|
+
yield* eachStep(visibilityBarriers, barrier => transitions.push(barrier));
|
|
151
125
|
try {
|
|
152
|
-
return
|
|
126
|
+
return yield* planDetectionBatchSteps(batch, transitions);
|
|
153
127
|
}
|
|
154
128
|
catch (error) {
|
|
155
129
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable.js","sourceRoot":"","sources":["../../src/detection/portable.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"portable.js","sourceRoot":"","sources":["../../src/detection/portable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,uBAAuB,GAUxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,SAAS,GAAG,CAAC,KAA0B,EAAU,EAAE,CACvD,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEnD,uEAAuE;AACvE,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAYtC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,OAA4B;IAC/E,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IACzD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,WA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B,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS;YAC3F,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,EAAE;YACrG,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,IAAI,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,mBAAmB,KAAK,CAAC,MAAM,YAAY,UAAU,GAAG,SAAS,MAAM,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Reconciliation consumes physical coverage owners, while Watch tracks every
|
|
2
|
+
* logical root independently. A settled outer notice cannot consume a later
|
|
3
|
+
* nested responsibility without a new observation of their shared owner. */
|
|
4
|
+
export declare function missingReconciliationOwners(directories: ReadonlySet<string>, coverage: readonly {
|
|
5
|
+
readonly directory: string;
|
|
6
|
+
readonly contentOwner: string | null;
|
|
7
|
+
}[]): readonly string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Reconciliation consumes physical coverage owners, while Watch tracks every
|
|
2
|
+
* logical root independently. A settled outer notice cannot consume a later
|
|
3
|
+
* nested responsibility without a new observation of their shared owner. */
|
|
4
|
+
export function missingReconciliationOwners(directories, coverage) {
|
|
5
|
+
const byDirectory = new Map(coverage.map(root => [root.directory, root.contentOwner]));
|
|
6
|
+
const missing = new Set();
|
|
7
|
+
for (const directory of directories) {
|
|
8
|
+
const owner = byDirectory.get(directory);
|
|
9
|
+
if (!owner)
|
|
10
|
+
throw new Error(`reconciliation has no physical coverage owner: ${directory}`);
|
|
11
|
+
if (!directories.has(owner))
|
|
12
|
+
missing.add(owner);
|
|
13
|
+
}
|
|
14
|
+
return [...missing];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=reconciliation-coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciliation-coverage.js","sourceRoot":"","sources":["../../src/detection/reconciliation-coverage.ts"],"names":[],"mappings":"AAAA;;4EAE4E;AAC5E,MAAM,UAAU,2BAA2B,CACzC,WAAgC,EAChC,QAAyF;IAEzF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACvF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,SAAS,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RepoIdentityEntry, type RepoIdentityMap, type ReplayInstruction } from "@amalgm/live";
|
|
2
|
+
import { type LiteralLane } from "../content-capture-pool.js";
|
|
3
|
+
import { type ObservedRepository } from "../git-repository-host.js";
|
|
4
|
+
import type { SourceProof } from "../source-proof.js";
|
|
5
|
+
import type { GroundRow } from "../ground-row.js";
|
|
6
|
+
export declare function publishRepository(input: {
|
|
7
|
+
readonly cacheDir: string;
|
|
8
|
+
readonly repository: GroundRow;
|
|
9
|
+
readonly before: GroundRow | null;
|
|
10
|
+
readonly observed: ObservedRepository;
|
|
11
|
+
/** The observation's own literal map, which an observed publication reuses. */
|
|
12
|
+
readonly observedIdentity: RepoIdentityMap;
|
|
13
|
+
readonly identity: readonly RepoIdentityEntry[];
|
|
14
|
+
readonly retained: ReadonlySet<string>;
|
|
15
|
+
readonly lane: LiteralLane;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
readonly row: GroundRow;
|
|
18
|
+
readonly replay: ReplayInstruction;
|
|
19
|
+
readonly proof: SourceProof;
|
|
20
|
+
}>;
|