@openrig/cli 0.5.10 → 0.5.11
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/daemon/assets/plugins/openrig-core/README.md +24 -5
- package/daemon/assets/plugins/openrig-core/skills/agent-operated-workflows/SKILL.md +4 -2
- package/daemon/assets/plugins/openrig-core/skills/applying-a-permission-policy/SKILL.md +11 -14
- package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +51 -59
- package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +11 -10
- package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/SKILL.md +39 -50
- package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/trunk-diff.sh +1 -1
- package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/templates/LEARNED.md +7 -5
- package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/templates/PLAYBOOK.md +3 -4
- package/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/templates/SPEC.md +7 -7
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +55 -64
- package/daemon/assets/plugins/openrig-core/skills/orienting-to-an-inherited-seat/CHANGELOG.md +14 -58
- package/daemon/assets/plugins/openrig-core/skills/queue-handoff/SKILL.md +8 -9
- package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/CHANGELOG.md +20 -46
- package/daemon/assets/plugins/openrig-core/skills/retiring-and-inheriting-a-seat/SKILL.md +62 -76
- package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +28 -22
- package/daemon/assets/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md +13 -15
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -3
- package/daemon/context-packs/onboarding-width/public-reference-material.md +19 -24
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +55 -24
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/SKILL.md +4 -2
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/SKILL.md +11 -14
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +51 -59
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/SKILL.md +21 -19
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/SKILL.md +11 -10
- 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/SKILL.md +84 -148
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +3 -3
- 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/SKILL.md +40 -47
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +16 -0
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/SKILL.md +12 -10
- 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/SKILL.md +15 -13
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/SKILL.md +11 -10
- 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/SKILL.md +39 -50
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/scripts/trunk-diff.sh +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/templates/LEARNED.md +7 -5
- package/daemon/context-packs/skills/openrig-operating-model/templates/PLAYBOOK.md +3 -4
- package/daemon/context-packs/skills/openrig-operating-model/templates/SPEC.md +7 -7
- package/daemon/context-packs/skills/openrig-user/SKILL.md +55 -64
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/CHANGELOG.md +14 -58
- 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/SKILL.md +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/SKILL.md +2 -2
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/SKILL.md +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/SKILL.md +3 -3
- 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/SKILL.md +41 -59
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/LOCAL-INSIGHTS.md +24 -53
- 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/find-polluter.sh +29 -15
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/SKILL.md +47 -40
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/SKILL.md +3 -3
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/SKILL.md +8 -9
- 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/CHANGELOG.md +20 -46
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/SKILL.md +62 -76
- 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 +28 -22
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/SKILL.md +13 -15
- 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/build-your-world.md +12 -7
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/tmux.d.ts +7 -9
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +7 -35
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/daemon-shutdown.d.ts +27 -0
- package/daemon/dist/daemon-shutdown.d.ts.map +1 -0
- package/daemon/dist/daemon-shutdown.js +84 -0
- package/daemon/dist/daemon-shutdown.js.map +1 -0
- package/daemon/dist/domain/codex-thread-id.d.ts +1 -0
- package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/daemon/dist/domain/codex-thread-id.js +32 -23
- package/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/daemon/dist/domain/context-usage-store.d.ts +2 -0
- package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/daemon/dist/domain/context-usage-store.js +7 -28
- package/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/daemon/dist/domain/crash-cart-conductor.js +1 -1
- package/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +24 -3
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/channel-operations.d.ts +1 -1
- package/daemon/dist/domain/gateway/channel-operations.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/connections-projection.d.ts +61 -0
- package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -0
- package/daemon/dist/domain/gateway/connections-projection.js +149 -0
- package/daemon/dist/domain/gateway/connections-projection.js.map +1 -0
- package/daemon/dist/domain/gateway/human-registry.d.ts +3 -1
- package/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/human-registry.js +3 -1
- package/daemon/dist/domain/gateway/human-registry.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 +3 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/health-diagnosis.js +1 -1
- package/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/daemon/dist/domain/lifecycle-obligations.d.ts +18 -0
- package/daemon/dist/domain/lifecycle-obligations.d.ts.map +1 -0
- package/daemon/dist/domain/lifecycle-obligations.js +35 -0
- package/daemon/dist/domain/lifecycle-obligations.js.map +1 -0
- package/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js +6 -1
- package/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts +1 -0
- package/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/daemon/dist/domain/policies/workflow-keepalive.js +7 -4
- package/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/daemon/dist/domain/project-lifecycle-compiler.d.ts +7 -0
- package/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
- package/daemon/dist/domain/project-lifecycle-compiler.js +119 -23
- package/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +1 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +8 -1
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +27 -11
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-proof.d.ts.map +1 -1
- package/daemon/dist/domain/startup-proof.js +10 -9
- package/daemon/dist/domain/startup-proof.js.map +1 -1
- package/daemon/dist/domain/startup-resolver.d.ts +3 -1
- package/daemon/dist/domain/startup-resolver.d.ts.map +1 -1
- package/daemon/dist/domain/startup-resolver.js +18 -0
- package/daemon/dist/domain/startup-resolver.js.map +1 -1
- package/daemon/dist/domain/startup-validation.d.ts.map +1 -1
- package/daemon/dist/domain/startup-validation.js +12 -1
- package/daemon/dist/domain/startup-validation.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +13 -1
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +14 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.d.ts +1 -0
- package/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-boot-sweep.js +3 -0
- package/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.d.ts +4 -3
- package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-escalation.js +22 -21
- package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/daemon/dist/domain/workflow-exception-router.d.ts +4 -3
- package/daemon/dist/domain/workflow-exception-router.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-exception-router.js +7 -6
- package/daemon/dist/domain/workflow-exception-router.js.map +1 -1
- package/daemon/dist/domain/workflow-human-destination.d.ts +18 -0
- package/daemon/dist/domain/workflow-human-destination.d.ts.map +1 -0
- package/daemon/dist/domain/workflow-human-destination.js +40 -0
- package/daemon/dist/domain/workflow-human-destination.js.map +1 -0
- package/daemon/dist/domain/workflow-projector.d.ts +4 -3
- package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +26 -17
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-role-context.d.ts +4 -6
- package/daemon/dist/domain/workflow-role-context.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-role-context.js +7 -14
- package/daemon/dist/domain/workflow-role-context.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +12 -3
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +66 -14
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-validator.js +39 -24
- package/daemon/dist/domain/workflow-validator.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +37 -96
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/project-lifecycle-surface.d.ts +1 -1
- package/daemon/dist/project-lifecycle-surface.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.d.ts.map +1 -1
- package/daemon/dist/routes/gateway.js +10 -0
- package/daemon/dist/routes/gateway.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +4 -3
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/require-sender-identity.d.ts +3 -1
- package/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/daemon/dist/routes/require-sender-identity.js +11 -5
- package/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +95 -27
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +6 -1
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +2 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +6 -3
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-spec.md +6 -0
- package/daemon/docs/reference/getting-started.md +134 -28
- package/daemon/docs/reference/health-diagnosis.md +26 -0
- package/daemon/docs/reference/mission-install.md +5 -0
- package/daemon/docs/reference/project-release-profile.yaml +82 -0
- package/daemon/docs/reference/release-boundary.md +5 -0
- package/daemon/docs/reference/rig-spec.md +43 -4
- package/daemon/specs/agents/conveyor/planner/guidance/role.md +5 -3
- package/daemon/specs/agents/conveyor/planner/startup/context.md +13 -4
- package/daemon/specs/agents/design/product-designer/agent.yaml +4 -3
- package/daemon/specs/agents/design/product-designer/guidance/role.md +12 -10
- package/daemon/specs/agents/product-management/pm/guidance/role.md +19 -17
- package/daemon/specs/agents/shared/skills/core/agent-starters/SKILL.md +21 -19
- package/daemon/specs/agents/shared/skills/core/agent-startup-and-context-ingestion/SKILL.md +11 -10
- package/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md +84 -148
- package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +40 -47
- package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +16 -0
- package/daemon/specs/agents/shared/skills/core/session-source-fork/SKILL.md +12 -10
- package/daemon/specs/agents/shared/skills/core/topology-mutation-and-seat-management/SKILL.md +15 -13
- package/daemon/specs/agents/shared/skills/pm/exec-summary/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/pm/plan-review/SKILL.md +2 -2
- package/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md +1 -1
- package/daemon/specs/agents/shared/skills/pm/ui-mockup/SKILL.md +3 -3
- package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +41 -59
- package/daemon/specs/agents/shared/skills/process/agent-browser/LOCAL-INSIGHTS.md +24 -53
- package/daemon/specs/agents/shared/skills/process/systematic-debugging/find-polluter.sh +29 -15
- package/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md +47 -40
- package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +3 -3
- package/daemon/specs/rigs/launch/first-project/CULTURE.md +39 -0
- package/daemon/specs/rigs/launch/first-project/rig.yaml +31 -0
- package/daemon/specs/rigs/launch/kernel/agents/advisor/lead/startup/context.md +1 -1
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +21 -7
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +2 -2
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/guidance/role.md +19 -11
- package/daemon/specs/rigs/launch/kernel/agents/queue/worker/startup/context.md +3 -2
- package/daemon/specs/rigs/launch/kernel/culture/CULTURE.md +15 -8
- package/daemon/specs/rigs/launch/kernel/rig-claude-only.yaml +7 -0
- package/daemon/specs/rigs/launch/kernel/rig-codex-only.yaml +7 -0
- package/daemon/specs/rigs/launch/kernel/rig.yaml +9 -4
- package/daemon/specs/rigs/preview/product-team/topology/seats/dev1-qa/CRAFT.md +6 -4
- package/dist/build-info.js +3 -3
- package/dist/client.d.ts +6 -20
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +53 -32
- package/dist/client.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +1 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +15 -13
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +31 -27
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/destroy.js +1 -1
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +59 -7
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +2 -2
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +9 -5
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +4 -8
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +10 -9
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/tui.d.ts +2 -0
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js +26 -10
- package/dist/commands/tui.js.map +1 -1
- package/dist/commands/walk.d.ts.map +1 -1
- package/dist/commands/walk.js +24 -48
- package/dist/commands/walk.js.map +1 -1
- package/dist/commands/workflow-render.d.ts +19 -0
- package/dist/commands/workflow-render.d.ts.map +1 -1
- package/dist/commands/workflow-render.js +12 -1
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -2
- package/dist/commands/workflow.js.map +1 -1
- package/dist/config-store.d.ts +2 -1
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +15 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-executor.d.ts +1 -1
- package/dist/cross-host-executor.js +2 -2
- package/dist/cross-host-executor.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +8 -11
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +281 -146
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-start-lock.d.ts +9 -0
- package/dist/daemon-start-lock.d.ts.map +1 -0
- package/dist/daemon-start-lock.js +47 -0
- package/dist/daemon-start-lock.js.map +1 -0
- package/dist/front-door.d.ts.map +1 -1
- package/dist/front-door.js +8 -1
- package/dist/front-door.js.map +1 -1
- package/dist/lib/file-transfer.js +1 -1
- package/dist/lib/file-transfer.js.map +1 -1
- package/dist/lib/walk-consumption.d.ts +6 -0
- package/dist/lib/walk-consumption.d.ts.map +1 -0
- package/dist/lib/walk-consumption.js +78 -0
- package/dist/lib/walk-consumption.js.map +1 -0
- package/dist/local-origin.d.ts +3 -0
- package/dist/local-origin.d.ts.map +1 -0
- package/dist/local-origin.js +37 -0
- package/dist/local-origin.js.map +1 -0
- package/dist/read-view.d.ts +17 -0
- package/dist/read-view.d.ts.map +1 -0
- package/dist/read-view.js +17 -0
- package/dist/read-view.js.map +1 -0
- package/dist/shared-tui.d.ts +12 -0
- package/dist/shared-tui.d.ts.map +1 -0
- package/dist/shared-tui.js +37 -0
- package/dist/shared-tui.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts +7 -9
- package/node_modules/@openrig/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/adapters/tmux.js +7 -35
- package/node_modules/@openrig/daemon/dist/adapters/tmux.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/build-info.js +3 -3
- package/node_modules/@openrig/daemon/dist/daemon-shutdown.d.ts +27 -0
- package/node_modules/@openrig/daemon/dist/daemon-shutdown.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/daemon-shutdown.js +84 -0
- package/node_modules/@openrig/daemon/dist/daemon-shutdown.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts +1 -0
- package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js +32 -23
- package/node_modules/@openrig/daemon/dist/domain/codex-thread-id.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts +2 -0
- package/node_modules/@openrig/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js +7 -28
- package/node_modules/@openrig/daemon/dist/domain/context-usage-store.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js +1 -1
- package/node_modules/@openrig/daemon/dist/domain/crash-cart-conductor.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/execution-view.js +24 -3
- package/node_modules/@openrig/daemon/dist/domain/execution-view.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/channel-operations.d.ts +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/channel-operations.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/connections-projection.d.ts +61 -0
- package/node_modules/@openrig/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/gateway/connections-projection.js +149 -0
- package/node_modules/@openrig/daemon/dist/domain/gateway/connections-projection.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts +3 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js +3 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/human-registry.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/gateway/slack/slack-subsystem.js +3 -2
- package/node_modules/@openrig/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/health-diagnosis.js +1 -1
- package/node_modules/@openrig/daemon/dist/domain/health-diagnosis.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/lifecycle-obligations.d.ts +18 -0
- package/node_modules/@openrig/daemon/dist/domain/lifecycle-obligations.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/lifecycle-obligations.js +35 -0
- package/node_modules/@openrig/daemon/dist/domain/lifecycle-obligations.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js +6 -1
- package/node_modules/@openrig/daemon/dist/domain/model-divergence/current-generation-record.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.d.ts +1 -0
- package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js +7 -4
- package/node_modules/@openrig/daemon/dist/domain/policies/workflow-keepalive.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts +7 -0
- package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js +119 -23
- package/node_modules/@openrig/daemon/dist/domain/project-lifecycle-compiler.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/queue-stuck-sweep.js +1 -0
- package/node_modules/@openrig/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js +8 -1
- package/node_modules/@openrig/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js +27 -11
- package/node_modules/@openrig/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-proof.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-proof.js +10 -9
- package/node_modules/@openrig/daemon/dist/domain/startup-proof.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-resolver.d.ts +3 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-resolver.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-resolver.js +18 -0
- package/node_modules/@openrig/daemon/dist/domain/startup-resolver.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-validation.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-validation.js +12 -1
- package/node_modules/@openrig/daemon/dist/domain/startup-validation.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/types.d.ts +13 -1
- package/node_modules/@openrig/daemon/dist/domain/types.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/types.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
- package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js +14 -0
- package/node_modules/@openrig/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.d.ts +1 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js +3 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-boot-sweep.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-escalation.d.ts +4 -3
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-escalation.js +22 -21
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-router.d.ts +4 -3
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-router.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-router.js +7 -6
- package/node_modules/@openrig/daemon/dist/domain/workflow-exception-router.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-human-destination.d.ts +18 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-human-destination.d.ts.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-human-destination.js +40 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-human-destination.js.map +1 -0
- package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts +4 -3
- package/node_modules/@openrig/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js +26 -17
- package/node_modules/@openrig/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-role-context.d.ts +4 -6
- package/node_modules/@openrig/daemon/dist/domain/workflow-role-context.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-role-context.js +7 -14
- package/node_modules/@openrig/daemon/dist/domain/workflow-role-context.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts +12 -3
- package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js +66 -14
- package/node_modules/@openrig/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-validator.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js +39 -24
- package/node_modules/@openrig/daemon/dist/domain/workflow-validator.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/index.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/index.js +37 -96
- package/node_modules/@openrig/daemon/dist/index.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts +1 -1
- package/node_modules/@openrig/daemon/dist/project-lifecycle-surface.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/gateway.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/gateway.js +10 -0
- package/node_modules/@openrig/daemon/dist/routes/gateway.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/queue.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/queue.js +4 -3
- package/node_modules/@openrig/daemon/dist/routes/queue.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/require-sender-identity.d.ts +3 -1
- package/node_modules/@openrig/daemon/dist/routes/require-sender-identity.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/require-sender-identity.js +11 -5
- package/node_modules/@openrig/daemon/dist/routes/require-sender-identity.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/sessions.js +95 -27
- package/node_modules/@openrig/daemon/dist/routes/sessions.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/routes/workflow.js +6 -1
- package/node_modules/@openrig/daemon/dist/routes/workflow.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/server.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/server.js +2 -1
- package/node_modules/@openrig/daemon/dist/server.js.map +1 -1
- package/node_modules/@openrig/daemon/dist/startup.d.ts.map +1 -1
- package/node_modules/@openrig/daemon/dist/startup.js +6 -3
- package/node_modules/@openrig/daemon/dist/startup.js.map +1 -1
- package/node_modules/@openrig/daemon/package.json +5 -1
- package/package.json +1 -1
- package/tui/dist/commands/completion.d.ts +8 -0
- package/tui/dist/commands/completion.d.ts.map +1 -0
- package/tui/dist/commands/completion.js +37 -0
- package/tui/dist/commands/completion.js.map +1 -0
- package/tui/dist/commands/registry.d.ts +7 -1
- package/tui/dist/commands/registry.d.ts.map +1 -1
- package/tui/dist/commands/registry.js +47 -0
- package/tui/dist/commands/registry.js.map +1 -1
- package/tui/dist/connections/connections-model.d.ts +72 -0
- package/tui/dist/connections/connections-model.d.ts.map +1 -0
- package/tui/dist/connections/connections-model.js +64 -0
- package/tui/dist/connections/connections-model.js.map +1 -0
- package/tui/dist/daemon-client.d.ts +1 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js +1 -0
- 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 +23 -0
- package/tui/dist/detail.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts +1 -1
- package/tui/dist/execution/execution-model.d.ts.map +1 -1
- package/tui/dist/execution/execution-model.js +46 -170
- package/tui/dist/execution/execution-model.js.map +1 -1
- package/tui/dist/execution/workflow-model.d.ts +6 -0
- package/tui/dist/execution/workflow-model.d.ts.map +1 -0
- package/tui/dist/execution/workflow-model.js +219 -0
- package/tui/dist/execution/workflow-model.js.map +1 -0
- package/tui/dist/grammar.d.ts.map +1 -1
- package/tui/dist/grammar.js +1 -2
- package/tui/dist/grammar.js.map +1 -1
- package/tui/dist/health/health-model.d.ts +1 -1
- package/tui/dist/health/health-model.d.ts.map +1 -1
- package/tui/dist/health/health-model.js +5 -4
- package/tui/dist/health/health-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +45 -8
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/input.d.ts +2 -0
- package/tui/dist/input.d.ts.map +1 -1
- package/tui/dist/input.js +28 -6
- package/tui/dist/input.js.map +1 -1
- package/tui/dist/main.js +47 -10
- package/tui/dist/main.js.map +1 -1
- package/tui/dist/render.d.ts +4 -0
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +128 -74
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/sections.d.ts.map +1 -1
- package/tui/dist/sections.js +1 -0
- package/tui/dist/sections.js.map +1 -1
- package/tui/dist/socket-server.d.ts +4 -0
- package/tui/dist/socket-server.d.ts.map +1 -1
- package/tui/dist/socket-server.js +4 -0
- package/tui/dist/socket-server.js.map +1 -1
- package/tui/dist/state.d.ts +3 -1
- package/tui/dist/state.d.ts.map +1 -1
- package/tui/dist/state.js +47 -9
- package/tui/dist/state.js.map +1 -1
- package/tui/dist/stylize.js +3 -3
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/time.d.ts +9 -0
- package/tui/dist/time.d.ts.map +1 -0
- package/tui/dist/time.js +42 -0
- package/tui/dist/time.js.map +1 -0
- package/tui/dist/types.d.ts +36 -1
- package/tui/dist/types.d.ts.map +1 -1
|
@@ -29,6 +29,9 @@ import { ensureWorkflowKeepaliveArmed } from "./workflow-keepalive-arming.js";
|
|
|
29
29
|
export async function runWorkflowBootSweep(deps) {
|
|
30
30
|
const log = deps.log ?? (() => { });
|
|
31
31
|
const now = (deps.now ?? (() => new Date()))();
|
|
32
|
+
const exceptionsClosed = deps.reconcileStuckExceptions?.() ?? 0;
|
|
33
|
+
if (exceptionsClosed)
|
|
34
|
+
log(`workflow boot sweep: ${exceptionsClosed} resolved overdue exception item(s) closed`);
|
|
32
35
|
const instances = [
|
|
33
36
|
...deps.instanceStore.listByStatus("active"),
|
|
34
37
|
...deps.instanceStore.listByStatus("waiting"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-boot-sweep.js","sourceRoot":"","sources":["../../src/domain/workflow-boot-sweep.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,mDAAmD;AACnD,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,uEAAuE;AACvE,2BAA2B;AAC3B,EAAE;AACF,oEAAoE;AACpE,oEAAoE;AACpE,uBAAuB;AACvB,6DAA6D;AAC7D,mEAAmE;AACnE,iEAAiE;AACjE,sEAAsE;AACtE,6DAA6D;AAC7D,+DAA+D;AAC/D,uEAAuE;AACvE,kEAAkE;AAClE,EAAE;AACF,gEAAgE;AAChE,yDAAyD;AACzD,EAAE;AACF,sEAAsE;AACtE,0DAA0D;AAK1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-bo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G,CACD,qEAAqE,QAAQ,CAAC,UAAU,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAChJ,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,GAAG,CACD,wBAAwB,MAAM,CAAC,cAAc,4BAA4B,MAAM,CAAC,eAAe,wBAAwB,MAAM,CAAC,kBAAkB,4BAA4B,MAAM,CAAC,aAAa,oBAAoB,MAAM,CAAC,qBAAqB,4BAA4B,CAC7Q,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type Database from "better-sqlite3";
|
|
2
|
-
import type
|
|
2
|
+
import { type QueueRepository } from "./queue-repository.js";
|
|
3
3
|
import type { WorkflowDeadlineVerdict } from "./workflow-deadline.js";
|
|
4
4
|
import { type WorkflowExceptionClass } from "./workflow-exception.js";
|
|
5
5
|
import type { ExceptionRoute } from "./workflow-exception-router.js";
|
|
6
|
+
import { type WorkflowHumanDestination } from "./workflow-human-destination.js";
|
|
6
7
|
export interface EnsureStuckExceptionInput {
|
|
7
8
|
workflowName: string;
|
|
8
9
|
workflowVersion: string;
|
|
@@ -21,12 +22,12 @@ export interface StuckExceptionDeps {
|
|
|
21
22
|
queueRepo: QueueRepository;
|
|
22
23
|
/** The maturity-dial resolution for a cached spec (runtime-owned —
|
|
23
24
|
* spec lookup + the shipped role resolution live there). null =
|
|
24
|
-
* spec not cached;
|
|
25
|
+
* spec not cached; registered-human selection applies.
|
|
25
26
|
* OPR.0.4.6.FAC1 (arch Q3): boundRig = the stuck instance's bound
|
|
26
27
|
* rig (read from workflow_instances at detection time) so the
|
|
27
28
|
* orchestrator-role dial position resolves capability-aware. */
|
|
28
29
|
resolveRoute: (workflowName: string, workflowVersion: string, exceptionClass: WorkflowExceptionClass, boundRig?: string | null) => ExceptionRoute | null;
|
|
29
|
-
humanFallbackSeat?:
|
|
30
|
+
humanFallbackSeat?: WorkflowHumanDestination;
|
|
30
31
|
log?: (line: string) => void;
|
|
31
32
|
}
|
|
32
33
|
export declare function makeEnsureStuckExceptionItem(deps: StuckExceptionDeps): EnsureStuckExceptionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-exception-escalation.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-exception-escalation.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"workflow-exception-escalation.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-exception-escalation.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAA4B,KAAK,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE1G,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB;6EACyE;IACzE,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,KAAK,EAAE,yBAAyB,KAC7B,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B;;;;;qEAKiE;IACjE,YAAY,EAAE,CACZ,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,sBAAsB,EACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,KACrB,cAAc,GAAG,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IAC7C,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,kBAAkB,GAAG,wBAAwB,CAwF/F"}
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
// send|skip|terminal) — the keepalive calls this injected helper as a
|
|
21
21
|
// side effect of its EXISTING evaluation; the sweep likewise. Injection
|
|
22
22
|
// at startup per the validateRig precedent.
|
|
23
|
+
import { QueueRepositoryError } from "./queue-repository.js";
|
|
23
24
|
import { classifyDeadlineVerdict, workflowExceptionTags, } from "./workflow-exception.js";
|
|
25
|
+
import { workflowHumanDestination } from "./workflow-human-destination.js";
|
|
24
26
|
export function makeEnsureStuckExceptionItem(deps) {
|
|
25
27
|
const log = deps.log ?? (() => { });
|
|
26
|
-
const fallbackSeat = deps.humanFallbackSeat ?? "human@host";
|
|
27
28
|
return async (input) => {
|
|
28
29
|
const exception = classifyDeadlineVerdict(input.workflowName, input.verdict);
|
|
29
30
|
if (!exception)
|
|
@@ -34,8 +35,13 @@ export function makeEnsureStuckExceptionItem(deps) {
|
|
|
34
35
|
const open = deps.db
|
|
35
36
|
.prepare(`SELECT qitem_id, destination_session FROM queue_items
|
|
36
37
|
WHERE state IN ('pending','in-progress','blocked')
|
|
37
|
-
AND tags
|
|
38
|
-
|
|
38
|
+
AND json_valid(tags)
|
|
39
|
+
AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = ?)
|
|
40
|
+
AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = ?)
|
|
41
|
+
AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = ?)
|
|
42
|
+
AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = 'workflow-exception')
|
|
43
|
+
AND EXISTS (SELECT 1 FROM json_each(tags) WHERE value = 'exception:stuck_overdue')`)
|
|
44
|
+
.get(`occurrence:${exception.identity.occurrenceKey}`, `instance:${exception.identity.instanceId}`, `workflow:${exception.identity.workflowName}`);
|
|
39
45
|
if (open) {
|
|
40
46
|
// Re-detection of the same unresolved episode: re-nudge the ONE
|
|
41
47
|
// item (best-effort — the durable item is the guarantee).
|
|
@@ -44,24 +50,19 @@ export function makeEnsureStuckExceptionItem(deps) {
|
|
|
44
50
|
}
|
|
45
51
|
// OPR.0.4.6.FAC1 (arch Q3): each exception item is a FRESH routing
|
|
46
52
|
// decision at its own detection moment — read the stuck instance's
|
|
47
|
-
// bound rig NOW
|
|
48
|
-
//
|
|
53
|
+
// bound rig NOW. A failed read cannot establish an unbound instance:
|
|
54
|
+
// propagate it before any routing or queue write.
|
|
49
55
|
let detectionBoundRig = null;
|
|
50
56
|
const stuckInstanceId = exception.deadlineEvidence?.instanceId;
|
|
51
57
|
if (stuckInstanceId) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
detectionBoundRig = row?.bound_rig ?? null;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
detectionBoundRig = null;
|
|
60
|
-
}
|
|
58
|
+
const row = deps.db
|
|
59
|
+
.prepare(`SELECT bound_rig FROM workflow_instances WHERE instance_id = ?`)
|
|
60
|
+
.get(stuckInstanceId);
|
|
61
|
+
detectionBoundRig = row?.bound_rig ?? null;
|
|
61
62
|
}
|
|
62
63
|
const route = deps.resolveRoute(input.workflowName, input.workflowVersion, "stuck_overdue", detectionBoundRig) ?? {
|
|
63
64
|
position: "fallback",
|
|
64
|
-
destinationSession:
|
|
65
|
+
destinationSession: workflowHumanDestination(deps.humanFallbackSeat),
|
|
65
66
|
tier: "human-gate",
|
|
66
67
|
humanRouted: true,
|
|
67
68
|
resolvedVia: "engine-default",
|
|
@@ -90,12 +91,12 @@ export function makeEnsureStuckExceptionItem(deps) {
|
|
|
90
91
|
try {
|
|
91
92
|
created = await createItem(route.destinationSession, route.tier);
|
|
92
93
|
}
|
|
93
|
-
catch {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
// storage
|
|
98
|
-
created = await createItem(
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (!(error instanceof QueueRepositoryError) || error.code !== "unknown_destination_rig" || route.humanRouted)
|
|
96
|
+
throw error;
|
|
97
|
+
// An unavailable agent rig may use the registered human fallback.
|
|
98
|
+
// Other admission/storage failures retain their original diagnosis.
|
|
99
|
+
created = await createItem(workflowHumanDestination(deps.humanFallbackSeat), "human-gate");
|
|
99
100
|
}
|
|
100
101
|
log(`workflow exception: stuck_overdue item ${created.qitemId} created for instance ${e.instanceId} (step ${e.stepId ?? "?"}, ${route.position})`);
|
|
101
102
|
return { outcome: "created", qitemId: created.qitemId };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-exception-escalation.js","sourceRoot":"","sources":["../../src/domain/workflow-exception-escalation.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,2BAA2B;AAC3B,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,uEAAuE;AACvE,yEAAyE;AACzE,6BAA6B;AAC7B,EAAE;AACF,6DAA6D;AAC7D,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,uEAAuE;AACvE,sEAAsE;AACtE,qEAAqE;AACrE,yCAAyC;AACzC,EAAE;AACF,qEAAqE;AACrE,sEAAsE;AACtE,wEAAwE;AACxE,4CAA4C;
|
|
1
|
+
{"version":3,"file":"workflow-exception-escalation.js","sourceRoot":"","sources":["../../src/domain/workflow-exception-escalation.ts"],"names":[],"mappings":"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CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WorkflowExceptionClass } from "./workflow-exception.js";
|
|
2
2
|
import type { WorkflowExceptionDialPosition, WorkflowSpec } from "./workflow-types.js";
|
|
3
|
+
import { type WorkflowHumanDestination } from "./workflow-human-destination.js";
|
|
3
4
|
/** The ordinary workflow-packet tier (the shipped default the attention
|
|
4
5
|
* union deliberately does NOT match on). */
|
|
5
6
|
export declare const WORKFLOW_EXCEPTION_ORCHESTRATOR_TIER = "mode2";
|
|
@@ -14,12 +15,12 @@ export interface ExceptionRouteInput {
|
|
|
14
15
|
/** The shipped role→preferred_targets resolution, wrapped by the caller
|
|
15
16
|
* (workflow-runtime owns runtime matching). null = unresolvable. */
|
|
16
17
|
resolveRoleTarget: (roleName: string) => string | null;
|
|
17
|
-
/**
|
|
18
|
-
humanFallbackSeat
|
|
18
|
+
/** Lazy: a valid agent route must not require human configuration. */
|
|
19
|
+
humanFallbackSeat?: WorkflowHumanDestination;
|
|
19
20
|
}
|
|
20
21
|
export interface ExceptionRoute {
|
|
21
22
|
/** Where the chain landed. `fallback` = orchestrator position whose
|
|
22
|
-
* role target did not resolve
|
|
23
|
+
* role target did not resolve. */
|
|
23
24
|
position: "orchestrator" | "human_only" | "fallback";
|
|
24
25
|
destinationSession: string;
|
|
25
26
|
/** THE TIER SPLIT — human-gate iff humanRouted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-exception-router.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-exception-router.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-exception-router.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-exception-router.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAA4B,KAAK,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE1G;6CAC6C;AAC7C,eAAO,MAAM,oCAAoC,UAAU,CAAC;AAC5D,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,sBAAsB,CAAC;IACvC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC;IACxD;gDAC4C;IAC5C,eAAe,EAAE,6BAA6B,GAAG,IAAI,CAAC;IACtD;yEACqE;IACrE,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACvD,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC7B;uCACmC;IACnC,QAAQ,EAAE,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;IACrD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB;qCACiC;IACjC,WAAW,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,cAAc,GAAG,gBAAgB,CAAC;CAC7G;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc,CAsDhF"}
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
// 2. the spec's declared per-WORKFLOW default (exception_routing.default)
|
|
8
8
|
// 3. the host-level dial default (settings key
|
|
9
9
|
// `workflow.exception_routing` — the MH-1 dynamic-key pattern;
|
|
10
|
-
// READ BY THE CALLER and passed in
|
|
10
|
+
// READ BY THE CALLER and passed in)
|
|
11
11
|
// 4. absent everywhere → ORCHESTRATOR-FIRST (the v1.3 engine default)
|
|
12
12
|
//
|
|
13
13
|
// Position → target:
|
|
14
14
|
// orchestrator → the spec-declared orchestrator role, resolved through
|
|
15
15
|
// the SAME shipped role→preferred_targets mechanism step owners use
|
|
16
16
|
// (caller passes the resolver — no new resolution machinery, no
|
|
17
|
-
// binding-layer dependency). Unresolvable →
|
|
18
|
-
//
|
|
17
|
+
// binding-layer dependency). Unresolvable → registered-human selection,
|
|
18
|
+
// or an explicit selection error when no human can be chosen.
|
|
19
19
|
// human_only → the human seat FIRST, and it GATES there (the
|
|
20
20
|
// orchestrator never auto-acts). Class (c) is intrinsically
|
|
21
21
|
// human-only — its WF-2-compiled park IS the item; FR-2 mints no
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
// Dial semantics: same recorded state + same config = same target, every
|
|
32
32
|
// time. A dial change applies to FUTURE items only — resolution runs
|
|
33
33
|
// exactly once, at item creation; nothing re-routes live items.
|
|
34
|
+
import { workflowHumanDestination } from "./workflow-human-destination.js";
|
|
34
35
|
/** The ordinary workflow-packet tier (the shipped default the attention
|
|
35
36
|
* union deliberately does NOT match on). */
|
|
36
37
|
export const WORKFLOW_EXCEPTION_ORCHESTRATOR_TIER = "mode2";
|
|
@@ -65,7 +66,7 @@ export function resolveExceptionRoute(input) {
|
|
|
65
66
|
if (position === "human_only") {
|
|
66
67
|
return {
|
|
67
68
|
position: "human_only",
|
|
68
|
-
destinationSession: input.humanFallbackSeat,
|
|
69
|
+
destinationSession: workflowHumanDestination(input.humanFallbackSeat),
|
|
69
70
|
tier: WORKFLOW_EXCEPTION_HUMAN_TIER,
|
|
70
71
|
humanRouted: true,
|
|
71
72
|
resolvedVia,
|
|
@@ -73,13 +74,13 @@ export function resolveExceptionRoute(input) {
|
|
|
73
74
|
}
|
|
74
75
|
// orchestrator position: resolve the declared orchestrator role via the
|
|
75
76
|
// shipped mechanism; unresolvable (no role declared, role unknown, or
|
|
76
|
-
// no target) =
|
|
77
|
+
// no target) = registered-human selection.
|
|
77
78
|
const roleName = routing?.orchestrator_role;
|
|
78
79
|
const target = roleName ? input.resolveRoleTarget(roleName) : null;
|
|
79
80
|
if (!target) {
|
|
80
81
|
return {
|
|
81
82
|
position: "fallback",
|
|
82
|
-
destinationSession: input.humanFallbackSeat,
|
|
83
|
+
destinationSession: workflowHumanDestination(input.humanFallbackSeat),
|
|
83
84
|
tier: WORKFLOW_EXCEPTION_HUMAN_TIER,
|
|
84
85
|
humanRouted: true,
|
|
85
86
|
resolvedVia,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-exception-router.js","sourceRoot":"","sources":["../../src/domain/workflow-exception-router.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uEAAuE;AACvE,sDAAsD;AACtD,EAAE;AACF,yCAAyC;AACzC,4EAA4E;AAC5E,4EAA4E;AAC5E,8DAA8D;AAC9D,oEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"workflow-exception-router.js","sourceRoot":"","sources":["../../src/domain/workflow-exception-router.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uEAAuE;AACvE,sDAAsD;AACtD,EAAE;AACF,yCAAyC;AACzC,4EAA4E;AAC5E,4EAA4E;AAC5E,8DAA8D;AAC9D,oEAAoE;AACpE,yCAAyC;AACzC,wEAAwE;AACxE,EAAE;AACF,qBAAqB;AACrB,yEAAyE;AACzE,wEAAwE;AACxE,oEAAoE;AACpE,4EAA4E;AAC5E,kEAAkE;AAClE,+DAA+D;AAC/D,gEAAgE;AAChE,qEAAqE;AACrE,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,gEAAgE;AAChE,sEAAsE;AACtE,mEAAmE;AACnE,sEAAsE;AACtE,6DAA6D;AAC7D,EAAE;AACF,yEAAyE;AACzE,qEAAqE;AACrE,gEAAgE;AAIhE,OAAO,EAAE,wBAAwB,EAAiC,MAAM,iCAAiC,CAAC;AAE1G;6CAC6C;AAC7C,MAAM,CAA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CAA2C;IAC3C,MAAM,QAAQ,GAAG,OAAO,EAAE,iBAAiB,CAAC;IAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,QAAQ,EAAE,UAAU;YACpB,kBAAkB,EAAE,wBAAwB,CAAC,KAAK,CAAC,iBAAiB,CAAC;YACrE,IAAI,EAAE,6BAA6B;YACnC,WAAW,EAAE,IAAI;YACjB,WAAW;SACZ,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,cAAc;QACxB,kBAAkB,EAAE,MAAM;QAC1B,IAAI,EAAE,oCAAoC;QAC1C,WAAW,EAAE,KAAK;QAClB,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type LoadResult } from "./gateway/human-registry.js";
|
|
2
|
+
export declare class WorkflowHumanDestinationError extends Error {
|
|
3
|
+
readonly details: {
|
|
4
|
+
state: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
readonly code = "workflow_human_destination_unavailable";
|
|
8
|
+
constructor(details: {
|
|
9
|
+
state: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}, message: string);
|
|
12
|
+
}
|
|
13
|
+
/** The existing operator selection, resolved afresh only when a human is needed. */
|
|
14
|
+
export declare function resolveWorkflowHumanDestination(configured?: () => unknown, registry?: () => LoadResult): string;
|
|
15
|
+
/** Explicit injected destinations remain available to embedders and isolated fixtures. */
|
|
16
|
+
export type WorkflowHumanDestination = string | (() => string);
|
|
17
|
+
export declare function workflowHumanDestination(selection?: WorkflowHumanDestination): string;
|
|
18
|
+
//# sourceMappingURL=workflow-human-destination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-human-destination.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-human-destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGhH,qBAAa,6BAA8B,SAAQ,KAAK;aAE1B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;IAD9E,QAAQ,CAAC,IAAI,4CAA4C;gBAC7B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,EAAE,OAAO,EAAE,MAAM;CAIhG;AAED,oFAAoF;AACpF,wBAAgB,+BAA+B,CAC7C,UAAU,GAAE,MAAM,OAAoF,EACtG,QAAQ,GAAE,MAAM,UAA8B,GAC7C,MAAM,CAuBR;AAED,0FAA0F;AAC1F,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;AAC/D,wBAAgB,wBAAwB,CAAC,SAAS,GAAE,wBAA0D,GAAG,MAAM,CAEtH"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { loadHumanRegistry, resolveRegisteredHumanAddress } from "./gateway/human-registry.js";
|
|
2
|
+
import { SettingsStore } from "./user-settings/settings-store.js";
|
|
3
|
+
export class WorkflowHumanDestinationError extends Error {
|
|
4
|
+
details;
|
|
5
|
+
code = "workflow_human_destination_unavailable";
|
|
6
|
+
constructor(details, message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.details = details;
|
|
9
|
+
this.name = "WorkflowHumanDestinationError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** The existing operator selection, resolved afresh only when a human is needed. */
|
|
13
|
+
export function resolveWorkflowHumanDestination(configured = () => new SettingsStore().resolveOne("workspace.operator_seat_name").value, registry = loadHumanRegistry) {
|
|
14
|
+
let selected;
|
|
15
|
+
let loaded;
|
|
16
|
+
try {
|
|
17
|
+
selected = configured();
|
|
18
|
+
loaded = registry();
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw new WorkflowHumanDestinationError({ state: "unavailable" }, `Workflow human selection is unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
22
|
+
}
|
|
23
|
+
if (!loaded.ok) {
|
|
24
|
+
throw new WorkflowHumanDestinationError({ state: "registry-unavailable" }, loaded.error);
|
|
25
|
+
}
|
|
26
|
+
const addresses = loaded.entities.map((human) => human.address);
|
|
27
|
+
if (typeof selected === "string" && selected.trim()) {
|
|
28
|
+
const address = resolveRegisteredHumanAddress(selected.trim(), loaded.entities);
|
|
29
|
+
if (address)
|
|
30
|
+
return address;
|
|
31
|
+
throw new WorkflowHumanDestinationError({ state: "unregistered", selected, addresses }, "workspace.operator_seat_name does not select a registered human. Inspect rig gateway human list --json and select the intended registered address.");
|
|
32
|
+
}
|
|
33
|
+
if (addresses.length === 1)
|
|
34
|
+
return addresses[0];
|
|
35
|
+
throw new WorkflowHumanDestinationError({ state: addresses.length ? "ambiguous" : "missing", addresses }, "Workflow human fallback needs one registered human. Inspect rig gateway human list --json; when several exist, explicitly select workspace.operator_seat_name. No human destination was invented.");
|
|
36
|
+
}
|
|
37
|
+
export function workflowHumanDestination(selection = resolveWorkflowHumanDestination) {
|
|
38
|
+
return typeof selection === "function" ? selection() : selection;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=workflow-human-destination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-human-destination.js","sourceRoot":"","sources":["../../src/domain/workflow-human-destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,6BAA6B,EAAmB,MAAM,6BAA6B,CAAC;AAChH,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAE1B;IADnB,IAAI,GAAG,wCAAwC,CAAC;IACzD,YAA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,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,EACpF,oJAAoJ,CAAC,CAAC;IAC1J,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC,CAAC,CAAE,CAAC;IACjD,MAAM,IAAI,6BAA6B,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,EACtG,mMAAmM,CAAC,CAAC;AACzM,CAAC;AAID,MAAM,UAAU,wBAAwB,CAAC,YAAsC,+BAA+B;IAC5G,OAAO,OAAO,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC"}
|
|
@@ -6,6 +6,7 @@ import type { WorkflowSpecCache } from "./workflow-spec-cache.js";
|
|
|
6
6
|
import type { WorkflowStepTrailLog } from "./workflow-step-trail-log.js";
|
|
7
7
|
import type { WorkflowExitKind, WorkflowInstance, WorkflowSpec, WorkflowStepSpec } from "./workflow-types.js";
|
|
8
8
|
import { type RoleResolutionContext } from "./workflow-role-context.js";
|
|
9
|
+
import { type WorkflowHumanDestination } from "./workflow-human-destination.js";
|
|
9
10
|
import type { WatchdogJobsRepository } from "./watchdog-jobs-repository.js";
|
|
10
11
|
/** One occurrence-bound action, shared by packet bodies and authored wait wakes. */
|
|
11
12
|
export declare function renderWorkflowProjectCommand(input: {
|
|
@@ -103,7 +104,7 @@ export declare class WorkflowProjector {
|
|
|
103
104
|
* (the validateRig precedent — the projector never reads config
|
|
104
105
|
* itself). hostDefault is read LIVE per exception (dial flips apply
|
|
105
106
|
* to future items only). Absent = engine defaults (orchestrator-
|
|
106
|
-
* first chain with
|
|
107
|
+
* first chain with registered-human selection). */
|
|
107
108
|
private readonly exceptionDial?;
|
|
108
109
|
constructor(db: Database.Database, eventBus: EventBus, queueRepo: QueueRepository, instanceStore: WorkflowInstanceStore, trailLog: WorkflowStepTrailLog, specCache: WorkflowSpecCache, now?: () => Date,
|
|
109
110
|
/** OPR.0.4.6.WF1 FR-3: optional — arms/disarms packet or legacy-instance keepalives in-txn. */
|
|
@@ -112,10 +113,10 @@ export declare class WorkflowProjector {
|
|
|
112
113
|
* (the validateRig precedent — the projector never reads config
|
|
113
114
|
* itself). hostDefault is read LIVE per exception (dial flips apply
|
|
114
115
|
* to future items only). Absent = engine defaults (orchestrator-
|
|
115
|
-
* first chain with
|
|
116
|
+
* first chain with registered-human selection). */
|
|
116
117
|
exceptionDial?: {
|
|
117
118
|
hostDefault: () => "orchestrator" | "human_only" | null;
|
|
118
|
-
humanFallbackSeat:
|
|
119
|
+
humanFallbackSeat: WorkflowHumanDestination;
|
|
119
120
|
} | undefined);
|
|
120
121
|
private nodeRuntimeOf;
|
|
121
122
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-projector.d.ts","sourceRoot":"","sources":["../../src/domain/workflow-projector.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
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|
@@ -24,9 +24,11 @@ import { isHumanSeatSession } from "./human-route-enforcer.js";
|
|
|
24
24
|
import { selectRoleSeat } from "./workflow-role-resolver.js";
|
|
25
25
|
import { roleResolutionContext, tryResolveRoleByCapability, } from "./workflow-role-context.js";
|
|
26
26
|
import { classifyFailedInstance, classifyGateTrip, workflowExceptionTags } from "./workflow-exception.js";
|
|
27
|
-
import { newQitemId } from "./queue-repository.js";
|
|
27
|
+
import { newQitemId, QueueRepositoryError } from "./queue-repository.js";
|
|
28
28
|
import { resolveExceptionRoute } from "./workflow-exception-router.js";
|
|
29
|
+
import { workflowHumanDestination } from "./workflow-human-destination.js";
|
|
29
30
|
import { disarmWorkflowKeepalive, ensureWorkflowKeepaliveArmed, } from "./workflow-keepalive-arming.js";
|
|
31
|
+
import { requiredLifecycleSteps } from "./lifecycle-obligations.js";
|
|
30
32
|
import { shellQuote } from "../adapters/shell-quote.js";
|
|
31
33
|
const WORKFLOW_CONTEXT_SHORTCUT = "Context: this workflow packet is a shortcut, not the whole story; inspect additional project, mission, and receipt evidence before choosing an authored exit.";
|
|
32
34
|
/** One occurrence-bound action, shared by packet bodies and authored wait wakes. */
|
|
@@ -60,6 +62,7 @@ export function workflowWaitWakeMessage(input) {
|
|
|
60
62
|
return [
|
|
61
63
|
`Workflow wait re-presentation (blocker progress or reminder): ${input.spec.id}@${input.spec.version} instance ${input.instance.instanceId} step ${input.step.id}.`,
|
|
62
64
|
`You still own the same frontier packet ${input.packetId}. Read it and inspect current evidence before choosing an authored exit.`,
|
|
65
|
+
...(input.step.objective ? [`Objective: ${input.step.objective}`] : []),
|
|
63
66
|
...(input.spec.context_refs ?? []).map((ref) => `Context reference: ${ref}`),
|
|
64
67
|
`Continuation: ${renderWorkflowProjectCommand({ ...input, instanceId: input.instance.instanceId })}`,
|
|
65
68
|
WORKFLOW_CONTEXT_SHORTCUT,
|
|
@@ -108,7 +111,7 @@ export class WorkflowProjector {
|
|
|
108
111
|
* (the validateRig precedent — the projector never reads config
|
|
109
112
|
* itself). hostDefault is read LIVE per exception (dial flips apply
|
|
110
113
|
* to future items only). Absent = engine defaults (orchestrator-
|
|
111
|
-
* first chain with
|
|
114
|
+
* first chain with registered-human selection). */
|
|
112
115
|
exceptionDial) {
|
|
113
116
|
this.db = db;
|
|
114
117
|
this.eventBus = eventBus;
|
|
@@ -175,6 +178,15 @@ export class WorkflowProjector {
|
|
|
175
178
|
allowedExits: currentStep.allowed_exits,
|
|
176
179
|
});
|
|
177
180
|
}
|
|
181
|
+
// Project profile receipts are agent-authored references. Presence is mechanical;
|
|
182
|
+
// the daemon neither reads the referenced prose nor decides its substance.
|
|
183
|
+
if (requiredLifecycleSteps(instance.lifecycleBinding).includes(currentStep.id) &&
|
|
184
|
+
(input.exit === "done" || input.exit === "handoff")) {
|
|
185
|
+
const receipt = input.closureEvidence?.evidence_ref;
|
|
186
|
+
if (typeof receipt !== "string" || receipt.trim() === "") {
|
|
187
|
+
throw new WorkflowProjectorError("lifecycle_receipt_required", `Boundary step "${currentStep.id}" needs an agent-judged receipt. Supply --evidence-ref; a terminal queue row is not acceptance.`, { stepId: currentStep.id, instanceId: instance.instanceId });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
178
190
|
validateAcceptance(currentStep, input, instance);
|
|
179
191
|
// A declared dependency graph opts into the S06 packet-addressed
|
|
180
192
|
// executor. Legacy specs keep the mature serial scribe below exactly.
|
|
@@ -656,13 +668,13 @@ export class WorkflowProjector {
|
|
|
656
668
|
// FAC-1 (arch Q3 — routing uniformity, bounded): declared
|
|
657
669
|
// preferred_targets stay the override; a bound instance's
|
|
658
670
|
// orchestrator-role dial position falls through to a
|
|
659
|
-
//
|
|
660
|
-
//
|
|
661
|
-
//
|
|
662
|
-
//
|
|
671
|
+
// capability pick on the bound rig (evidenced no-match →
|
|
672
|
+
// registered-human selection, with an explicit error if no
|
|
673
|
+
// human can be selected). Evidence-read failures propagate
|
|
674
|
+
// and roll back the close. Fresh decision per episode.
|
|
663
675
|
resolveRoleTarget: (role) => spec.roles?.[role]?.preferred_targets?.[0] ??
|
|
664
676
|
tryResolveRoleByCapability(roleCtx, role),
|
|
665
|
-
humanFallbackSeat: this.exceptionDial?.humanFallbackSeat
|
|
677
|
+
humanFallbackSeat: this.exceptionDial?.humanFallbackSeat,
|
|
666
678
|
});
|
|
667
679
|
const evidenceRef = `rig workflow trace ${instance.instanceId}`;
|
|
668
680
|
const itemBody = `WORKFLOW EXCEPTION (${exception.identity.exceptionClass})\n` +
|
|
@@ -687,16 +699,13 @@ export class WorkflowProjector {
|
|
|
687
699
|
try {
|
|
688
700
|
createdException = createExceptionItem(route.destinationSession, route.tier);
|
|
689
701
|
}
|
|
690
|
-
catch {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
//
|
|
694
|
-
//
|
|
695
|
-
//
|
|
696
|
-
|
|
697
|
-
// real storage error and propagates: the whole close rolls
|
|
698
|
-
// back rather than committing an item-less failure.
|
|
699
|
-
createdException = createExceptionItem(this.exceptionDial?.humanFallbackSeat ?? "human@host", "human-gate");
|
|
702
|
+
catch (error) {
|
|
703
|
+
if (!(error instanceof QueueRepositoryError) || error.code !== "unknown_destination_rig" || route.humanRouted)
|
|
704
|
+
throw error;
|
|
705
|
+
// Only an unavailable agent rig invokes human selection. Other
|
|
706
|
+
// admission/storage failures propagate unchanged and roll back the
|
|
707
|
+
// close, retaining the failure+attention-item atomic contract.
|
|
708
|
+
createdException = createExceptionItem(workflowHumanDestination(this.exceptionDial?.humanFallbackSeat), "human-gate");
|
|
700
709
|
}
|
|
701
710
|
registerEvent(createdException.persistedEvent);
|
|
702
711
|
exceptionItemPostCommit = {
|