@openrig/cli 0.7.11 → 0.7.13
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 -6
- package/daemon/assets/guidance/openrig-context-entry.md +8 -0
- package/daemon/assets/herdr-app/mods/rig-cell-header/main.js +15 -0
- package/daemon/assets/herdr-app/mods/rig-cell-header/mod.json +1 -0
- package/daemon/assets/herdr-app/mods/rig-ended/main.js +14 -0
- package/daemon/assets/herdr-app/mods/rig-ended/mod.json +1 -0
- package/daemon/assets/herdr-app/mods/rig-pad/main.js +10 -0
- package/daemon/assets/herdr-app/mods/rig-pad/mod.json +1 -0
- package/daemon/assets/herdr-app/mods/rig-strip/main.js +153 -0
- package/daemon/assets/herdr-app/mods/rig-strip/mod.json +1 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/icon.png +0 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +2 -2
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +4 -2
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +2 -2
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +2 -2
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +5 -3
- package/daemon/assets/plugins/openrig-core/README.md +6 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +140 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-state.cjs +103 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +194 -87
- package/daemon/assets/plugins/openrig-core/skills/agent-operated-software/SKILL.md +5 -1
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +3 -2
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +10 -6
- package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +1 -1
- package/daemon/assets/skills/rigs/SKILL.md +43 -4
- package/daemon/context-packs/help/help.md +18 -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 +74 -26
- package/daemon/context-packs/reference/getting-started.md +41 -14
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +29 -9
- package/daemon/context-packs/reference/tmux-servers.md +6 -3
- package/daemon/context-packs/reference/whats-new.md +300 -295
- package/daemon/context-packs/skills/agent-operated-software/SKILL.md +5 -1
- 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/SKILL.md +3 -2
- 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/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/SKILL.md +1 -0
- 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-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/SKILL.md +5 -0
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- 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 +1 -1
- 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/SKILL.md +2 -0
- 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/retiring-and-inheriting-a-seat/SKILL.md +1 -1
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +10 -6
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +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 +18 -3
- 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 +13 -5
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +18 -2
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts +10 -6
- package/daemon/dist/adapters/community-harness-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/community-harness-runtime-adapter.js +78 -24
- package/daemon/dist/adapters/community-harness-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts +27 -0
- package/daemon/dist/adapters/pi-community-runtime-adapter.d.ts.map +1 -0
- package/daemon/dist/adapters/pi-community-runtime-adapter.js +38 -0
- package/daemon/dist/adapters/pi-community-runtime-adapter.js.map +1 -0
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +5 -3
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.js +6 -1
- package/daemon/dist/adapters/pi-runner-protocol.js.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +58 -5
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +441 -52
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +32 -15
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +41 -10
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux-exec.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-exec.js +13 -4
- package/daemon/dist/adapters/tmux-exec.js.map +1 -1
- package/daemon/dist/adapters/tmux-server.d.ts +11 -1
- package/daemon/dist/adapters/tmux-server.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux-server.js +37 -5
- package/daemon/dist/adapters/tmux-server.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +14 -1
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +77 -15
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/attention-surface.d.ts +7 -0
- 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/connection-contract-surface.d.ts +2 -0
- package/daemon/dist/connection-contract-surface.d.ts.map +1 -0
- package/daemon/dist/connection-contract-surface.js +4 -0
- package/daemon/dist/connection-contract-surface.js.map +1 -0
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +16 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/155_queue_erasure.d.ts +12 -0
- package/daemon/dist/db/migrations/155_queue_erasure.d.ts.map +1 -0
- package/daemon/dist/db/migrations/155_queue_erasure.js +28 -0
- package/daemon/dist/db/migrations/155_queue_erasure.js.map +1 -0
- package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts +4 -0
- package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js +14 -0
- package/daemon/dist/db/migrations/156_queue_erasure_link_indexes.js.map +1 -0
- package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts +9 -0
- package/daemon/dist/db/migrations/157_queue_erasure_batches.d.ts.map +1 -0
- package/daemon/dist/db/migrations/157_queue_erasure_batches.js +18 -0
- package/daemon/dist/db/migrations/157_queue_erasure_batches.js.map +1 -0
- package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts +8 -0
- package/daemon/dist/db/migrations/158_queue_inbox_checkins.d.ts.map +1 -0
- package/daemon/dist/db/migrations/158_queue_inbox_checkins.js +15 -0
- package/daemon/dist/db/migrations/158_queue_inbox_checkins.js.map +1 -0
- package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts +5 -0
- package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.d.ts.map +1 -0
- package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js +9 -0
- package/daemon/dist/db/migrations/159_queue_items_handed_off_from_index.js.map +1 -0
- package/daemon/dist/db/migrations/160_network_bindings.d.ts +7 -0
- package/daemon/dist/db/migrations/160_network_bindings.d.ts.map +1 -0
- package/daemon/dist/db/migrations/160_network_bindings.js +26 -0
- package/daemon/dist/db/migrations/160_network_bindings.js.map +1 -0
- package/daemon/dist/db/migrations/161_network_receipts.d.ts +8 -0
- package/daemon/dist/db/migrations/161_network_receipts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/161_network_receipts.js +25 -0
- package/daemon/dist/db/migrations/161_network_receipts.js.map +1 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts +5 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.d.ts.map +1 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.js +12 -0
- package/daemon/dist/db/migrations/162_session_address_read_indexes.js.map +1 -0
- package/daemon/dist/domain/agent-activity-store.d.ts +12 -2
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +25 -7
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/bootstrap-orchestrator.js +5 -0
- package/daemon/dist/domain/bootstrap-orchestrator.js.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.d.ts +8 -0
- package/daemon/dist/domain/builtin-startup-files.d.ts.map +1 -1
- package/daemon/dist/domain/builtin-startup-files.js +37 -11
- package/daemon/dist/domain/builtin-startup-files.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +30 -17
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +140 -66
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/claude-continuation-launch.d.ts +16 -0
- package/daemon/dist/domain/claude-continuation-launch.d.ts.map +1 -0
- package/daemon/dist/domain/claude-continuation-launch.js +110 -0
- package/daemon/dist/domain/claude-continuation-launch.js.map +1 -0
- package/daemon/dist/domain/claude-git-trust-root.d.ts +11 -0
- package/daemon/dist/domain/claude-git-trust-root.d.ts.map +1 -0
- package/daemon/dist/domain/claude-git-trust-root.js +72 -0
- package/daemon/dist/domain/claude-git-trust-root.js.map +1 -0
- package/daemon/dist/domain/claude-managed-launch.d.ts +1 -0
- package/daemon/dist/domain/claude-managed-launch.d.ts.map +1 -1
- package/daemon/dist/domain/claude-managed-launch.js +5 -5
- package/daemon/dist/domain/claude-managed-launch.js.map +1 -1
- package/daemon/dist/domain/community-harness-presets.d.ts +5 -0
- package/daemon/dist/domain/community-harness-presets.d.ts.map +1 -1
- package/daemon/dist/domain/community-harness-presets.js +33 -6
- package/daemon/dist/domain/community-harness-presets.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +37 -6
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/connection-contract.d.ts +111 -0
- package/daemon/dist/domain/connection-contract.d.ts.map +1 -0
- package/daemon/dist/domain/connection-contract.js +113 -0
- package/daemon/dist/domain/connection-contract.js.map +1 -0
- package/daemon/dist/domain/current-work.d.ts +52 -0
- package/daemon/dist/domain/current-work.d.ts.map +1 -1
- package/daemon/dist/domain/current-work.js +215 -0
- package/daemon/dist/domain/current-work.js.map +1 -1
- package/daemon/dist/domain/default-receiver.d.ts +40 -0
- package/daemon/dist/domain/default-receiver.d.ts.map +1 -0
- package/daemon/dist/domain/default-receiver.js +70 -0
- package/daemon/dist/domain/default-receiver.js.map +1 -0
- package/daemon/dist/domain/draft-aware-delivery.js +1 -1
- package/daemon/dist/domain/draft-aware-delivery.js.map +1 -1
- package/daemon/dist/domain/escalation-owner.d.ts.map +1 -1
- package/daemon/dist/domain/escalation-owner.js +8 -3
- package/daemon/dist/domain/escalation-owner.js.map +1 -1
- package/daemon/dist/domain/event-bus.d.ts +16 -8
- package/daemon/dist/domain/event-bus.d.ts.map +1 -1
- package/daemon/dist/domain/event-bus.js +50 -16
- package/daemon/dist/domain/event-bus.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +30 -5
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/gateway-subsystem.d.ts +3 -0
- package/daemon/dist/domain/gateway/gateway-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/gateway-subsystem.js +9 -0
- package/daemon/dist/domain/gateway/gateway-subsystem.js.map +1 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts +2 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.js +2 -1
- package/daemon/dist/domain/gateway/human-quiet-windows.js.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts +12 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +64 -8
- package/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/daemon/dist/domain/gateway/relay-config.d.ts +5 -2
- package/daemon/dist/domain/gateway/relay-config.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/relay-config.js +34 -3
- package/daemon/dist/domain/gateway/relay-config.js.map +1 -1
- package/daemon/dist/domain/gateway/relay-inbound.d.ts +11 -0
- package/daemon/dist/domain/gateway/relay-inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/relay-inbound.js +283 -41
- package/daemon/dist/domain/gateway/relay-inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/relay-outbound.d.ts +5 -2
- package/daemon/dist/domain/gateway/relay-outbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/relay-outbound.js +37 -6
- package/daemon/dist/domain/gateway/relay-outbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/config.d.ts +21 -0
- package/daemon/dist/domain/gateway/slack/config.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/config.js +30 -3
- package/daemon/dist/domain/gateway/slack/config.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +7 -2
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/open-asks.d.ts +13 -1
- package/daemon/dist/domain/gateway/slack/open-asks.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/open-asks.js +58 -7
- package/daemon/dist/domain/gateway/slack/open-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts +9 -0
- package/daemon/dist/domain/gateway/slack/outbound-driver.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/outbound-driver.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 +19 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts +3 -0
- package/daemon/dist/domain/gateway/slack/slack-api.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-api.js +12 -4
- package/daemon/dist/domain/gateway/slack/slack-api.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +2 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +38 -12
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts +12 -1
- package/daemon/dist/domain/gateway/slack/slack-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-recovery.js +68 -10
- package/daemon/dist/domain/gateway/slack/slack-recovery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +151 -47
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/socket-inbound.js +5 -0
- package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/state-store.js +4 -1
- package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts +23 -3
- package/daemon/dist/domain/gateway/slack/thread-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-recovery.js +52 -10
- package/daemon/dist/domain/gateway/slack/thread-recovery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts +4 -1
- package/daemon/dist/domain/gateway/slack/thread-seat-map.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/thread-seat-map.js +7 -4
- package/daemon/dist/domain/gateway/slack/thread-seat-map.js.map +1 -1
- package/daemon/dist/domain/guidance-projection.d.ts +39 -0
- package/daemon/dist/domain/guidance-projection.d.ts.map +1 -0
- package/daemon/dist/domain/guidance-projection.js +91 -0
- package/daemon/dist/domain/guidance-projection.js.map +1 -0
- package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
- package/daemon/dist/domain/health-passive-ceremony.js +31 -12
- package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
- package/daemon/dist/domain/hosted-wake.d.ts +5 -1
- package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
- package/daemon/dist/domain/hosted-wake.js +13 -3
- package/daemon/dist/domain/hosted-wake.js.map +1 -1
- package/daemon/dist/domain/install-engine.d.ts +5 -0
- package/daemon/dist/domain/install-engine.d.ts.map +1 -1
- package/daemon/dist/domain/install-engine.js +28 -26
- package/daemon/dist/domain/install-engine.js.map +1 -1
- package/daemon/dist/domain/install-verifier.d.ts +5 -1
- package/daemon/dist/domain/install-verifier.d.ts.map +1 -1
- package/daemon/dist/domain/install-verifier.js +12 -1
- package/daemon/dist/domain/install-verifier.js.map +1 -1
- package/daemon/dist/domain/launch-wrapper.d.ts +2 -1
- package/daemon/dist/domain/launch-wrapper.d.ts.map +1 -1
- package/daemon/dist/domain/launch-wrapper.js +6 -2
- package/daemon/dist/domain/launch-wrapper.js.map +1 -1
- package/daemon/dist/domain/managed-block-records.d.ts +9 -3
- package/daemon/dist/domain/managed-block-records.d.ts.map +1 -1
- package/daemon/dist/domain/managed-block-records.js +43 -8
- package/daemon/dist/domain/managed-block-records.js.map +1 -1
- package/daemon/dist/domain/managed-blocks.d.ts +43 -3
- package/daemon/dist/domain/managed-blocks.d.ts.map +1 -1
- package/daemon/dist/domain/managed-blocks.js +156 -39
- package/daemon/dist/domain/managed-blocks.js.map +1 -1
- package/daemon/dist/domain/markdown-address.d.ts.map +1 -1
- package/daemon/dist/domain/markdown-address.js +12 -1
- package/daemon/dist/domain/markdown-address.js.map +1 -1
- 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 +39 -7
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-process-arguments.d.ts +5 -0
- package/daemon/dist/domain/native-process-arguments.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-arguments.js +60 -5
- package/daemon/dist/domain/native-process-arguments.js.map +1 -1
- package/daemon/dist/domain/network/hub-client.d.ts +40 -0
- package/daemon/dist/domain/network/hub-client.d.ts.map +1 -0
- package/daemon/dist/domain/network/hub-client.js +102 -0
- package/daemon/dist/domain/network/hub-client.js.map +1 -0
- package/daemon/dist/domain/network/network-bindings.d.ts +74 -0
- package/daemon/dist/domain/network/network-bindings.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-bindings.js +235 -0
- package/daemon/dist/domain/network/network-bindings.js.map +1 -0
- package/daemon/dist/domain/network/network-connector.d.ts +77 -0
- package/daemon/dist/domain/network/network-connector.d.ts.map +1 -0
- package/daemon/dist/domain/network/network-connector.js +380 -0
- package/daemon/dist/domain/network/network-connector.js.map +1 -0
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +9 -8
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/package-install-service.d.ts +1 -0
- package/daemon/dist/domain/package-install-service.d.ts.map +1 -1
- package/daemon/dist/domain/package-install-service.js +2 -1
- package/daemon/dist/domain/package-install-service.js.map +1 -1
- package/daemon/dist/domain/package-manifest.d.ts.map +1 -1
- package/daemon/dist/domain/package-manifest.js +10 -5
- package/daemon/dist/domain/package-manifest.js.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.d.ts +9 -0
- package/daemon/dist/domain/plugin-vendor-service.d.ts.map +1 -1
- package/daemon/dist/domain/plugin-vendor-service.js +50 -8
- package/daemon/dist/domain/plugin-vendor-service.js.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.d.ts.map +1 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.js +9 -1
- package/daemon/dist/domain/policies/delivery-digest-flush.js.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts +4 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.d.ts.map +1 -1
- package/daemon/dist/domain/policies/mode-scheduled-end.js +19 -10
- package/daemon/dist/domain/policies/mode-scheduled-end.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +3 -2
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.d.ts +19 -6
- package/daemon/dist/domain/policies/quiet-release.d.ts.map +1 -1
- package/daemon/dist/domain/policies/quiet-release.js +44 -7
- package/daemon/dist/domain/policies/quiet-release.js.map +1 -1
- package/daemon/dist/domain/proof/judgments.d.ts +23 -13
- package/daemon/dist/domain/proof/judgments.d.ts.map +1 -1
- package/daemon/dist/domain/proof/judgments.js +75 -38
- package/daemon/dist/domain/proof/judgments.js.map +1 -1
- package/daemon/dist/domain/proof/source-watch.d.ts +1 -1
- package/daemon/dist/domain/proof/source-watch.d.ts.map +1 -1
- package/daemon/dist/domain/proof/source-watch.js +45 -22
- package/daemon/dist/domain/proof/source-watch.js.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts +3 -3
- package/daemon/dist/domain/provider/claude-usage-reader.d.ts.map +1 -1
- package/daemon/dist/domain/provider/claude-usage-reader.js +16 -5
- package/daemon/dist/domain/provider/claude-usage-reader.js.map +1 -1
- package/daemon/dist/domain/provider/codex-limit-banner.d.ts.map +1 -1
- package/daemon/dist/domain/provider/codex-limit-banner.js +2 -1
- package/daemon/dist/domain/provider/codex-limit-banner.js.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.d.ts +6 -0
- package/daemon/dist/domain/provider/provider-signals.d.ts.map +1 -1
- package/daemon/dist/domain/provider/provider-signals.js +9 -3
- package/daemon/dist/domain/provider/provider-signals.js.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.d.ts.map +1 -1
- package/daemon/dist/domain/provider/reactive-tap.js +6 -0
- package/daemon/dist/domain/provider/reactive-tap.js.map +1 -1
- package/daemon/dist/domain/queue-blocker.d.ts +5 -0
- package/daemon/dist/domain/queue-blocker.d.ts.map +1 -0
- package/daemon/dist/domain/queue-blocker.js +12 -0
- package/daemon/dist/domain/queue-blocker.js.map +1 -0
- package/daemon/dist/domain/queue-erasure.d.ts +173 -0
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -0
- package/daemon/dist/domain/queue-erasure.js +885 -0
- package/daemon/dist/domain/queue-erasure.js.map +1 -0
- package/daemon/dist/domain/queue-owner.d.ts +6 -0
- package/daemon/dist/domain/queue-owner.d.ts.map +1 -1
- package/daemon/dist/domain/queue-owner.js +13 -4
- package/daemon/dist/domain/queue-owner.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +176 -21
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +503 -62
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-retention.d.ts +15 -1
- package/daemon/dist/domain/queue-retention.d.ts.map +1 -1
- package/daemon/dist/domain/queue-retention.js +35 -0
- package/daemon/dist/domain/queue-retention.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +17 -4
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +309 -100
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-transition-log.d.ts +5 -2
- package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
- package/daemon/dist/domain/queue-transition-log.js +30 -5
- package/daemon/dist/domain/queue-transition-log.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts +48 -2
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +73 -13
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +124 -55
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +3 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +6 -0
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/rebuild-priming-chain.d.ts +3 -1
- package/daemon/dist/domain/rebuild-priming-chain.d.ts.map +1 -1
- package/daemon/dist/domain/rebuild-priming-chain.js +3 -1
- package/daemon/dist/domain/rebuild-priming-chain.js.map +1 -1
- package/daemon/dist/domain/receiver-context.d.ts +9 -0
- package/daemon/dist/domain/receiver-context.d.ts.map +1 -0
- package/daemon/dist/domain/receiver-context.js +24 -0
- package/daemon/dist/domain/receiver-context.js.map +1 -0
- package/daemon/dist/domain/reconciler.d.ts +15 -6
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +26 -26
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/refocus-record.d.ts +17 -0
- package/daemon/dist/domain/refocus-record.d.ts.map +1 -0
- package/daemon/dist/domain/refocus-record.js +94 -0
- package/daemon/dist/domain/refocus-record.js.map +1 -0
- package/daemon/dist/domain/restore-check-service.js +1 -1
- package/daemon/dist/domain/restore-check-service.js.map +1 -1
- package/daemon/dist/domain/restore-guidance.d.ts +6 -4
- package/daemon/dist/domain/restore-guidance.d.ts.map +1 -1
- package/daemon/dist/domain/restore-guidance.js +43 -33
- package/daemon/dist/domain/restore-guidance.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +2 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +39 -18
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +2 -1
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/resume-token-validation.d.ts +7 -0
- package/daemon/dist/domain/resume-token-validation.d.ts.map +1 -1
- package/daemon/dist/domain/resume-token-validation.js +13 -3
- package/daemon/dist/domain/resume-token-validation.js.map +1 -1
- package/daemon/dist/domain/rig-repository.js +3 -3
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +2 -1
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigs-being-built.d.ts +5 -0
- package/daemon/dist/domain/rigs-being-built.d.ts.map +1 -0
- package/daemon/dist/domain/rigs-being-built.js +18 -0
- package/daemon/dist/domain/rigs-being-built.js.map +1 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts +3 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +32 -2
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-preflight.js +4 -1
- package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
- package/daemon/dist/domain/rigspec-schema.js +2 -2
- package/daemon/dist/domain/rigspec-schema.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +11 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +24 -1
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +16 -0
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +104 -16
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/runtime-adapter.d.ts +1 -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/scope/logical-checkbox.d.ts.map +1 -1
- package/daemon/dist/domain/scope/logical-checkbox.js +14 -0
- package/daemon/dist/domain/scope/logical-checkbox.js.map +1 -1
- package/daemon/dist/domain/seat-activity-service.d.ts +12 -0
- package/daemon/dist/domain/seat-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-activity-service.js +85 -4
- package/daemon/dist/domain/seat-activity-service.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +16 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +78 -15
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +18 -2
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-kinds.d.ts +21 -0
- package/daemon/dist/domain/seat-kinds.d.ts.map +1 -0
- package/daemon/dist/domain/seat-kinds.js +27 -0
- package/daemon/dist/domain/seat-kinds.js.map +1 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts +4 -0
- package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
- package/daemon/dist/domain/seat-launch-environment.js +7 -6
- package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +17 -0
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +74 -13
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +23 -12
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +2 -0
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.js +5 -2
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
- package/daemon/dist/domain/seat-skill-storage.js +1 -1
- package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
- package/daemon/dist/domain/seat-status-service.d.ts +10 -0
- package/daemon/dist/domain/seat-status-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-status-service.js +36 -2
- package/daemon/dist/domain/seat-status-service.js.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.d.ts +8 -0
- package/daemon/dist/domain/seat-structural-activity-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-structural-activity-service.js +15 -6
- package/daemon/dist/domain/seat-structural-activity-service.js.map +1 -1
- package/daemon/dist/domain/session-jsonl.d.ts +4 -2
- package/daemon/dist/domain/session-jsonl.d.ts.map +1 -1
- package/daemon/dist/domain/session-jsonl.js +56 -22
- package/daemon/dist/domain/session-jsonl.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +20 -3
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +55 -8
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +30 -4
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +243 -60
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +46 -2
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +522 -37
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.d.ts +0 -3
- package/daemon/dist/domain/slow-op-recorder.d.ts.map +1 -1
- package/daemon/dist/domain/slow-op-recorder.js +5 -34
- package/daemon/dist/domain/slow-op-recorder.js.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts +2 -0
- package/daemon/dist/domain/spec-library-workflow-scanner.d.ts.map +1 -1
- package/daemon/dist/domain/spec-library-workflow-scanner.js +22 -13
- package/daemon/dist/domain/spec-library-workflow-scanner.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +5 -2
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.d.ts +1 -0
- package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
- package/daemon/dist/domain/startup-submission-evidence.js +18 -4
- package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts +5 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +11 -6
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +3 -2
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-app-install.d.ts +28 -0
- package/daemon/dist/domain/terminal/herdr-app-install.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-install.js +170 -0
- package/daemon/dist/domain/terminal/herdr-app-install.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-layout.d.ts +79 -0
- package/daemon/dist/domain/terminal/herdr-app-layout.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-layout.js +134 -0
- package/daemon/dist/domain/terminal/herdr-app-layout.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts +123 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.js +681 -0
- package/daemon/dist/domain/terminal/herdr-app-provider.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-state.d.ts +91 -0
- package/daemon/dist/domain/terminal/herdr-app-state.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-state.js +140 -0
- package/daemon/dist/domain/terminal/herdr-app-state.js.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-transport.d.ts +68 -0
- package/daemon/dist/domain/terminal/herdr-app-transport.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/herdr-app-transport.js +133 -0
- package/daemon/dist/domain/terminal/herdr-app-transport.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +18 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +28 -3
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +41 -8
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/view-composer.js +1 -0
- package/daemon/dist/domain/terminal/view-composer.js.map +1 -1
- package/daemon/dist/domain/time-bound-advisory.js +3 -3
- package/daemon/dist/domain/time-bound-advisory.js.map +1 -1
- package/daemon/dist/domain/tmux-option-defaults.d.ts +4 -4
- package/daemon/dist/domain/tmux-option-defaults.d.ts.map +1 -1
- package/daemon/dist/domain/tmux-option-defaults.js +25 -12
- package/daemon/dist/domain/tmux-option-defaults.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +54 -0
- 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-browser.d.ts +2 -1
- package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-browser.js +22 -3
- package/daemon/dist/domain/user-settings/settings-browser.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 +35 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/wake-recovery.d.ts.map +1 -1
- package/daemon/dist/domain/wake-recovery.js +3 -2
- package/daemon/dist/domain/wake-recovery.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.js +8 -3
- package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
- package/daemon/dist/domain/whoami-service.d.ts +6 -0
- package/daemon/dist/domain/whoami-service.d.ts.map +1 -1
- package/daemon/dist/domain/whoami-service.js +9 -1
- package/daemon/dist/domain/whoami-service.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +1 -1
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +4 -4
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.d.ts +22 -0
- package/daemon/dist/domain/workflow-spec-cache.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-spec-cache.js +59 -14
- package/daemon/dist/domain/workflow-spec-cache.js.map +1 -1
- package/daemon/dist/index.d.ts +2 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +11 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts +3 -0
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +3 -1
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +122 -23
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +2 -0
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/config.d.ts.map +1 -1
- package/daemon/dist/routes/config.js +9 -1
- package/daemon/dist/routes/config.js.map +1 -1
- package/daemon/dist/routes/events.js +7 -2
- package/daemon/dist/routes/events.js.map +1 -1
- package/daemon/dist/routes/gateway.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.js +34 -5
- package/daemon/dist/routes/gateway.js.map +1 -1
- package/daemon/dist/routes/hosts.d.ts.map +1 -1
- package/daemon/dist/routes/hosts.js +154 -79
- package/daemon/dist/routes/hosts.js.map +1 -1
- package/daemon/dist/routes/network.d.ts +9 -0
- package/daemon/dist/routes/network.d.ts.map +1 -0
- package/daemon/dist/routes/network.js +58 -0
- package/daemon/dist/routes/network.js.map +1 -0
- package/daemon/dist/routes/packages.js +3 -1
- package/daemon/dist/routes/packages.js.map +1 -1
- package/daemon/dist/routes/proof.d.ts.map +1 -1
- package/daemon/dist/routes/proof.js +6 -4
- package/daemon/dist/routes/proof.js.map +1 -1
- package/daemon/dist/routes/provider.js +1 -1
- package/daemon/dist/routes/provider.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +19 -0
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +236 -43
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/skills.d.ts.map +1 -1
- package/daemon/dist/routes/skills.js +8 -2
- package/daemon/dist/routes/skills.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts +1 -0
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +217 -39
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/spec-library.d.ts.map +1 -1
- package/daemon/dist/routes/spec-library.js +7 -3
- package/daemon/dist/routes/spec-library.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +40 -3
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +0 -1
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +5 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts +34 -0
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +206 -36
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-spec.md +2 -4
- package/daemon/docs/reference/agent-startup-guide.md +45 -15
- package/daemon/docs/reference/claude-status-line.md +25 -9
- package/daemon/docs/reference/community-harness-examples/omo/omo.yaml +14 -0
- package/daemon/docs/reference/community-harness-presets.md +56 -2
- package/daemon/docs/reference/daemon-http-clients.md +15 -1
- package/daemon/docs/reference/edge-types.md +6 -4
- package/daemon/docs/reference/gateway-participants.md +19 -0
- package/daemon/docs/reference/gateway-relay.md +41 -12
- package/daemon/docs/reference/getting-started.md +41 -14
- package/daemon/docs/reference/harness-runner-contract.md +61 -12
- package/daemon/docs/reference/health-diagnosis.md +5 -1
- package/daemon/docs/reference/help.md +18 -0
- package/daemon/docs/reference/herdr-app.md +149 -0
- package/daemon/docs/reference/hosted-members.md +51 -9
- package/daemon/docs/reference/keeping-a-watch.md +31 -1
- package/daemon/docs/reference/network-connector.md +114 -0
- package/daemon/docs/reference/queue-erasure.md +161 -0
- package/daemon/docs/reference/quickstart.md +4 -4
- package/daemon/docs/reference/rig-spec.md +29 -9
- package/daemon/docs/reference/rosters.md +5 -0
- package/daemon/docs/reference/runner-conformance/README.md +3 -0
- package/daemon/docs/reference/runner-conformance/check-runner.mjs +27 -6
- package/daemon/docs/reference/runner-conformance/fake-acp-agent.mjs +1 -1
- package/daemon/docs/reference/sdlc-conventions.md +16 -1
- package/daemon/docs/reference/seat-delivery.md +10 -3
- package/daemon/docs/reference/slack-app-setup.md +37 -12
- package/daemon/docs/reference/terminal-sessions.md +28 -15
- package/daemon/docs/reference/tmux-servers.md +6 -3
- package/daemon/docs/reference/whats-new.md +300 -295
- package/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md +1 -0
- package/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md +5 -0
- package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +2 -0
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +66 -16
- package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +7 -4
- package/daemon/specs/rigs/launch/kernel/rig.yaml +6 -3
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +3 -1
- package/dist/build-info.js +3 -3
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +11 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +44 -4
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/daemon.d.ts +8 -2
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +63 -7
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/gateway.d.ts.map +1 -1
- package/dist/commands/gateway.js +21 -4
- package/dist/commands/gateway.js.map +1 -1
- package/dist/commands/host.d.ts +4 -10
- package/dist/commands/host.d.ts.map +1 -1
- package/dist/commands/host.js +17 -35
- package/dist/commands/host.js.map +1 -1
- package/dist/commands/launch.d.ts +1 -0
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +1 -1
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/network.d.ts +12 -0
- package/dist/commands/network.d.ts.map +1 -0
- package/dist/commands/network.js +95 -0
- package/dist/commands/network.js.map +1 -0
- package/dist/commands/package.d.ts.map +1 -1
- package/dist/commands/package.js +5 -0
- package/dist/commands/package.js.map +1 -1
- package/dist/commands/proof.d.ts.map +1 -1
- package/dist/commands/proof.js +18 -6
- package/dist/commands/proof.js.map +1 -1
- package/dist/commands/provider.js +1 -1
- package/dist/commands/ps.d.ts +9 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +23 -2
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +233 -8
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +17 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/roster.js +47 -2
- package/dist/commands/roster.js.map +1 -1
- package/dist/commands/scope.d.ts +2 -0
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +15 -0
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +65 -10
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts +2 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +16 -6
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +5 -0
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/slack.d.ts +1 -1
- package/dist/commands/slack.d.ts.map +1 -1
- package/dist/commands/slack.js +5 -1
- package/dist/commands/slack.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +11 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/terminal.d.ts +22 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +116 -7
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +22 -0
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/watchdog.d.ts.map +1 -1
- package/dist/commands/watchdog.js +22 -2
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +13 -2
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/workflow-errors.js +1 -1
- package/dist/commands/workflow-errors.js.map +1 -1
- package/dist/commands/workflow.js +1 -1
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +8 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +60 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-executor.d.ts.map +1 -1
- package/dist/cross-host-executor.js +6 -1
- package/dist/cross-host-executor.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +11 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +61 -9
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-reachability.js +1 -1
- package/dist/daemon-reachability.js.map +1 -1
- package/dist/daemon-start-lock.d.ts +24 -2
- package/dist/daemon-start-lock.d.ts.map +1 -1
- package/dist/daemon-start-lock.js +125 -4
- package/dist/daemon-start-lock.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lazy-program.d.ts.map +1 -1
- package/dist/lazy-program.js +1 -0
- package/dist/lazy-program.js.map +1 -1
- package/dist/lib/scope/logical-checkbox.d.ts.map +1 -1
- package/dist/lib/scope/logical-checkbox.js +14 -0
- package/dist/lib/scope/logical-checkbox.js.map +1 -1
- package/dist/lib/scope/scope-fs.d.ts.map +1 -1
- package/dist/lib/scope/scope-fs.js +36 -2
- package/dist/lib/scope/scope-fs.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +49 -8
- package/dist/mcp-server.js.map +1 -1
- package/dist/recap-seat.d.ts +28 -0
- package/dist/recap-seat.d.ts.map +1 -0
- package/dist/recap-seat.js +41 -0
- package/dist/recap-seat.js.map +1 -0
- package/dist/seat-attention.d.ts +24 -0
- package/dist/seat-attention.d.ts.map +1 -0
- package/dist/seat-attention.js +119 -0
- package/dist/seat-attention.js.map +1 -0
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +3 -3
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/attention/attention-model.d.ts.map +1 -1
- package/tui/dist/attention/attention-model.js +13 -5
- package/tui/dist/attention/attention-model.js.map +1 -1
- package/tui/dist/config/config-model.d.ts.map +1 -1
- package/tui/dist/config/config-model.js +6 -1
- package/tui/dist/config/config-model.js.map +1 -1
- package/tui/dist/config/pairing.d.ts +49 -0
- package/tui/dist/config/pairing.d.ts.map +1 -0
- package/tui/dist/config/pairing.js +98 -0
- package/tui/dist/config/pairing.js.map +1 -0
- package/tui/dist/daemon-client.d.ts +11 -1
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +18 -5
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/detail.d.ts +3 -0
- package/tui/dist/detail.d.ts.map +1 -1
- package/tui/dist/detail.js +6 -1
- package/tui/dist/detail.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts +2 -0
- package/tui/dist/execution/execution-model.d.ts.map +1 -1
- package/tui/dist/execution/execution-model.js +10 -3
- package/tui/dist/execution/execution-model.js.map +1 -1
- package/tui/dist/health/health-model.d.ts.map +1 -1
- package/tui/dist/health/health-model.js +27 -11
- package/tui/dist/health/health-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +12 -6
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/main.js +6 -1
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/navigator.js +1 -1
- package/tui/dist/navigator.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +44 -29
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/scopes/scopes-model.d.ts +9 -0
- package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
- package/tui/dist/scopes/scopes-model.js +27 -1
- package/tui/dist/scopes/scopes-model.js.map +1 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +6 -5
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/stylize.d.ts.map +1 -1
- package/tui/dist/stylize.js +4 -0
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/terminals/open-window.d.ts +21 -1
- package/tui/dist/terminals/open-window.d.ts.map +1 -1
- package/tui/dist/terminals/open-window.js +46 -9
- package/tui/dist/terminals/open-window.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts +8 -1
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +25 -8
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/tui/dist/topology/host-label.d.ts +2 -0
- package/tui/dist/topology/host-label.d.ts.map +1 -1
- package/tui/dist/topology/host-label.js +7 -1
- package/tui/dist/topology/host-label.js.map +1 -1
- package/tui/dist/types.d.ts +20 -3
- package/tui/dist/types.d.ts.map +1 -1
|
@@ -32,6 +32,7 @@ import { createLinkedSuccessorLookup, deriveCrossHostSuccessorId, hasLinkedSucce
|
|
|
32
32
|
import { stalledPickupFinding } from "./queue-pickup.js";
|
|
33
33
|
import { SettingsStore } from "./user-settings/settings-store.js";
|
|
34
34
|
import { loadHostRegistry } from "./hosts/hosts-registry-reader.js";
|
|
35
|
+
import { describeCheckIn, readWakeOutcome } from "./connection-contract.js";
|
|
35
36
|
export const STUCK_SWEEP_INTERVAL_KEY = "queue.stuck_sweep_interval_seconds";
|
|
36
37
|
export const DEFAULT_STUCK_SWEEP_INTERVAL_SECONDS = 300;
|
|
37
38
|
export const STUCK_SWEEP_UNCLAIMED_AGE_KEY = "queue.stuck_sweep_unclaimed_age_minutes";
|
|
@@ -51,6 +52,11 @@ const NO_WAKE_ROUTE_RULES = [
|
|
|
51
52
|
"the row's creator",
|
|
52
53
|
"the operator agent (agents.operator_session)",
|
|
53
54
|
];
|
|
55
|
+
/** How a failed wake's finding at a seat with no declared route names the rule that chose its recipient, in the order tried. */
|
|
56
|
+
const FAILED_WAKE_ROUTE_RULES = [
|
|
57
|
+
"the row's creator",
|
|
58
|
+
"the operator agent (agents.operator_session)",
|
|
59
|
+
];
|
|
54
60
|
// S01 ladder marker vocabulary (the seam contract). S01 writes these transition-note
|
|
55
61
|
// prefixes; the sweep derives "live ladder" from the latest marker. An attempt/rung is
|
|
56
62
|
// LIVE, an exhausted marker hands the row back, and a later attempt starts a live cycle
|
|
@@ -101,6 +107,7 @@ export function createStuckSweepStatus() {
|
|
|
101
107
|
lastError: null,
|
|
102
108
|
consecutiveFailures: 0,
|
|
103
109
|
findingsRouted: 0,
|
|
110
|
+
findingsOpen: 0,
|
|
104
111
|
runningSince: null,
|
|
105
112
|
skippedTicks: 0,
|
|
106
113
|
};
|
|
@@ -110,8 +117,10 @@ export function createStuckSweepStatus() {
|
|
|
110
117
|
state.lastOutcome = outcome;
|
|
111
118
|
state.lastError = outcome === "failed" ? (detail?.error ?? "unknown error") : null;
|
|
112
119
|
state.consecutiveFailures = outcome === "failed" ? state.consecutiveFailures + 1 : 0;
|
|
113
|
-
if (detail?.
|
|
114
|
-
state.findingsRouted += detail.
|
|
120
|
+
if (detail?.created)
|
|
121
|
+
state.findingsRouted += detail.created;
|
|
122
|
+
if (detail?.open !== undefined)
|
|
123
|
+
state.findingsOpen = detail.open;
|
|
115
124
|
},
|
|
116
125
|
pass(pass) {
|
|
117
126
|
state.runningSince = pass.runningSince;
|
|
@@ -149,8 +158,10 @@ export { resolveSessionNodeId, defaultResolveOrchestrator, resolveOperatorSeat }
|
|
|
149
158
|
* ladder live again. Unrelated transitions do not change the latest marker. */
|
|
150
159
|
/** Durable custody-verification disposition: a transition note on the CLOSED source row,
|
|
151
160
|
* written by whoever performed the registered-host read (never by this detector),
|
|
152
|
-
* `custody-verified: <exact-target> <free-form how/where>`. Prefix-anchored parse;
|
|
153
|
-
*
|
|
161
|
+
* `custody-verified: <exact-target> <free-form how/where>`. Prefix-anchored parse; per note,
|
|
162
|
+
* the first whitespace-delimited word after the prefix that names one of the row's targets
|
|
163
|
+
* (itself or a comma member, matched exactly) is what that note verifies, so prose naming the
|
|
164
|
+
* successor later still verifies it while a later mention of another target doesn't (#2841).
|
|
154
165
|
* Read from the ACTIVE table AND the retention archive: the daily archiver MOVES every
|
|
155
166
|
* transition of an aged terminal qitem into `queue_transitions_archive` (the exact class
|
|
156
167
|
* custody rows belong to) while the row itself keeps participating in this sweep, so an
|
|
@@ -158,7 +169,7 @@ export { resolveSessionNodeId, defaultResolveOrchestrator, resolveOperatorSeat }
|
|
|
158
169
|
* the very finding the verifier already answered. The archive is never deleted, so the
|
|
159
170
|
* union is the complete audit history. */
|
|
160
171
|
export const CUSTODY_VERIFIED_PREFIX = "custody-verified:";
|
|
161
|
-
function custodyVerifiedTargets(db, qitemId) {
|
|
172
|
+
function custodyVerifiedTargets(db, qitemId, targets) {
|
|
162
173
|
const notes = db
|
|
163
174
|
.prepare(`SELECT transition_note FROM queue_transitions WHERE qitem_id = ? AND transition_note LIKE ?
|
|
164
175
|
UNION ALL
|
|
@@ -168,13 +179,15 @@ function custodyVerifiedTargets(db, qitemId) {
|
|
|
168
179
|
for (const { transition_note: note } of notes) {
|
|
169
180
|
if (!note)
|
|
170
181
|
continue;
|
|
171
|
-
const token
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
for (const token of note.slice(CUSTODY_VERIFIED_PREFIX.length).trim().split(/\s+/)) {
|
|
183
|
+
const named = [token, ...token.split(",").map((t) => t.trim())]
|
|
184
|
+
.filter(Boolean)
|
|
185
|
+
.map((t) => targets.includes(t) ? t : t.replace(/[.,;:)]$/, ""));
|
|
186
|
+
if (!named.some((t) => targets.includes(t)))
|
|
187
|
+
continue;
|
|
188
|
+
for (const t of named)
|
|
189
|
+
verified.add(t);
|
|
190
|
+
break;
|
|
178
191
|
}
|
|
179
192
|
}
|
|
180
193
|
return verified;
|
|
@@ -207,6 +220,11 @@ function defaultIsRegisteredHost(log) {
|
|
|
207
220
|
* Use the closing transition, including archived history; later same-state notes
|
|
208
221
|
* and delivery receipts do not transfer responsibility. A newer cancellation
|
|
209
222
|
* without closure metadata still supersedes an older closing actor. */
|
|
223
|
+
/** OpenRig's own machinery (the daemon, or a `@system` actor such as this sweep): it creates and closes rows, but it isn't
|
|
224
|
+
* a seat that can act on a finding. */
|
|
225
|
+
function isMachinerySession(session) {
|
|
226
|
+
return session === "daemon@kernel" || session.endsWith("@system");
|
|
227
|
+
}
|
|
210
228
|
function custodyFindingRoute(db, queueRepo, row) {
|
|
211
229
|
// Unknown identity cannot establish a new owner. The caller retains this row's
|
|
212
230
|
// established destination if the registry needed for classification is unavailable.
|
|
@@ -224,7 +242,7 @@ function custodyFindingRoute(db, queueRepo, row) {
|
|
|
224
242
|
AND (state IS NOT previous_state OR closure_reason IS NOT NULL)
|
|
225
243
|
ORDER BY transition_id DESC LIMIT 1`).get(row.qitemId, row.qitemId);
|
|
226
244
|
for (const session of [closure?.actor_session, row.sourceSession]) {
|
|
227
|
-
if (!session || session
|
|
245
|
+
if (!session || isMachinerySession(session))
|
|
228
246
|
continue;
|
|
229
247
|
if (!queueRepo.isHumanDestination(session) && queueRepo.acceptsDestination(session)) {
|
|
230
248
|
return session;
|
|
@@ -307,7 +325,7 @@ function legacyHumanRecipientRetained(deps, row) {
|
|
|
307
325
|
* source's receipts and dispositions before closing an existing finding; an
|
|
308
326
|
* unavailable source or an unconfirmed send supplies no resolution evidence. */
|
|
309
327
|
function deliveryResolutionEvidence(deps, kind, qitemId, now) {
|
|
310
|
-
const row = deps.queueRepo.getById(qitemId);
|
|
328
|
+
const row = deps.queueRepo.getById(qitemId, { waiting: false });
|
|
311
329
|
if (!row)
|
|
312
330
|
return null;
|
|
313
331
|
if (["done", "failed", "denied", "canceled", "handed-off"].includes(row.state)) {
|
|
@@ -323,9 +341,10 @@ function deliveryResolutionEvidence(deps, kind, qitemId, now) {
|
|
|
323
341
|
if (row.state === "blocked")
|
|
324
342
|
return "source parked";
|
|
325
343
|
if (kind === "undelivered-wake") {
|
|
326
|
-
|
|
344
|
+
const wake = readWakeOutcome(row.lastNudgeResult);
|
|
345
|
+
if (wake?.fact === "accepted" && wake.renderVerified)
|
|
327
346
|
return "source wake verified";
|
|
328
|
-
if (
|
|
347
|
+
if (wake?.fact === "accepted" && wake.route === "hosted-trigger")
|
|
329
348
|
return "source wake accepted by its hosted trigger";
|
|
330
349
|
}
|
|
331
350
|
}
|
|
@@ -401,7 +420,8 @@ export function custodyHeadline(rowId, targets, ageMinutes) {
|
|
|
401
420
|
function evidenceBody(db, c) {
|
|
402
421
|
if (c.verificationTargets?.length) {
|
|
403
422
|
const checks = c.verificationTargets
|
|
404
|
-
.map((target) => `- ${target}\n ${verificationCommand(target)}`
|
|
423
|
+
.map((target) => `- ${target}\n ${verificationCommand(target)}\n` +
|
|
424
|
+
` rig queue update ${c.row.qitemId} --note "custody-verified: ${target} <how verified>"`)
|
|
405
425
|
.join("\n");
|
|
406
426
|
return (`STUCK SWEEP FINDING (successor-verification-required)\n` +
|
|
407
427
|
`row: ${c.row.qitemId}\n` +
|
|
@@ -409,10 +429,11 @@ function evidenceBody(db, c) {
|
|
|
409
429
|
`age: ${c.ageMinutes} min\n` +
|
|
410
430
|
`last transition: ${lastTransitionLine(db, c.row.qitemId)}\n` +
|
|
411
431
|
`why: ${c.why}\n` +
|
|
412
|
-
`verification targets (indeterminate until checked on the registered host):\n${checks}\n` +
|
|
413
|
-
`After a registered-host read confirms a target, record
|
|
414
|
-
`
|
|
415
|
-
`
|
|
432
|
+
`verification targets (indeterminate until checked on the registered host), each with its check and its note:\n${checks}\n` +
|
|
433
|
+
`After a registered-host read confirms a target, record its note on the closed row so the sweep stops asking. ` +
|
|
434
|
+
`The note starts with "custody-verified:"; its first word that names one of these targets exactly is what it verifies. ` +
|
|
435
|
+
`Name several in one comma-list word (a,b), or write one note each.\n` +
|
|
436
|
+
`Do not rewrite historical custody from this local observation; the note is the separate record of the verification.`);
|
|
416
437
|
}
|
|
417
438
|
return (`STUCK SWEEP FINDING (${c.kind})\n` +
|
|
418
439
|
`row: ${c.row.qitemId}\n` +
|
|
@@ -424,9 +445,8 @@ function evidenceBody(db, c) {
|
|
|
424
445
|
}
|
|
425
446
|
/** The last line of a standing notice's body: every row it stands for, so the sweep knows what it covered. */
|
|
426
447
|
const BACKLOG_ROWS_PREFIX = "Every row this notice stands for: ";
|
|
427
|
-
/** A
|
|
428
|
-
|
|
429
|
-
function unclaimedBacklogText(seat, rows, thresholdMinutes, node) {
|
|
448
|
+
/** A standing notice's row lines: oldest first, the first ones by id, the rest counted. */
|
|
449
|
+
function backlogListing(rows) {
|
|
430
450
|
const sorted = [...rows].sort((a, b) => a.since.localeCompare(b.since) || a.qitemId.localeCompare(b.qitemId));
|
|
431
451
|
const listed = sorted.slice(0, UNCLAIMED_BACKLOG_LISTED_ROWS).map((r) => {
|
|
432
452
|
const about = r.summary ? `: ${r.summary.replace(/\s+/g, " ").trim().slice(0, 120)}` : "";
|
|
@@ -434,7 +454,12 @@ function unclaimedBacklogText(seat, rows, thresholdMinutes, node) {
|
|
|
434
454
|
});
|
|
435
455
|
if (sorted.length > listed.length)
|
|
436
456
|
listed.push(`- and ${sorted.length - listed.length} more`);
|
|
437
|
-
|
|
457
|
+
return { sorted, listed, count: `${rows.length} ${rows.length === 1 ? "row" : "rows"}` };
|
|
458
|
+
}
|
|
459
|
+
/** A seat's standing unclaimed-backlog notice: its rows by id, how to list them, and how to send their findings to a seat
|
|
460
|
+
* that watches this one. Built only from the rows' fixed facts, so a pass rewrites it only when the rows change. */
|
|
461
|
+
function unclaimedBacklogText(seat, rows, thresholdMinutes, node) {
|
|
462
|
+
const { sorted, listed, count } = backlogListing(rows);
|
|
438
463
|
const edge = node ? `rig edge add ${node.rig} ${node.logicalId} <watching seat> --kind escalates_to` : "an escalates_to edge from this seat";
|
|
439
464
|
return {
|
|
440
465
|
summary: `Stuck sweep: unclaimed-backlog on ${seat} (${count})`,
|
|
@@ -450,6 +475,52 @@ function unclaimedBacklogText(seat, rows, thresholdMinutes, node) {
|
|
|
450
475
|
`${BACKLOG_ROWS_PREFIX}${JSON.stringify(sorted.map((r) => r.qitemId))}`,
|
|
451
476
|
};
|
|
452
477
|
}
|
|
478
|
+
/** A polling hosted member's standing notice: whether it's checking in (its own inbox reads), the rows it hasn't claimed,
|
|
479
|
+
* and what to do. Its work's age runs from each row's own time, which a check-in never resets. Built from the rows' fixed
|
|
480
|
+
* facts and the member's check-in state, never a current check-in's exact time, so a pass rewrites it only when the rows
|
|
481
|
+
* or that state change. */
|
|
482
|
+
function polledBacklogText(member, rows, thresholdMinutes, checkIn, now) {
|
|
483
|
+
const { sorted, listed, count } = backlogListing(rows);
|
|
484
|
+
// The member's shared check-in status, in the same words `rig roster` uses (`describeCheckIn`). Only the words follow
|
|
485
|
+
// it; when this notice is filed doesn't. Where that line would carry the time of a check-in that keeps moving (checking
|
|
486
|
+
// in, on request, unknown), the notice says instead whether the member read its inbox within the threshold, so a
|
|
487
|
+
// check-in rewrites the notice only when it changes that, never its time alone. An overdue or never-seen member's line
|
|
488
|
+
// is fixed until it checks in, so it keeps its evidence.
|
|
489
|
+
const at = checkIn.lastCheckInAt;
|
|
490
|
+
const lately = at !== null && now.getTime() - Date.parse(at) <= thresholdMinutes * 60_000;
|
|
491
|
+
const recency = at === null ? "" : lately ? `; it read its own inbox within the last ${thresholdMinutes} min` : `; no check-in since ${at}`;
|
|
492
|
+
const recent = checkIn.status === "checking-in" || ((checkIn.status === "on-request" || checkIn.status === "unknown") && lately);
|
|
493
|
+
const checkIns = (() => {
|
|
494
|
+
switch (checkIn.status) {
|
|
495
|
+
case "checking-in": return `checking in: its last check-in is within twice its expected ${checkIn.expectedMinutes} min`;
|
|
496
|
+
case "on-request": return `on request: it checks its queue when a person asks it${recency}`;
|
|
497
|
+
case "unknown": return `unknown (${checkIn.reason ?? "its check-in status couldn't be read"})${recency}`;
|
|
498
|
+
case "check-in-overdue":
|
|
499
|
+
case "no-check-in-yet":
|
|
500
|
+
case "disconnected":
|
|
501
|
+
return describeCheckIn(checkIn);
|
|
502
|
+
}
|
|
503
|
+
})();
|
|
504
|
+
const why = recent
|
|
505
|
+
? "it's reading its own inbox, but this work is still unclaimed. Check whether it can do this work, or route it to another seat"
|
|
506
|
+
: checkIn.status === "check-in-overdue"
|
|
507
|
+
? "nobody has claimed these rows, and it hasn't checked in as often as its setup expects. Ask its owner to check its schedule or a pending approval, or route the work to another seat"
|
|
508
|
+
: checkIn.status === "unknown" && at === null
|
|
509
|
+
? "nobody has claimed these rows, and whether it's reading its queue isn't known. Ask its owner, or route the work to another seat"
|
|
510
|
+
: "nobody has claimed these rows, and no read of its own inbox has been observed in that time. Ask its owner to check it's running, or route the work to another seat";
|
|
511
|
+
return {
|
|
512
|
+
summary: `Stuck sweep: unclaimed-backlog on ${member} (${count})`,
|
|
513
|
+
body: `STUCK SWEEP FINDING (unclaimed-backlog)\n` +
|
|
514
|
+
`member: ${member} (a hosted member with no wake trigger: it picks up work when it reads its own queue)\n` +
|
|
515
|
+
`check-ins: ${checkIns}\n` +
|
|
516
|
+
`unclaimed: ${count} (the threshold is ${thresholdMinutes} min)\n` +
|
|
517
|
+
`${listed.join("\n")}\n` +
|
|
518
|
+
`why: ${why}. This one notice stands for these rows instead of a finding per row, and follows them as they come and go.\n` +
|
|
519
|
+
`List them: rig queue list --destination ${member} --state pending\n` +
|
|
520
|
+
`The sweep closes this notice itself once every row it stands for is claimed, parked or closed.\n` +
|
|
521
|
+
`${BACKLOG_ROWS_PREFIX}${JSON.stringify(sorted.map((r) => r.qitemId))}`,
|
|
522
|
+
};
|
|
523
|
+
}
|
|
453
524
|
/** The rows a standing notice's body says it stands for, or null when the line is missing or unreadable: unknown, which is
|
|
454
525
|
* never read as "none". */
|
|
455
526
|
function backlogRowsOf(body) {
|
|
@@ -464,6 +535,14 @@ function backlogRowsOf(body) {
|
|
|
464
535
|
return null;
|
|
465
536
|
}
|
|
466
537
|
}
|
|
538
|
+
/** What a pass hands the status: the findings it created (the routed total grows only by these), and the finding
|
|
539
|
+
* rows still open after it. Open is read from the queue, not from the pass's actions: a finding kept open without an
|
|
540
|
+
* action (a live ladder suppresses its reporting, a grace holds it) is still open. */
|
|
541
|
+
function findingCounts(db, findings) {
|
|
542
|
+
const open = db.prepare(`SELECT COUNT(*) AS n FROM queue_items WHERE state IN ('pending', 'in-progress', 'blocked')
|
|
543
|
+
AND tags LIKE ?`).get(`%"${STUCK_SWEEP_FINDING_TAG}"%`);
|
|
544
|
+
return { created: findings.filter((f) => f.action === "created").length, open: open.n };
|
|
545
|
+
}
|
|
467
546
|
/**
|
|
468
547
|
* One sweep pass. Instance-wide (no rig scope — the loop is the net for every rig the
|
|
469
548
|
* daemon carries). Never throws: a sweep that cannot run reports outcome=failed loudly
|
|
@@ -474,6 +553,10 @@ function backlogRowsOf(body) {
|
|
|
474
553
|
* for its whole length (seconds on a queue of tens of thousands of rows, with healthz and every request waiting);
|
|
475
554
|
* every this many rows it now lets timers and requests run. */
|
|
476
555
|
export const STUCK_SWEEP_YIELD_EVERY_ROWS = 50;
|
|
556
|
+
/** ...or after this many milliseconds of work since the last yield, whichever comes first: a stretch of slow rows (or
|
|
557
|
+
* of awaited writes that resolve by microtasks alone) holds the loop no longer than this. The clock restarts after the
|
|
558
|
+
* yield, so the time others run during it does not count against the next stretch. */
|
|
559
|
+
export const STUCK_SWEEP_YIELD_AFTER_MS = 50;
|
|
477
560
|
export async function runStuckSweep(deps) {
|
|
478
561
|
const log = deps.log ?? ((line) => console.error(line));
|
|
479
562
|
const status = deps.status;
|
|
@@ -487,17 +570,29 @@ export async function runStuckSweep(deps) {
|
|
|
487
570
|
// Every yield and every awaited write lets other code run: indexes read before it are dropped, and `othersRan`
|
|
488
571
|
// tells a list read before it that its rows need a fresh read.
|
|
489
572
|
let othersRan = 0;
|
|
490
|
-
|
|
573
|
+
/** Each seat's agent-seat reading (agentSeatNode, below), dropped with the indexes: another writer can declare a
|
|
574
|
+
* seat's delegation parent while the pass yields or awaits a write. */
|
|
575
|
+
const agentSeats = new Map();
|
|
576
|
+
const othersMayHaveRun = () => { othersRan++; recoveries.invalidate(); successors?.invalidate(); agentSeats.clear(); };
|
|
577
|
+
// A successor index whose build took at least half of a stretch that yielded by elapsed time is not rebuilt for
|
|
578
|
+
// the rest of the pass: the yield drops it, the next stretch would pay the build again and end the same way after a
|
|
579
|
+
// few rows, so the rows would pay about one build each instead of one per STUCK_SWEEP_YIELD_EVERY_ROWS. Those rows
|
|
580
|
+
// ask their own narrow query (hasLinkedSuccessor), which costs less than a rebuilt index.
|
|
581
|
+
let successorsPerRow = false;
|
|
491
582
|
// A synchronous read with both indexes lent to what it calls deep inside (a getById's waiting view and handoff
|
|
492
583
|
// advisory ask the same questions per row). Never spans an await: the lend ends when fn returns.
|
|
493
|
-
const indexed = (fn) => recoveries.run(() => (successors ? successors.run(fn) : fn()));
|
|
584
|
+
const indexed = (fn) => recoveries.run(() => (successors && !successorsPerRow ? successors.run(fn) : fn()));
|
|
494
585
|
// `if (dueToYield()) await yieldLoop();` and never a bare await per row: even an await that does not yield lets
|
|
495
586
|
// queued microtasks (other requests' continuations) run and write between two rows the snapshot still covers.
|
|
496
587
|
let rowsSinceYield = 0;
|
|
497
|
-
|
|
588
|
+
let lastYieldAt = performance.now();
|
|
589
|
+
const dueToYield = () => ++rowsSinceYield >= STUCK_SWEEP_YIELD_EVERY_ROWS || performance.now() - lastYieldAt >= STUCK_SWEEP_YIELD_AFTER_MS;
|
|
498
590
|
const yieldLoop = async () => {
|
|
591
|
+
const stretchMs = performance.now() - lastYieldAt;
|
|
592
|
+
successorsPerRow ||= successors !== null && stretchMs >= STUCK_SWEEP_YIELD_AFTER_MS && 2 * successors.builtMs() >= stretchMs;
|
|
499
593
|
rowsSinceYield = 0;
|
|
500
594
|
await new Promise((resolve) => setImmediate(resolve));
|
|
595
|
+
lastYieldAt = performance.now();
|
|
501
596
|
othersMayHaveRun();
|
|
502
597
|
};
|
|
503
598
|
const suppressionMinutes = deps.ladderSuppressionMinutes ?? resolveLadderSuppressionMinutes();
|
|
@@ -549,7 +644,7 @@ export async function runStuckSweep(deps) {
|
|
|
549
644
|
// S04 seam — a claimed row with no later motion past the pickup threshold. The
|
|
550
645
|
// pickup module remains the ONE derivation rule; this only enumerates and routes.
|
|
551
646
|
const stalledCandidate = (qitemId) => {
|
|
552
|
-
const row = indexed(() => deps.queueRepo.getById(qitemId));
|
|
647
|
+
const row = indexed(() => deps.queueRepo.getById(qitemId, { waiting: false }));
|
|
553
648
|
if (!row || isFindingRow(row))
|
|
554
649
|
return null;
|
|
555
650
|
if ((row.state !== "pending" && row.state !== "in-progress") || !row.claimedAt)
|
|
@@ -581,7 +676,7 @@ export async function runStuckSweep(deps) {
|
|
|
581
676
|
if (!notice || now.getTime() - Date.parse(notice.at) <= resolvePickupThresholdMinutes() * 60_000)
|
|
582
677
|
return null;
|
|
583
678
|
const binding = deps.db.prepare("SELECT qitem_id FROM queue_transition_wakes WHERE wake_ref = ? AND phase = 'armed' ORDER BY transition_id DESC LIMIT 1").get(jobId);
|
|
584
|
-
const row = binding ? indexed(() => deps.queueRepo.getById(binding.qitem_id)) : null;
|
|
679
|
+
const row = binding ? indexed(() => deps.queueRepo.getById(binding.qitem_id, { waiting: false })) : null;
|
|
585
680
|
if (!row || row.state !== "blocked" || deps.queueRepo.getParkWakeStatus(row.qitemId)?.ref !== jobId)
|
|
586
681
|
return null;
|
|
587
682
|
const response = lastMeaningfulTransition(deps.db, row.qitemId);
|
|
@@ -597,7 +692,7 @@ export async function runStuckSweep(deps) {
|
|
|
597
692
|
// The parked policy stops repeating a positively no-input failure. Unhealthy blocked rows
|
|
598
693
|
// have no retry ladder: the same sweep/recovery route owns their actionable disposition.
|
|
599
694
|
const parkedCandidate = (qitemId) => {
|
|
600
|
-
const row = indexed(() => deps.queueRepo.getById(qitemId));
|
|
695
|
+
const row = indexed(() => deps.queueRepo.getById(qitemId, { waiting: false }));
|
|
601
696
|
if (!row || isFindingRow(row))
|
|
602
697
|
return null;
|
|
603
698
|
if (row.state !== "blocked" || !startsWithCI(row.lastNudgeResult, "failed:"))
|
|
@@ -627,15 +722,23 @@ export async function runStuckSweep(deps) {
|
|
|
627
722
|
// row's own wake intent instead of reporting it: the intent is claimed and settled, so a startup drain doesn't send it
|
|
628
723
|
// again, and one already in flight or settled isn't sent twice. The next tick reads the new result, so a failed send
|
|
629
724
|
// is reported then. A row with a live retry ladder is left to the ladder.
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
&& !hasLiveLadder(deps.db, row.qitemId, now, suppressionMinutes)
|
|
633
|
-
&& deps.queueRepo.classifyDestinationOf(row.destinationSession).class === "pane-bound";
|
|
725
|
+
// The rule is shared with the reachable-seat retry; a live retry ladder is this sweep's own check.
|
|
726
|
+
const wakeToRetry = (row) => deps.queueRepo.unroutableWakeRetryable(row, now)
|
|
727
|
+
&& !hasLiveLadder(deps.db, row.qitemId, now, suppressionMinutes);
|
|
634
728
|
const isHumanNotice = (row) => row.deliveryOutcome === "never-posted" || row.deliveryOutcome === "transport-failed";
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
729
|
+
// A hosted member with no wake trigger picks up its work by reading the queue: nothing can push work to it, by design.
|
|
730
|
+
// Its rows' unroutable wakes aren't failed deliveries, so they get no finding each; work it leaves unclaimed past the
|
|
731
|
+
// unclaimed age is listed in the member's one standing notice instead. Read once per member per pass.
|
|
732
|
+
const pollingMembers = new Map();
|
|
733
|
+
const pollsForWork = (session) => {
|
|
734
|
+
let polls = pollingMembers.get(session);
|
|
735
|
+
if (polls === undefined) {
|
|
736
|
+
polls = deps.queueRepo.isHostedMember(session) && deps.queueRepo.classifyDestinationOf(session).class === "unroutable";
|
|
737
|
+
pollingMembers.set(session, polls);
|
|
738
|
+
}
|
|
739
|
+
return polls;
|
|
740
|
+
};
|
|
741
|
+
const polledRow = (row) => !!row.lastNudgeResult?.startsWith("unroutable:") && pollsForWork(row.destinationSession);
|
|
639
742
|
/** `row` comes from findUndelivered (it carries the delivery verdict). Call it after any wake retry the row needs. */
|
|
640
743
|
const undeliveredCandidate = (row, recordSuppression) => {
|
|
641
744
|
if (isFindingRow(row))
|
|
@@ -648,14 +751,20 @@ export async function runStuckSweep(deps) {
|
|
|
648
751
|
return null;
|
|
649
752
|
if (!humanNotice && deps.queueRepo.isLocalHumanDecisionWithoutGateway(row))
|
|
650
753
|
return null;
|
|
754
|
+
if (!humanNotice && polledRow(row))
|
|
755
|
+
return null;
|
|
651
756
|
const notification = humanNotice ? deps.queueRepo.transitionLog.latestOwnerNotificationForQitem(row.qitemId) : null;
|
|
652
757
|
const resolutionNotice = notification?.ownerNotificationKind === "human-decision-resolved";
|
|
653
758
|
// Match the notification source in slack/queue-access.ts, not the agent wake's escalator.
|
|
654
759
|
const noticeOwner = row.state === "blocked" || resolutionNotice ? row.destinationSession : row.sourceSession;
|
|
655
760
|
const noticeRecipient = resolutionNotice ? notification.actorSession : row.state === "blocked" ? row.blockedOn : row.destinationSession;
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
761
|
+
// Slack answered 2xx but its body couldn't be read (slack-delivery's POSSIBLY_POSTED_CLASS): it may be in Slack.
|
|
762
|
+
const possiblyPosted = humanNotice && /\bclass=possibly-posted\b/.test(row.deliveryFailureDetail ?? "");
|
|
763
|
+
const failure = possiblyPosted
|
|
764
|
+
? `human notice may have posted to ${noticeRecipient}: Slack answered but its reply couldn't be read (${row.deliveryFailureDetail}); the gateway checks Slack for its marker before any resend`
|
|
765
|
+
: humanNotice
|
|
766
|
+
? `human notice ${row.deliveryOutcome} to ${noticeRecipient}: ${row.deliveryFailureDetail}`
|
|
767
|
+
: `wake failed (${row.lastNudgeResult ?? "failed"})`;
|
|
659
768
|
// Quiet hours: a held, turned-back or released ask belongs to its window's release job, so a failed wake, or a post
|
|
660
769
|
// not yet made, isn't "nothing retried it". A release whose post failed is a failed delivery, and a hold with no
|
|
661
770
|
// live release job is orphaned: both stay findings, with their own reason.
|
|
@@ -685,13 +794,13 @@ export async function runStuckSweep(deps) {
|
|
|
685
794
|
: `${failure} and nothing retried it`,
|
|
686
795
|
};
|
|
687
796
|
};
|
|
688
|
-
const undeliveredNow = (qitemId) => indexed(() => deps.queueRepo.findUndelivered({ qitemId }))[0];
|
|
797
|
+
const undeliveredNow = (qitemId) => indexed(() => deps.queueRepo.findUndelivered({ qitemId, waiting: false }))[0];
|
|
689
798
|
// The A1 net — created-with-destination rows carrying real obligations, unclaimed past
|
|
690
799
|
// the config-keyed age. Parks (state=blocked) legitimately wait and never appear here;
|
|
691
800
|
// failed-nudge rows already surfaced in half 2; laddered rows are S01's.
|
|
692
801
|
const cutoff = new Date(now.getTime() - ageMinutes * 60_000).toISOString();
|
|
693
802
|
const unclaimedCandidate = (qitemId, recordSuppression) => {
|
|
694
|
-
const row = indexed(() => deps.queueRepo.getById(qitemId));
|
|
803
|
+
const row = indexed(() => deps.queueRepo.getById(qitemId, { waiting: false }));
|
|
695
804
|
if (!row || isFindingRow(row))
|
|
696
805
|
return null;
|
|
697
806
|
// The query's own predicate, on the row as it is now.
|
|
@@ -740,9 +849,24 @@ export async function runStuckSweep(deps) {
|
|
|
740
849
|
evidenceAt: actionableAt,
|
|
741
850
|
why: quiet?.state === "orphaned"
|
|
742
851
|
? `held for quiet hours (window ${quiet.windowId}) for ${minutesSince(actionableAt, now)} min, but no release job is live for that window: nothing will release it`
|
|
743
|
-
: `actionable with a destination and unclaimed for ${minutesSince(actionableAt, now)} min (threshold ${ageMinutes})`,
|
|
852
|
+
: `actionable with a destination and unclaimed for ${minutesSince(actionableAt, now)} min (threshold ${ageMinutes})${unreadableOwner(row.destinationSession) ? "; owner activity unknown (can't read the seat)" : ""}`,
|
|
744
853
|
};
|
|
745
854
|
};
|
|
855
|
+
/** The seat's activity can't be read (no reading, or one that reads unknown): said in the finding, so an unreadable
|
|
856
|
+
* seat isn't taken for one ignoring its work. The stalled finding says the same (`queue-pickup.ts`). A person has no
|
|
857
|
+
* seat to read, so their row never says so; nor does a row whose destination can't be classified, since it may be a
|
|
858
|
+
* person's. A classification fault never stops the sweep. */
|
|
859
|
+
function unreadableOwner(session) {
|
|
860
|
+
try {
|
|
861
|
+
if (deps.queueRepo.isHumanDestination(session))
|
|
862
|
+
return false;
|
|
863
|
+
}
|
|
864
|
+
catch {
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
const activity = deps.queueRepo.ownerActivity(session)?.activity;
|
|
868
|
+
return !activity || activity === "unknown";
|
|
869
|
+
}
|
|
746
870
|
// The custody class — a terminal row whose closure names one or more successor
|
|
747
871
|
// qitems or seat-address targets (closure_reason = 'handed_off_to'). A local miss is
|
|
748
872
|
// never proof of absence: the successor may live in another registered host's database.
|
|
@@ -768,7 +892,7 @@ export async function runStuckSweep(deps) {
|
|
|
768
892
|
/** `recheck`: read live without the lent indexes, and don't log the registry fallback a second time. */
|
|
769
893
|
const custodyCandidate = (qitemId, hasSuccessor, recheck = false) => {
|
|
770
894
|
// A recheck reads live, without the lent indexes: one row's own queries cost less than a rebuilt successor index.
|
|
771
|
-
const row = recheck ? deps.queueRepo.getById(qitemId) : indexed(() => deps.queueRepo.getById(qitemId));
|
|
895
|
+
const row = recheck ? deps.queueRepo.getById(qitemId, { waiting: false }) : indexed(() => deps.queueRepo.getById(qitemId, { waiting: false }));
|
|
772
896
|
if (!row || isFindingRow(row))
|
|
773
897
|
return null;
|
|
774
898
|
// The query's own predicate, on the row as it is now.
|
|
@@ -787,7 +911,7 @@ export async function runStuckSweep(deps) {
|
|
|
787
911
|
if (targets.length === 0 && row.closureReason === "handed_off_to") {
|
|
788
912
|
targets.push("(unspecified)");
|
|
789
913
|
}
|
|
790
|
-
const verified = custodyVerifiedTargets(deps.db, row.qitemId);
|
|
914
|
+
const verified = custodyVerifiedTargets(deps.db, row.qitemId, targets);
|
|
791
915
|
const verificationTargets = targets.filter((target) => {
|
|
792
916
|
if (verified.has(target))
|
|
793
917
|
return false;
|
|
@@ -802,7 +926,7 @@ export async function runStuckSweep(deps) {
|
|
|
802
926
|
}
|
|
803
927
|
if (target === row.qitemId)
|
|
804
928
|
return true;
|
|
805
|
-
return !indexed(() => deps.queueRepo.getById(target));
|
|
929
|
+
return !indexed(() => deps.queueRepo.getById(target, { waiting: false }));
|
|
806
930
|
}
|
|
807
931
|
try {
|
|
808
932
|
return !hasSuccessor(row.qitemId, target);
|
|
@@ -841,7 +965,7 @@ export async function runStuckSweep(deps) {
|
|
|
841
965
|
const freshCandidate = (kind, id, jobId) => {
|
|
842
966
|
switch (kind) {
|
|
843
967
|
case "overdue-claim": {
|
|
844
|
-
const row = deps.queueRepo.findOverdue({ now: nowIso, qitemId: id })[0];
|
|
968
|
+
const row = deps.queueRepo.findOverdue({ now: nowIso, qitemId: id, waiting: false })[0];
|
|
845
969
|
return row ? overdueCandidate(row) : null;
|
|
846
970
|
}
|
|
847
971
|
case "stalled-after-claim": return stalledCandidate(id);
|
|
@@ -885,10 +1009,10 @@ export async function runStuckSweep(deps) {
|
|
|
885
1009
|
// The rows each rule looks at. The id lists are judged on a fresh getById per row; the two finders return whole
|
|
886
1010
|
// rows, which are read again by id once other code may have run since the list was read.
|
|
887
1011
|
let listedAt = othersRan;
|
|
888
|
-
for (const listed of indexed(() => deps.queueRepo.findOverdue({ now: nowIso }))) {
|
|
1012
|
+
for (const listed of indexed(() => deps.queueRepo.findOverdue({ now: nowIso, waiting: false }))) {
|
|
889
1013
|
if (dueToYield())
|
|
890
1014
|
await yieldLoop();
|
|
891
|
-
const row = listedAt !== othersRan ? indexed(() => deps.queueRepo.findOverdue({ now: nowIso, qitemId: listed.qitemId }))[0] : listed;
|
|
1015
|
+
const row = listedAt !== othersRan ? indexed(() => deps.queueRepo.findOverdue({ now: nowIso, qitemId: listed.qitemId, waiting: false }))[0] : listed;
|
|
892
1016
|
const c = row ? overdueCandidate(row) : null;
|
|
893
1017
|
if (!c)
|
|
894
1018
|
continue;
|
|
@@ -927,18 +1051,18 @@ export async function runStuckSweep(deps) {
|
|
|
927
1051
|
candidates.push(c);
|
|
928
1052
|
}
|
|
929
1053
|
listedAt = othersRan;
|
|
930
|
-
for (const listed of indexed(() => deps.queueRepo.findUndelivered())) {
|
|
1054
|
+
for (const listed of indexed(() => deps.queueRepo.findUndelivered({ waiting: false }))) {
|
|
931
1055
|
if (dueToYield())
|
|
932
1056
|
await yieldLoop();
|
|
933
1057
|
let row = listedAt !== othersRan ? undeliveredNow(listed.qitemId) : listed;
|
|
934
1058
|
if (!row || isFindingRow(row))
|
|
935
1059
|
continue;
|
|
936
|
-
if (
|
|
1060
|
+
if (wakeToRetry(row)) {
|
|
937
1061
|
await deps.queueRepo.deliverWakeForSuccessor(row.qitemId, row.destinationSession, true, row.sourceSession);
|
|
938
1062
|
othersMayHaveRun();
|
|
939
1063
|
// judged again on the row as the send (and anyone else during it) left it
|
|
940
1064
|
row = undeliveredNow(row.qitemId);
|
|
941
|
-
if (!row
|
|
1065
|
+
if (!row?.lastNudgeResult?.startsWith("unroutable:"))
|
|
942
1066
|
continue;
|
|
943
1067
|
}
|
|
944
1068
|
const c = undeliveredCandidate(row, true);
|
|
@@ -998,7 +1122,9 @@ export async function runStuckSweep(deps) {
|
|
|
998
1122
|
for (const { qitem_id } of custodyRows) {
|
|
999
1123
|
if (dueToYield())
|
|
1000
1124
|
await yieldLoop();
|
|
1001
|
-
const c = custodyCandidate(qitem_id,
|
|
1125
|
+
const c = custodyCandidate(qitem_id, successorsPerRow
|
|
1126
|
+
? (source, target) => hasLinkedSuccessor(deps.db, source, target)
|
|
1127
|
+
: (source, target) => lookup.has(source, target));
|
|
1002
1128
|
if (c)
|
|
1003
1129
|
candidates.push(c);
|
|
1004
1130
|
}
|
|
@@ -1040,6 +1166,22 @@ export async function runStuckSweep(deps) {
|
|
|
1040
1166
|
// unroutable or a terminal seat itself. A bound terminal seat goes the same way: the queue wake types nothing into
|
|
1041
1167
|
// it, and nothing there can claim work.
|
|
1042
1168
|
const classOf = (seat) => deps.queueRepo.classifyDestinationOf(seat).class;
|
|
1169
|
+
/** Who hears about work for a destination that can't hear it: the index into NO_WAKE_ROUTE_RULES and the seat, or -1. */
|
|
1170
|
+
const noWakeRecipient = (destination, creator) => {
|
|
1171
|
+
const operatorSeat = (deps.resolveOperatorSeat ?? resolveOperatorSeat)();
|
|
1172
|
+
const person = operatorSeat && classOf(operatorSeat) === "gateway-routable" ? operatorSeat : null;
|
|
1173
|
+
const choices = [person, creator, (deps.resolveRecoveryAgentSeat ?? resolveRecoveryAgentSeat)()];
|
|
1174
|
+
const chosen = choices.findIndex((seat) => !!seat && seat !== destination && !sessionMissing(seat) && classOf(seat) !== "unroutable"
|
|
1175
|
+
&& !isBoundTerminalSeat(deps.db, seat));
|
|
1176
|
+
return { chosen, seat: chosen < 0 ? null : choices[chosen] };
|
|
1177
|
+
};
|
|
1178
|
+
/** The person (the operator seat when it's a person's address) or the operator agent: recipients that may see any row. */
|
|
1179
|
+
const seesAnyRow = (seat) => {
|
|
1180
|
+
const operatorSeat = (deps.resolveOperatorSeat ?? resolveOperatorSeat)();
|
|
1181
|
+
if (operatorSeat === seat && classOf(seat) === "gateway-routable")
|
|
1182
|
+
return true;
|
|
1183
|
+
return (deps.resolveRecoveryAgentSeat ?? resolveRecoveryAgentSeat)() === seat;
|
|
1184
|
+
};
|
|
1043
1185
|
const routeAroundNoWake = (c) => {
|
|
1044
1186
|
if (c.route !== c.row.destinationSession)
|
|
1045
1187
|
return;
|
|
@@ -1048,25 +1190,20 @@ export async function runStuckSweep(deps) {
|
|
|
1048
1190
|
const terminalSeat = destination === "pane-bound" && isBoundTerminalSeat(deps.db, c.row.destinationSession);
|
|
1049
1191
|
if (!noRoute && !terminalSeat && !(destination === "hosted" && !c.row.claimedAt))
|
|
1050
1192
|
return;
|
|
1051
|
-
|
|
1052
|
-
const
|
|
1053
|
-
const choices = [person, c.row.sourceSession, (deps.resolveRecoveryAgentSeat ?? resolveRecoveryAgentSeat)()];
|
|
1054
|
-
const chosen = choices.findIndex((seat) => !!seat && seat !== c.route && !sessionMissing(seat) && classOf(seat) !== "unroutable"
|
|
1055
|
-
&& !isBoundTerminalSeat(deps.db, seat));
|
|
1193
|
+
c.noWake = true;
|
|
1194
|
+
const recipient = noWakeRecipient(c.route, c.row.sourceSession);
|
|
1056
1195
|
c.why += noRoute
|
|
1057
1196
|
? `; ${c.route} has no wake route on this daemon (no terminal, not a person). If it's a hosted member, it sees this work only when it next checks, so ask it to; otherwise fix the address`
|
|
1058
1197
|
: terminalSeat
|
|
1059
1198
|
? `; ${c.route} is a terminal seat; nothing there can claim this work, and no wake is typed into it. Route the work to an agent seat`
|
|
1060
1199
|
: `; ${c.route} is a hosted member. OpenRig rang its trigger (${c.row.lastNudgeResult ?? "no ring recorded"}), and it hasn't claimed this work. It sees work only when it checks, so ask it to`;
|
|
1061
|
-
if (
|
|
1200
|
+
if (!recipient.seat) {
|
|
1062
1201
|
c.why += `. No person, creator or operator agent that can be reached is available, so this finding stays addressed to it`;
|
|
1063
1202
|
return;
|
|
1064
1203
|
}
|
|
1065
|
-
c.why += `. This finding goes to ${
|
|
1066
|
-
c.route =
|
|
1204
|
+
c.why += `. This finding goes to ${recipient.seat}, ${NO_WAKE_ROUTE_RULES[recipient.chosen]}`;
|
|
1205
|
+
c.route = recipient.seat;
|
|
1067
1206
|
};
|
|
1068
|
-
/** The two re-routes, in order, for one candidate. */
|
|
1069
|
-
const routeCandidate = (c) => { routeAroundMissing(c); routeAroundNoWake(c); };
|
|
1070
1207
|
for (const c of candidates) {
|
|
1071
1208
|
if (dueToYield())
|
|
1072
1209
|
await yieldLoop();
|
|
@@ -1091,10 +1228,9 @@ export async function runStuckSweep(deps) {
|
|
|
1091
1228
|
// (below). A finding per row stays for a person's address or a terminal seat, for a declared route that failed (its
|
|
1092
1229
|
// finding names why, and a declared delegation parent with no session is one), and for a row that already has a
|
|
1093
1230
|
// recovery.
|
|
1094
|
-
const agentSeats = new Map();
|
|
1095
1231
|
/** An agent seat's node: one whose runtime isn't a terminal, with no declared delegation parent, at an address that
|
|
1096
1232
|
* isn't a person's. An address the human registry can't classify counts as a person's. null for anything else. Read
|
|
1097
|
-
* once per seat
|
|
1233
|
+
* once per seat until other code may have run (agentSeats). */
|
|
1098
1234
|
const agentSeatNode = (session) => {
|
|
1099
1235
|
if (agentSeats.has(session))
|
|
1100
1236
|
return agentSeats.get(session);
|
|
@@ -1113,23 +1249,56 @@ export async function runStuckSweep(deps) {
|
|
|
1113
1249
|
agentSeats.set(session, agent);
|
|
1114
1250
|
return agent;
|
|
1115
1251
|
};
|
|
1252
|
+
// A wake that failed at a live agent seat with no delegation parent or escalates_to made its finding that same seat's,
|
|
1253
|
+
// so the finding's own wake went to the seat that had just failed to take one, onto whatever was in its input box.
|
|
1254
|
+
// The row's creator can act on it (resend, reroute or ask), as the waiting and parked-owner findings already route;
|
|
1255
|
+
// for a seat that sent itself the work, a row OpenRig's own machinery created, or a creator that is a bound terminal
|
|
1256
|
+
// seat (nothing there can claim it, as for the no-wake rule), the operator agent can. A declared
|
|
1257
|
+
// route that failed keeps its fallback, and a finding the two re-routes above moved keeps its recipient. A wake that
|
|
1258
|
+
// found no route never reached the seat, so a seat launched since keeps its own finding, whose wake is the one it missed.
|
|
1259
|
+
const routeAroundFailedWake = (c) => {
|
|
1260
|
+
if (c.kind !== "undelivered-wake" || !startsWithCI(c.row.lastNudgeResult, "failed:") || c.noWake
|
|
1261
|
+
|| c.route !== c.row.destinationSession
|
|
1262
|
+
|| routeNotes.has(c.row.qitemId) || agentSeatNode(c.route) === null)
|
|
1263
|
+
return;
|
|
1264
|
+
const choices = [c.row.sourceSession, (deps.resolveRecoveryAgentSeat ?? resolveRecoveryAgentSeat)()];
|
|
1265
|
+
const chosen = choices.findIndex((seat) => !!seat && seat !== c.route && !isMachinerySession(seat)
|
|
1266
|
+
&& !sessionMissing(seat) && deps.queueRepo.acceptsDestination(seat) && !isBoundTerminalSeat(deps.db, seat));
|
|
1267
|
+
if (chosen < 0) {
|
|
1268
|
+
c.why += `; ${c.route} declares no delegation parent or escalates_to, and its creator and the operator agent (agents.operator_session) are each unset, missing, this seat, OpenRig's own machinery, a terminal seat or not an address this queue takes, so this finding stays addressed to it`;
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
c.why += `; ${c.route} declares no delegation parent or escalates_to, so this finding goes to ${choices[chosen]}, ${FAILED_WAKE_ROUTE_RULES[chosen]}`;
|
|
1272
|
+
c.route = choices[chosen];
|
|
1273
|
+
};
|
|
1274
|
+
/** The three re-routes, in order, for one candidate. The third reads no earlier pass: a failed wake's finding is
|
|
1275
|
+
* routed only here, on the row as it is right before the finding is created. */
|
|
1276
|
+
const routeCandidate = (c) => { routeAroundMissing(c); routeAroundNoWake(c); routeAroundFailedWake(c); };
|
|
1116
1277
|
const selfRoutedUnclaimed = (c) => c.kind === "unclaimed-obligation"
|
|
1117
1278
|
&& c.route === c.row.destinationSession && !routeNotes.has(c.row.qitemId) && agentSeatNode(c.route) !== null;
|
|
1279
|
+
// A hosted member that polls for its work (no wake trigger) can't hear a finding, so each unclaimed row went to a
|
|
1280
|
+
// person as a finding of its own. Those rows share one standing notice per member instead, unless a route the member
|
|
1281
|
+
// declares (a delegation parent or escalates_to) takes them.
|
|
1282
|
+
const polledUnclaimed = (c) => c.kind === "unclaimed-obligation" && c.noWake === true
|
|
1283
|
+
&& !routeNotes.has(c.row.qitemId) && polledRow(c.row);
|
|
1284
|
+
/** The standing notice a candidate belongs to (the seat or member it stands for), or null for a finding of its own. */
|
|
1285
|
+
const backlogKeyOf = (c) => polledUnclaimed(c) ? c.row.destinationSession : selfRoutedUnclaimed(c) ? c.route : null;
|
|
1118
1286
|
const unclaimedBacklog = new Map();
|
|
1119
1287
|
for (const c of [...new Map(candidates.map(c => [c.row.qitemId, c])).values()]) {
|
|
1120
1288
|
if (dueToYield())
|
|
1121
1289
|
await yieldLoop();
|
|
1122
1290
|
const dedupTag = findingDedupTag(c.kind, c.row.qitemId);
|
|
1123
1291
|
const shared = recoveries.find(c.row.qitemId);
|
|
1124
|
-
|
|
1125
|
-
|
|
1292
|
+
const backlogKey = shared ? null : backlogKeyOf(c);
|
|
1293
|
+
if (backlogKey) {
|
|
1294
|
+
const rows = unclaimedBacklog.get(backlogKey);
|
|
1126
1295
|
if (rows)
|
|
1127
1296
|
rows.push(c);
|
|
1128
1297
|
else
|
|
1129
|
-
unclaimedBacklog.set(
|
|
1298
|
+
unclaimedBacklog.set(backlogKey, [c]);
|
|
1130
1299
|
continue;
|
|
1131
1300
|
}
|
|
1132
|
-
const sharedRow = shared ? indexed(() => deps.queueRepo.getById(shared.qitemId)) : null;
|
|
1301
|
+
const sharedRow = shared ? indexed(() => deps.queueRepo.getById(shared.qitemId, { waiting: false })) : null;
|
|
1133
1302
|
// A later accepted deadline can expire after the previous finding closed.
|
|
1134
1303
|
// Its newer time is fresh evidence even when the pickup candidate wins this row.
|
|
1135
1304
|
// An OPEN recovery still owns custody.
|
|
@@ -1204,7 +1373,8 @@ export async function runStuckSweep(deps) {
|
|
|
1204
1373
|
: `Stuck sweep: ${c.kind} on ${c.row.qitemId} (${now_.ageMinutes} min)`,
|
|
1205
1374
|
evidenceRef: `rig queue show ${c.row.qitemId}`,
|
|
1206
1375
|
tags: [STUCK_SWEEP_FINDING_TAG, dedupTag, recoveryTag(c.row.qitemId),
|
|
1207
|
-
...(routed.has(c.row.qitemId) || now_.row.tags?.includes(ESCALATION_HOP_TAG) ? [ESCALATION_HOP_TAG] : [])
|
|
1376
|
+
...(routed.has(c.row.qitemId) || now_.row.tags?.includes(ESCALATION_HOP_TAG) ? [ESCALATION_HOP_TAG] : []),
|
|
1377
|
+
...(now_.row.tags ?? []).filter((tag) => /^(project|mission|slice):/.test(tag))],
|
|
1208
1378
|
// OpenRig's own finding, whoever created the stuck row.
|
|
1209
1379
|
wakeTrigger: "openrig",
|
|
1210
1380
|
};
|
|
@@ -1246,10 +1416,48 @@ export async function runStuckSweep(deps) {
|
|
|
1246
1416
|
const tag = unclaimedBacklogTag(seat);
|
|
1247
1417
|
liveDedupTags.add(tag);
|
|
1248
1418
|
const node = agentSeatNode(seat);
|
|
1419
|
+
// A polling member's notice says whether it's checking in; an agent seat's names the route to add instead.
|
|
1420
|
+
const polled = rows.length > 0 ? rows.some(polledUnclaimed) : pollsForWork(seat);
|
|
1421
|
+
const backlogText = (standsFor) => polled
|
|
1422
|
+
? polledBacklogText(seat, standsFor, ageMinutes, deps.queueRepo.hostedMemberCheckIn(seat, now), now)
|
|
1423
|
+
: unclaimedBacklogText(seat, standsFor, ageMinutes, node);
|
|
1424
|
+
// A polling member's notice goes where its rows' findings went: the person, else their creator when they share one,
|
|
1425
|
+
// else the operator agent. With none, it stays with the member, which reads it when it next checks.
|
|
1426
|
+
const recipientFor = (creators) => {
|
|
1427
|
+
if (!polled)
|
|
1428
|
+
return seat;
|
|
1429
|
+
const distinct = [...new Set(creators)];
|
|
1430
|
+
return noWakeRecipient(seat, distinct.length === 1 ? distinct[0] : null).seat ?? seat;
|
|
1431
|
+
};
|
|
1432
|
+
/** Files a notice and wakes its recipient; false when the create failed (reported in failedCreates). */
|
|
1433
|
+
const fileNotice = async (text, recipient) => {
|
|
1434
|
+
try {
|
|
1435
|
+
const created = await deps.queueRepo.create({
|
|
1436
|
+
// A notice about a seat's own rows comes from that seat, as a restore notice does; OpenRig wakes its recipient.
|
|
1437
|
+
sourceSession: seat,
|
|
1438
|
+
destinationSession: recipient,
|
|
1439
|
+
body: text.body,
|
|
1440
|
+
summary: text.summary,
|
|
1441
|
+
evidenceRef: `rig queue list --destination ${seat} --state pending`,
|
|
1442
|
+
tags: [STUCK_SWEEP_FINDING_TAG, tag],
|
|
1443
|
+
wakeTrigger: "openrig",
|
|
1444
|
+
});
|
|
1445
|
+
othersMayHaveRun();
|
|
1446
|
+
findings.push({ kind: "unclaimed-backlog", qitemId: seat, findingQitemId: created.qitemId, action: "created" });
|
|
1447
|
+
return true;
|
|
1448
|
+
}
|
|
1449
|
+
catch (err) {
|
|
1450
|
+
const message = `unclaimed-backlog notice for ${seat} not created: ${err instanceof Error ? err.message : String(err)}`;
|
|
1451
|
+
othersMayHaveRun();
|
|
1452
|
+
log(`[stuck-sweep] ${message}`);
|
|
1453
|
+
failedCreates.push(message);
|
|
1454
|
+
return false;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1249
1457
|
const last = deps.db
|
|
1250
1458
|
.prepare(
|
|
1251
1459
|
// The first term lets the planner use idx_queue_items_recovery_tags, as the finding lookup above does.
|
|
1252
|
-
`SELECT qitem_id, state, ts_updated, summary, body FROM queue_items
|
|
1460
|
+
`SELECT qitem_id, state, ts_updated, summary, body, destination_session FROM queue_items
|
|
1253
1461
|
WHERE (tags LIKE '%"stuck-sweep:%') AND tags LIKE ? ESCAPE '\\'
|
|
1254
1462
|
ORDER BY CASE WHEN state IN ('pending', 'in-progress', 'blocked') THEN 0 ELSE 1 END,
|
|
1255
1463
|
ts_updated DESC, ts_created DESC, qitem_id DESC
|
|
@@ -1259,7 +1467,7 @@ export async function runStuckSweep(deps) {
|
|
|
1259
1467
|
const listedNow = new Set(rows.map((c) => c.row.qitemId));
|
|
1260
1468
|
const stoodFor = backlogRowsOf(last.body);
|
|
1261
1469
|
const still = [...(stoodFor ?? [])].filter((id) => !listedNow.has(id)).flatMap((id) => {
|
|
1262
|
-
const row = indexed(() => deps.queueRepo.getById(id));
|
|
1470
|
+
const row = indexed(() => deps.queueRepo.getById(id, { waiting: false }));
|
|
1263
1471
|
// Gone, someone else's now, resolved at its source, or held by a finding or recovery of its own: one actually
|
|
1264
1472
|
// written, so a create that failed this pass leaves the row here.
|
|
1265
1473
|
if (!row || row.destinationSession !== seat || recoveries.find(id)
|
|
@@ -1285,7 +1493,28 @@ export async function runStuckSweep(deps) {
|
|
|
1285
1493
|
findings.push({ kind: "unclaimed-backlog", qitemId: seat, findingQitemId: last.qitem_id, action: "closed" });
|
|
1286
1494
|
continue;
|
|
1287
1495
|
}
|
|
1288
|
-
|
|
1496
|
+
// A notice that went to one of its rows' creators (no person reachable) shows that creator only rows it sent. When a
|
|
1497
|
+
// row from anyone else would join it, one notice for every row it stands for goes where a new notice would go now,
|
|
1498
|
+
// which wakes that recipient, and only then does this one close: a notice the sweep closed holds its rows back, so a
|
|
1499
|
+
// failed create leaves it open as it was (not rewritten), and the next pass tries again. A person, the operator
|
|
1500
|
+
// agent and the member see any of the rows.
|
|
1501
|
+
if (polled && last.destination_session !== seat && !seesAnyRow(last.destination_session)
|
|
1502
|
+
&& standsFor.some((r) => r.from !== last.destination_session)) {
|
|
1503
|
+
const recipient = recipientFor(standsFor.map((r) => r.from));
|
|
1504
|
+
if (!(await fileNotice(backlogText(standsFor), recipient)))
|
|
1505
|
+
continue;
|
|
1506
|
+
await deps.queueRepo.update({
|
|
1507
|
+
qitemId: last.qitem_id,
|
|
1508
|
+
actorSession: "stuck-sweep@system",
|
|
1509
|
+
state: "done",
|
|
1510
|
+
closureReason: "no-follow-on",
|
|
1511
|
+
transitionNote: `stuck-sweep re-filed: unclaimed-backlog on ${seat}: a row it stands for didn't come from ${last.destination_session}, the creator it went to; one notice for every row went to ${recipient}`,
|
|
1512
|
+
});
|
|
1513
|
+
othersMayHaveRun();
|
|
1514
|
+
findings.push({ kind: "unclaimed-backlog", qitemId: seat, findingQitemId: last.qitem_id, action: "closed" });
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1517
|
+
const text = backlogText(standsFor);
|
|
1289
1518
|
if (text.summary !== last.summary || text.body !== last.body) {
|
|
1290
1519
|
deps.db.prepare("UPDATE queue_items SET body = ?, summary = ? WHERE qitem_id = ? AND body = ? AND summary IS ? AND state IN ('pending', 'in-progress', 'blocked')")
|
|
1291
1520
|
.run(text.body, text.summary, last.qitem_id, last.body, last.summary);
|
|
@@ -1302,7 +1531,7 @@ export async function runStuckSweep(deps) {
|
|
|
1302
1531
|
const now_ = freshCandidate(c.kind, c.row.qitemId);
|
|
1303
1532
|
if (now_)
|
|
1304
1533
|
routeCandidate(now_);
|
|
1305
|
-
return now_ &&
|
|
1534
|
+
return now_ && backlogKeyOf(now_) === seat && !recoveries.find(now_.row.qitemId) ? [now_] : [];
|
|
1306
1535
|
});
|
|
1307
1536
|
if (current.length === 0)
|
|
1308
1537
|
continue;
|
|
@@ -1310,27 +1539,7 @@ export async function runStuckSweep(deps) {
|
|
|
1310
1539
|
const covered = last ? backlogRowsOf(last.body) : null;
|
|
1311
1540
|
if (last && !current.some((c) => (covered !== null && !covered.has(c.row.qitemId)) || evidenceIsNewer(c.evidenceAt, last.ts_updated)))
|
|
1312
1541
|
continue;
|
|
1313
|
-
|
|
1314
|
-
try {
|
|
1315
|
-
const created = await deps.queueRepo.create({
|
|
1316
|
-
// A notice to a seat about its own rows comes from that seat, as a restore notice does; OpenRig wakes it.
|
|
1317
|
-
sourceSession: seat,
|
|
1318
|
-
destinationSession: seat,
|
|
1319
|
-
body: text.body,
|
|
1320
|
-
summary: text.summary,
|
|
1321
|
-
evidenceRef: `rig queue list --destination ${seat} --state pending`,
|
|
1322
|
-
tags: [STUCK_SWEEP_FINDING_TAG, tag],
|
|
1323
|
-
wakeTrigger: "openrig",
|
|
1324
|
-
});
|
|
1325
|
-
othersMayHaveRun();
|
|
1326
|
-
findings.push({ kind: "unclaimed-backlog", qitemId: seat, findingQitemId: created.qitemId, action: "created" });
|
|
1327
|
-
}
|
|
1328
|
-
catch (err) {
|
|
1329
|
-
const message = `unclaimed-backlog notice for ${seat} not created: ${err instanceof Error ? err.message : String(err)}`;
|
|
1330
|
-
othersMayHaveRun();
|
|
1331
|
-
log(`[stuck-sweep] ${message}`);
|
|
1332
|
-
failedCreates.push(message);
|
|
1333
|
-
}
|
|
1542
|
+
await fileNotice(backlogText(current.map(backlogRow)), recipientFor(current.map((c) => c.row.sourceSession)));
|
|
1334
1543
|
}
|
|
1335
1544
|
// Resolution: an open finding whose underlying condition is no longer detected closes
|
|
1336
1545
|
// with its reason — the sweep cleans up after itself, no human unwind.
|
|
@@ -1360,7 +1569,7 @@ export async function runStuckSweep(deps) {
|
|
|
1360
1569
|
continue;
|
|
1361
1570
|
// #2661: a claim working only on a grace (a background shell, a pending managed restore) is not resolved: the
|
|
1362
1571
|
// grace stops new detection, and an open stall recovery stays open, so the ceiling's expiry stays actionable.
|
|
1363
|
-
if (kind === "stalled-after-claim" && stuckId && deps.queueRepo.getById(stuckId)?.pickup?.grace)
|
|
1572
|
+
if (kind === "stalled-after-claim" && stuckId && deps.queueRepo.getById(stuckId, { waiting: false })?.pickup?.grace)
|
|
1364
1573
|
continue;
|
|
1365
1574
|
let resolution = "no longer detected";
|
|
1366
1575
|
if (stuckId && (kind === "undelivered-wake" || kind === "undelivered-human-notice" || kind === "unclaimed-obligation")) {
|
|
@@ -1401,11 +1610,11 @@ export async function runStuckSweep(deps) {
|
|
|
1401
1610
|
if (failedCreates.length > 0) {
|
|
1402
1611
|
// Not a clean or complete pass: say so, while keeping the findings that were made.
|
|
1403
1612
|
const error = failedCreates.join("; ");
|
|
1404
|
-
status?.record("failed", { error,
|
|
1613
|
+
status?.record("failed", { error, ...findingCounts(deps.db, findings) });
|
|
1405
1614
|
return { outcome: "failed", findings, error };
|
|
1406
1615
|
}
|
|
1407
1616
|
const outcome = findings.length > 0 ? "findings" : "clean";
|
|
1408
|
-
status?.record(outcome,
|
|
1617
|
+
status?.record(outcome, findingCounts(deps.db, findings));
|
|
1409
1618
|
return { outcome, findings };
|
|
1410
1619
|
}
|
|
1411
1620
|
catch (err) {
|