@openrig/cli 0.7.16 → 0.7.18
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/README.md +9 -9
- package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -41
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +5 -0
- package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +23 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +11 -0
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +25 -5
- package/daemon/assets/skills/rigs/SKILL.md +95 -42
- package/daemon/assets/skills/rigs/references/installing-for-someone.md +47 -0
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +123 -35
- package/daemon/context-packs/reference/getting-started.md +8 -8
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +166 -0
- package/daemon/context-packs/reference/whats-new.md +294 -6
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/SKILL.md +11 -0
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +25 -5
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +52 -8
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -1
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +17 -7
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +22 -10
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/openshell-driver.d.ts +1 -0
- package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-driver.js +3 -0
- package/daemon/dist/adapters/openshell-driver.js.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.d.ts +9 -7
- package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
- package/daemon/dist/adapters/openshell-podman-observer.js +20 -3
- package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +43 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +88 -5
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +707 -43
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/tmux-credential-env.d.ts +4 -0
- package/daemon/dist/adapters/tmux-credential-env.d.ts.map +1 -0
- package/daemon/dist/adapters/tmux-credential-env.js +14 -0
- package/daemon/dist/adapters/tmux-credential-env.js.map +1 -0
- package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-exec.js +4 -3
- package/daemon/dist/adapters/tmux-exec.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +2 -2
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +12 -4
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +223 -12
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +836 -30
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +4 -1
- package/daemon/dist/attention-surface.d.ts.map +1 -1
- package/daemon/dist/attention-surface.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +12 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts +6 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts.map +1 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js +10 -0
- package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts +3 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts.map +1 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js +21 -0
- package/daemon/dist/db/migrations/170_rig_delivery_drains.js.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts +4 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js +9 -0
- package/daemon/dist/db/migrations/171_claude_auto_mode.js.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts +4 -0
- package/daemon/dist/db/migrations/171_node_input_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_node_input_route.js +6 -0
- package/daemon/dist/db/migrations/171_node_input_route.js.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts +3 -0
- package/daemon/dist/db/migrations/172_queue_return_route.d.ts.map +1 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js +13 -0
- package/daemon/dist/db/migrations/172_queue_return_route.js.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts +4 -0
- package/daemon/dist/db/migrations/173_node_process_limits.d.ts.map +1 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js +6 -0
- package/daemon/dist/db/migrations/173_node_process_limits.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +2 -0
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +36 -1
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +192 -3
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts +10 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.d.ts.map +1 -1
- package/daemon/dist/domain/agent-images/resume-token-discovery.js +21 -0
- package/daemon/dist/domain/agent-images/resume-token-discovery.js.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.d.ts +5 -0
- package/daemon/dist/domain/applied-launch-observation-store.d.ts.map +1 -1
- package/daemon/dist/domain/applied-launch-observation-store.js +57 -21
- package/daemon/dist/domain/applied-launch-observation-store.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts +26 -12
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +73 -34
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/claude-auto-mode.d.ts +64 -0
- package/daemon/dist/domain/claude-auto-mode.d.ts.map +1 -0
- package/daemon/dist/domain/claude-auto-mode.js +114 -0
- package/daemon/dist/domain/claude-auto-mode.js.map +1 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +2 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +11 -4
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts +5 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.js +51 -2
- package/daemon/dist/domain/claude-continuation-launch.js.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.d.ts +7 -3
- package/daemon/dist/domain/claude-core-plugin-env.d.ts.map +1 -1
- package/daemon/dist/domain/claude-core-plugin-env.js +11 -8
- package/daemon/dist/domain/claude-core-plugin-env.js.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.d.ts.map +1 -1
- package/daemon/dist/domain/codex-daemon-support.js +6 -1
- package/daemon/dist/domain/codex-daemon-support.js.map +1 -1
- package/daemon/dist/domain/codex-thread-id.d.ts +13 -0
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +132 -9
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.d.ts +2 -0
- package/daemon/dist/domain/community-harness-launch-result.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-launch-result.js +5 -1
- package/daemon/dist/domain/community-harness-launch-result.js.map +1 -1
- package/daemon/dist/domain/connection-contract.d.ts +91 -0
- package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
- package/daemon/dist/domain/connection-contract.js +75 -1
- package/daemon/dist/domain/connection-contract.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts +16 -2
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +70 -15
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/current-work.d.ts +11 -1
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +107 -12
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/cwd-resolution.d.ts +2 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +7 -2
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js +5 -1
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.d.ts +15 -0
- package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
- package/daemon/dist/domain/environment-lifecycle.js +22 -4
- package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
- package/daemon/dist/domain/errors.d.ts +4 -0
- package/daemon/dist/domain/errors.d.ts.map +1 -1
- package/daemon/dist/domain/errors.js +7 -0
- package/daemon/dist/domain/errors.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +8 -1
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.d.ts +2 -0
- package/daemon/dist/domain/existing-rig-restore.d.ts.map +1 -1
- package/daemon/dist/domain/existing-rig-restore.js +1 -0
- package/daemon/dist/domain/existing-rig-restore.js.map +1 -1
- package/daemon/dist/domain/expected-conversation.d.ts.map +1 -1
- package/daemon/dist/domain/expected-conversation.js +26 -11
- package/daemon/dist/domain/expected-conversation.js.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.d.ts +4 -0
- package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/destination-resolver.js +10 -3
- package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +3 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/operator-delivery-engine.js +120 -6
- package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts +9 -1
- package/daemon/dist/domain/gateway/slack/capabilities.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js +6 -1
- package/daemon/dist/domain/gateway/slack/capabilities.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js +1 -1
- package/daemon/dist/domain/gateway/slack/inbound-admission.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/inbound.js +15 -1
- package/daemon/dist/domain/gateway/slack/inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts +5 -1
- package/daemon/dist/domain/gateway/slack/manifest.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/manifest.js +12 -3
- package/daemon/dist/domain/gateway/slack/manifest.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +4 -1
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/queue-access.js +1 -0
- package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +6 -5
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.js +7 -2
- package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
- package/daemon/dist/domain/harness-not-started-notice.d.ts +36 -0
- package/daemon/dist/domain/harness-not-started-notice.d.ts.map +1 -0
- package/daemon/dist/domain/harness-not-started-notice.js +81 -0
- package/daemon/dist/domain/harness-not-started-notice.js.map +1 -0
- package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +4 -0
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/hot-potato-enforcer.d.ts +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js +1 -1
- package/daemon/dist/domain/input-read-diagnostic.js.map +1 -1
- package/daemon/dist/domain/instance-initialization.d.ts +2 -0
- package/daemon/dist/domain/instance-initialization.d.ts.map +1 -1
- package/daemon/dist/domain/instance-initialization.js +2 -1
- package/daemon/dist/domain/instance-initialization.js.map +1 -1
- package/daemon/dist/domain/member-connection.d.ts +14 -0
- package/daemon/dist/domain/member-connection.d.ts.map +1 -0
- package/daemon/dist/domain/member-connection.js +34 -0
- package/daemon/dist/domain/member-connection.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts +3 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-model-reader.js +32 -7
- package/daemon/dist/domain/model-divergence/current-model-reader.js.map +1 -1
- package/daemon/dist/domain/native-model-picker.d.ts +2 -0
- package/daemon/dist/domain/native-model-picker.d.ts.map +1 -1
- package/daemon/dist/domain/native-model-picker.js +8 -2
- package/daemon/dist/domain/native-model-picker.js.map +1 -1
- package/daemon/dist/domain/native-permission-store.d.ts +6 -2
- package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
- package/daemon/dist/domain/native-permission-store.js +12 -5
- package/daemon/dist/domain/native-permission-store.js.map +1 -1
- package/daemon/dist/domain/native-resume-probe.d.ts +5 -0
- package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
- package/daemon/dist/domain/native-resume-probe.js +172 -21
- package/daemon/dist/domain/native-resume-probe.js.map +1 -1
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-connector.js +16 -5
- package/daemon/dist/domain/network/network-connector.js.map +1 -1
- package/daemon/dist/domain/network/network-installations.d.ts +5 -4
- package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
- package/daemon/dist/domain/network/network-installations.js +42 -11
- package/daemon/dist/domain/network/network-installations.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +28 -0
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +11 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +23 -7
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts +4 -1
- package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
- package/daemon/dist/domain/occupant-invalidator.js +10 -2
- package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts +1 -1
- package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
- package/daemon/dist/domain/operation-correlation.js +1 -1
- package/daemon/dist/domain/operation-correlation.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +50 -0
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +255 -1
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/parked-query.d.ts.map +1 -1
- package/daemon/dist/domain/parked-query.js +3 -1
- package/daemon/dist/domain/parked-query.js.map +1 -1
- package/daemon/dist/domain/permission-account.d.ts +28 -1
- package/daemon/dist/domain/permission-account.d.ts.map +1 -1
- package/daemon/dist/domain/permission-account.js +55 -11
- package/daemon/dist/domain/permission-account.js.map +1 -1
- package/daemon/dist/domain/permission-drift.d.ts +2 -0
- package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
- package/daemon/dist/domain/permission-drift.js.map +1 -1
- package/daemon/dist/domain/pi-compaction-request-store.d.ts +16 -0
- package/daemon/dist/domain/pi-compaction-request-store.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-request-store.js +40 -0
- package/daemon/dist/domain/pi-compaction-request-store.js.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts +82 -0
- package/daemon/dist/domain/pi-compaction-service.d.ts.map +1 -0
- package/daemon/dist/domain/pi-compaction-service.js +229 -0
- package/daemon/dist/domain/pi-compaction-service.js.map +1 -0
- package/daemon/dist/domain/process-limits.d.ts +37 -0
- package/daemon/dist/domain/process-limits.d.ts.map +1 -0
- package/daemon/dist/domain/process-limits.js +69 -0
- package/daemon/dist/domain/process-limits.js.map +1 -0
- package/daemon/dist/domain/process-table.d.ts +9 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +21 -4
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +7 -0
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +27 -1
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/ps-projection.d.ts +2 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +6 -1
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts +18 -7
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +270 -41
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +81 -16
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +325 -76
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +3 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +90 -30
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -3
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +9 -6
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +245 -41
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +2 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +31 -4
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/restore-check-service.d.ts +23 -0
- package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
- package/daemon/dist/domain/restore-check-service.js +198 -12
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +64 -3
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +335 -82
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +28 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +17 -5
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/restore-preconditions.d.ts +26 -0
- package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
- package/daemon/dist/domain/restore-preconditions.js +63 -1
- package/daemon/dist/domain/restore-preconditions.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +4 -1
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts +3 -1
- package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-validation.js +6 -3
- package/daemon/dist/domain/resume-token-validation.js.map +1 -1
- package/daemon/dist/domain/return-route.d.ts +73 -0
- package/daemon/dist/domain/return-route.d.ts.map +1 -0
- package/daemon/dist/domain/return-route.js +124 -0
- package/daemon/dist/domain/return-route.js.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts +46 -0
- package/daemon/dist/domain/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/domain/rig-delivery-drain.js +128 -0
- package/daemon/dist/domain/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/domain/rig-expansion-service.js +1 -1
- package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
- package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts +12 -0
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +73 -0
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +22 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +99 -20
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-codec.js +9 -0
- package/daemon/dist/domain/rigspec-codec.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.d.ts +6 -0
- package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +30 -0
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +22 -2
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +82 -23
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +16 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +44 -1
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +12 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +17 -4
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +33 -0
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -0
- package/daemon/dist/domain/runner-channel.js +179 -0
- package/daemon/dist/domain/runner-channel.js.map +1 -0
- package/daemon/dist/domain/runner-grant-launch.js +2 -2
- package/daemon/dist/domain/runtime-adapter.d.ts +2 -0
- package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-adapter.js.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.d.ts.map +1 -1
- package/daemon/dist/domain/runtime-switch-materials.js +4 -3
- package/daemon/dist/domain/runtime-switch-materials.js.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +55 -3
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.d.ts +6 -4
- package/daemon/dist/domain/seat-attention-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-attention-reconciler.js +17 -10
- package/daemon/dist/domain/seat-attention-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +2 -1
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +27 -4
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +209 -64
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +8 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +52 -12
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.d.ts +3 -2
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +16 -4
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +21 -4
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +68 -2
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts +9 -2
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +34 -2
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts +4 -0
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +9 -3
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +4 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +31 -6
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/session-name.d.ts +13 -0
- package/daemon/dist/domain/session-name.d.ts.map +1 -1
- package/daemon/dist/domain/session-name.js +77 -0
- package/daemon/dist/domain/session-name.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +7 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +7 -4
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +16 -3
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +161 -16
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-conversation.d.ts +58 -0
- package/daemon/dist/domain/shared-conversation.d.ts.map +1 -0
- package/daemon/dist/domain/shared-conversation.js +98 -0
- package/daemon/dist/domain/shared-conversation.js.map +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts +1 -0
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +3 -1
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
- package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
- package/daemon/dist/domain/snapshot-capture.js +19 -12
- package/daemon/dist/domain/snapshot-capture.js.map +1 -1
- package/daemon/dist/domain/startup-phase-timing.d.ts +19 -0
- package/daemon/dist/domain/startup-phase-timing.d.ts.map +1 -0
- package/daemon/dist/domain/startup-phase-timing.js +23 -0
- package/daemon/dist/domain/startup-phase-timing.js.map +1 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +3 -2
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +9 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +24 -7
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/team-operations.d.ts +6 -6
- package/daemon/dist/domain/team-operations.d.ts.map +1 -1
- package/daemon/dist/domain/team-operations.js +2 -4
- package/daemon/dist/domain/team-operations.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +6 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js +23 -1
- package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -1
- package/daemon/dist/domain/terminal-policy.js +1 -1
- package/daemon/dist/domain/terminal-policy.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +91 -6
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +6 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +6 -3
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +1 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +9 -0
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +42 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.d.ts +3 -2
- package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-instance-store.js +6 -4
- package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.d.ts +48 -0
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +160 -90
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts +7 -1
- package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-reconciliation.js +51 -13
- package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +5 -3
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +48 -22
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts +7 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +35 -7
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/daemon/dist/gateway-slack-surface.d.ts +2 -2
- package/daemon/dist/gateway-slack-surface.d.ts.map +1 -1
- package/daemon/dist/gateway-slack-surface.js +1 -1
- package/daemon/dist/gateway-slack-surface.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +13 -2
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +105 -2
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +6 -1
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +2 -1
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts.map +1 -1
- package/daemon/dist/routes/compaction.js +46 -7
- package/daemon/dist/routes/compaction.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +4 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +266 -38
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +4 -3
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +18 -0
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/rig-delivery-drain.d.ts +3 -0
- package/daemon/dist/routes/rig-delivery-drain.d.ts.map +1 -0
- package/daemon/dist/routes/rig-delivery-drain.js +46 -0
- package/daemon/dist/routes/rig-delivery-drain.js.map +1 -0
- package/daemon/dist/routes/rigspec.d.ts.map +1 -1
- package/daemon/dist/routes/rigspec.js +24 -4
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +107 -6
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.js +14 -3
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/startup.d.ts.map +1 -1
- package/daemon/dist/routes/startup.js +127 -29
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/up.d.ts.map +1 -1
- package/daemon/dist/routes/up.js +16 -4
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +18 -1
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.js +1 -1
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +3 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +13 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +57 -16
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +5 -3
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +8 -0
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +139 -5
- package/daemon/docs/reference/community-harness-presets.md +2 -0
- package/daemon/docs/reference/daemon-http-clients.md +123 -6
- package/daemon/docs/reference/getting-started.md +8 -8
- package/daemon/docs/reference/harness-runner-contract.md +91 -1
- package/daemon/docs/reference/herdr-app.md +6 -0
- package/daemon/docs/reference/hosted-members.md +4 -2
- package/daemon/docs/reference/network-connector.md +4 -3
- package/daemon/docs/reference/queue-erasure.md +16 -1
- package/daemon/docs/reference/quickstart.md +2 -2
- package/daemon/docs/reference/rig-spec.md +166 -0
- package/daemon/docs/reference/rosters.md +9 -0
- package/daemon/docs/reference/sdlc-conventions.md +5 -1
- package/daemon/docs/reference/slack-app-setup.md +39 -21
- package/daemon/docs/reference/whats-new.md +294 -6
- package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +23 -0
- package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +1 -1
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
- package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +26 -5
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +92 -18
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +9 -6
- package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +12 -0
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +26 -5
- package/dist/acp/connector.js +1 -1
- package/dist/acp/connector.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +7 -1
- package/dist/cli-error.js.map +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/ask.d.ts.map +1 -1
- package/dist/commands/ask.js +92 -11
- package/dist/commands/ask.js.map +1 -1
- package/dist/commands/broadcast.js +9 -5
- package/dist/commands/broadcast.js.map +1 -1
- package/dist/commands/compact.d.ts +3 -4
- package/dist/commands/compact.d.ts.map +1 -1
- package/dist/commands/compact.js +76 -16
- package/dist/commands/compact.js.map +1 -1
- package/dist/commands/config-init-workspace.d.ts.map +1 -1
- package/dist/commands/config-init-workspace.js +3 -0
- package/dist/commands/config-init-workspace.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +2 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +7 -1
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/environment.js +1 -1
- package/dist/commands/environment.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +2 -1
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fork.d.ts.map +1 -1
- package/dist/commands/fork.js +2 -0
- package/dist/commands/fork.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +11 -3
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/network.d.ts +2 -0
- package/dist/commands/network.d.ts.map +1 -1
- package/dist/commands/network.js +14 -1
- package/dist/commands/network.js.map +1 -1
- package/dist/commands/ps.d.ts +28 -0
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +76 -2
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +350 -29
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/restore.d.ts.map +1 -1
- package/dist/commands/restore.js +6 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/rig.d.ts +2 -0
- package/dist/commands/rig.d.ts.map +1 -1
- package/dist/commands/rig.js +36 -2
- package/dist/commands/rig.js.map +1 -1
- package/dist/commands/roster.d.ts +3 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +128 -9
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +47 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +5 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/slack.d.ts +2 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +38 -2
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +5 -5
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +10 -0
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +10 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +3 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +5 -0
- package/dist/config-store.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +1 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/bundle-check.d.ts.map +1 -1
- package/dist/lib/bundle-check.js +33 -3
- package/dist/lib/bundle-check.js.map +1 -1
- package/dist/lib/model-observation.d.ts.map +1 -1
- package/dist/lib/model-observation.js +9 -3
- package/dist/lib/model-observation.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +55 -3
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/local-db.d.ts +5 -0
- package/dist/local-db.d.ts.map +1 -0
- package/dist/local-db.js +23 -0
- package/dist/local-db.js.map +1 -0
- package/dist/local-origin.d.ts.map +1 -1
- package/dist/local-origin.js +2 -17
- package/dist/local-origin.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +170 -27
- package/dist/mcp-server.js.map +1 -1
- package/dist/person-registration-offer.d.ts.map +1 -1
- package/dist/person-registration-offer.js +2 -1
- package/dist/person-registration-offer.js.map +1 -1
- package/dist/sender-identity.d.ts +18 -6
- package/dist/sender-identity.d.ts.map +1 -1
- package/dist/sender-identity.js +67 -7
- package/dist/sender-identity.js.map +1 -1
- package/dist/terminal-window-rex.d.ts +1 -1
- package/dist/terminal-window-rex.d.ts.map +1 -1
- package/dist/terminal-window-rex.js +3 -2
- package/dist/terminal-window-rex.js.map +1 -1
- package/dist/terminal-window.js +3 -3
- package/dist/terminal-window.js.map +1 -1
- package/package.json +2 -2
- package/tui/dist/config/config-model.js +1 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/daemon-client.d.ts +3 -1
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +6 -3
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +31 -1
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +106 -15
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/types.d.ts +2 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/ui/dist/assets/{index-BvUEh33d.js → index-1O1f3A7K.js} +55 -55
- package/ui/dist/index.html +1 -1
|
@@ -6,7 +6,9 @@ import type Database from "better-sqlite3";
|
|
|
6
6
|
* (`content_erased_at` set). The create path's retry identity still finds it, so a retried create makes no new work.
|
|
7
7
|
* A later note, summary or reclose makes it eligible again.
|
|
8
8
|
* - delete: the row and everything linked to it go. Only its id is kept, in `queue_erased_ids` (no endpoints, no
|
|
9
|
-
* content), and the create path refuses that id (`qitem_erased`).
|
|
9
|
+
* content), and the create path refuses that id (`qitem_erased`). Native delivery receipts additionally retain
|
|
10
|
+
* opaque custody tombstones (IDs, run order, binding hash and erased marker), with no native payload or result:
|
|
11
|
+
* their deletion would permit blind replay or sequence reuse. Legacy outbox deletion stays physical.
|
|
10
12
|
* The row's own copies follow it: its transitions, live and archived; events whose payload names it; its
|
|
11
13
|
* mission-control audit rows. Copies another party holds (outbox and inbox entries, stream reader actions and
|
|
12
14
|
* dispositions) go only when they're the owner's: both endpoints the account's (members scope) or the row's own
|
|
@@ -16,7 +18,8 @@ import type Database from "better-sqlite3";
|
|
|
16
18
|
* Scope is exact. Account deletion takes the account's recorded membership (exact session names): a row between two
|
|
17
19
|
* members, or between a member and OpenRig, is deleted, whatever its state; a row with one member endpoint and the
|
|
18
20
|
* other outside the account is reported as mixed and left untouched. Named with the account's rig, it also removes
|
|
19
|
-
* the rig's own records that outlive the rig.
|
|
21
|
+
* the rig's own records that outlive the rig. An empty membership is accepted only with the rig, for an account rig
|
|
22
|
+
* that never had a session (refuseUnlessNeverHadSession). Routine
|
|
20
23
|
* retention touches only closed rows (done, canceled, denied, handed-off; never failed or open work), aged from the
|
|
21
24
|
* start of their final closed state. A row a workflow still references is reported, never erased.
|
|
22
25
|
*
|
|
@@ -73,6 +76,9 @@ export interface EraseOptions {
|
|
|
73
76
|
* changes anything, then {batch, committed} once the batch commits or rolls back. The file is opened before the run
|
|
74
77
|
* writes anything at all */
|
|
75
78
|
ledgerPath?: string;
|
|
79
|
+
/** For a never-member erase: whose host a host-qualified address names. Without it, this database's own host id is
|
|
80
|
+
* this host and anything else is unknown (so it refuses). */
|
|
81
|
+
classifyHost?: (host: string) => HostClass;
|
|
76
82
|
}
|
|
77
83
|
type Stage = "ledger" | "select" | "events" | "rows" | "unlinked" | "rig";
|
|
78
84
|
type CopyTable = "outbox_entries" | "inbox_entries" | "stream_reader_actions" | "stream_dispositions";
|
|
@@ -86,8 +92,8 @@ export interface EraseReport {
|
|
|
86
92
|
scope: EraseScope["kind"];
|
|
87
93
|
/** false when the run stopped at maxBatches or on an error; rerun to continue */
|
|
88
94
|
complete: boolean;
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
95
|
+
/** Complete with nothing needing further content erasure: no mixed rows/copies, gaps, unreadable events or
|
|
96
|
+
* leftover entries/rig records. Opaque native custody tombstones are intentional and counted separately. */
|
|
91
97
|
clean: boolean;
|
|
92
98
|
/** why the run stopped early, and where; everything listed in qitems was committed before it */
|
|
93
99
|
error?: {
|
|
@@ -136,20 +142,23 @@ export interface EraseReport {
|
|
|
136
142
|
seq: number;
|
|
137
143
|
qitemIds: string[];
|
|
138
144
|
}>;
|
|
139
|
-
/**
|
|
145
|
+
/** Copies whose content is erased with the rows, or would be. nativeCustodyRetained is the outbox subset kept
|
|
146
|
+
* as opaque native tombstones rather than physically deleted (legacy outbox delete remains physical). */
|
|
140
147
|
linked: {
|
|
141
148
|
transitions: number;
|
|
142
149
|
archivedTransitions: number;
|
|
143
150
|
outbox: number;
|
|
151
|
+
nativeCustodyRetained?: number;
|
|
144
152
|
inbox: number;
|
|
145
153
|
events: number;
|
|
146
154
|
streamActions: number;
|
|
147
155
|
missionControl: number;
|
|
148
156
|
};
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
157
|
+
/** Members scope: unlinked entries between members, or a member and OpenRig; mixed entries are left. outbox counts physical legacy
|
|
158
|
+
* deletions; nativeCustodyRetained separately counts native content erasure retaining opaque custody. */
|
|
151
159
|
unlinked?: {
|
|
152
160
|
outbox: number;
|
|
161
|
+
nativeCustodyRetained?: number;
|
|
153
162
|
inbox: number;
|
|
154
163
|
streamItems: number;
|
|
155
164
|
mixedEntries: number;
|
|
@@ -171,6 +180,8 @@ export interface EraseReport {
|
|
|
171
180
|
metadataDays: number;
|
|
172
181
|
};
|
|
173
182
|
}
|
|
183
|
+
/** Whose host a host-qualified address names: this one, another known host, or one that can't be resolved. */
|
|
184
|
+
export type HostClass = "self" | "other" | "unknown";
|
|
174
185
|
/** Erase queue rows in one scope. With apply false it reports exactly what an apply would erase and writes nothing. */
|
|
175
186
|
export declare function eraseQueue(db: Database.Database, opts: EraseOptions): Promise<EraseReport>;
|
|
176
187
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-erasure.d.ts","sourceRoot":"","sources":["../../src/domain/queue-erasure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queue-erasure.d.ts","sourceRoot":"","sources":["../../src/domain/queue-erasure.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,uDAAwD,CAAC;AAczF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC7C,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,iFAAiF;IACjF,OAAO,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,iEAAiE;AACjE,qBAAa,YAAa,SAAQ,KAAK;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGnD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,2DAA2D;IAC3D,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;iCAE6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;kEAC8D;IAC9D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;CAC5C;AAED,KAAK,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAC1E,KAAK,SAAS,GAAG,gBAAgB,GAAG,eAAe,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AACtG,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,oBAAoB,GAAG,WAAW,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvJ,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB;gHAC4G;IAC5G,KAAK,EAAE,OAAO,CAAC;IACf,gGAAgG;IAChG,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,kEAAkE;IAClE,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE;oBACgB;IAChB,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,QAAQ,GAAG,aAAa,CAAA;KAAE,CAAC,CAAC;IAC5E;;wEAEoE;IACpE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,+GAA+G;IAC/G,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mFAAmF;IACnF,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD;;4BAEwB;IACxB,MAAM,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAClC,oHAAoH;IACpH,UAAU,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IACrG;qHACiH;IACjH,gBAAgB,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC7D;6GACyG;IACzG,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3L;6GACyG;IACzG,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAA;KAAE,CAAC;IACvJ;4GACwG;IACxG,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACrI,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,OAAO,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AA0QD,8GAA8G;AAC9G,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAsKrD,uHAAuH;AACvH,wBAAsB,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA6bhG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OutboxHandler } from "./outbox-handler.js";
|
|
1
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
3
|
import { appendFileSync, closeSync, openSync, readSync, statSync } from "node:fs";
|
|
3
4
|
import { isOpenRigSender, OPENRIG_SENDER } from "../lib/pane-envelope.js";
|
|
@@ -8,7 +9,9 @@ import { isOpenRigSender, OPENRIG_SENDER } from "../lib/pane-envelope.js";
|
|
|
8
9
|
* (`content_erased_at` set). The create path's retry identity still finds it, so a retried create makes no new work.
|
|
9
10
|
* A later note, summary or reclose makes it eligible again.
|
|
10
11
|
* - delete: the row and everything linked to it go. Only its id is kept, in `queue_erased_ids` (no endpoints, no
|
|
11
|
-
* content), and the create path refuses that id (`qitem_erased`).
|
|
12
|
+
* content), and the create path refuses that id (`qitem_erased`). Native delivery receipts additionally retain
|
|
13
|
+
* opaque custody tombstones (IDs, run order, binding hash and erased marker), with no native payload or result:
|
|
14
|
+
* their deletion would permit blind replay or sequence reuse. Legacy outbox deletion stays physical.
|
|
12
15
|
* The row's own copies follow it: its transitions, live and archived; events whose payload names it; its
|
|
13
16
|
* mission-control audit rows. Copies another party holds (outbox and inbox entries, stream reader actions and
|
|
14
17
|
* dispositions) go only when they're the owner's: both endpoints the account's (members scope) or the row's own
|
|
@@ -18,7 +21,8 @@ import { isOpenRigSender, OPENRIG_SENDER } from "../lib/pane-envelope.js";
|
|
|
18
21
|
* Scope is exact. Account deletion takes the account's recorded membership (exact session names): a row between two
|
|
19
22
|
* members, or between a member and OpenRig, is deleted, whatever its state; a row with one member endpoint and the
|
|
20
23
|
* other outside the account is reported as mixed and left untouched. Named with the account's rig, it also removes
|
|
21
|
-
* the rig's own records that outlive the rig.
|
|
24
|
+
* the rig's own records that outlive the rig. An empty membership is accepted only with the rig, for an account rig
|
|
25
|
+
* that never had a session (refuseUnlessNeverHadSession). Routine
|
|
22
26
|
* retention touches only closed rows (done, canceled, denied, handed-off; never failed or open work), aged from the
|
|
23
27
|
* start of their final closed state. A row a workflow still references is reported, never erased.
|
|
24
28
|
*
|
|
@@ -139,9 +143,15 @@ function linkedCopies(st, ids) {
|
|
|
139
143
|
const COPY_KEY = {
|
|
140
144
|
outbox_entries: "outbox_id", inbox_entries: "inbox_id", stream_reader_actions: "action_id", stream_dispositions: "stream_item_id",
|
|
141
145
|
};
|
|
142
|
-
function eraseCopies(st, copies, action) {
|
|
146
|
+
function eraseCopies(st, copies, action, outbox, at) {
|
|
143
147
|
for (const table of Object.keys(COPY_KEY)) {
|
|
144
|
-
|
|
148
|
+
let keys = copies.filter((copy) => copy.table === table).map((copy) => copy.id);
|
|
149
|
+
if (table === "outbox_entries") {
|
|
150
|
+
const native = keys.filter(id => outbox.eraseRunner(id, at));
|
|
151
|
+
// Native-only opaque custody survives physical deletion. Original content is removed at the requested scope;
|
|
152
|
+
// composed group content/results were scrubbed atomically above, including copies owned by another member.
|
|
153
|
+
keys = keys.filter(id => !native.includes(id));
|
|
154
|
+
}
|
|
145
155
|
if (keys.length === 0)
|
|
146
156
|
continue;
|
|
147
157
|
const params = { keys: JSON.stringify(keys) };
|
|
@@ -255,6 +265,171 @@ function closedSince(st, qitemId, state, fallback) {
|
|
|
255
265
|
function membersDigest(members) {
|
|
256
266
|
return createHash("sha256").update(JSON.stringify([...new Set(members)].sort())).digest("hex");
|
|
257
267
|
}
|
|
268
|
+
/** An account rig is erased with no members only when it never had a session, shown from what this database keeps: no
|
|
269
|
+
* session on its nodes (the both-ways membership check), no event of the rig or its nodes naming one, no node removed
|
|
270
|
+
* from it (a node's sessions are deleted with it), and no earlier erasure that recorded members for it. Anything less
|
|
271
|
+
* is refused: a delete doesn't guess. */
|
|
272
|
+
function refuseUnlessNeverHadSession(db, rigId, rigName) {
|
|
273
|
+
const named = db.prepare(`SELECT 1 FROM events WHERE (rig_id = @rig OR node_id IN (SELECT id FROM nodes WHERE rig_id = @rig))
|
|
274
|
+
AND (instr(payload, '"sessionName"') > 0 OR instr(payload, '"sessionId"') > 0) LIMIT 1`).get({ rig: rigId });
|
|
275
|
+
if (named !== undefined) {
|
|
276
|
+
throw new EraseRefusal("erase_rig_had_sessions", `Rig ${rigName}'s events name a session, so it had members. Name them.`);
|
|
277
|
+
}
|
|
278
|
+
if (db.prepare("SELECT 1 FROM events WHERE rig_id = ? AND type = 'node.removed' LIMIT 1").get(rigId) !== undefined) {
|
|
279
|
+
throw new EraseRefusal("erase_rig_history_unknown", `A node was removed from rig ${rigName}, and its sessions went with it, so it can't be shown that the rig never had a session.`);
|
|
280
|
+
}
|
|
281
|
+
const kept = db.prepare("SELECT members_digest AS digest FROM queue_erased_rigs WHERE rig_id = ?").get(rigId);
|
|
282
|
+
if (kept !== undefined && kept.digest !== membersDigest([])) {
|
|
283
|
+
throw new EraseRefusal("erase_rig_had_sessions", `An earlier erasure recorded members for rig ${rigName}. Name them.`);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/** Where queue work keeps a session address. A seat that worked at a rig shows here even with no session row: a
|
|
287
|
+
* grant-service caller acting as its grant's seat, or a hosted member. */
|
|
288
|
+
const ADDRESS_COLUMNS = [
|
|
289
|
+
{ table: "queue_items", columns: ["source_session", "destination_session"] },
|
|
290
|
+
{ table: "queue_transitions", columns: ["actor_session"] },
|
|
291
|
+
{ table: "queue_transitions_archive", columns: ["actor_session"] },
|
|
292
|
+
{ table: "inbox_entries", columns: ["sender_session", "destination_session"] },
|
|
293
|
+
{ table: "outbox_entries", columns: ["sender_session", "destination_session"] },
|
|
294
|
+
{ table: "stream_items", columns: ["source_session"] },
|
|
295
|
+
// A seat listing its own inbox (an MCP grant or hosted seat polling before it has any row) records a check-in.
|
|
296
|
+
{ table: "queue_inbox_checkins", columns: ["session"] },
|
|
297
|
+
// A reader's decline or other action on a stream item, which leaves no queue row.
|
|
298
|
+
{ table: "stream_reader_actions", columns: ["reader_session"] },
|
|
299
|
+
// A chatroom post, which an MCP grant or hosted seat can make in any rig's room.
|
|
300
|
+
{ table: "chat_messages", columns: ["sender"] },
|
|
301
|
+
// A reader seat's stream subscription.
|
|
302
|
+
{ table: "stream_subscriptions", columns: ["reader_session", "created_by"] },
|
|
303
|
+
];
|
|
304
|
+
const ADDRESS_WINDOW = 5_000;
|
|
305
|
+
/** How many matches past the watermark the in-run guard reads per table. */
|
|
306
|
+
const GUARD_PAGE = 100;
|
|
307
|
+
/** A session address at the rig, `<name>@<rig>` or host-qualified `<name>@<rig>@<host>`: matched exactly on the part after
|
|
308
|
+
* the first `@` (LIKE would read `_` in a rig name as a wildcard). */
|
|
309
|
+
const AT_RIG = (column) => `(instr(${column}, '@') > 0 AND (substr(${column}, instr(${column}, '@') + 1) = @rigName
|
|
310
|
+
OR substr(${column}, instr(${column}, '@') + 1, length(@rigName) + 1) = @rigName || '@'))`;
|
|
311
|
+
const atRig = (address, rigName) => {
|
|
312
|
+
if (typeof address !== "string" || !address.includes("@"))
|
|
313
|
+
return false;
|
|
314
|
+
const rest = address.slice(address.indexOf("@") + 1);
|
|
315
|
+
return rest === rigName || rest.startsWith(`${rigName}@`);
|
|
316
|
+
};
|
|
317
|
+
/** Whether an address at the rig is evidence of a member of this daemon's rig. Unqualified, or qualified with this
|
|
318
|
+
* host: yes. Qualified with another known host: no, that's that host's same-named rig. A host that can't be resolved:
|
|
319
|
+
* yes, since unknown refuses. */
|
|
320
|
+
function memberEvidence(address, rigName, classifyHost) {
|
|
321
|
+
const rest = address.slice(address.indexOf("@") + 1);
|
|
322
|
+
if (rest === rigName)
|
|
323
|
+
return true;
|
|
324
|
+
return classifyHost(rest.slice(rigName.length + 1)) !== "other";
|
|
325
|
+
}
|
|
326
|
+
/** Without a resolver from the caller: this database's own host id is this host, and anything else is unknown. */
|
|
327
|
+
function defaultHostClassifier(db) {
|
|
328
|
+
let self;
|
|
329
|
+
return (host) => {
|
|
330
|
+
if (self === undefined) {
|
|
331
|
+
try {
|
|
332
|
+
self = db.prepare("SELECT host_id FROM self_host_identity WHERE singleton = 1").get()?.host_id ?? null;
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
self = null;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return self !== null && host === self ? "self" : "unknown";
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function watermark(db, tables) {
|
|
342
|
+
const rowids = {};
|
|
343
|
+
for (const { table } of ADDRESS_COLUMNS) {
|
|
344
|
+
if (tables.has(table))
|
|
345
|
+
rowids[table] = db.prepare(`SELECT MAX(rowid) AS n FROM ${table}`).get().n ?? 0;
|
|
346
|
+
}
|
|
347
|
+
return { seq: db.prepare("SELECT MAX(seq) AS n FROM events").get().n ?? 0, rowids };
|
|
348
|
+
}
|
|
349
|
+
/** Addresses at the rig in queue work, read in rowid windows with a yield between them (from a watermark: only rows past
|
|
350
|
+
* it). At most `limit` are listed. */
|
|
351
|
+
async function addressesAtRig(db, tables, rigName, classifyHost, limit = 20) {
|
|
352
|
+
const found = new Set();
|
|
353
|
+
for (const { table, columns } of ADDRESS_COLUMNS) {
|
|
354
|
+
if (!tables.has(table))
|
|
355
|
+
continue;
|
|
356
|
+
const top = db.prepare(`SELECT MAX(rowid) AS n FROM ${table}`).get().n ?? 0;
|
|
357
|
+
const read = db.prepare(`SELECT ${columns.join(", ")} FROM ${table}
|
|
358
|
+
WHERE rowid > @lo AND rowid <= @hi AND (${columns.map(AT_RIG).join(" OR ")})`);
|
|
359
|
+
for (let lo = 0; lo < top && found.size < limit; lo += ADDRESS_WINDOW) {
|
|
360
|
+
for (const row of read.all({ lo, hi: Math.min(lo + ADDRESS_WINDOW, top), rigName })) {
|
|
361
|
+
for (const column of columns) {
|
|
362
|
+
const address = row[column];
|
|
363
|
+
if (atRig(address, rigName) && memberEvidence(address, rigName, classifyHost))
|
|
364
|
+
found.add(address);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
await yieldToLoop();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return [...found].sort().slice(0, limit);
|
|
371
|
+
}
|
|
372
|
+
/** A never-member erase rechecks its proof inside each transaction that deletes or records: nothing new for the rig past
|
|
373
|
+
* the watermark (an event of the rig or its nodes, a session on its nodes, queue work at its address). A seat that
|
|
374
|
+
* arrives while the run yields stops it before its records go, and no receipt is written. */
|
|
375
|
+
function neverMemberGuard(db, tables, rig, mark, classifyHost) {
|
|
376
|
+
const params = { rig: rig.id, rigName: rig.name ?? "", seq: mark.seq };
|
|
377
|
+
const stop = (what) => {
|
|
378
|
+
throw new Error(`rig ${rig.name ?? rig.id} changed during the run (${what}), so nothing more was erased and no receipt was written; rerun to check it again`);
|
|
379
|
+
};
|
|
380
|
+
// `full`, in the receipt's own transaction: every row at the rig, not only those past the watermark. A table without
|
|
381
|
+
// AUTOINCREMENT can give a new row a deleted row's rowid, at or below its watermark. One unindexed pass over each table.
|
|
382
|
+
return (full = false) => {
|
|
383
|
+
const event = (db.prepare("SELECT type FROM events WHERE rig_id = @rig AND seq > @seq LIMIT 1").get(params)
|
|
384
|
+
?? db.prepare("SELECT type FROM events WHERE node_id IN (SELECT id FROM nodes WHERE rig_id = @rig) AND seq > @seq LIMIT 1").get(params));
|
|
385
|
+
if (event !== undefined)
|
|
386
|
+
stop(`event ${event.type}`);
|
|
387
|
+
if (db.prepare("SELECT 1 FROM sessions s JOIN nodes n ON n.id = s.node_id WHERE n.rig_id = @rig LIMIT 1").get(params) !== undefined)
|
|
388
|
+
stop("a session");
|
|
389
|
+
if (rig.name === null)
|
|
390
|
+
return;
|
|
391
|
+
const rigName = rig.name;
|
|
392
|
+
const isEvidence = (row, columns) => columns.some((column) => atRig(row[column], rigName) && memberEvidence(row[column], rigName, classifyHost));
|
|
393
|
+
// A full page could hide evidence past it, and unknown refuses: it stops too (a rerun reads it all again).
|
|
394
|
+
const evidence = (rows, columns) => rows.length >= GUARD_PAGE
|
|
395
|
+
|| rows.some((row) => isEvidence(row, columns));
|
|
396
|
+
for (const { table, columns } of ADDRESS_COLUMNS) {
|
|
397
|
+
if (!tables.has(table))
|
|
398
|
+
continue;
|
|
399
|
+
if (full) {
|
|
400
|
+
const every = db.prepare(`SELECT ${columns.join(", ")} FROM ${table} WHERE ${columns.map(AT_RIG).join(" OR ")}`);
|
|
401
|
+
for (const row of every.iterate(params)) {
|
|
402
|
+
if (isEvidence(row, columns))
|
|
403
|
+
stop(`queue work at the rig in ${table}`);
|
|
404
|
+
}
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
const rows = db.prepare(`SELECT ${columns.join(", ")} FROM ${table} WHERE rowid > @after AND (${columns.map(AT_RIG).join(" OR ")}) LIMIT ${GUARD_PAGE}`)
|
|
408
|
+
.all({ ...params, after: mark.rowids[table] ?? 0 });
|
|
409
|
+
if (evidence(rows, columns))
|
|
410
|
+
stop(`queue work at the rig in ${table}`);
|
|
411
|
+
}
|
|
412
|
+
// An existing row moved to an address at the rig (a fallback reroute, say) leaves a transition, not a new row.
|
|
413
|
+
if (tables.has("queue_transitions") && tables.has("queue_items")) {
|
|
414
|
+
const moved = db.prepare(`SELECT q.source_session, q.destination_session FROM queue_transitions t JOIN queue_items q ON q.qitem_id = t.qitem_id
|
|
415
|
+
WHERE t.transition_id > @after AND (${AT_RIG("q.source_session")} OR ${AT_RIG("q.destination_session")}) LIMIT ${GUARD_PAGE}`)
|
|
416
|
+
.all({ ...params, after: mark.rowids.queue_transitions ?? 0 });
|
|
417
|
+
if (evidence(moved, ["source_session", "destination_session"]))
|
|
418
|
+
stop("a row moved to an address at the rig");
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
/** After a never-member erase recorded its receipt and the rig was removed: anything of the rig since then that only a
|
|
423
|
+
* member leaves (a node or seat event, a session event, one naming a session) means a member came later, so the
|
|
424
|
+
* receipt no longer holds. */
|
|
425
|
+
function refuseIfMemberSinceReceipt(db, rigId) {
|
|
426
|
+
const event = db.prepare(`SELECT type FROM events WHERE rig_id = ?
|
|
427
|
+
AND (substr(type, 1, 5) IN ('node.', 'seat.') OR substr(type, 1, 8) IN ('session.', 'binding.') OR type = 'rig.expanded'
|
|
428
|
+
OR instr(payload, '"sessionName"') > 0 OR instr(payload, '"sessionId"') > 0) LIMIT 1`).get(rigId);
|
|
429
|
+
if (event !== undefined) {
|
|
430
|
+
throw new EraseRefusal("erase_rig_had_sessions", `Rig ${rigId} had a member after its erasure was recorded with none (event ${event.type}). Name its members.`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
258
433
|
/** The batches this database recorded as committed (each batch with ledger lines records its id in its own
|
|
259
434
|
* transaction). */
|
|
260
435
|
function recordedBatches(st, batches) {
|
|
@@ -298,6 +473,7 @@ function reconcileLedger(st, path, nowIso) {
|
|
|
298
473
|
/** Erase queue rows in one scope. With apply false it reports exactly what an apply would erase and writes nothing. */
|
|
299
474
|
export async function eraseQueue(db, opts) {
|
|
300
475
|
const st = new Statements(db);
|
|
476
|
+
const erasureOutbox = new OutboxHandler(db);
|
|
301
477
|
const batchSize = opts.batchSize ?? DEFAULT_BATCH;
|
|
302
478
|
const maxBatches = opts.maxBatches ?? DEFAULT_MAX_BATCHES;
|
|
303
479
|
const { scope } = opts;
|
|
@@ -305,6 +481,13 @@ export async function eraseQueue(db, opts) {
|
|
|
305
481
|
// members included), and every session of it is a member. A rig already removed is verified only by the record an
|
|
306
482
|
// earlier run kept with this membership.
|
|
307
483
|
let rig = null;
|
|
484
|
+
// A never-member erase (no members, with its rig): the tables read, and where they stood when its proof was taken.
|
|
485
|
+
let tables;
|
|
486
|
+
let proofMark;
|
|
487
|
+
const classifyHost = opts.classifyHost ?? defaultHostClassifier(db);
|
|
488
|
+
if (scope.kind === "members" && scope.members.length === 0 && scope.rig === undefined) {
|
|
489
|
+
throw new EraseRefusal("erase_members_invalid", "An empty members list names an account rig that never had a member: give its rig.");
|
|
490
|
+
}
|
|
308
491
|
if (scope.kind === "members" && scope.rig !== undefined) {
|
|
309
492
|
const name = db.prepare("SELECT name FROM rigs WHERE id = ?").get(scope.rig)?.name ?? null;
|
|
310
493
|
if (name !== null) {
|
|
@@ -318,12 +501,36 @@ export async function eraseQueue(db, opts) {
|
|
|
318
501
|
unlisted.length > 0 ? `Rig ${name} has sessions the members don't list: ${unlisted.join(", ")}.` : "",
|
|
319
502
|
].filter(Boolean).join(" "));
|
|
320
503
|
}
|
|
504
|
+
if (scope.members.length === 0) {
|
|
505
|
+
tables ??= tableNames(db);
|
|
506
|
+
proofMark = watermark(db, tables);
|
|
507
|
+
refuseUnlessNeverHadSession(db, scope.rig, name);
|
|
508
|
+
const addresses = await addressesAtRig(db, tables, name, classifyHost);
|
|
509
|
+
if (addresses.length > 0) {
|
|
510
|
+
throw new EraseRefusal("erase_rig_had_sessions", `Queue work names seats of rig ${name}: ${addresses.join(", ")}. Name them.`);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
321
513
|
rig = { id: scope.rig, name, found: true, verified: true, completedAt: null };
|
|
322
514
|
}
|
|
323
515
|
else {
|
|
324
516
|
const kept = db.prepare(`SELECT rig_name AS name, members_digest AS digest, completed_at AS completedAt
|
|
325
517
|
FROM queue_erased_rigs WHERE rig_id = ?`).get(scope.rig);
|
|
326
518
|
const verified = kept !== undefined && kept.digest === membersDigest(scope.members);
|
|
519
|
+
// With no members, a removed rig is erased only on an earlier run's record that it had none.
|
|
520
|
+
if (scope.members.length === 0 && !verified) {
|
|
521
|
+
throw new EraseRefusal("erase_rig_history_unknown", `Rig ${scope.rig} isn't on this daemon, and no earlier erasure recorded it with no members, so it can't be shown that it never had a session.`);
|
|
522
|
+
}
|
|
523
|
+
if (scope.members.length === 0) {
|
|
524
|
+
tables ??= tableNames(db);
|
|
525
|
+
proofMark = watermark(db, tables);
|
|
526
|
+
refuseIfMemberSinceReceipt(db, scope.rig);
|
|
527
|
+
if (kept.name !== "") {
|
|
528
|
+
const addresses = await addressesAtRig(db, tables, kept.name, classifyHost);
|
|
529
|
+
if (addresses.length > 0) {
|
|
530
|
+
throw new EraseRefusal("erase_rig_had_sessions", `Queue work names seats of rig ${kept.name}: ${addresses.join(", ")}. Name them.`);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
327
534
|
rig = { id: scope.rig, name: verified && kept.name !== "" ? kept.name : null, found: false, verified,
|
|
328
535
|
completedAt: verified ? kept.completedAt : null };
|
|
329
536
|
}
|
|
@@ -671,8 +878,8 @@ export async function eraseQueue(db, opts) {
|
|
|
671
878
|
rewriteEvent.run(payload, seq);
|
|
672
879
|
for (const seq of planned.events.remove)
|
|
673
880
|
removeEvent.run(seq);
|
|
674
|
-
eraseCopies(st, planned.owned.scrub, "scrub");
|
|
675
|
-
eraseCopies(st, planned.owned.delete, "delete");
|
|
881
|
+
eraseCopies(st, planned.owned.scrub, "scrub", erasureOutbox, opts.nowIso);
|
|
882
|
+
eraseCopies(st, planned.owned.delete, "delete", erasureOutbox, opts.nowIso);
|
|
676
883
|
const scrub = planned.rows.filter((row) => row.action === "scrub").map((row) => row.qitemId);
|
|
677
884
|
const remove = [...planned.rows.filter((row) => row.action === "delete").map((row) => row.qitemId), ...planned.absent];
|
|
678
885
|
if (scrub.length > 0)
|
|
@@ -686,6 +893,10 @@ export async function eraseQueue(db, opts) {
|
|
|
686
893
|
report.linked.archivedTransitions += plan.counts.archivedTransitions;
|
|
687
894
|
report.linked.missionControl += plan.counts.missionControl;
|
|
688
895
|
report.linked.outbox += all.filter((copy) => copy.table === "outbox_entries").length;
|
|
896
|
+
const nativeRetained = all.filter(copy => copy.table === "outbox_entries"
|
|
897
|
+
&& (erasureOutbox.runnerPrimary(copy.id) || erasureOutbox.inputRoute(copy.id) === "native")).length;
|
|
898
|
+
if (nativeRetained)
|
|
899
|
+
report.linked.nativeCustodyRetained = (report.linked.nativeCustodyRetained ?? 0) + nativeRetained;
|
|
689
900
|
report.linked.inbox += all.filter((copy) => copy.table === "inbox_entries").length;
|
|
690
901
|
report.linked.streamActions += all.filter((copy) => copy.table === "stream_reader_actions" || copy.table === "stream_dispositions").length;
|
|
691
902
|
for (const seq of plan.events.seqs)
|
|
@@ -724,11 +935,12 @@ export async function eraseQueue(db, opts) {
|
|
|
724
935
|
stage = "unlinked";
|
|
725
936
|
report.unlinked = eraseUnlinked(db, st, {
|
|
726
937
|
members, plannedActions, plannedDispositions, erasedRows: report.qitems.map((row) => row.qitemId),
|
|
727
|
-
}, opts.apply);
|
|
938
|
+
}, opts.apply, opts.nowIso);
|
|
728
939
|
if (rig !== null) {
|
|
729
940
|
stage = "rig";
|
|
730
941
|
report.rig = { id: rig.id, found: rig.found, verified: rig.verified, erased: {}, left: {}, unknown: [] };
|
|
731
|
-
|
|
942
|
+
const guard = proofMark !== undefined && tables !== undefined ? neverMemberGuard(db, tables, rig, proofMark, classifyHost) : undefined;
|
|
943
|
+
await eraseRigRecords(db, st, { ...rig, members, digest: membersDigest(scope.members) }, opts.apply, opts.nowIso, report.rig, guard);
|
|
732
944
|
}
|
|
733
945
|
}
|
|
734
946
|
}
|
|
@@ -748,7 +960,7 @@ export async function eraseQueue(db, opts) {
|
|
|
748
960
|
* member endpoint and the other outside the account, or a stream item something still references, is counted and
|
|
749
961
|
* left. Rows and references this run erases are counted as they were before it, so a dry run and an apply report the
|
|
750
962
|
* same set. */
|
|
751
|
-
function eraseUnlinked(db, st, plan, apply) {
|
|
963
|
+
function eraseUnlinked(db, st, plan, apply, at) {
|
|
752
964
|
// A row this run erased still owns its copies here: they were reported with it (keptCopies), not as unowned.
|
|
753
965
|
const rows = "(SELECT qitem_id FROM queue_items UNION ALL SELECT value FROM json_each(@rows))";
|
|
754
966
|
// COALESCE: an entry with no pointer is unowned, not unknown (NULL IN (...) would drop it from both counts).
|
|
@@ -778,23 +990,32 @@ function eraseUnlinked(db, st, plan, apply) {
|
|
|
778
990
|
const referenced = `stream_item_id IN (${references.join(" UNION ")})`;
|
|
779
991
|
const params = { members: plan.members, actions: JSON.stringify(plan.plannedActions), dispositions: JSON.stringify(plan.plannedDispositions),
|
|
780
992
|
rows: JSON.stringify(plan.erasedRows) };
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
993
|
+
// Select and erase under the same snapshot: a native source cannot cross account ownership between them.
|
|
994
|
+
return db.transaction(() => {
|
|
995
|
+
const outbox = new OutboxHandler(db);
|
|
996
|
+
const nativeIds = st.get(`SELECT outbox_id AS id FROM outbox_entries WHERE ${both} AND NOT ${ownedOutbox}
|
|
997
|
+
AND (json_extract(guard_delivery,'$.runner') IS NOT NULL OR json_extract(guard_delivery,'$.nativeRequestId') IS NOT NULL OR json_extract(guard_delivery,'$.inputRoute')='native')`)
|
|
998
|
+
.all(params).map(row => row.id);
|
|
999
|
+
const result = {
|
|
1000
|
+
...(nativeIds.length ? { nativeCustodyRetained: nativeIds.length } : {}),
|
|
1001
|
+
outbox: st.count(`SELECT COUNT(*) AS n FROM outbox_entries WHERE ${both} AND NOT ${ownedOutbox}`, params) - nativeIds.length,
|
|
1002
|
+
inbox: st.count(`SELECT COUNT(*) AS n FROM inbox_entries WHERE ${both} AND NOT ${ownedInbox}`, params),
|
|
1003
|
+
streamItems: st.count(`SELECT COUNT(*) AS n FROM stream_items WHERE source_session IN ${MEMBERS} AND NOT ${referenced}`, params),
|
|
1004
|
+
// A row's own copies are reported with that row (mixed, keptCopies); these are the entries no row owns.
|
|
1005
|
+
mixedEntries: [fromMember, toMember].reduce((sum, where) => sum + st.count(`SELECT COUNT(*) AS n FROM outbox_entries WHERE ${where} AND NOT ${ownedOutbox}`, params)
|
|
1006
|
+
+ st.count(`SELECT COUNT(*) AS n FROM inbox_entries WHERE ${where} AND NOT ${ownedInbox}`, params), 0),
|
|
1007
|
+
referencedStreamItems: st.count(`SELECT COUNT(*) AS n FROM stream_items WHERE source_session IN ${MEMBERS} AND ${referenced}`, params),
|
|
1008
|
+
};
|
|
1009
|
+
if (apply) {
|
|
1010
|
+
for (const id of nativeIds)
|
|
1011
|
+
outbox.eraseRunner(id, at);
|
|
1012
|
+
// Native sources now have empty endpoints; only legacy rows still match this physical-delete scope.
|
|
792
1013
|
st.get(`DELETE FROM outbox_entries WHERE ${both} AND NOT ${ownedOutbox}`).run(params);
|
|
793
1014
|
st.get(`DELETE FROM inbox_entries WHERE ${both} AND NOT ${ownedInbox}`).run(params);
|
|
794
1015
|
st.get(`DELETE FROM stream_items WHERE source_session IN ${MEMBERS} AND NOT ${referenced}`).run(params);
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
|
|
1016
|
+
}
|
|
1017
|
+
return result;
|
|
1018
|
+
})();
|
|
798
1019
|
}
|
|
799
1020
|
// The account rig's own records that outlive the rig (no cascading key to it), in delete order: dependents first.
|
|
800
1021
|
// byRigId: keyed by the rig's id alone, so erased only for a verified id. NODES: the rig's nodes, while it has them.
|
|
@@ -834,9 +1055,8 @@ const RIG_RECORDS_LEFT = [
|
|
|
834
1055
|
const RIG_RECORDS_CHUNK = 1_000;
|
|
835
1056
|
/** The account rig's records, counted into `out` as each chunk commits, so a pass that stops partway still reports
|
|
836
1057
|
* what it erased. */
|
|
837
|
-
async function eraseRigRecords(db, st, rig, apply, nowIso, out) {
|
|
838
|
-
const tables =
|
|
839
|
-
.map((row) => row.name));
|
|
1058
|
+
async function eraseRigRecords(db, st, rig, apply, nowIso, out, guard) {
|
|
1059
|
+
const tables = tableNames(db);
|
|
840
1060
|
const params = { rig: rig.id, rigName: rig.name ?? "", members: rig.members };
|
|
841
1061
|
const add = (into, table, n) => {
|
|
842
1062
|
into[table] = (into[table] ?? 0) + n;
|
|
@@ -855,9 +1075,13 @@ async function eraseRigRecords(db, st, rig, apply, nowIso, out) {
|
|
|
855
1075
|
}
|
|
856
1076
|
add(out.erased, table, 0);
|
|
857
1077
|
// In chunks by rowid (every one of these tables has one; a declared key can be NULL), so a large table (events)
|
|
858
|
-
// never holds the daemon in one statement.
|
|
1078
|
+
// never holds the daemon in one statement. A guard rechecks its proof in each chunk's own transaction.
|
|
859
1079
|
const chunk = st.get(`DELETE FROM ${table} WHERE rowid IN (SELECT rowid FROM ${table} WHERE ${where} LIMIT ${RIG_RECORDS_CHUNK})`);
|
|
860
|
-
|
|
1080
|
+
const run = db.transaction(() => {
|
|
1081
|
+
guard?.();
|
|
1082
|
+
return chunk.run(params).changes;
|
|
1083
|
+
});
|
|
1084
|
+
for (let changes = run(); changes > 0; changes = run()) {
|
|
861
1085
|
add(out.erased, table, changes);
|
|
862
1086
|
await yieldToLoop();
|
|
863
1087
|
}
|
|
@@ -879,20 +1103,25 @@ async function eraseRigRecords(db, st, rig, apply, nowIso, out) {
|
|
|
879
1103
|
const leftTotal = Object.values(out.left).reduce((sum, n) => sum + n, 0);
|
|
880
1104
|
if (rig.completedAt !== null)
|
|
881
1105
|
out.completedAt = rig.completedAt;
|
|
882
|
-
if (apply && rig.verified)
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
1106
|
+
if (apply && rig.verified)
|
|
1107
|
+
db.transaction(() => {
|
|
1108
|
+
guard?.(true);
|
|
1109
|
+
if (rig.found) {
|
|
1110
|
+
// While the rig exists, its id and name are kept with this membership, so the run after its removal is verified.
|
|
1111
|
+
db.prepare(`INSERT INTO queue_erased_rigs (rig_id, rig_name, members_digest, verified_at, completed_at) VALUES (?, ?, ?, ?, NULL)
|
|
886
1112
|
ON CONFLICT(rig_id) DO UPDATE SET rig_name = excluded.rig_name, members_digest = excluded.members_digest,
|
|
887
1113
|
verified_at = excluded.verified_at, completed_at = NULL`).run(rig.id, rig.name, rig.digest, nowIso);
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1114
|
+
}
|
|
1115
|
+
else if (leftTotal === 0 && unknown.size === 0 && rig.completedAt === null) {
|
|
1116
|
+
// After the removal, once nothing of the rig is left, the record becomes a completion receipt: the name goes,
|
|
1117
|
+
// and the id, membership digest and time stay, so an identical rerun (say, after a lost response) still
|
|
1118
|
+
// verifies and reports the same clean result.
|
|
1119
|
+
db.prepare("UPDATE queue_erased_rigs SET rig_name = '', completed_at = ? WHERE rig_id = ?").run(nowIso, rig.id);
|
|
1120
|
+
out.completedAt = nowIso;
|
|
1121
|
+
}
|
|
1122
|
+
})();
|
|
1123
|
+
}
|
|
1124
|
+
function tableNames(db) {
|
|
1125
|
+
return new Set(db.prepare("SELECT name FROM sqlite_master WHERE type = 'table'").all().map((row) => row.name));
|
|
897
1126
|
}
|
|
898
1127
|
//# sourceMappingURL=queue-erasure.js.map
|