@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
|
@@ -2,11 +2,13 @@ import { captureClaudeContinuation } from "./claude-continuation-launch.js";
|
|
|
2
2
|
import { observeSolePane } from "./pane-binding-observation.js";
|
|
3
3
|
import { automaticRestoreOverrides } from "./existing-rig-restore.js";
|
|
4
4
|
import { restoreRuntimeCompatibilityError } from "./restore-runtime-compatibility.js";
|
|
5
|
-
import { leftAttachedReason } from "./restore-plan-preview.js";
|
|
5
|
+
import { leftAttachedReason, restorePermissionSeat } from "./restore-plan-preview.js";
|
|
6
|
+
import { planRestorePermission } from "./permission-account.js";
|
|
6
7
|
import { assessSnapshotCurrentOccupants, stoppedSnapshotReason } from "./rehydrate-eligibility.js";
|
|
7
8
|
import { nonInterruptiveNotice, nonInterruptiveSummary } from "../adapters/non-interruptive.js";
|
|
8
9
|
import { planModelAliasNotice } from "../adapters/yolo-mode.js";
|
|
9
10
|
import { effortPrecedence, readSeatEffort } from "./seat-effort.js";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
10
12
|
import { accessSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
11
13
|
import { dirname, isAbsolute, join } from "node:path";
|
|
12
14
|
import { SEAT_SKILLS_BOOTSTRAP_BLOCK_ID, ensureSeatSkillPlugin, followSeatSkills, hasFollowingSeatSkills, hasSeatSkillRecords, rehydrateSeatSkills, seatSkillPaths, seatSkillPathsForNode, seatCatalogKeptNote, seatSkillReplay, writeSeatSkillCatalog, writeSeatSkillRouter, seatRouterKeptNote } from "./seat-skill-storage.js";
|
|
@@ -31,10 +33,14 @@ import { AppliedLaunchObservationStore } from "./applied-launch-observation-stor
|
|
|
31
33
|
import { isShellForeground } from "./shell-classifier.js";
|
|
32
34
|
import { rebindAndVerifyPaneIdentity } from "./seat-attention-reconciler.js";
|
|
33
35
|
import { SeatIdentityStore } from "./seat-identity-store.js";
|
|
34
|
-
import { validatePreRestore } from "./restore-preconditions.js";
|
|
36
|
+
import { SEAT_STARTUP_BLOCKERS, resumingConversationSeats, validatePreRestore } from "./restore-preconditions.js";
|
|
37
|
+
import { describePartners, holdsRecordedConversation, pairableConversation } from "./shared-conversation.js";
|
|
38
|
+
import { getNodeInventoryForRigs } from "./node-inventory.js";
|
|
35
39
|
import { resolveSnapshotRestoreTopology } from "./restore-topology.js";
|
|
36
40
|
// Only these edge kinds constrain launch order
|
|
37
41
|
const LAUNCH_DEPENDENCY_KINDS = new Set(["delegates_to", "spawned_by"]);
|
|
42
|
+
/** A subset launch's refusal (selection_changed) for a saved seat no current seat matches by both id and logical id. */
|
|
43
|
+
const SNAPSHOT_SEAT_CHANGED = "A snapshot seat was removed or recreated. Select history for the current seat.";
|
|
38
44
|
// OPR.0.5.7.1 consumer alignment: the four-way active-occupant ladder lives
|
|
39
45
|
// in the pure leaf module active-occupant.ts, shared with preview, snapshot
|
|
40
46
|
// usability, and lifecycle projection. Imported and re-exported here so the
|
|
@@ -48,8 +54,6 @@ import { pluginPathsOf } from "./claude-core-plugin-env.js";
|
|
|
48
54
|
import { seatLaunchAdditionsForLaunch, systemPromptPendingNoteForNode } from "./seat-launch-additions.js";
|
|
49
55
|
import { resolveSeatKind, seatProcessOwner } from "./seat-kinds.js";
|
|
50
56
|
export { resolveActiveSnapshotSession } from "./active-occupant.js";
|
|
51
|
-
/** Pre-restore blockers that concern one seat's own startup content; see restore(). */
|
|
52
|
-
const SEAT_STARTUP_BLOCKERS = new Set(["required_startup_file_missing", "startup_owner_root_missing"]);
|
|
53
57
|
export function rollupRestoreRigResult(nodes) {
|
|
54
58
|
if (nodes.length === 0)
|
|
55
59
|
return "failed";
|
|
@@ -62,6 +66,9 @@ export function rollupRestoreRigResult(nodes) {
|
|
|
62
66
|
// A seat running without part of its guidance keeps its own status; the rig isn't fully restored.
|
|
63
67
|
if (nodes.some((node) => (node.guidanceGaps?.length ?? 0) > 0))
|
|
64
68
|
return "partially_restored";
|
|
69
|
+
// A seat left in its external attachment wasn't restored here: the rig isn't fully restored, and the seat says why.
|
|
70
|
+
if (nodes.some((node) => node.status === "left_attached"))
|
|
71
|
+
return "partially_restored";
|
|
65
72
|
// Same for an unhealed restore gap (e.g. a current-selection re-apply
|
|
66
73
|
// that was skipped, failed, or threw): the seat runs, but the restore was not whole.
|
|
67
74
|
if (nodes.some((node) => (node.restoreGaps?.length ?? 0) > 0))
|
|
@@ -137,6 +144,14 @@ export function snapshotLaunchOutcome(data, nodeId, runtime, savedRuntime, resum
|
|
|
137
144
|
return { kind: "fresh", why: "records no resume source for this seat" };
|
|
138
145
|
return { kind: "resume" };
|
|
139
146
|
}
|
|
147
|
+
/** A restored seat's checkpoint file in its working directory, named for the seat, so seats restored into one folder (a
|
|
148
|
+
* run's `--cwd`, or a saved folder they share) each keep their own: the session name made safe for a file name, then the
|
|
149
|
+
* first 8 hex of the SHA-256 of the exact name. Names that become the same safe text (`alpha beta`, `alpha-beta`) or
|
|
150
|
+
* differ only in case (on a case-insensitive filesystem) still get different files; no name is refused. */
|
|
151
|
+
function checkpointFileName(sessionName) {
|
|
152
|
+
const digest = createHash("sha256").update(sessionName).digest("hex").slice(0, 8);
|
|
153
|
+
return `.rigged-checkpoint-${sessionName.replace(/[^A-Za-z0-9._@-]/g, "-")}-${digest}.md`;
|
|
154
|
+
}
|
|
140
155
|
export class RestoreOrchestrator {
|
|
141
156
|
db;
|
|
142
157
|
activeRestores = new Set();
|
|
@@ -163,6 +178,7 @@ export class RestoreOrchestrator {
|
|
|
163
178
|
routerLineSettings;
|
|
164
179
|
getDesiredClaudeActivityHooks;
|
|
165
180
|
appliedLaunchStore;
|
|
181
|
+
harnessNotStartedNotice;
|
|
166
182
|
constructor(deps) {
|
|
167
183
|
if (deps.db !== deps.rigRepo.db) {
|
|
168
184
|
throw new Error("RestoreOrchestrator: rigRepo must share the same db handle");
|
|
@@ -204,6 +220,7 @@ export class RestoreOrchestrator {
|
|
|
204
220
|
this.freshLaunchAvailable = deps.freshLaunchAvailable;
|
|
205
221
|
this.seatSkillSelection = deps.seatSkillSelection;
|
|
206
222
|
this.getDesiredClaudeActivityHooks = deps.getDesiredClaudeActivityHooks;
|
|
223
|
+
this.harnessNotStartedNotice = deps.harnessNotStartedNotice;
|
|
207
224
|
this.routerLineSettings = deps.routerLineSettings;
|
|
208
225
|
this.appliedLaunchStore = new AppliedLaunchObservationStore(deps.db);
|
|
209
226
|
}
|
|
@@ -274,16 +291,42 @@ export class RestoreOrchestrator {
|
|
|
274
291
|
}
|
|
275
292
|
this.activeRestores.add(rigId);
|
|
276
293
|
try {
|
|
294
|
+
const currentRuntimes = Object.fromEntries((this.rigRepo.getRig(rigId)?.nodes ?? []).map((current) => [current.logicalId, current.runtime]));
|
|
295
|
+
// One observation of the seat records for the shared-conversation report, before any restore mutation: the
|
|
296
|
+
// validation and the partner check below name every agent from it, so a stale session this restore then marks
|
|
297
|
+
// detached is not "running" in one warning and "detached" in the other (the maintainer's 3rd review of #3250).
|
|
298
|
+
// The sessions the classification above already found stale are named detached, the status this restore gives them.
|
|
299
|
+
const observed = this.observeConversationRecords(rigId, snapshot.data, opts?.freshLogicalIds, currentRuntimes, classification.stale);
|
|
277
300
|
const validation = validatePreRestore(snapshot.data, {
|
|
278
301
|
fsOps: opts?.fsOps,
|
|
279
302
|
servicesRecord: this.rigRepo.getServicesRecord(rigId),
|
|
280
303
|
freshLogicalIds: opts?.freshLogicalIds,
|
|
281
|
-
currentRuntimes
|
|
304
|
+
currentRuntimes,
|
|
282
305
|
currentCodexProfiles: Object.fromEntries((this.rigRepo.getRig(rigId)?.nodes ?? [])
|
|
283
306
|
.filter((current) => current.codexConfigProfile !== undefined)
|
|
284
307
|
.map((current) => [current.logicalId, current.codexConfigProfile])),
|
|
308
|
+
...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}),
|
|
309
|
+
currentStatuses: observed.currentStatuses,
|
|
310
|
+
attachedLogicalIds: observed.attachedLogicalIds,
|
|
285
311
|
});
|
|
286
312
|
const topology = resolveSnapshotRestoreTopology(snapshot.data);
|
|
313
|
+
// A seat that is still a node of this rig but isn't in the snapshot's intended roster isn't started by this restore:
|
|
314
|
+
// one claimed with rig bind or rig attach after the rig's topology was recorded, or one added or claimed after this
|
|
315
|
+
// snapshot was taken, so it isn't in the snapshot at all. It's named as skipped rather than filed as historical or left
|
|
316
|
+
// out, and the rig isn't fully restored. A roster the operator narrowed on purpose keeps the rest out without reading
|
|
317
|
+
// as a skip.
|
|
318
|
+
const liveNodes = this.rigRepo.getRig(rigId)?.nodes ?? [];
|
|
319
|
+
const liveNodeIds = new Set(liveNodes.map((current) => current.id));
|
|
320
|
+
const snapshotNodeIds = new Set(snapshot.data.nodes.map((node) => node.id));
|
|
321
|
+
const narrowedRoster = snapshot.data.topologyRoster?.source === "operator_explicit";
|
|
322
|
+
const excludedNodes = [
|
|
323
|
+
...topology.excludedNodes.map((excluded) => !narrowedRoster && liveNodeIds.has(excluded.nodeId)
|
|
324
|
+
? { ...excluded, reason: "current_seat_not_in_intended_roster" } : excluded),
|
|
325
|
+
...(narrowedRoster ? [] : liveNodes.filter((current) => !snapshotNodeIds.has(current.id)).map((current) => ({
|
|
326
|
+
nodeId: current.id, logicalId: current.logicalId, reason: "current_seat_not_in_intended_roster",
|
|
327
|
+
}))),
|
|
328
|
+
];
|
|
329
|
+
const skippedSeats = excludedNodes.filter((excluded) => excluded.reason === "current_seat_not_in_intended_roster");
|
|
287
330
|
// A required startup file that is missing holds only its own seat. That seat isn't launched, because it would start
|
|
288
331
|
// without its startup content; it's reported failed with the reason, and the rest of the rig restores. Any other
|
|
289
332
|
// blocker, or holds on every seat this restore would launch, still stops the whole restore before any mutation.
|
|
@@ -309,7 +352,7 @@ export class RestoreOrchestrator {
|
|
|
309
352
|
blockers: validation.blockers,
|
|
310
353
|
snapshotSelection,
|
|
311
354
|
intendedRoster: topology.intendedRoster,
|
|
312
|
-
excludedNodes
|
|
355
|
+
excludedNodes,
|
|
313
356
|
};
|
|
314
357
|
return {
|
|
315
358
|
ok: false,
|
|
@@ -336,7 +379,7 @@ export class RestoreOrchestrator {
|
|
|
336
379
|
snapshotId,
|
|
337
380
|
snapshotSelection,
|
|
338
381
|
intendedRoster: topology.intendedRoster,
|
|
339
|
-
excludedNodes
|
|
382
|
+
excludedNodes,
|
|
340
383
|
});
|
|
341
384
|
const attemptId = restoreStartedEvent.seq;
|
|
342
385
|
try {
|
|
@@ -364,7 +407,7 @@ export class RestoreOrchestrator {
|
|
|
364
407
|
warnings: [`Service boot failed: ${bootResult.error}`],
|
|
365
408
|
snapshotSelection,
|
|
366
409
|
intendedRoster: topology.intendedRoster,
|
|
367
|
-
excludedNodes
|
|
410
|
+
excludedNodes,
|
|
368
411
|
},
|
|
369
412
|
});
|
|
370
413
|
return { ok: false, code: "service_boot_failed", message: `Service boot failed before agent restore: ${bootResult.error}` };
|
|
@@ -377,6 +420,8 @@ export class RestoreOrchestrator {
|
|
|
377
420
|
// 5. Execute restore with compensating pattern per node
|
|
378
421
|
const nodeResults = [];
|
|
379
422
|
const restoreWarnings = [...validation.warnings];
|
|
423
|
+
const heldLogicalIds = snapshot.data.nodes.filter((node) => heldForStartup.has(node.id)).map((node) => node.logicalId);
|
|
424
|
+
restoreWarnings.push(...this.conversationPartners(rigId, snapshot.data, observed, opts?.freshLogicalIds, currentRuntimes, heldLogicalIds));
|
|
380
425
|
if (this.rigRepo.getRigNonInterruptive(rigId))
|
|
381
426
|
restoreWarnings.push(nonInterruptiveSummary(true));
|
|
382
427
|
else if (opts?.nonInterruptive === false)
|
|
@@ -394,16 +439,23 @@ export class RestoreOrchestrator {
|
|
|
394
439
|
restoreWarnings.push(`Stopped ${entry.node.logicalId}'s startup occupant for explicit replacement; replacement outcome: ${result.status}.`);
|
|
395
440
|
}
|
|
396
441
|
}
|
|
442
|
+
for (const skipped of skippedSeats) {
|
|
443
|
+
restoreWarnings.push(`Restore: ${skipped.logicalId} was skipped: it's a seat of this rig but not in this snapshot's intended roster (it was added or claimed after that roster was recorded), so restore didn't start it.`);
|
|
444
|
+
}
|
|
445
|
+
const rolledUp = rollupRestoreRigResult(nodeResults);
|
|
397
446
|
const restoreResult = {
|
|
398
447
|
snapshotId,
|
|
399
448
|
preRestoreSnapshotId: preRestoreSnapshot.id,
|
|
400
|
-
rigResult:
|
|
449
|
+
rigResult: rolledUp === "fully_restored" && skippedSeats.length > 0 ? "partially_restored" : rolledUp,
|
|
401
450
|
nodes: nodeResults,
|
|
402
451
|
warnings: restoreWarnings,
|
|
403
452
|
snapshotSelection,
|
|
404
453
|
intendedRoster: topology.intendedRoster,
|
|
405
|
-
excludedNodes
|
|
454
|
+
excludedNodes,
|
|
406
455
|
};
|
|
456
|
+
const notice = await this.noticeBareShells(rigId, `restore attempt ${attemptId}`, nodeResults, restoreWarnings);
|
|
457
|
+
if (notice)
|
|
458
|
+
restoreResult.harnessNotStarted = notice;
|
|
407
459
|
// 7. Emit restore.completed
|
|
408
460
|
this.eventBus.emit({ type: "restore.completed", rigId, snapshotId, result: restoreResult });
|
|
409
461
|
return { ok: true, result: restoreResult };
|
|
@@ -454,7 +506,19 @@ export class RestoreOrchestrator {
|
|
|
454
506
|
snapshotSelection: selected.selection,
|
|
455
507
|
targetNodes: intendedNodes
|
|
456
508
|
.filter((node) => targetIds.has(node.logicalId))
|
|
457
|
-
.map((node) =>
|
|
509
|
+
.map((node) => {
|
|
510
|
+
// The permission this launch will start the seat with: restore's own posture rule through the launch's resolver.
|
|
511
|
+
// Only the saved seat itself is read, matched as the launch matches it; a seat recreated under the same name
|
|
512
|
+
// (or none) reads unknown with the launch's own refusal, never the replacement's account.
|
|
513
|
+
const live = rig.nodes.find((candidate) => candidate.id === node.id && candidate.logicalId === node.logicalId);
|
|
514
|
+
if (live && seatProcessOwner(resolveSeatKind(live.binding?.attachmentType)) === "external") {
|
|
515
|
+
return { nodeId: node.id, logicalId: node.logicalId };
|
|
516
|
+
}
|
|
517
|
+
const seat = restorePermissionSeat(rig.rig.name, live ?? { id: node.id, logicalId: node.logicalId, runtime: node.runtime ?? null }, selected.snapshot, node.id);
|
|
518
|
+
return { nodeId: node.id, logicalId: node.logicalId,
|
|
519
|
+
permission: planRestorePermission(this.db, { ...seat, ...(live ? {} : { seatChanged: SNAPSHOT_SEAT_CHANGED }),
|
|
520
|
+
restorePosture: () => this.resolveRestorePosture(seat.nodeId, rigId) }) };
|
|
521
|
+
}),
|
|
458
522
|
unmatchedIds: logicalIds.filter((id) => !targetIds.has(id) && !targetNodeIds.has(id)),
|
|
459
523
|
nonTargetEffects,
|
|
460
524
|
};
|
|
@@ -489,7 +553,7 @@ export class RestoreOrchestrator {
|
|
|
489
553
|
if (targetNodes.length === 0)
|
|
490
554
|
return { ok: false, code: "no_matching_nodes", message: `No nodes match logical ids: ${logicalIds.join(", ")}` };
|
|
491
555
|
if (targetNodes.some(saved => !allNodes.some(current => current.id === saved.id && current.logicalId === saved.logicalId))) {
|
|
492
|
-
return { ok: false, code: "selection_changed", message:
|
|
556
|
+
return { ok: false, code: "selection_changed", message: SNAPSHOT_SEAT_CHANGED };
|
|
493
557
|
}
|
|
494
558
|
if (opts.selectedHistory && (targetNodes.length !== 1 || targetNodes[0].id !== opts.selectedHistory.nodeId
|
|
495
559
|
|| !allNodes.some(node => node.id === opts.selectedHistory.nodeId && node.logicalId === logicalIds[0]))) {
|
|
@@ -559,9 +623,12 @@ export class RestoreOrchestrator {
|
|
|
559
623
|
isUnknown = true;
|
|
560
624
|
}
|
|
561
625
|
}
|
|
626
|
+
// A live session that isn't proven to be a bare shell. Nothing here shows an agent is running in it, so the pane is
|
|
627
|
+
// kept and reported as a live session, never as a running agent.
|
|
562
628
|
if (isLive) {
|
|
563
|
-
if (opts.selectedHistory)
|
|
564
|
-
return { ok: false, code: "seat_running", message: "The selected seat
|
|
629
|
+
if (opts.selectedHistory) {
|
|
630
|
+
return { ok: false, code: "seat_running", message: "The selected seat has a live session (its agent isn't proven running); no resume was started." };
|
|
631
|
+
}
|
|
565
632
|
alreadyRunning.push({ nodeId: node.id, logicalId: node.logicalId });
|
|
566
633
|
continue;
|
|
567
634
|
}
|
|
@@ -612,21 +679,28 @@ export class RestoreOrchestrator {
|
|
|
612
679
|
if (opts.selectedHistory && !opts.selectedHistory.beforeEffect()) {
|
|
613
680
|
return { ok: false, code: "selection_changed", message: "The selected history or seat changed during terminal verification. No resume was started." };
|
|
614
681
|
}
|
|
615
|
-
const
|
|
682
|
+
const liveChoice = opts.selectedHistory?.currentChoices
|
|
683
|
+
? this.rigRepo.getRig(rigId)?.nodes.find(current => current.id === node.id) : undefined;
|
|
684
|
+
const currentEffort = liveChoice ? readSeatEffort(this.db, liveChoice.id) : null;
|
|
685
|
+
const planEntry = { node: liveChoice ? { ...node, cwd: liveChoice.cwd, model: liveChoice.model,
|
|
686
|
+
effort: currentEffort?.effective ?? null, effortChoice: currentEffort?.choice ?? null } : node };
|
|
616
687
|
const result = await this.restoreNodeWithCompensation(planEntry, rigId, snapshot.id, snapshot.data, { adapters: opts?.adapters, fsOps: opts?.fsOps, selectedHistory: opts.selectedHistory, resumePeriodicCarry }, subsetWarnings);
|
|
617
688
|
launched.push(result);
|
|
618
689
|
}
|
|
619
690
|
// Emit restore.subset_completed for launched targets only
|
|
691
|
+
let harnessNotStarted;
|
|
620
692
|
if (launched.length > 0) {
|
|
621
693
|
const subsetResult = {
|
|
622
694
|
snapshotId: snapshot.id,
|
|
623
695
|
preRestoreSnapshotId: null,
|
|
624
696
|
rigResult: rollupRestoreRigResult(launched),
|
|
625
697
|
nodes: launched,
|
|
626
|
-
|
|
698
|
+
// A copy: the notice below adds its warnings to the launch's result, not to the event already emitted.
|
|
699
|
+
warnings: [...subsetWarnings],
|
|
627
700
|
snapshotSelection,
|
|
628
701
|
};
|
|
629
|
-
this.eventBus.emit({ type: "restore.subset_completed", rigId, snapshotId: snapshot.id, result: subsetResult });
|
|
702
|
+
const completed = this.eventBus.emit({ type: "restore.subset_completed", rigId, snapshotId: snapshot.id, result: subsetResult });
|
|
703
|
+
harnessNotStarted = await this.noticeBareShells(rigId, `launch attempt ${completed.seq}`, launched, subsetWarnings);
|
|
630
704
|
}
|
|
631
705
|
// Emit node.held for non-running held non-targets (tri-state: running/unknown/held)
|
|
632
706
|
const held = [];
|
|
@@ -675,6 +749,7 @@ export class RestoreOrchestrator {
|
|
|
675
749
|
unmatchedIds: unmatchedIds.length > 0 ? unmatchedIds : undefined,
|
|
676
750
|
warnings: subsetWarnings.length > 0 ? subsetWarnings : undefined,
|
|
677
751
|
snapshotSelection,
|
|
752
|
+
...(harnessNotStarted ? { harnessNotStarted } : {}),
|
|
678
753
|
nonTargetEffects: {
|
|
679
754
|
mode: opts.nonTargetMode,
|
|
680
755
|
reason: opts.nonTargetMode === "detach_and_hold" ? holdReasonText : null,
|
|
@@ -811,6 +886,81 @@ export class RestoreOrchestrator {
|
|
|
811
886
|
this.sessionRegistry.updateStatus(sess.id, sess.status);
|
|
812
887
|
}
|
|
813
888
|
}
|
|
889
|
+
/**
|
|
890
|
+
* #3218 item 3 (B1 of its review; points 3 to 5 of the maintainer's): the agents this restore resumes, compared with
|
|
891
|
+
* the known agents outside it, with their recorded status (in this rig outside a replacement's selection, kept
|
|
892
|
+
* attached to an external CLI or held for startup, or in another rig), from the same rigs rig restore-check reads: the
|
|
893
|
+
* listed ones, archived rigs left out. Named in the restore's warnings; nothing is refused, stopped or picked, and an
|
|
894
|
+
* inventory that cannot be read says the comparison is unavailable. Every status comes from the one observation taken
|
|
895
|
+
* before the restore changed anything (observeConversationRecords).
|
|
896
|
+
*/
|
|
897
|
+
conversationPartners(rigId, data, observed, freshLogicalIds, currentRuntimes, heldLogicalIds) {
|
|
898
|
+
const resuming = resumingConversationSeats(data, { freshLogicalIds, currentRuntimes, currentStatuses: observed.currentStatuses,
|
|
899
|
+
attachedLogicalIds: observed.attachedLogicalIds, heldLogicalIds });
|
|
900
|
+
if (!resuming.some(pairableConversation))
|
|
901
|
+
return [];
|
|
902
|
+
if (observed.inventory === null) {
|
|
903
|
+
return [`Restore pre-validation: the shared-conversation comparison with agents outside this restore is unavailable (${observed.unavailable}).`];
|
|
904
|
+
}
|
|
905
|
+
// Left out: only the seats restore launches. One kept attached to an external CLI (left_attached) stays running
|
|
906
|
+
// with its conversation, and one held for startup keeps its current session: both are compared as agents outside
|
|
907
|
+
// the restore (the maintainer's reviews of #3250).
|
|
908
|
+
const launched = new Set(resolveSnapshotRestoreTopology(data).intendedNodes.map((node) => node.logicalId)
|
|
909
|
+
.filter((logicalId) => !observed.attachedLogicalIds.includes(logicalId) && !heldLogicalIds.includes(logicalId)));
|
|
910
|
+
const others = observed.inventory
|
|
911
|
+
.filter((entry) => !(entry.rigId === rigId && launched.has(entry.logicalId)) && holdsRecordedConversation(entry))
|
|
912
|
+
.map((entry) => ({
|
|
913
|
+
seat: entry.canonicalSessionName ?? `${entry.logicalId}@${entry.rigName}`,
|
|
914
|
+
state: entry.sessionStatus ?? "unknown",
|
|
915
|
+
resumeType: entry.resumeType,
|
|
916
|
+
resumeToken: entry.resumeToken,
|
|
917
|
+
}));
|
|
918
|
+
const rigName = data.rig?.name ?? rigId;
|
|
919
|
+
return describePartners(resuming.map((entry) => ({ ...entry, seat: `${entry.seat}@${rigName}` })), others)
|
|
920
|
+
.map((warning) => `Restore pre-validation: ${warning}`);
|
|
921
|
+
}
|
|
922
|
+
/** The one observation of the seat records the shared-conversation report names (#3250, the maintainer's 3rd
|
|
923
|
+
* review), taken before any restore mutation: the seats kept attached to an external CLI, from their bindings (the
|
|
924
|
+
* record that makes restore leave them running, left_attached, instead of launching them), and, only when this
|
|
925
|
+
* restore would resume a seat with a recorded conversation it can pair (pairableConversation), ONE read of the node inventory of the listed rigs and
|
|
926
|
+
* this rig (an archived rig's restore inclusive): this rig's seats' sessionStatus and the partners' records. A seat of
|
|
927
|
+
* this rig whose current session is recorded running and was found stale by classifyRunningSessions (no tmux session)
|
|
928
|
+
* is named detached, the status this restore gives it before it launches anything, so the report never calls it
|
|
929
|
+
* running. An inventory that cannot be read leaves the partner comparison unavailable; this rig's own statuses then
|
|
930
|
+
* come from a read of this rig alone ("unknown" when that fails too). */
|
|
931
|
+
observeConversationRecords(rigId, data, freshLogicalIds, currentRuntimes, staleSessionIds) {
|
|
932
|
+
const attachedLogicalIds = (this.rigRepo.getRig(rigId)?.nodes ?? [])
|
|
933
|
+
.filter((node) => seatProcessOwner(resolveSeatKind(this.sessionRegistry.getBindingForNode(node.id)?.attachmentType)) === "external")
|
|
934
|
+
.map((node) => node.logicalId);
|
|
935
|
+
if (!resumingConversationSeats(data, { freshLogicalIds, currentRuntimes, attachedLogicalIds }).some(pairableConversation)) {
|
|
936
|
+
return { currentStatuses: {}, attachedLogicalIds, inventory: [] };
|
|
937
|
+
}
|
|
938
|
+
const staleIds = new Set(staleSessionIds);
|
|
939
|
+
// An inventory entry is its node's newest session (node-inventory's ORDER BY id DESC). It is named detached only
|
|
940
|
+
// when that session is a stale one, not when an older session of the node is.
|
|
941
|
+
const newestByNode = new Map();
|
|
942
|
+
for (const session of this.sessionRegistry.getSessionsForRig(rigId)) {
|
|
943
|
+
const newest = newestByNode.get(session.nodeId);
|
|
944
|
+
if (newest === undefined || session.id > newest)
|
|
945
|
+
newestByNode.set(session.nodeId, session.id);
|
|
946
|
+
}
|
|
947
|
+
const staleNodeIds = new Set([...newestByNode].filter(([, sessionId]) => staleIds.has(sessionId)).map(([nodeId]) => nodeId));
|
|
948
|
+
const labelled = (entry) => entry.rigId === rigId && entry.sessionStatus === "running" && staleNodeIds.has(entry.nodeId) ? { ...entry, sessionStatus: "detached" } : entry;
|
|
949
|
+
const statusesOf = (entries) => Object.fromEntries(entries.map((entry) => [entry.logicalId, entry.sessionStatus ?? null]));
|
|
950
|
+
try {
|
|
951
|
+
const byRig = getNodeInventoryForRigs(this.db, new Set([...this.rigRepo.listRigs().map((rig) => rig.id), rigId]));
|
|
952
|
+
const inventory = [...byRig.values()].flat().map(labelled);
|
|
953
|
+
return { currentStatuses: statusesOf(inventory.filter((entry) => entry.rigId === rigId)), attachedLogicalIds, inventory };
|
|
954
|
+
}
|
|
955
|
+
catch (err) {
|
|
956
|
+
let currentStatuses = {};
|
|
957
|
+
try {
|
|
958
|
+
currentStatuses = statusesOf((getNodeInventoryForRigs(this.db, new Set([rigId])).get(rigId) ?? []).map(labelled));
|
|
959
|
+
}
|
|
960
|
+
catch { /* every seat "unknown" */ }
|
|
961
|
+
return { currentStatuses, attachedLogicalIds, inventory: null, unavailable: err instanceof Error ? err.message : String(err) };
|
|
962
|
+
}
|
|
963
|
+
}
|
|
814
964
|
computeRestorePlan(data) {
|
|
815
965
|
const nodes = resolveSnapshotRestoreTopology(data).intendedNodes;
|
|
816
966
|
const edges = data.edges;
|
|
@@ -888,6 +1038,9 @@ export class RestoreOrchestrator {
|
|
|
888
1038
|
* Preserve prior state so a failed launch or resume can be compensated.
|
|
889
1039
|
*/
|
|
890
1040
|
async restoreNodeWithCompensation(entry, rigId, snapshotId, data, opts, warnings, preserveStoppedCurrent = false) {
|
|
1041
|
+
// `--cwd`: the seat launches, resumes and gets its guidance and checkpoint in the given directory, for this run only.
|
|
1042
|
+
if (opts?.cwdOverride)
|
|
1043
|
+
entry = { ...entry, node: { ...entry.node, cwd: opts.cwdOverride } };
|
|
891
1044
|
// Compare against the live logical target without changing saved post-launch inputs.
|
|
892
1045
|
const node = entry.node;
|
|
893
1046
|
// Activity-hook restore gaps (#1530) are collected out-of-band: postLaunchRestore
|
|
@@ -907,6 +1060,13 @@ export class RestoreOrchestrator {
|
|
|
907
1060
|
if (external && seatProcessOwner(resolveSeatKind(external.attachmentType)) === "external") {
|
|
908
1061
|
return { nodeId, logicalId: node.logicalId, status: "left_attached", error: leftAttachedReason(external.externalSessionName ?? node.logicalId), ...notStarted };
|
|
909
1062
|
}
|
|
1063
|
+
// A seat's saved directory that isn't on this machine (a workspace restored onto another home) is named plainly, with
|
|
1064
|
+
// the way to launch elsewhere; nothing is refused here, and the launch below goes on as before.
|
|
1065
|
+
const savedCwd = node.cwd ?? liveNode?.cwd;
|
|
1066
|
+
if (!opts?.cwdOverride && savedCwd && isAbsolute(savedCwd) && opts?.fsOps && !opts.fsOps.exists(savedCwd)) {
|
|
1067
|
+
warnings?.push(`Restore: ${node.logicalId}'s working directory ${savedCwd} doesn't exist on this machine. To launch this rig's `
|
|
1068
|
+
+ `seats in another directory for this run: rig up ${data.rig?.name ?? rigId} --existing --cwd <dir>.`);
|
|
1069
|
+
}
|
|
910
1070
|
// OPR.0.5.7.1 (bought ordering blocker, baton 0efd154d): D1 present-map
|
|
911
1071
|
// ambiguity must be DETECTED before any continuity_state short-circuit —
|
|
912
1072
|
// a pod node in 'restoring' otherwise returns a silent status "fresh"
|
|
@@ -1066,16 +1226,22 @@ export class RestoreOrchestrator {
|
|
|
1066
1226
|
// derive (below) is observable, never a silent divergence.
|
|
1067
1227
|
const pinnedTarget = priorState.binding?.tmuxSession ?? null;
|
|
1068
1228
|
let pinnedTargetUsed = false;
|
|
1229
|
+
let unusablePin = null;
|
|
1069
1230
|
if (pinnedTarget) {
|
|
1070
|
-
const { validateSessionName } = await import("./session-name.js");
|
|
1071
|
-
|
|
1231
|
+
const { boundSessionNameProblem, validateSessionName } = await import("./session-name.js");
|
|
1232
|
+
// An adopted seat is bound to its own tmux session's name, which need not follow OpenRig's pattern. It is kept
|
|
1233
|
+
// when tmux and OpenRig's addressing both keep it as given, so the seat comes back at the address its peers use.
|
|
1234
|
+
const conventional = validateSessionName(pinnedTarget);
|
|
1235
|
+
const problem = conventional ? null : boundSessionNameProblem(pinnedTarget);
|
|
1236
|
+
if (!problem) {
|
|
1072
1237
|
expectedSessionName = pinnedTarget;
|
|
1073
|
-
launchOpts = { ...launchOpts, sessionName: expectedSessionName };
|
|
1238
|
+
launchOpts = { ...launchOpts, sessionName: expectedSessionName, ...(conventional ? {} : { keepsBoundSessionName: true }) };
|
|
1074
1239
|
pinnedTargetUsed = true;
|
|
1075
1240
|
}
|
|
1076
1241
|
else {
|
|
1077
|
-
// Binding present but the bound name
|
|
1078
|
-
|
|
1242
|
+
// Binding present but the bound name can't be launched again as given: the seat gets a derived address, said
|
|
1243
|
+
// old to new below.
|
|
1244
|
+
unusablePin = { name: pinnedTarget, problem };
|
|
1079
1245
|
}
|
|
1080
1246
|
}
|
|
1081
1247
|
else {
|
|
@@ -1105,6 +1271,11 @@ export class RestoreOrchestrator {
|
|
|
1105
1271
|
expectedSessionName = deriveSessionName(rig.rig.name, node.logicalId);
|
|
1106
1272
|
}
|
|
1107
1273
|
}
|
|
1274
|
+
if (unusablePin) {
|
|
1275
|
+
// Said before the launch, so it names the attempt: the launch below may still fail and put the prior state back.
|
|
1276
|
+
const planned = expectedSessionName ? `"${expectedSessionName}"` : "a derived session name";
|
|
1277
|
+
warnings?.push(`FR-5: restore starts ${node.logicalId} as ${planned}, not "${unusablePin.name}", the session name it was bound to: ${unusablePin.problem}. Once it runs there, peers that address "${unusablePin.name}" need ${planned}.`);
|
|
1278
|
+
}
|
|
1108
1279
|
// Write transcript boundary marker BEFORE launch (before pipe-pane attaches)
|
|
1109
1280
|
// so the marker appears before any post-restore terminal output.
|
|
1110
1281
|
// Uses "restore attempt" language — honest even if launch subsequently fails.
|
|
@@ -1185,6 +1356,9 @@ export class RestoreOrchestrator {
|
|
|
1185
1356
|
const onSessionLaunched = opts?.onSessionLaunched;
|
|
1186
1357
|
const launchResult = await this.nodeLauncher.launchNode(rigId, node.logicalId, {
|
|
1187
1358
|
...launchOpts,
|
|
1359
|
+
// #3253: a restore or resume is a recovery: nothing of the seat runs, so a limit that can't be applied doesn't stop
|
|
1360
|
+
// it. It goes ahead with a structured warning, and the request stays stored for a fresh launch to apply.
|
|
1361
|
+
processLimitsMode: "recovery",
|
|
1188
1362
|
...(selectedHistory ? { expectedNodeId: nodeId, beforeEffect: selectedHistory.beforeNative,
|
|
1189
1363
|
beforeRegistration: selectedHistory.beforeRegistration } : {}),
|
|
1190
1364
|
...(savedStartup ? { pluginPaths: pluginPathsOf(savedStartup.projectionEntries) } : {}),
|
|
@@ -1218,7 +1392,9 @@ export class RestoreOrchestrator {
|
|
|
1218
1392
|
const restored = await this.postLaunchRestore(entry, rigId, data, launchResult.sessionName, launchResult, { ...opts, ...(claudeExecutable ? { claudeExecutable } : {}), ...(claudeLaunch ? { claudeLaunch } : {}), compensation }, warnings, priorState, seatRehydration, resumeSession, activityHookGaps, restoredSkillCatalog);
|
|
1219
1393
|
const checked = { ...this.checkRestoredGuidance(restored, entry.node, rigId, data, warnings),
|
|
1220
1394
|
...(activityHookGaps.length > 0 ? { restoreGaps: activityHookGaps } : {}),
|
|
1221
|
-
...(keptPane ? { launchStarted: true } : {})
|
|
1395
|
+
...(keptPane ? { launchStarted: true } : {}),
|
|
1396
|
+
// #3253: the provisional shell's notice, unless a replacement retired it and reported its own (the key is set).
|
|
1397
|
+
...(launchResult.processLimits && !("processLimits" in restored) ? { processLimits: launchResult.processLimits } : {}) };
|
|
1222
1398
|
return selectedHistory ? { ...checked, sourceSessionId: selectedHistory.historySessionId, resultSessionId: launchResult.session.id,
|
|
1223
1399
|
...(compensation.ran ? { compensated: true } : {}) } : checked;
|
|
1224
1400
|
}
|
|
@@ -1442,20 +1618,23 @@ export class RestoreOrchestrator {
|
|
|
1442
1618
|
* reused pane), mark its row superseded, and restore the prior state (the existing
|
|
1443
1619
|
* launch-failure compensating action). The caller fires this ONLY on a
|
|
1444
1620
|
* POSITIVE determination the session is fresh/blank — never for
|
|
1445
|
-
* unknown-but-possibly-valid continuity.
|
|
1621
|
+
* unknown-but-possibly-valid continuity. When tmux doesn't confirm the stop, the session may still be running, so
|
|
1622
|
+
* its row and binding are left as they are and the result says the stop is unconfirmed. */
|
|
1446
1623
|
async rollbackToZeroSession(nodeId, sessionName, launchedSessionId, priorState, assertCurrent, keepPane = false) {
|
|
1447
1624
|
if (assertCurrent && !assertCurrent())
|
|
1448
1625
|
return { rolledBack: false, terminalStopped: false };
|
|
1449
|
-
// Whether tmux confirmed the stop
|
|
1626
|
+
// Whether tmux confirmed the stop. A kept pane isn't stopped.
|
|
1450
1627
|
let terminalStopped = false;
|
|
1451
1628
|
if (!keepPane) {
|
|
1452
1629
|
try {
|
|
1453
1630
|
terminalStopped = (await this.tmuxAdapter.killSession(sessionName)).ok === true;
|
|
1454
1631
|
}
|
|
1455
|
-
catch { /*
|
|
1632
|
+
catch { /* an unconfirmed stop, the same as a refused one */ }
|
|
1456
1633
|
}
|
|
1457
1634
|
if (assertCurrent && !assertCurrent())
|
|
1458
1635
|
return { rolledBack: false, terminalStopped };
|
|
1636
|
+
if (!keepPane && !terminalStopped)
|
|
1637
|
+
return { rolledBack: false, terminalStopped, stopUnconfirmed: true };
|
|
1459
1638
|
if (launchedSessionId) {
|
|
1460
1639
|
try {
|
|
1461
1640
|
this.sessionRegistry.updateStatus(launchedSessionId, "superseded");
|
|
@@ -1468,6 +1647,36 @@ export class RestoreOrchestrator {
|
|
|
1468
1647
|
}
|
|
1469
1648
|
return { rolledBack: true, terminalStopped };
|
|
1470
1649
|
}
|
|
1650
|
+
/** The notice for the seats an attempt positively left as bare shells, each with its own cause. Its warnings join the
|
|
1651
|
+
* attempt's, and a failure to send it is a warning too: it never changes or blocks the attempt's own result. Seats not
|
|
1652
|
+
* positively left as shells stay in the roll call. */
|
|
1653
|
+
async noticeBareShells(rigId, attempt, results, warnings) {
|
|
1654
|
+
const shells = results.filter((n) => n.stage === "harness_not_started");
|
|
1655
|
+
if (shells.length === 0 || !this.harnessNotStartedNotice)
|
|
1656
|
+
return undefined;
|
|
1657
|
+
try {
|
|
1658
|
+
// The launcher finds a seat by its logical id in the live rig, so a seat recreated since the snapshot was launched
|
|
1659
|
+
// under its live node, while its result keeps the snapshot's node id: the notice reads the node the shell is on.
|
|
1660
|
+
const liveNodes = this.rigRepo.getRig(rigId)?.nodes ?? [];
|
|
1661
|
+
const seats = shells.map(({ nodeId, logicalId, error }) => ({ nodeId: liveNodes.find((node) => node.logicalId === logicalId)?.id ?? nodeId,
|
|
1662
|
+
logicalId, ...(error ? { cause: error } : {}) }));
|
|
1663
|
+
const report = await this.harnessNotStartedNotice({ rigId, attempt, seats });
|
|
1664
|
+
for (const warning of report.warnings ?? [])
|
|
1665
|
+
warnings.push(`Restore: ${warning}`);
|
|
1666
|
+
return report;
|
|
1667
|
+
}
|
|
1668
|
+
catch (err) {
|
|
1669
|
+
warnings.push(`Restore: the notice for the seats left as a bare shell wasn't recorded (${err instanceof Error ? err.message : String(err)}).`);
|
|
1670
|
+
return undefined;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
/** Restore left this pane as a bare shell, which the launcher registered as a running session. Mark that session, with
|
|
1674
|
+
* the stage that says no harness started, so nothing counts the shell as a running seat. Nothing is stopped. The node
|
|
1675
|
+
* is the session's own: a seat recreated since the snapshot is launched under its live node. */
|
|
1676
|
+
markHarnessNotStarted(rigId, nodeId, sessionId, error) {
|
|
1677
|
+
this.sessionRegistry.updateStartupStatus(sessionId, "attention_required");
|
|
1678
|
+
this.eventBus.emit({ type: "node.startup_failed", rigId, nodeId, error, sessionId, stage: "harness_not_started" });
|
|
1679
|
+
}
|
|
1471
1680
|
/** Retire only the provisional session created by this restore attempt. The prior
|
|
1472
1681
|
* binding must stay cleared while a replacement launch is handed off. */
|
|
1473
1682
|
async retireProvisionalSession(nodeId, sessionName, launchedSessionId) {
|
|
@@ -1553,15 +1762,19 @@ export class RestoreOrchestrator {
|
|
|
1553
1762
|
// row ordering (cite site 2 of 2; "latest = max id" was the incident's
|
|
1554
1763
|
// defect: a superseded row with a newer ULID defeated the real occupant).
|
|
1555
1764
|
const selected = opts?.selectedHistory;
|
|
1765
|
+
/** Rolls this restore's blank session back; null when it did, else the result the restore reports instead. */
|
|
1556
1766
|
const rollbackOwnBlank = async () => {
|
|
1557
|
-
const { rolledBack, terminalStopped } = await this.rollbackToZeroSession(node.id, sessionName, launchResult?.session.id, priorState, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined, opts?.keepPane);
|
|
1767
|
+
const { rolledBack, terminalStopped, stopUnconfirmed } = await this.rollbackToZeroSession(node.id, sessionName, launchResult?.session.id, priorState, selected ? () => selected.beforeNative(launchResult?.session.id, launchResult?.binding.id) : undefined, opts?.keepPane);
|
|
1558
1768
|
// Known compensation: tmux confirmed the terminal stopped, and the earlier state was put back.
|
|
1559
1769
|
if (rolledBack && terminalStopped && priorState && !opts?.keepPane && opts?.compensation)
|
|
1560
1770
|
opts.compensation.ran = true;
|
|
1561
|
-
|
|
1771
|
+
if (rolledBack)
|
|
1772
|
+
return null;
|
|
1773
|
+
return stopUnconfirmed ? { nodeId: node.id, logicalId: node.logicalId, status: "attention_required",
|
|
1774
|
+
error: `Original session unresumable, and the blank session this restore launched couldn't be confirmed stopped: it may still be running, so its session record and binding were left in place. Check it with rig capture ${sessionName}, stop it with ${this.stopSeatCommand(rigId, data, node.logicalId)}, then retry the restore.` }
|
|
1775
|
+
: { nodeId: node.id, logicalId: node.logicalId, status: "attention_required",
|
|
1776
|
+
error: "The selected terminal or source changed during cleanup. Its current owner was preserved; inspect the partial launch before retrying." };
|
|
1562
1777
|
};
|
|
1563
|
-
const changedDuringRollback = () => ({ nodeId: node.id, logicalId: node.logicalId,
|
|
1564
|
-
status: "attention_required", error: "The selected terminal or source changed during cleanup. Its current owner was preserved; inspect the partial launch before retrying." });
|
|
1565
1778
|
const selectedRows = selected ? data.sessions.filter(row => row.nodeId === node.id && row.id === selected.historySessionId) : [];
|
|
1566
1779
|
const sessionResolution = selected
|
|
1567
1780
|
? selectedRows.length === 1 ? { kind: "resolved", session: selectedRows[0] } : { kind: "none" }
|
|
@@ -1633,7 +1846,9 @@ export class RestoreOrchestrator {
|
|
|
1633
1846
|
const recoveryRuntime = startupCtx?.runtime
|
|
1634
1847
|
?? (!isPodAware && liveRuntime === node.runtime ? node.runtime : null);
|
|
1635
1848
|
if (resumeRequested && resumeToken && launchResult && recoveryRuntime === "claude-code") {
|
|
1636
|
-
|
|
1849
|
+
// The saved hooks resource ships under the install's specs: read it from the running install, as replay does.
|
|
1850
|
+
const entries = (startupCtx?.projectionEntries ?? []).filter(e => e.category === "runtime_resource" && e.resourceType === "claude_activity_hooks")
|
|
1851
|
+
.map((e) => reanchorShippedProjectionEntry(e, undefined, opts?.fsOps?.exists ?? (() => true)));
|
|
1637
1852
|
if (entries.length > 0 && activityAdapter)
|
|
1638
1853
|
try {
|
|
1639
1854
|
const result = await activityAdapter.project({
|
|
@@ -1756,8 +1971,11 @@ export class RestoreOrchestrator {
|
|
|
1756
1971
|
// before any session exists. If it is somehow reached post-launch, the
|
|
1757
1972
|
// just-created session is a confirmed blank (no resume was possible) —
|
|
1758
1973
|
// roll back to zero sessions and present the decision honestly.
|
|
1759
|
-
|
|
1760
|
-
|
|
1974
|
+
{
|
|
1975
|
+
const kept = await rollbackOwnBlank();
|
|
1976
|
+
if (kept)
|
|
1977
|
+
return kept;
|
|
1978
|
+
}
|
|
1761
1979
|
return { nodeId: node.id, logicalId: node.logicalId, status: "awaiting-decision", error: `Original session unresumable: resume requested but no token available. No session is running. Restore the original session manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.` };
|
|
1762
1980
|
}
|
|
1763
1981
|
else {
|
|
@@ -1803,8 +2021,11 @@ export class RestoreOrchestrator {
|
|
|
1803
2021
|
// OPR.0.3.4.2 (B): resume CONCLUDED failed — the launched session is
|
|
1804
2022
|
// a confirmed blank agent (precision guard trigger (i)). Roll back to
|
|
1805
2023
|
// zero sessions; the stop-and-ask is realized as awaiting-decision.
|
|
1806
|
-
|
|
1807
|
-
|
|
2024
|
+
{
|
|
2025
|
+
const kept = await rollbackOwnBlank();
|
|
2026
|
+
if (kept)
|
|
2027
|
+
return kept;
|
|
2028
|
+
}
|
|
1808
2029
|
return { nodeId: node.id, logicalId: node.logicalId, status: "awaiting-decision", error: `Original session unresumable: resume attempted but failed. The blank session was rolled back; no session is running. Check the harness state manually, or deliberately start only this seat fresh: ${this.freshSeatCommand(rigId, data, node.logicalId)}.` };
|
|
1809
2030
|
}
|
|
1810
2031
|
}
|
|
@@ -1815,8 +2036,11 @@ export class RestoreOrchestrator {
|
|
|
1815
2036
|
// instead of silently downgrading to a fresh launch with amnesia.
|
|
1816
2037
|
if (!resumeToken) {
|
|
1817
2038
|
// Defense in depth (pre-launch classification catches this first).
|
|
1818
|
-
|
|
1819
|
-
|
|
2039
|
+
{
|
|
2040
|
+
const kept = await rollbackOwnBlank();
|
|
2041
|
+
if (kept)
|
|
2042
|
+
return kept;
|
|
2043
|
+
}
|
|
1820
2044
|
return {
|
|
1821
2045
|
nodeId: node.id,
|
|
1822
2046
|
logicalId: node.logicalId,
|
|
@@ -1832,8 +2056,11 @@ export class RestoreOrchestrator {
|
|
|
1832
2056
|
// Explicit --fresh and non-resume policies stay the only fresh-prime paths.
|
|
1833
2057
|
const resumeAdapter = seatAdapter(opts?.adapters, node.runtime, session?.communityHarness);
|
|
1834
2058
|
if (!resumeAdapter) {
|
|
1835
|
-
|
|
1836
|
-
|
|
2059
|
+
{
|
|
2060
|
+
const kept = await rollbackOwnBlank();
|
|
2061
|
+
if (kept)
|
|
2062
|
+
return kept;
|
|
2063
|
+
}
|
|
1837
2064
|
return {
|
|
1838
2065
|
nodeId: node.id,
|
|
1839
2066
|
logicalId: node.logicalId,
|
|
@@ -1847,7 +2074,7 @@ export class RestoreOrchestrator {
|
|
|
1847
2074
|
if (!node.cwd) {
|
|
1848
2075
|
return { nodeId: node.id, logicalId: node.logicalId, status: "failed", error: "Checkpoint available but node has no cwd" };
|
|
1849
2076
|
}
|
|
1850
|
-
const written = this.writeCheckpointFile(node.cwd, checkpoint);
|
|
2077
|
+
const written = this.writeCheckpointFile(node.cwd, sessionName, checkpoint);
|
|
1851
2078
|
if (written) {
|
|
1852
2079
|
baseStatus = "rebuilt";
|
|
1853
2080
|
}
|
|
@@ -1911,7 +2138,8 @@ export class RestoreOrchestrator {
|
|
|
1911
2138
|
if (this.freshLaunchAvailable && !this.freshLaunchAvailable(rigId, node.id)) {
|
|
1912
2139
|
const error = `Harness not started: no usable persisted launch recipe for ${node.logicalId}.`;
|
|
1913
2140
|
warnings?.push(`Restore: ${error}`);
|
|
1914
|
-
|
|
2141
|
+
this.markHarnessNotStarted(rigId, launchResult.session.nodeId, launchResult.session.id, error);
|
|
2142
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error, stage: "harness_not_started" };
|
|
1915
2143
|
}
|
|
1916
2144
|
const retired = await this.retireProvisionalSession(node.id, sessionName, launchResult.session.id);
|
|
1917
2145
|
if (!retired.ok) {
|
|
@@ -1923,15 +2151,21 @@ export class RestoreOrchestrator {
|
|
|
1923
2151
|
&& candidate.status === "running"
|
|
1924
2152
|
&& candidate.id !== launchResult.session.id);
|
|
1925
2153
|
try {
|
|
1926
|
-
|
|
2154
|
+
// #3253: this replaces the provisional shell of a restore, so it is a recovery too: a limit that can't be
|
|
2155
|
+
// applied doesn't stop the seat, and its notice is the node's. The replacement launches where the provisional
|
|
2156
|
+
// shell did: this run's `--cwd`, else the saved folder.
|
|
2157
|
+
const fresh = await this.freshLaunch(rigId, node.id, { processLimitsMode: "recovery", ...(opts?.cwdOverride ? { cwdOverride: opts.cwdOverride } : {}) });
|
|
1927
2158
|
if (fresh.warnings?.length)
|
|
1928
2159
|
warnings?.push(...fresh.warnings);
|
|
2160
|
+
// The replacement's own outcome, also when it applied the limit (no notice): the retired provisional shell's
|
|
2161
|
+
// notice no longer describes the seat (the key is set either way, so the caller doesn't fall back to it).
|
|
2162
|
+
const limits = { processLimits: fresh.processLimits };
|
|
1929
2163
|
if (fresh.status === "launched") {
|
|
1930
|
-
return { nodeId: node.id, logicalId: node.logicalId, status: "fresh-primed" };
|
|
2164
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "fresh-primed", ...limits };
|
|
1931
2165
|
}
|
|
1932
2166
|
if (priorState && !replacementExists())
|
|
1933
2167
|
this.restoreNodeState(node.id, priorState);
|
|
1934
|
-
return { nodeId: node.id, logicalId: node.logicalId, status: fresh.status, error: fresh.error };
|
|
2168
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: fresh.status, error: fresh.error, ...limits };
|
|
1935
2169
|
}
|
|
1936
2170
|
catch (err) {
|
|
1937
2171
|
if (priorState && !replacementExists())
|
|
@@ -1940,6 +2174,7 @@ export class RestoreOrchestrator {
|
|
|
1940
2174
|
nodeId: node.id,
|
|
1941
2175
|
logicalId: node.logicalId,
|
|
1942
2176
|
status: "failed",
|
|
2177
|
+
processLimits: undefined,
|
|
1943
2178
|
error: `Fresh launch failed: ${err.message}`,
|
|
1944
2179
|
};
|
|
1945
2180
|
}
|
|
@@ -1947,7 +2182,8 @@ export class RestoreOrchestrator {
|
|
|
1947
2182
|
const cause = replayCtx ? `no ${startupRuntime} runtime adapter` : "no startup context";
|
|
1948
2183
|
const error = `Harness not started: ${cause} for ${node.logicalId}.`;
|
|
1949
2184
|
warnings?.push(`Restore: ${error}`);
|
|
1950
|
-
|
|
2185
|
+
this.markHarnessNotStarted(rigId, launchResult.session.nodeId, launchResult.session.id, error);
|
|
2186
|
+
return { nodeId: node.id, logicalId: node.logicalId, status: "attention_required", error, stage: "harness_not_started" };
|
|
1951
2187
|
}
|
|
1952
2188
|
// Attempt restore-safe startup replay if context available
|
|
1953
2189
|
if ((data.nodeStartupContext || replayCtx) && opts?.adapters && launchResult) {
|
|
@@ -2086,8 +2322,11 @@ export class RestoreOrchestrator {
|
|
|
2086
2322
|
// ONLY on the concluded-fresh determination; a genuinely
|
|
2087
2323
|
// unknown-but-possibly-valid continuity never reaches here
|
|
2088
2324
|
// (continuityOutcome would not be "fresh").
|
|
2089
|
-
|
|
2090
|
-
|
|
2325
|
+
{
|
|
2326
|
+
const kept = await rollbackOwnBlank();
|
|
2327
|
+
if (kept)
|
|
2328
|
+
return kept;
|
|
2329
|
+
}
|
|
2091
2330
|
return {
|
|
2092
2331
|
nodeId: node.id,
|
|
2093
2332
|
logicalId: node.logicalId,
|
|
@@ -2128,8 +2367,11 @@ export class RestoreOrchestrator {
|
|
|
2128
2367
|
// as unresumable. A pane that went back to its shell for another reason stays failed,
|
|
2129
2368
|
// with its pane and binding kept, so its output can still be read.
|
|
2130
2369
|
if (startupResult.missingConversation) {
|
|
2131
|
-
|
|
2132
|
-
|
|
2370
|
+
{
|
|
2371
|
+
const kept = await rollbackOwnBlank();
|
|
2372
|
+
if (kept)
|
|
2373
|
+
return kept;
|
|
2374
|
+
}
|
|
2133
2375
|
// The records can't tell a seat that was never used from one whose conversation is elsewhere (a moved
|
|
2134
2376
|
// account or folder), so the seat waits for the person who knows, with the steps that start it fresh. A kept
|
|
2135
2377
|
// pane leaves the seat's own tmux session at a shell, which the fresh launch won't replace until it's stopped.
|
|
@@ -2333,6 +2575,7 @@ export class RestoreOrchestrator {
|
|
|
2333
2575
|
let kernelAuthority = false;
|
|
2334
2576
|
let teamPermissionDefault = false;
|
|
2335
2577
|
let claudePermissions;
|
|
2578
|
+
let claudeAutoMode;
|
|
2336
2579
|
let claudeMcp;
|
|
2337
2580
|
let launchWrapper;
|
|
2338
2581
|
let codexPermissions;
|
|
@@ -2344,6 +2587,7 @@ export class RestoreOrchestrator {
|
|
|
2344
2587
|
kernelAuthority = override.kernelAuthority === true;
|
|
2345
2588
|
teamPermissionDefault = override.teamPermissionDefault === true;
|
|
2346
2589
|
claudePermissions = override.claudePermissions;
|
|
2590
|
+
claudeAutoMode = override.claudeAutoMode;
|
|
2347
2591
|
claudeMcp = runtime === "claude-code" ? readSeatClaudeMcp(this.db, nodeId) : undefined;
|
|
2348
2592
|
launchWrapper = isLaunchWrapperRuntime(runtime) ? readSeatLaunchWrapper(this.db, nodeId) : undefined;
|
|
2349
2593
|
codexPermissions = override.codexPermissions;
|
|
@@ -2373,7 +2617,8 @@ export class RestoreOrchestrator {
|
|
|
2373
2617
|
...(claudeExecutable ? [claudeExecutable] : [])] : tail;
|
|
2374
2618
|
const mcpTail = claudeMcp === undefined ? guardedTail : [...guardedTail, ...Array(Math.max(0, 9 - guardedTail.length)).fill(undefined), claudeMcp];
|
|
2375
2619
|
const wrapperTail = launchWrapper?.length ? [...mcpTail, ...Array(Math.max(0, 10 - mcpTail.length)).fill(undefined), launchWrapper] : mcpTail;
|
|
2376
|
-
const
|
|
2620
|
+
const continuationTail = claudeLaunch ? [...wrapperTail, ...Array(Math.max(0, 11 - wrapperTail.length)).fill(undefined), claudeLaunch] : wrapperTail;
|
|
2621
|
+
const wrappedTail = claudeAutoMode !== undefined ? [...continuationTail, ...Array(Math.max(0, 12 - continuationTail.length)).fill(undefined), claudeAutoMode] : continuationTail;
|
|
2377
2622
|
if (beforeNative && !beforeNative())
|
|
2378
2623
|
return { kind: "attention_required", message: "The selected seat, settings or history changed during native preparation; resume was not dispatched." };
|
|
2379
2624
|
const result = await this.claudeResume.resume(sessionName, resumeType, resumeToken, cwd, resolvedPosture, model, permissionMode, nodeId, ...wrappedTail);
|
|
@@ -2496,33 +2741,16 @@ export class RestoreOrchestrator {
|
|
|
2496
2741
|
* to reconcile).
|
|
2497
2742
|
*/
|
|
2498
2743
|
async reconcileNodeRuntimeTruth(rigId, nodeId) {
|
|
2499
|
-
// Locate the latest restore attempt
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
// failed or attention_required, the reconciler has nothing to upgrade.
|
|
2508
|
-
const completedRow = this.db.prepare("SELECT payload FROM events WHERE rig_id = ? AND type = 'restore.completed' AND seq > ? ORDER BY seq DESC LIMIT 1").get(rigId, attemptId);
|
|
2509
|
-
let nodeStatus = null;
|
|
2510
|
-
let nodeLogicalId = null;
|
|
2511
|
-
if (completedRow) {
|
|
2512
|
-
try {
|
|
2513
|
-
const parsed = JSON.parse(completedRow.payload);
|
|
2514
|
-
const found = parsed.result?.nodes?.find((n) => n.nodeId === nodeId);
|
|
2515
|
-
if (found) {
|
|
2516
|
-
nodeStatus = found.status;
|
|
2517
|
-
nodeLogicalId = found.logicalId;
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
catch {
|
|
2521
|
-
// payload corruption — treat as no node record found
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2744
|
+
// Locate the node's latest restore attempt and its outcome there. If the
|
|
2745
|
+
// outcome is not failed or attention_required, there is nothing to upgrade.
|
|
2746
|
+
const attempt = this.currentRestoreAttempt(rigId, nodeId);
|
|
2747
|
+
if (!attempt) {
|
|
2748
|
+
return { ok: false, code: "no_attempt", detail: "No restore.started or restore.subset_completed event recorded for this rig." };
|
|
2749
|
+
}
|
|
2750
|
+
const attemptId = attempt.attemptId;
|
|
2751
|
+
const nodeStatus = attempt.status;
|
|
2524
2752
|
if (!nodeStatus) {
|
|
2525
|
-
return { ok: false, code: "node_not_found", detail: `Node ${nodeId} has no record in
|
|
2753
|
+
return { ok: false, code: "node_not_found", detail: `Node ${nodeId} has no record in its latest restore attempt for rig ${rigId}.` };
|
|
2526
2754
|
}
|
|
2527
2755
|
if (nodeStatus !== "failed" && nodeStatus !== "attention_required") {
|
|
2528
2756
|
return { ok: false, code: "outcome_not_upgradable", detail: `Reconciliation only upgrades failed or attention_required; current outcome is ${nodeStatus}.` };
|
|
@@ -2625,12 +2853,12 @@ export class RestoreOrchestrator {
|
|
|
2625
2853
|
}
|
|
2626
2854
|
return { ok: false, code: "pane_not_usable", probe: evidence, attemptId, detail: `Pane state is ${probe.status} (${probe.code}); reconciliation requires resumed.` };
|
|
2627
2855
|
}
|
|
2628
|
-
// The checks above awaited native reads. A restore
|
|
2629
|
-
// makes this proof one for an older subject, so it can't settle the current outcome.
|
|
2630
|
-
const
|
|
2856
|
+
// The checks above awaited native reads. A restore or subset launch recorded since, or a changed binding or expected
|
|
2857
|
+
// token, makes this proof one for an older subject, so it can't settle the current outcome.
|
|
2858
|
+
const latestAttempt = this.currentRestoreAttempt(rigId, nodeId);
|
|
2631
2859
|
const latestBinding = this.db.prepare("SELECT tmux_session FROM bindings WHERE node_id = ?").get(nodeId);
|
|
2632
2860
|
const latestSession = this.db.prepare("SELECT session_name, resume_token FROM sessions WHERE node_id = ? ORDER BY created_at DESC, id DESC LIMIT 1").get(nodeId);
|
|
2633
|
-
if (
|
|
2861
|
+
if (latestAttempt?.attemptId !== attemptId || latestBinding?.tmux_session !== sessionName
|
|
2634
2862
|
|| latestSession?.session_name !== sessionName || latestSession.resume_token !== expectedResumeToken) {
|
|
2635
2863
|
return { ok: false, code: "proof_superseded", attemptId, detail: "A newer restore attempt, binding or resume token was recorded while the live seat was checked, so this proof doesn't settle the current outcome." };
|
|
2636
2864
|
}
|
|
@@ -2643,9 +2871,34 @@ export class RestoreOrchestrator {
|
|
|
2643
2871
|
}
|
|
2644
2872
|
return { ok: true, attemptId, from: fromStatus, to: "operator_recovered", evidence };
|
|
2645
2873
|
}
|
|
2646
|
-
|
|
2874
|
+
/** A node's latest restore attempt and its outcome there (null when that attempt has no record of it). A full restore's
|
|
2875
|
+
* attempt is its `restore.started`, with the outcome in the `restore.completed` after it. A subset launch
|
|
2876
|
+
* (`rig launch --seats`) records only its `restore.subset_completed`, which is its attempt; a later one that names the
|
|
2877
|
+
* node is the node's latest attempt. */
|
|
2878
|
+
currentRestoreAttempt(rigId, nodeId) {
|
|
2879
|
+
const nodeStatusIn = (payload) => {
|
|
2880
|
+
try {
|
|
2881
|
+
return JSON.parse(payload).result?.nodes?.find((n) => n.nodeId === nodeId)?.status ?? null;
|
|
2882
|
+
}
|
|
2883
|
+
catch {
|
|
2884
|
+
return null; // payload corruption — treat as no node record found
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
const started = this.db.prepare("SELECT seq FROM events WHERE rig_id = ? AND type = 'restore.started' ORDER BY seq DESC LIMIT 1").get(rigId);
|
|
2888
|
+
const subsets = this.db.prepare("SELECT seq, payload FROM events WHERE rig_id = ? AND type = 'restore.subset_completed' AND seq > ? ORDER BY seq DESC").all(rigId, started?.seq ?? 0);
|
|
2889
|
+
for (const subset of subsets) {
|
|
2890
|
+
const status = nodeStatusIn(subset.payload);
|
|
2891
|
+
if (status)
|
|
2892
|
+
return { attemptId: subset.seq, status };
|
|
2893
|
+
}
|
|
2894
|
+
if (!started)
|
|
2895
|
+
return null;
|
|
2896
|
+
const completed = this.db.prepare("SELECT payload FROM events WHERE rig_id = ? AND type = 'restore.completed' AND seq > ? ORDER BY seq DESC LIMIT 1").get(rigId, started.seq);
|
|
2897
|
+
return { attemptId: started.seq, status: completed ? nodeStatusIn(completed.payload) : null };
|
|
2898
|
+
}
|
|
2899
|
+
writeCheckpointFile(cwd, sessionName, checkpoint) {
|
|
2647
2900
|
try {
|
|
2648
|
-
const filePath = join(cwd,
|
|
2901
|
+
const filePath = join(cwd, checkpointFileName(sessionName));
|
|
2649
2902
|
const content = [
|
|
2650
2903
|
"# OpenRig Checkpoint",
|
|
2651
2904
|
"",
|