@telora/daemon 0.21.26 → 0.21.82
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/build-info.json +4 -3
- package/dist/audit/audit-hooks.d.ts +127 -0
- package/dist/audit/audit-hooks.d.ts.map +1 -0
- package/dist/audit/audit-hooks.js +346 -0
- package/dist/audit/audit-hooks.js.map +1 -0
- package/dist/audit/audit-phase.d.ts +170 -0
- package/dist/audit/audit-phase.d.ts.map +1 -0
- package/dist/audit/audit-phase.js +492 -0
- package/dist/audit/audit-phase.js.map +1 -0
- package/dist/audit/audit-prompt.d.ts.map +1 -0
- package/dist/audit/audit-prompt.js.map +1 -0
- package/dist/audit/audit-shape.d.ts.map +1 -0
- package/dist/audit/audit-shape.js.map +1 -0
- package/dist/backends/agent-backend.d.ts +1 -1
- package/dist/backends/agent-backend.d.ts.map +1 -1
- package/dist/backends/availability.d.ts +1 -1
- package/dist/backends/availability.d.ts.map +1 -1
- package/dist/backends/codex/codex-backend.js +1 -1
- package/dist/backends/codex/codex-backend.js.map +1 -1
- package/dist/backends/codex/codex-mcp-proxy.js +1 -1
- package/dist/backends/codex/codex-mcp-proxy.js.map +1 -1
- package/dist/backends/codex/mcp-preflight.d.ts +1 -1
- package/dist/backends/codex/mcp-preflight.d.ts.map +1 -1
- package/dist/backends/lacuna/launch-adapter.d.ts +1 -1
- package/dist/backends/lacuna/launch-adapter.d.ts.map +1 -1
- package/dist/backends/lacuna/lifecycle.d.ts +1 -1
- package/dist/backends/lacuna/lifecycle.d.ts.map +1 -1
- package/dist/backends/lacuna/lifecycle.js +1 -1
- package/dist/backends/lacuna/lifecycle.js.map +1 -1
- package/dist/backends/lacuna/supervisor.d.ts +1 -1
- package/dist/backends/lacuna/supervisor.d.ts.map +1 -1
- package/dist/backends/lacuna/supervisor.js +2 -2
- package/dist/backends/lacuna/supervisor.js.map +1 -1
- package/dist/backends/resolve.js +2 -2
- package/dist/backends/resolve.js.map +1 -1
- package/dist/ci/ci-escalation.d.ts.map +1 -0
- package/dist/ci/ci-escalation.js +66 -0
- package/dist/ci/ci-escalation.js.map +1 -0
- package/dist/ci/ci-sensor-loop.d.ts +146 -0
- package/dist/ci/ci-sensor-loop.d.ts.map +1 -0
- package/dist/ci/ci-sensor-loop.js +265 -0
- package/dist/ci/ci-sensor-loop.js.map +1 -0
- package/dist/ci/ci-status-git.d.ts +53 -0
- package/dist/ci/ci-status-git.d.ts.map +1 -0
- package/dist/ci/ci-status-git.js +89 -0
- package/dist/ci/ci-status-git.js.map +1 -0
- package/dist/ci/ci-status.d.ts +137 -0
- package/dist/ci/ci-status.d.ts.map +1 -0
- package/dist/ci/ci-status.js.map +1 -0
- package/dist/cli/backfill-frt-prose.d.ts +3 -3
- package/dist/cli/backfill-frt-prose.d.ts.map +1 -1
- package/dist/cli/backfill-frt-prose.js +2 -2
- package/dist/cli/backfill-frt-prose.js.map +1 -1
- package/dist/cli/codex-provision.js +1 -1
- package/dist/cli/codex-provision.js.map +1 -1
- package/dist/cli/connect/cline.js +1 -1
- package/dist/cli/connect/cline.js.map +1 -1
- package/dist/cli/connect/codex.js +1 -1
- package/dist/cli/connect/codex.js.map +1 -1
- package/dist/cli/connect/ide.js +1 -1
- package/dist/cli/connect/ide.js.map +1 -1
- package/dist/cli/connect.js +4 -4
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/open.js +2 -2
- package/dist/cli/open.js.map +1 -1
- package/dist/cli/session-state.d.ts +1 -1
- package/dist/cli/session-state.d.ts.map +1 -1
- package/dist/cli/session-state.js +4 -4
- package/dist/cli/session-state.js.map +1 -1
- package/dist/cli/verify-setup-config.d.ts +1 -1
- package/dist/cli/verify-setup-config.d.ts.map +1 -1
- package/dist/cli/verify-setup.js +2 -2
- package/dist/cli/verify-setup.js.map +1 -1
- package/dist/completion/advanceability.d.ts +1 -1
- package/dist/completion/advanceability.d.ts.map +1 -1
- package/dist/completion/advanceability.js +2 -2
- package/dist/completion/advanceability.js.map +1 -1
- package/dist/completion/delivery-advancement-guard.d.ts +20 -2
- package/dist/completion/delivery-advancement-guard.d.ts.map +1 -1
- package/dist/completion/delivery-advancement-guard.js +32 -4
- package/dist/completion/delivery-advancement-guard.js.map +1 -1
- package/dist/completion/detector.d.ts +9 -3
- package/dist/completion/detector.d.ts.map +1 -1
- package/dist/completion/detector.js +26 -4
- package/dist/completion/detector.js.map +1 -1
- package/dist/completion/escalation-provenance.d.ts +78 -0
- package/dist/completion/escalation-provenance.d.ts.map +1 -0
- package/dist/completion/escalation-provenance.js +206 -0
- package/dist/completion/escalation-provenance.js.map +1 -0
- package/dist/completion/escalations.d.ts +85 -0
- package/dist/completion/escalations.d.ts.map +1 -0
- package/dist/completion/escalations.js +91 -0
- package/dist/completion/escalations.js.map +1 -0
- package/dist/completion/event-entry-phases.d.ts +1 -1
- package/dist/completion/event-entry-phases.d.ts.map +1 -1
- package/dist/completion/event-entry-phases.js +3 -3
- package/dist/completion/event-entry-phases.js.map +1 -1
- package/dist/completion/event-escalations.d.ts +1 -1
- package/dist/completion/event-escalations.d.ts.map +1 -1
- package/dist/completion/event-escalations.js +1 -1
- package/dist/completion/event-escalations.js.map +1 -1
- package/dist/completion/event-phases.d.ts +44 -1
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +165 -13
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/event.d.ts +20 -1
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +7 -4
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/exit-classification.d.ts +1 -1
- package/dist/completion/exit-classification.d.ts.map +1 -1
- package/dist/completion/merge-phase.d.ts +21 -7
- package/dist/completion/merge-phase.d.ts.map +1 -1
- package/dist/completion/merge-phase.js +14 -11
- package/dist/completion/merge-phase.js.map +1 -1
- package/dist/completion/progress-snapshot.d.ts +1 -1
- package/dist/completion/progress-snapshot.d.ts.map +1 -1
- package/dist/completion/read-only-pristine.d.ts +1 -1
- package/dist/completion/read-only-pristine.d.ts.map +1 -1
- package/dist/completion/read-only-pristine.js +2 -2
- package/dist/completion/read-only-pristine.js.map +1 -1
- package/dist/completion/review-defect-detector.d.ts +82 -0
- package/dist/completion/review-defect-detector.d.ts.map +1 -0
- package/dist/completion/review-defect-detector.js +148 -0
- package/dist/completion/review-defect-detector.js.map +1 -0
- package/dist/completion/review-exit-escalations.d.ts +1 -1
- package/dist/completion/review-exit-escalations.d.ts.map +1 -1
- package/dist/completion/review-exit-escalations.js +1 -1
- package/dist/completion/review-exit-escalations.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts +4 -3
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +10 -9
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/review-exit-shortfall.d.ts +1 -1
- package/dist/completion/review-exit-shortfall.d.ts.map +1 -1
- package/dist/completion/review-exit-shortfall.js +1 -1
- package/dist/completion/review-exit-shortfall.js.map +1 -1
- package/dist/completion/review-spawn-coverage-guard.d.ts.map +1 -0
- package/dist/completion/review-spawn-coverage-guard.js.map +1 -0
- package/dist/completion/state-cascade.d.ts +90 -0
- package/dist/completion/state-cascade.d.ts.map +1 -0
- package/dist/completion/state-cascade.js +230 -0
- package/dist/completion/state-cascade.js.map +1 -0
- package/dist/completion/status-advance-phase.d.ts +4 -4
- package/dist/completion/status-advance-phase.d.ts.map +1 -1
- package/dist/completion/status-advance-phase.js +9 -7
- package/dist/completion/status-advance-phase.js.map +1 -1
- package/dist/completion/team-completion.d.ts +2 -2
- package/dist/completion/team-completion.d.ts.map +1 -1
- package/dist/completion/team-completion.js +15 -9
- package/dist/completion/team-completion.js.map +1 -1
- package/dist/completion/team-lifecycle.d.ts +1 -1
- package/dist/completion/team-lifecycle.d.ts.map +1 -1
- package/dist/completion/team-lifecycle.js +10 -11
- package/dist/completion/team-lifecycle.js.map +1 -1
- package/dist/completion/terminated-work-reconcile.d.ts +2 -2
- package/dist/completion/terminated-work-reconcile.d.ts.map +1 -1
- package/dist/completion/terminated-work-reconcile.js +5 -4
- package/dist/completion/terminated-work-reconcile.js.map +1 -1
- package/dist/context/context-audit.d.ts +68 -0
- package/dist/context/context-audit.d.ts.map +1 -0
- package/dist/context/context-audit.js.map +1 -0
- package/dist/context/context-lock.d.ts +129 -0
- package/dist/context/context-lock.d.ts.map +1 -0
- package/dist/context/context-lock.js.map +1 -0
- package/dist/delivery/delivery-advance-block.d.ts +143 -0
- package/dist/delivery/delivery-advance-block.d.ts.map +1 -0
- package/dist/delivery/delivery-advance-block.js +360 -0
- package/dist/delivery/delivery-advance-block.js.map +1 -0
- package/dist/delivery/delivery-artifacts.d.ts +26 -0
- package/dist/delivery/delivery-artifacts.d.ts.map +1 -0
- package/dist/delivery/delivery-artifacts.js +56 -0
- package/dist/delivery/delivery-artifacts.js.map +1 -0
- package/dist/delivery/delivery-close-actions.d.ts +39 -0
- package/dist/delivery/delivery-close-actions.d.ts.map +1 -0
- package/dist/delivery/delivery-close-actions.js +53 -0
- package/dist/delivery/delivery-close-actions.js.map +1 -0
- package/dist/delivery/delivery-lifecycle.d.ts +144 -0
- package/dist/delivery/delivery-lifecycle.d.ts.map +1 -0
- package/dist/delivery/delivery-lifecycle.js +498 -0
- package/dist/delivery/delivery-lifecycle.js.map +1 -0
- package/dist/delivery/delivery-reconciler-apply.d.ts.map +1 -0
- package/dist/delivery/delivery-reconciler-apply.js +77 -0
- package/dist/delivery/delivery-reconciler-apply.js.map +1 -0
- package/dist/delivery/delivery-reconciler-shadow.d.ts +66 -0
- package/dist/delivery/delivery-reconciler-shadow.d.ts.map +1 -0
- package/dist/delivery/delivery-reconciler-shadow.js +127 -0
- package/dist/delivery/delivery-reconciler-shadow.js.map +1 -0
- package/dist/delivery/delivery-reconciler.d.ts +217 -0
- package/dist/delivery/delivery-reconciler.d.ts.map +1 -0
- package/dist/delivery/delivery-reconciler.js +249 -0
- package/dist/delivery/delivery-reconciler.js.map +1 -0
- package/dist/delivery/external-hold.d.ts +145 -0
- package/dist/delivery/external-hold.d.ts.map +1 -0
- package/dist/delivery/external-hold.js +223 -0
- package/dist/delivery/external-hold.js.map +1 -0
- package/dist/delivery/operator-hold.d.ts +66 -0
- package/dist/delivery/operator-hold.d.ts.map +1 -0
- package/dist/delivery/operator-hold.js +99 -0
- package/dist/delivery/operator-hold.js.map +1 -0
- package/dist/directive/close-loop-dispatcher.d.ts +325 -0
- package/dist/directive/close-loop-dispatcher.d.ts.map +1 -0
- package/dist/directive/close-loop-dispatcher.js +362 -0
- package/dist/directive/close-loop-dispatcher.js.map +1 -0
- package/dist/directive/close-loop-stage.d.ts +2 -2
- package/dist/directive/close-loop-stage.d.ts.map +1 -1
- package/dist/directive/close-loop-stage.js +3 -3
- package/dist/directive/close-loop-stage.js.map +1 -1
- package/dist/directive/directive-assembly.d.ts +2 -3
- package/dist/directive/directive-assembly.d.ts.map +1 -1
- package/dist/directive/directive-assembly.js +5 -4
- package/dist/directive/directive-assembly.js.map +1 -1
- package/dist/directive/directive-dispatch.d.ts +2 -2
- package/dist/directive/directive-dispatch.d.ts.map +1 -1
- package/dist/directive/directive-dispatch.js +3 -3
- package/dist/directive/directive-dispatch.js.map +1 -1
- package/dist/directive/directive-executor.d.ts +37 -0
- package/dist/directive/directive-executor.d.ts.map +1 -0
- package/dist/directive/directive-executor.js +241 -0
- package/dist/directive/directive-executor.js.map +1 -0
- package/dist/directive/directive-queue.d.ts +2 -2
- package/dist/directive/directive-queue.d.ts.map +1 -1
- package/dist/directive/phase-sync.js +3 -3
- package/dist/directive/phase-sync.js.map +1 -1
- package/dist/directive/resolver-dispatch.d.ts.map +1 -0
- package/dist/directive/resolver-dispatch.js.map +1 -0
- package/dist/discovery-fetch.js +1 -1
- package/dist/discovery-fetch.js.map +1 -1
- package/dist/drift/drift-eval-loop.d.ts +71 -0
- package/dist/drift/drift-eval-loop.d.ts.map +1 -0
- package/dist/drift/drift-eval-loop.js +259 -0
- package/dist/drift/drift-eval-loop.js.map +1 -0
- package/dist/drift/drift-evaluator.d.ts.map +1 -0
- package/dist/drift/drift-evaluator.js.map +1 -0
- package/dist/drift/drift-ratify-policy.d.ts.map +1 -0
- package/dist/drift/drift-ratify-policy.js.map +1 -0
- package/dist/drift/retention-observation.d.ts.map +1 -0
- package/dist/drift/retention-observation.js.map +1 -0
- package/dist/drift/sensor-sweep.d.ts +194 -0
- package/dist/drift/sensor-sweep.d.ts.map +1 -0
- package/dist/drift/sensor-sweep.js +458 -0
- package/dist/drift/sensor-sweep.js.map +1 -0
- package/dist/drift/staleness-sensor.d.ts +176 -0
- package/dist/drift/staleness-sensor.d.ts.map +1 -0
- package/dist/drift/staleness-sensor.js +335 -0
- package/dist/drift/staleness-sensor.js.map +1 -0
- package/dist/drift/staleness.d.ts +134 -0
- package/dist/drift/staleness.d.ts.map +1 -0
- package/dist/drift/staleness.js +249 -0
- package/dist/drift/staleness.js.map +1 -0
- package/dist/focus/focus-branch-ahead.d.ts +42 -0
- package/dist/focus/focus-branch-ahead.d.ts.map +1 -0
- package/dist/focus/focus-branch-ahead.js +45 -0
- package/dist/focus/focus-branch-ahead.js.map +1 -0
- package/dist/focus/focus-branch-identity.d.ts +62 -0
- package/dist/focus/focus-branch-identity.d.ts.map +1 -0
- package/dist/focus/focus-branch-identity.js +59 -0
- package/dist/focus/focus-branch-identity.js.map +1 -0
- package/dist/focus/focus-engine.d.ts +74 -0
- package/dist/focus/focus-engine.d.ts.map +1 -0
- package/dist/focus/focus-engine.js +528 -0
- package/dist/focus/focus-engine.js.map +1 -0
- package/dist/focus/focus-executor.d.ts +79 -0
- package/dist/focus/focus-executor.d.ts.map +1 -0
- package/dist/focus/focus-executor.js +421 -0
- package/dist/focus/focus-executor.js.map +1 -0
- package/dist/focus/focus-lifecycle.d.ts +60 -0
- package/dist/focus/focus-lifecycle.d.ts.map +1 -0
- package/dist/focus/focus-lifecycle.js +543 -0
- package/dist/focus/focus-lifecycle.js.map +1 -0
- package/dist/focus/focus-loop-registry.d.ts +52 -0
- package/dist/focus/focus-loop-registry.d.ts.map +1 -0
- package/dist/focus/focus-loop-registry.js +362 -0
- package/dist/focus/focus-loop-registry.js.map +1 -0
- package/dist/focus/focus-loop.d.ts +96 -0
- package/dist/focus/focus-loop.d.ts.map +1 -0
- package/dist/focus/focus-loop.js +364 -0
- package/dist/focus/focus-loop.js.map +1 -0
- package/dist/focus/focus-phase.d.ts.map +1 -0
- package/dist/focus/focus-phase.js.map +1 -0
- package/dist/focus/focus-respawn-guard.d.ts +39 -0
- package/dist/focus/focus-respawn-guard.d.ts.map +1 -0
- package/dist/focus/focus-respawn-guard.js +62 -0
- package/dist/focus/focus-respawn-guard.js.map +1 -0
- package/dist/focus/focus-team-state.d.ts +115 -0
- package/dist/focus/focus-team-state.d.ts.map +1 -0
- package/dist/focus/focus-team-state.js +195 -0
- package/dist/focus/focus-team-state.js.map +1 -0
- package/dist/focus/focus-worktree-state.d.ts +70 -0
- package/dist/focus/focus-worktree-state.d.ts.map +1 -0
- package/dist/focus/focus-worktree-state.js +118 -0
- package/dist/focus/focus-worktree-state.js.map +1 -0
- package/dist/focus/listener-auto-advance.d.ts +126 -0
- package/dist/focus/listener-auto-advance.d.ts.map +1 -0
- package/dist/focus/listener-auto-advance.js +629 -0
- package/dist/focus/listener-auto-advance.js.map +1 -0
- package/dist/focus/listener.d.ts +101 -0
- package/dist/focus/listener.d.ts.map +1 -0
- package/dist/focus/listener.js +770 -0
- package/dist/focus/listener.js.map +1 -0
- package/dist/focus-stage-lifecycle/index.d.ts +63 -0
- package/dist/focus-stage-lifecycle/index.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/index.js +179 -0
- package/dist/focus-stage-lifecycle/index.js.map +1 -0
- package/dist/focus-stage-lifecycle/planning-release.js +4 -4
- package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
- package/dist/focus-stage-lifecycle/review-convergence.d.ts +1 -1
- package/dist/focus-stage-lifecycle/review-convergence.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle/review-convergence.js +2 -2
- package/dist/focus-stage-lifecycle/review-convergence.js.map +1 -1
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +1 -1
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle/wedge-watchdog.js +3 -3
- package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -1
- package/dist/git/branch.d.ts +1 -1
- package/dist/git/branch.d.ts.map +1 -1
- package/dist/git/branch.js +1 -1
- package/dist/git/branch.js.map +1 -1
- package/dist/git/exec.d.ts +24 -0
- package/dist/git/exec.d.ts.map +1 -0
- package/dist/git/exec.js +114 -0
- package/dist/git/exec.js.map +1 -0
- package/dist/git/genesis.js +1 -1
- package/dist/git/genesis.js.map +1 -1
- package/dist/git/index.d.ts +3 -8
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +3 -8
- package/dist/git/index.js.map +1 -1
- package/dist/git/integration.d.ts +1 -1
- package/dist/git/integration.d.ts.map +1 -1
- package/dist/git/integration.js +1 -1
- package/dist/git/integration.js.map +1 -1
- package/dist/git/merge-lock.js +1 -1
- package/dist/git/merge-lock.js.map +1 -1
- package/dist/git/merge.d.ts +33 -2
- package/dist/git/merge.d.ts.map +1 -1
- package/dist/git/merge.js +159 -18
- package/dist/git/merge.js.map +1 -1
- package/dist/git/state-detector.d.ts +1 -1
- package/dist/git/state-detector.d.ts.map +1 -1
- package/dist/git/state-detector.js +1 -1
- package/dist/git/state-detector.js.map +1 -1
- package/dist/git/types.d.ts +1 -1
- package/dist/git/types.d.ts.map +1 -1
- package/dist/git/utils.js +1 -1
- package/dist/git/utils.js.map +1 -1
- package/dist/guard/condition-evaluators.d.ts +70 -0
- package/dist/guard/condition-evaluators.d.ts.map +1 -0
- package/dist/guard/condition-evaluators.js +203 -0
- package/dist/guard/condition-evaluators.js.map +1 -0
- package/dist/guard/evaluation-context.d.ts.map +1 -0
- package/dist/guard/evaluation-context.js +44 -0
- package/dist/guard/evaluation-context.js.map +1 -0
- package/dist/guard/guard-evaluator.d.ts +47 -0
- package/dist/guard/guard-evaluator.d.ts.map +1 -0
- package/dist/guard/guard-evaluator.js +195 -0
- package/dist/guard/guard-evaluator.js.map +1 -0
- package/dist/guard/trigger-executor.d.ts +99 -0
- package/dist/guard/trigger-executor.d.ts.map +1 -0
- package/dist/guard/trigger-executor.js +437 -0
- package/dist/guard/trigger-executor.js.map +1 -0
- package/dist/host-control/catalog.js +1 -1
- package/dist/host-control/catalog.js.map +1 -1
- package/dist/host-control/client.js +1 -1
- package/dist/host-control/client.js.map +1 -1
- package/dist/host-control/discovery-poll.d.ts +36 -0
- package/dist/host-control/discovery-poll.d.ts.map +1 -0
- package/dist/host-control/discovery-poll.js +94 -0
- package/dist/host-control/discovery-poll.js.map +1 -0
- package/dist/host-control/sizing.js +1 -1
- package/dist/host-control/sizing.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/loops/context-audit-pass.d.ts +2 -2
- package/dist/loops/context-audit-pass.d.ts.map +1 -1
- package/dist/loops/context-audit-pass.js +3 -3
- package/dist/loops/context-audit-pass.js.map +1 -1
- package/dist/loops/engine.js +2 -2
- package/dist/loops/engine.js.map +1 -1
- package/dist/loops/llm-client.d.ts +8 -1
- package/dist/loops/llm-client.d.ts.map +1 -1
- package/dist/loops/llm-client.js +5 -4
- package/dist/loops/llm-client.js.map +1 -1
- package/dist/loops/prompt-builder.js +1 -1
- package/dist/loops/prompt-builder.js.map +1 -1
- package/dist/merge/focus-merge.d.ts +131 -0
- package/dist/merge/focus-merge.d.ts.map +1 -0
- package/dist/merge/focus-merge.js +556 -0
- package/dist/merge/focus-merge.js.map +1 -0
- package/dist/merge/merge-back-loop.d.ts +122 -0
- package/dist/merge/merge-back-loop.d.ts.map +1 -0
- package/dist/merge/merge-back-loop.js +657 -0
- package/dist/merge/merge-back-loop.js.map +1 -0
- package/dist/merge/merge-detector.d.ts +55 -0
- package/dist/merge/merge-detector.d.ts.map +1 -0
- package/dist/merge/merge-detector.js +222 -0
- package/dist/merge/merge-detector.js.map +1 -0
- package/dist/merge/merge-failure-classify.d.ts +48 -0
- package/dist/merge/merge-failure-classify.d.ts.map +1 -0
- package/dist/merge/merge-failure-classify.js +89 -0
- package/dist/merge/merge-failure-classify.js.map +1 -0
- package/dist/nexus/endpoint-clearance.d.ts +12 -3
- package/dist/nexus/endpoint-clearance.d.ts.map +1 -1
- package/dist/nexus/endpoint-clearance.js +17 -8
- package/dist/nexus/endpoint-clearance.js.map +1 -1
- package/dist/nexus/escalation-bridge.js +1 -1
- package/dist/nexus/escalation-bridge.js.map +1 -1
- package/dist/nexus/incoming.d.ts +1 -1
- package/dist/nexus/incoming.d.ts.map +1 -1
- package/dist/nexus/incoming.js +1 -1
- package/dist/nexus/incoming.js.map +1 -1
- package/dist/nexus/intake-spawn.d.ts +1 -1
- package/dist/nexus/intake-spawn.d.ts.map +1 -1
- package/dist/nexus/intake-spawn.js +1 -1
- package/dist/nexus/intake-spawn.js.map +1 -1
- package/dist/nexus/intake.d.ts +1 -1
- package/dist/nexus/intake.d.ts.map +1 -1
- package/dist/nexus/intake.js +1 -1
- package/dist/nexus/intake.js.map +1 -1
- package/dist/nexus/return.d.ts +1 -1
- package/dist/nexus/return.d.ts.map +1 -1
- package/dist/nexus/return.js +2 -2
- package/dist/nexus/return.js.map +1 -1
- package/dist/otlp/log-parser.js +1 -1
- package/dist/otlp/log-parser.js.map +1 -1
- package/dist/otlp/metric-parser.js +1 -1
- package/dist/otlp/metric-parser.js.map +1 -1
- package/dist/otlp/receiver.d.ts +1 -1
- package/dist/otlp/receiver.d.ts.map +1 -1
- package/dist/otlp/receiver.js +2 -2
- package/dist/otlp/receiver.js.map +1 -1
- package/dist/otlp/telemetry-writer.d.ts +90 -0
- package/dist/otlp/telemetry-writer.d.ts.map +1 -0
- package/dist/otlp/telemetry-writer.js +213 -0
- package/dist/otlp/telemetry-writer.js.map +1 -0
- package/dist/prd/controller.d.ts +2 -2
- package/dist/prd/controller.d.ts.map +1 -1
- package/dist/prd/controller.js +3 -3
- package/dist/prd/controller.js.map +1 -1
- package/dist/prd/focus-pushdown.d.ts +1 -1
- package/dist/prd/focus-pushdown.d.ts.map +1 -1
- package/dist/prd/focus-pushdown.js +2 -2
- package/dist/prd/focus-pushdown.js.map +1 -1
- package/dist/prd/steward.d.ts +1 -1
- package/dist/prd/steward.d.ts.map +1 -1
- package/dist/prd/steward.js +3 -2
- package/dist/prd/steward.js.map +1 -1
- package/dist/prompt/focus-prompt-builder.d.ts +33 -0
- package/dist/prompt/focus-prompt-builder.d.ts.map +1 -0
- package/dist/prompt/focus-prompt-builder.js +118 -0
- package/dist/prompt/focus-prompt-builder.js.map +1 -0
- package/dist/prompt/onboarding-directive.d.ts.map +1 -0
- package/dist/prompt/onboarding-directive.js.map +1 -0
- package/dist/prompt/prompt-contradictions.d.ts.map +1 -0
- package/dist/prompt/prompt-contradictions.js.map +1 -0
- package/dist/prompt/prompt-listing.d.ts +70 -0
- package/dist/prompt/prompt-listing.d.ts.map +1 -0
- package/dist/prompt/prompt-listing.js.map +1 -0
- package/dist/prompt/team-prompt-base.d.ts +43 -0
- package/dist/prompt/team-prompt-base.d.ts.map +1 -0
- package/dist/prompt/team-prompt-base.js +123 -0
- package/dist/prompt/team-prompt-base.js.map +1 -0
- package/dist/prompt-sections/context-sections.d.ts +1 -1
- package/dist/prompt-sections/context-sections.d.ts.map +1 -1
- package/dist/prompt-sections/execution-sections.d.ts +1 -1
- package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
- package/dist/prompt-sections/execution-sections.js +2 -2
- package/dist/prompt-sections/execution-sections.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +2 -2
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +1 -1
- package/dist/prompt-sections/role-sections.d.ts +1 -1
- package/dist/prompt-sections/role-sections.d.ts.map +1 -1
- package/dist/prompt-sections/shared.d.ts +1 -1
- package/dist/prompt-sections/shared.d.ts.map +1 -1
- package/dist/queries/agent-resolvable-promotion.d.ts +2 -2
- package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
- package/dist/queries/agent-resolvable-promotion.js +5 -5
- package/dist/queries/agent-resolvable-promotion.js.map +1 -1
- package/dist/queries/context-assembly.d.ts +1 -1
- package/dist/queries/context-assembly.d.ts.map +1 -1
- package/dist/queries/context-assembly.js +1 -1
- package/dist/queries/context-assembly.js.map +1 -1
- package/dist/queries/context-lock-queries.d.ts +2 -2
- package/dist/queries/context-lock-queries.d.ts.map +1 -1
- package/dist/queries/deliveries.d.ts +24 -6
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +34 -39
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.d.ts.map +1 -1
- package/dist/queries/escalation-suppression.js +1 -1
- package/dist/queries/escalation-suppression.js.map +1 -1
- package/dist/queries/focuses.d.ts +1 -1
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +1 -1
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/guards.d.ts +1 -1
- package/dist/queries/guards.d.ts.map +1 -1
- package/dist/queries/guards.js +1 -1
- package/dist/queries/guards.js.map +1 -1
- package/dist/queries/holds.d.ts +3 -2
- package/dist/queries/holds.d.ts.map +1 -1
- package/dist/queries/holds.js +7 -6
- package/dist/queries/holds.js.map +1 -1
- package/dist/queries/issues.d.ts +20 -8
- package/dist/queries/issues.d.ts.map +1 -1
- package/dist/queries/issues.js +26 -29
- package/dist/queries/issues.js.map +1 -1
- package/dist/queries/prd.d.ts +2 -1
- package/dist/queries/prd.d.ts.map +1 -1
- package/dist/queries/prd.js +3 -2
- package/dist/queries/prd.js.map +1 -1
- package/dist/queries/reality-tree.js +1 -1
- package/dist/queries/reality-tree.js.map +1 -1
- package/dist/queries/roles.d.ts +1 -1
- package/dist/queries/roles.d.ts.map +1 -1
- package/dist/queries/schemas.d.ts +51 -28
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +48 -28
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/sessions.d.ts +1 -1
- package/dist/queries/sessions.d.ts.map +1 -1
- package/dist/queries/shared.d.ts +12 -1
- package/dist/queries/shared.d.ts.map +1 -1
- package/dist/queries/shared.js.map +1 -1
- package/dist/queries/system-session.d.ts +14 -3
- package/dist/queries/system-session.d.ts.map +1 -1
- package/dist/queries/system-session.js +9 -11
- package/dist/queries/system-session.js.map +1 -1
- package/dist/queries/verification.d.ts +6 -5
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +17 -14
- package/dist/queries/verification.js.map +1 -1
- package/dist/queries/workflows.d.ts +1 -1
- package/dist/queries/workflows.d.ts.map +1 -1
- package/dist/queries/worktrees.d.ts +10 -10
- package/dist/queries/worktrees.d.ts.map +1 -1
- package/dist/queries/worktrees.js.map +1 -1
- package/dist/reality/realign-apply.d.ts +65 -0
- package/dist/reality/realign-apply.d.ts.map +1 -0
- package/dist/reality/realign-apply.js +302 -0
- package/dist/reality/realign-apply.js.map +1 -0
- package/dist/reality/reality-pole-capture.d.ts.map +1 -0
- package/dist/reality/reality-pole-capture.js +114 -0
- package/dist/reality/reality-pole-capture.js.map +1 -0
- package/dist/reality/reality-pole.d.ts +64 -0
- package/dist/reality/reality-pole.d.ts.map +1 -0
- package/dist/reality/reality-pole.js +101 -0
- package/dist/reality/reality-pole.js.map +1 -0
- package/dist/reality/reality-writeback.d.ts.map +1 -0
- package/dist/reality/reality-writeback.js.map +1 -0
- package/dist/resolvers/agent-escalations.js +2 -2
- package/dist/resolvers/agent-escalations.js.map +1 -1
- package/dist/resolvers/agent-session-summaries.js +2 -2
- package/dist/resolvers/agent-session-summaries.js.map +1 -1
- package/dist/resolvers/assembly-engine.d.ts +114 -0
- package/dist/resolvers/assembly-engine.d.ts.map +1 -0
- package/dist/resolvers/assembly-engine.js +137 -0
- package/dist/resolvers/assembly-engine.js.map +1 -0
- package/dist/resolvers/delivery-acceptance-criteria.js +1 -1
- package/dist/resolvers/delivery-acceptance-criteria.js.map +1 -1
- package/dist/resolvers/delivery-description.js +1 -1
- package/dist/resolvers/delivery-description.js.map +1 -1
- package/dist/resolvers/delivery-issues.js +1 -1
- package/dist/resolvers/delivery-issues.js.map +1 -1
- package/dist/resolvers/delivery-listing.js +2 -2
- package/dist/resolvers/delivery-listing.js.map +1 -1
- package/dist/resolvers/delivery-tech-context.js +1 -1
- package/dist/resolvers/delivery-tech-context.js.map +1 -1
- package/dist/resolvers/deployment-profile.js +2 -2
- package/dist/resolvers/deployment-profile.js.map +1 -1
- package/dist/resolvers/drift-shortfall-proposals.js +3 -3
- package/dist/resolvers/drift-shortfall-proposals.js.map +1 -1
- package/dist/resolvers/escalation-answers.js +2 -2
- package/dist/resolvers/escalation-answers.js.map +1 -1
- package/dist/resolvers/focus-anchoring-injections.js +2 -2
- package/dist/resolvers/focus-anchoring-injections.js.map +1 -1
- package/dist/resolvers/focus-context.js +1 -1
- package/dist/resolvers/focus-context.js.map +1 -1
- package/dist/resolvers/focus-endpoint-catalog.js +1 -1
- package/dist/resolvers/focus-endpoint-catalog.js.map +1 -1
- package/dist/resolvers/focus-injections.js +2 -2
- package/dist/resolvers/focus-injections.js.map +1 -1
- package/dist/resolvers/focus-last-review-report.js +2 -2
- package/dist/resolvers/focus-last-review-report.js.map +1 -1
- package/dist/resolvers/focus-reality-tree.js +2 -2
- package/dist/resolvers/focus-reality-tree.js.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +2 -2
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/guards-evaluation-results.js +2 -2
- package/dist/resolvers/guards-evaluation-results.js.map +1 -1
- package/dist/resolvers/index.d.ts +6 -5
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +7 -6
- package/dist/resolvers/index.js.map +1 -1
- package/dist/resolvers/loop-context.js +2 -2
- package/dist/resolvers/loop-context.js.map +1 -1
- package/dist/resolvers/loop-delivery-index.js +2 -2
- package/dist/resolvers/loop-delivery-index.js.map +1 -1
- package/dist/resolvers/loop-documents.js +2 -2
- package/dist/resolvers/loop-documents.js.map +1 -1
- package/dist/resolvers/loop-expected-effects.js +2 -2
- package/dist/resolvers/loop-expected-effects.js.map +1 -1
- package/dist/resolvers/loop-frt-statement.js +2 -2
- package/dist/resolvers/loop-frt-statement.js.map +1 -1
- package/dist/resolvers/loop-injection.js +2 -2
- package/dist/resolvers/loop-injection.js.map +1 -1
- package/dist/resolvers/loop-persona.js +3 -3
- package/dist/resolvers/loop-persona.js.map +1 -1
- package/dist/resolvers/loop-questions.js +2 -2
- package/dist/resolvers/loop-questions.js.map +1 -1
- package/dist/resolvers/loop-upstream-udes.js +2 -2
- package/dist/resolvers/loop-upstream-udes.js.map +1 -1
- package/dist/resolvers/prd-context.js +2 -2
- package/dist/resolvers/prd-context.js.map +1 -1
- package/dist/resolvers/prd-persona.js +1 -1
- package/dist/resolvers/prd-persona.js.map +1 -1
- package/dist/resolvers/reality-metrics.js +2 -2
- package/dist/resolvers/reality-metrics.js.map +1 -1
- package/dist/resolvers/reality-projections.js +2 -2
- package/dist/resolvers/reality-projections.js.map +1 -1
- package/dist/resolvers/reality-tree-snapshot.js +2 -2
- package/dist/resolvers/reality-tree-snapshot.js.map +1 -1
- package/dist/resolvers/retired-injections.js +2 -2
- package/dist/resolvers/retired-injections.js.map +1 -1
- package/dist/resolvers/review-outcomes.js +2 -2
- package/dist/resolvers/review-outcomes.js.map +1 -1
- package/dist/resolvers/security-advisory.js +2 -2
- package/dist/resolvers/security-advisory.js.map +1 -1
- package/dist/resolvers/shared/loop.d.ts +1 -1
- package/dist/resolvers/shared/loop.d.ts.map +1 -1
- package/dist/resolvers/shared/wiki.d.ts +2 -1
- package/dist/resolvers/shared/wiki.d.ts.map +1 -1
- package/dist/resolvers/shared/wiki.js +4 -3
- package/dist/resolvers/shared/wiki.js.map +1 -1
- package/dist/resolvers/wiki-search.js +1 -1
- package/dist/resolvers/wiki-search.js.map +1 -1
- package/dist/resolvers/wiki-topic.js +2 -2
- package/dist/resolvers/wiki-topic.js.map +1 -1
- package/dist/resolvers/workflow-stages.js +2 -2
- package/dist/resolvers/workflow-stages.js.map +1 -1
- package/dist/scanners/deps.d.ts +1 -1
- package/dist/scanners/deps.d.ts.map +1 -1
- package/dist/scanners/signatures.d.ts +1 -1
- package/dist/scanners/signatures.d.ts.map +1 -1
- package/dist/scanners/workflow.d.ts +1 -1
- package/dist/scanners/workflow.d.ts.map +1 -1
- package/dist/security/security-auto-inject.d.ts.map +1 -0
- package/dist/security/security-auto-inject.js +168 -0
- package/dist/security/security-auto-inject.js.map +1 -0
- package/dist/security/security-finding-gate.d.ts.map +1 -0
- package/dist/security/security-finding-gate.js +84 -0
- package/dist/security/security-finding-gate.js.map +1 -0
- package/dist/security/security-rescan-resolution.d.ts.map +1 -0
- package/dist/security/security-rescan-resolution.js +117 -0
- package/dist/security/security-rescan-resolution.js.map +1 -0
- package/dist/security/security-scan-engine.d.ts +145 -0
- package/dist/security/security-scan-engine.d.ts.map +1 -0
- package/dist/security/security-scan-engine.js +271 -0
- package/dist/security/security-scan-engine.js.map +1 -0
- package/dist/session/session-lineage.d.ts.map +1 -0
- package/dist/session/session-lineage.js.map +1 -0
- package/dist/session/session-stamp.d.ts +63 -0
- package/dist/session/session-stamp.d.ts.map +1 -0
- package/dist/session/session-stamp.js +67 -0
- package/dist/session/session-stamp.js.map +1 -0
- package/dist/shell/activity-tracker.d.ts.map +1 -0
- package/dist/shell/activity-tracker.js +19 -0
- package/dist/shell/activity-tracker.js.map +1 -0
- package/dist/shell/agent-state.d.ts.map +1 -0
- package/dist/shell/agent-state.js.map +1 -0
- package/dist/shell/auth-liveness.d.ts.map +1 -0
- package/dist/shell/auth-liveness.js.map +1 -0
- package/dist/shell/branch-status.d.ts +97 -0
- package/dist/shell/branch-status.d.ts.map +1 -0
- package/dist/shell/branch-status.js +299 -0
- package/dist/shell/branch-status.js.map +1 -0
- package/dist/shell/circuit-wedge-watcher.d.ts +48 -0
- package/dist/shell/circuit-wedge-watcher.d.ts.map +1 -0
- package/dist/shell/circuit-wedge-watcher.js +94 -0
- package/dist/shell/circuit-wedge-watcher.js.map +1 -0
- package/dist/shell/config-hot-reload.d.ts +91 -0
- package/dist/shell/config-hot-reload.d.ts.map +1 -0
- package/dist/shell/config-hot-reload.js.map +1 -0
- package/dist/shell/config-reconcile.d.ts +114 -0
- package/dist/shell/config-reconcile.d.ts.map +1 -0
- package/dist/shell/config-reconcile.js +189 -0
- package/dist/shell/config-reconcile.js.map +1 -0
- package/dist/shell/config.d.ts +102 -0
- package/dist/shell/config.d.ts.map +1 -0
- package/dist/shell/config.js +486 -0
- package/dist/shell/config.js.map +1 -0
- package/dist/shell/constants.d.ts.map +1 -0
- package/dist/shell/constants.js.map +1 -0
- package/dist/shell/control-state.d.ts +109 -0
- package/dist/shell/control-state.d.ts.map +1 -0
- package/dist/shell/control-state.js +337 -0
- package/dist/shell/control-state.js.map +1 -0
- package/dist/shell/crash-recovery.d.ts +141 -0
- package/dist/shell/crash-recovery.d.ts.map +1 -0
- package/dist/shell/crash-recovery.js +631 -0
- package/dist/shell/crash-recovery.js.map +1 -0
- package/dist/shell/daemon-logs.d.ts.map +1 -0
- package/dist/shell/daemon-logs.js.map +1 -0
- package/dist/shell/daemon-process.d.ts.map +1 -0
- package/dist/shell/daemon-process.js +463 -0
- package/dist/shell/daemon-process.js.map +1 -0
- package/dist/shell/daemon-readiness.d.ts.map +1 -0
- package/dist/shell/daemon-readiness.js.map +1 -0
- package/dist/shell/drain-teardown.d.ts.map +1 -0
- package/dist/shell/drain-teardown.js.map +1 -0
- package/dist/shell/gitignore-convergence.d.ts.map +1 -0
- package/dist/shell/gitignore-convergence.js.map +1 -0
- package/dist/shell/health-events.d.ts.map +1 -0
- package/dist/shell/health-events.js.map +1 -0
- package/dist/shell/heartbeat.d.ts +165 -0
- package/dist/shell/heartbeat.d.ts.map +1 -0
- package/dist/shell/heartbeat.js +502 -0
- package/dist/shell/heartbeat.js.map +1 -0
- package/dist/shell/install-probe-tick.d.ts +63 -0
- package/dist/shell/install-probe-tick.d.ts.map +1 -0
- package/dist/shell/install-probe-tick.js +139 -0
- package/dist/shell/install-probe-tick.js.map +1 -0
- package/dist/shell/install-probe.d.ts.map +1 -0
- package/dist/shell/install-probe.js.map +1 -0
- package/dist/shell/intake-control.d.ts.map +1 -0
- package/dist/shell/intake-control.js.map +1 -0
- package/dist/shell/log-manager.d.ts +18 -0
- package/dist/shell/log-manager.d.ts.map +1 -0
- package/dist/shell/log-manager.js.map +1 -0
- package/dist/shell/log.d.ts.map +1 -0
- package/dist/shell/log.js.map +1 -0
- package/dist/shell/mcp-resolution.d.ts.map +1 -0
- package/dist/shell/mcp-resolution.js.map +1 -0
- package/dist/shell/model-resolution.d.ts.map +1 -0
- package/dist/shell/model-resolution.js.map +1 -0
- package/dist/shell/non-interactive-init.d.ts +40 -0
- package/dist/shell/non-interactive-init.d.ts.map +1 -0
- package/dist/shell/non-interactive-init.js.map +1 -0
- package/dist/shell/product-scaffold.d.ts +56 -0
- package/dist/shell/product-scaffold.d.ts.map +1 -0
- package/dist/shell/product-scaffold.js +136 -0
- package/dist/shell/product-scaffold.js.map +1 -0
- package/dist/shell/schema-version-gate.d.ts.map +1 -0
- package/dist/shell/schema-version-gate.js +220 -0
- package/dist/shell/schema-version-gate.js.map +1 -0
- package/dist/shell/shutdown-state.d.ts.map +1 -0
- package/dist/shell/shutdown-state.js.map +1 -0
- package/dist/shell/stop-request.d.ts.map +1 -0
- package/dist/shell/stop-request.js.map +1 -0
- package/dist/shell/unified-engine-lifecycle.d.ts +186 -0
- package/dist/shell/unified-engine-lifecycle.d.ts.map +1 -0
- package/dist/shell/unified-engine-lifecycle.js +594 -0
- package/dist/shell/unified-engine-lifecycle.js.map +1 -0
- package/dist/shell/unified-init.d.ts +86 -0
- package/dist/shell/unified-init.d.ts.map +1 -0
- package/dist/shell/unified-init.js +313 -0
- package/dist/shell/unified-init.js.map +1 -0
- package/dist/shell/unified-shell-config.d.ts +103 -0
- package/dist/shell/unified-shell-config.d.ts.map +1 -0
- package/dist/shell/unified-shell-config.js.map +1 -0
- package/dist/shell/unified-shell-provisioning.d.ts.map +1 -0
- package/dist/shell/unified-shell-provisioning.js +277 -0
- package/dist/shell/unified-shell-provisioning.js.map +1 -0
- package/dist/shell/unified-shell-status.d.ts.map +1 -0
- package/dist/shell/unified-shell-status.js +143 -0
- package/dist/shell/unified-shell-status.js.map +1 -0
- package/dist/shell/unified-shell.d.ts.map +1 -0
- package/dist/shell/unified-shell.js +583 -0
- package/dist/shell/unified-shell.js.map +1 -0
- package/dist/shell/worker-pidfile.d.ts.map +1 -0
- package/dist/shell/worker-pidfile.js.map +1 -0
- package/dist/spawn/dag-validator.d.ts +52 -0
- package/dist/spawn/dag-validator.d.ts.map +1 -0
- package/dist/spawn/dag-validator.js.map +1 -0
- package/dist/spawn/delivered-manifest.d.ts +1 -1
- package/dist/spawn/delivered-manifest.d.ts.map +1 -1
- package/dist/spawn/dependency-resolver.d.ts +77 -0
- package/dist/spawn/dependency-resolver.d.ts.map +1 -0
- package/dist/spawn/dependency-resolver.js.map +1 -0
- package/dist/spawn/guards.d.ts.map +1 -0
- package/dist/spawn/guards.js +46 -0
- package/dist/spawn/guards.js.map +1 -0
- package/dist/spawn/helpers.d.ts +86 -0
- package/dist/spawn/helpers.d.ts.map +1 -0
- package/dist/spawn/helpers.js +220 -0
- package/dist/spawn/helpers.js.map +1 -0
- package/dist/spawn/index.d.ts +29 -0
- package/dist/spawn/index.d.ts.map +1 -0
- package/dist/spawn/index.js +37 -0
- package/dist/spawn/index.js.map +1 -0
- package/dist/spawn/lifecycle.d.ts +148 -0
- package/dist/spawn/lifecycle.d.ts.map +1 -0
- package/dist/spawn/lifecycle.js +413 -0
- package/dist/spawn/lifecycle.js.map +1 -0
- package/dist/spawn/liveness.d.ts.map +1 -0
- package/dist/spawn/liveness.js +41 -0
- package/dist/spawn/liveness.js.map +1 -0
- package/dist/spawn/model-routing.d.ts +2 -2
- package/dist/spawn/model-routing.d.ts.map +1 -1
- package/dist/spawn/model-routing.js +4 -4
- package/dist/spawn/model-routing.js.map +1 -1
- package/dist/spawn/process-spawn.d.ts +7 -7
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +9 -9
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/prompt-assembly.d.ts +6 -6
- package/dist/spawn/prompt-assembly.d.ts.map +1 -1
- package/dist/spawn/prompt-assembly.js +6 -6
- package/dist/spawn/prompt-assembly.js.map +1 -1
- package/dist/spawn/shared.d.ts +3 -3
- package/dist/spawn/shared.d.ts.map +1 -1
- package/dist/spawn/shared.js +1 -1
- package/dist/spawn/spawn-cooldown.d.ts.map +1 -0
- package/dist/spawn/spawn-cooldown.js +53 -0
- package/dist/spawn/spawn-cooldown.js.map +1 -0
- package/dist/spawn/spawn-decision.d.ts +6 -6
- package/dist/spawn/spawn-decision.d.ts.map +1 -1
- package/dist/spawn/spawn-decision.js +8 -8
- package/dist/spawn/spawn-decision.js.map +1 -1
- package/dist/spawn/spawn-environment.d.ts +126 -0
- package/dist/spawn/spawn-environment.d.ts.map +1 -0
- package/dist/spawn/spawn-environment.js +177 -0
- package/dist/spawn/spawn-environment.js.map +1 -0
- package/dist/spawn/spawn-sandbox.d.ts +121 -0
- package/dist/spawn/spawn-sandbox.d.ts.map +1 -0
- package/dist/spawn/spawn-sandbox.js.map +1 -0
- package/dist/spawn/state.d.ts.map +1 -0
- package/dist/spawn/state.js.map +1 -0
- package/dist/spawn/task-converter.d.ts +61 -0
- package/dist/spawn/task-converter.d.ts.map +1 -0
- package/dist/spawn/task-converter.js.map +1 -0
- package/dist/spawn/worker-registry.d.ts.map +1 -0
- package/dist/spawn/worker-registry.js.map +1 -0
- package/dist/spawn/worktree-session.d.ts +5 -5
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +12 -12
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/types/focus.d.ts +79 -51
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/update/auto-update-idle.d.ts.map +1 -0
- package/dist/update/auto-update-idle.js.map +1 -0
- package/dist/update/auto-update.d.ts.map +1 -0
- package/dist/update/auto-update.js +317 -0
- package/dist/update/auto-update.js.map +1 -0
- package/dist/update/build-info.d.ts.map +1 -0
- package/dist/update/build-info.js.map +1 -0
- package/dist/update/capability-pointer.d.ts.map +1 -0
- package/dist/update/capability-pointer.js.map +1 -0
- package/dist/update/self-update.d.ts.map +1 -0
- package/dist/update/self-update.js +565 -0
- package/dist/update/self-update.js.map +1 -0
- package/dist/update/version-check.d.ts.map +1 -0
- package/dist/update/version-check.js +115 -0
- package/dist/update/version-check.js.map +1 -0
- package/dist/verify/ai-inspection-context.d.ts +63 -0
- package/dist/verify/ai-inspection-context.d.ts.map +1 -0
- package/dist/verify/ai-inspection-context.js +203 -0
- package/dist/verify/ai-inspection-context.js.map +1 -0
- package/dist/verify/ai-inspection-runner.d.ts.map +1 -0
- package/dist/verify/ai-inspection-runner.js +256 -0
- package/dist/verify/ai-inspection-runner.js.map +1 -0
- package/dist/verify/cascade-restatement.d.ts.map +1 -0
- package/dist/verify/cascade-restatement.js.map +1 -0
- package/dist/verify/de-restatement.d.ts.map +1 -0
- package/dist/verify/de-restatement.js +160 -0
- package/dist/verify/de-restatement.js.map +1 -0
- package/dist/verify/retire-aware-restatement.d.ts.map +1 -0
- package/dist/verify/retire-aware-restatement.js +231 -0
- package/dist/verify/retire-aware-restatement.js.map +1 -0
- package/dist/verify/stall-detector-config.d.ts.map +1 -0
- package/dist/verify/stall-detector-config.js.map +1 -0
- package/dist/verify/stall-detectors.d.ts +196 -0
- package/dist/verify/stall-detectors.d.ts.map +1 -0
- package/dist/verify/stall-detectors.js +348 -0
- package/dist/verify/stall-detectors.js.map +1 -0
- package/dist/verify/verification-baseline.d.ts +112 -0
- package/dist/verify/verification-baseline.d.ts.map +1 -0
- package/dist/verify/verification-baseline.js +267 -0
- package/dist/verify/verification-baseline.js.map +1 -0
- package/dist/verify/verification-config.d.ts +146 -0
- package/dist/verify/verification-config.d.ts.map +1 -0
- package/dist/verify/verification-config.js.map +1 -0
- package/dist/verify/verification-default-on.d.ts +160 -0
- package/dist/verify/verification-default-on.d.ts.map +1 -0
- package/dist/verify/verification-default-on.js +272 -0
- package/dist/verify/verification-default-on.js.map +1 -0
- package/dist/verify/verification-deps.d.ts +191 -0
- package/dist/verify/verification-deps.d.ts.map +1 -0
- package/dist/verify/verification-deps.js.map +1 -0
- package/dist/verify/verification-deterministic.d.ts +56 -0
- package/dist/verify/verification-deterministic.d.ts.map +1 -0
- package/dist/verify/verification-deterministic.js +153 -0
- package/dist/verify/verification-deterministic.js.map +1 -0
- package/dist/verify/verification-engine.d.ts +94 -0
- package/dist/verify/verification-engine.d.ts.map +1 -0
- package/dist/verify/verification-engine.js +717 -0
- package/dist/verify/verification-engine.js.map +1 -0
- package/dist/verify/verification-evidence.d.ts +106 -0
- package/dist/verify/verification-evidence.d.ts.map +1 -0
- package/dist/verify/verification-evidence.js +159 -0
- package/dist/verify/verification-evidence.js.map +1 -0
- package/dist/verify/verification-failure-parser.d.ts.map +1 -0
- package/dist/verify/verification-failure-parser.js.map +1 -0
- package/dist/verify/verification-feedback.d.ts +173 -0
- package/dist/verify/verification-feedback.d.ts.map +1 -0
- package/dist/verify/verification-feedback.js +442 -0
- package/dist/verify/verification-feedback.js.map +1 -0
- package/dist/verify/verification-manifest.d.ts.map +1 -0
- package/dist/verify/verification-manifest.js.map +1 -0
- package/dist/verify/verify-reconciliation.d.ts.map +1 -0
- package/dist/verify/verify-reconciliation.js.map +1 -0
- package/dist/verify/verify-restatement.d.ts.map +1 -0
- package/dist/verify/verify-restatement.js +167 -0
- package/dist/verify/verify-restatement.js.map +1 -0
- package/dist/workflow/pipeline-config.d.ts +72 -0
- package/dist/workflow/pipeline-config.d.ts.map +1 -0
- package/dist/workflow/pipeline-config.js.map +1 -0
- package/dist/workflow/stage-classifier.d.ts +32 -0
- package/dist/workflow/stage-classifier.d.ts.map +1 -0
- package/dist/workflow/stage-classifier.js.map +1 -0
- package/dist/workflow/workflow-engine.d.ts +95 -0
- package/dist/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/workflow/workflow-engine.js.map +1 -0
- package/dist/worktree/focus.d.ts +15 -70
- package/dist/worktree/focus.d.ts.map +1 -1
- package/dist/worktree/focus.js +16 -180
- package/dist/worktree/focus.js.map +1 -1
- package/dist/worktree/identity.js +1 -1
- package/dist/worktree/identity.js.map +1 -1
- package/dist/worktree/index.d.ts +1 -1
- package/dist/worktree/index.js +1 -1
- package/dist/worktree/provision.d.ts +147 -0
- package/dist/worktree/provision.d.ts.map +1 -0
- package/dist/worktree/provision.js +467 -0
- package/dist/worktree/provision.js.map +1 -0
- package/dist/worktree/reap.js +1 -1
- package/dist/worktree/reap.js.map +1 -1
- package/dist/worktree/safety.js +1 -1
- package/dist/worktree/safety.js.map +1 -1
- package/dist/worktree/scratch-guard.js +1 -1
- package/dist/worktree/scratch-guard.js.map +1 -1
- package/dist/worktree/state.d.ts +1 -1
- package/dist/worktree/state.d.ts.map +1 -1
- package/dist/worktree/state.js +3 -3
- package/dist/worktree/state.js.map +1 -1
- package/dist/worktree/verify-interlock.js +1 -1
- package/dist/worktree/verify-interlock.js.map +1 -1
- package/package.json +4 -4
- package/dist/activity-tracker.d.ts.map +0 -1
- package/dist/activity-tracker.js +0 -19
- package/dist/activity-tracker.js.map +0 -1
- package/dist/agent-state.d.ts.map +0 -1
- package/dist/agent-state.js.map +0 -1
- package/dist/ai-inspection-context.d.ts +0 -63
- package/dist/ai-inspection-context.d.ts.map +0 -1
- package/dist/ai-inspection-context.js +0 -203
- package/dist/ai-inspection-context.js.map +0 -1
- package/dist/ai-inspection-runner.d.ts.map +0 -1
- package/dist/ai-inspection-runner.js +0 -256
- package/dist/ai-inspection-runner.js.map +0 -1
- package/dist/assembly-engine.d.ts +0 -114
- package/dist/assembly-engine.d.ts.map +0 -1
- package/dist/assembly-engine.js +0 -137
- package/dist/assembly-engine.js.map +0 -1
- package/dist/assembly-resolvers.d.ts +0 -28
- package/dist/assembly-resolvers.d.ts.map +0 -1
- package/dist/assembly-resolvers.js +0 -30
- package/dist/assembly-resolvers.js.map +0 -1
- package/dist/audit-hooks.d.ts +0 -122
- package/dist/audit-hooks.d.ts.map +0 -1
- package/dist/audit-hooks.js +0 -274
- package/dist/audit-hooks.js.map +0 -1
- package/dist/audit-phase.d.ts +0 -171
- package/dist/audit-phase.d.ts.map +0 -1
- package/dist/audit-phase.js +0 -491
- package/dist/audit-phase.js.map +0 -1
- package/dist/audit-prompt.d.ts.map +0 -1
- package/dist/audit-prompt.js.map +0 -1
- package/dist/audit-shape.d.ts.map +0 -1
- package/dist/audit-shape.js.map +0 -1
- package/dist/auth-liveness.d.ts.map +0 -1
- package/dist/auth-liveness.js.map +0 -1
- package/dist/auto-update-idle.d.ts.map +0 -1
- package/dist/auto-update-idle.js.map +0 -1
- package/dist/auto-update.d.ts.map +0 -1
- package/dist/auto-update.js +0 -317
- package/dist/auto-update.js.map +0 -1
- package/dist/branch-status.d.ts +0 -79
- package/dist/branch-status.d.ts.map +0 -1
- package/dist/branch-status.js +0 -292
- package/dist/branch-status.js.map +0 -1
- package/dist/build-info.d.ts.map +0 -1
- package/dist/build-info.js.map +0 -1
- package/dist/capability-pointer.d.ts.map +0 -1
- package/dist/capability-pointer.js.map +0 -1
- package/dist/cascade-restatement.d.ts.map +0 -1
- package/dist/cascade-restatement.js.map +0 -1
- package/dist/ci-escalation.d.ts.map +0 -1
- package/dist/ci-escalation.js +0 -66
- package/dist/ci-escalation.js.map +0 -1
- package/dist/ci-sensor-loop.d.ts +0 -112
- package/dist/ci-sensor-loop.d.ts.map +0 -1
- package/dist/ci-sensor-loop.js +0 -243
- package/dist/ci-sensor-loop.js.map +0 -1
- package/dist/ci-status-git.d.ts +0 -53
- package/dist/ci-status-git.d.ts.map +0 -1
- package/dist/ci-status-git.js +0 -89
- package/dist/ci-status-git.js.map +0 -1
- package/dist/ci-status.d.ts +0 -137
- package/dist/ci-status.d.ts.map +0 -1
- package/dist/ci-status.js.map +0 -1
- package/dist/circuit-wedge-watcher.d.ts +0 -48
- package/dist/circuit-wedge-watcher.d.ts.map +0 -1
- package/dist/circuit-wedge-watcher.js +0 -94
- package/dist/circuit-wedge-watcher.js.map +0 -1
- package/dist/close-loop-dispatcher.d.ts +0 -325
- package/dist/close-loop-dispatcher.d.ts.map +0 -1
- package/dist/close-loop-dispatcher.js +0 -362
- package/dist/close-loop-dispatcher.js.map +0 -1
- package/dist/condition-evaluators.d.ts +0 -70
- package/dist/condition-evaluators.d.ts.map +0 -1
- package/dist/condition-evaluators.js +0 -203
- package/dist/condition-evaluators.js.map +0 -1
- package/dist/config-hot-reload.d.ts +0 -91
- package/dist/config-hot-reload.d.ts.map +0 -1
- package/dist/config-hot-reload.js.map +0 -1
- package/dist/config-reconcile.d.ts +0 -114
- package/dist/config-reconcile.d.ts.map +0 -1
- package/dist/config-reconcile.js +0 -189
- package/dist/config-reconcile.js.map +0 -1
- package/dist/config.d.ts +0 -102
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -486
- package/dist/config.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/context-audit.d.ts +0 -68
- package/dist/context-audit.d.ts.map +0 -1
- package/dist/context-audit.js.map +0 -1
- package/dist/context-lock.d.ts +0 -129
- package/dist/context-lock.d.ts.map +0 -1
- package/dist/context-lock.js.map +0 -1
- package/dist/control-state.d.ts +0 -109
- package/dist/control-state.d.ts.map +0 -1
- package/dist/control-state.js +0 -337
- package/dist/control-state.js.map +0 -1
- package/dist/crash-recovery.d.ts +0 -141
- package/dist/crash-recovery.d.ts.map +0 -1
- package/dist/crash-recovery.js +0 -631
- package/dist/crash-recovery.js.map +0 -1
- package/dist/daemon-logs.d.ts.map +0 -1
- package/dist/daemon-logs.js.map +0 -1
- package/dist/daemon-process.d.ts.map +0 -1
- package/dist/daemon-process.js +0 -463
- package/dist/daemon-process.js.map +0 -1
- package/dist/daemon-readiness.d.ts.map +0 -1
- package/dist/daemon-readiness.js.map +0 -1
- package/dist/dag-validator.d.ts +0 -52
- package/dist/dag-validator.d.ts.map +0 -1
- package/dist/dag-validator.js.map +0 -1
- package/dist/de-restatement.d.ts.map +0 -1
- package/dist/de-restatement.js +0 -160
- package/dist/de-restatement.js.map +0 -1
- package/dist/delivery-advance-block.d.ts +0 -143
- package/dist/delivery-advance-block.d.ts.map +0 -1
- package/dist/delivery-advance-block.js +0 -360
- package/dist/delivery-advance-block.js.map +0 -1
- package/dist/delivery-artifacts.d.ts +0 -26
- package/dist/delivery-artifacts.d.ts.map +0 -1
- package/dist/delivery-artifacts.js +0 -56
- package/dist/delivery-artifacts.js.map +0 -1
- package/dist/delivery-close-actions.d.ts +0 -39
- package/dist/delivery-close-actions.d.ts.map +0 -1
- package/dist/delivery-close-actions.js +0 -53
- package/dist/delivery-close-actions.js.map +0 -1
- package/dist/delivery-lifecycle.d.ts +0 -144
- package/dist/delivery-lifecycle.d.ts.map +0 -1
- package/dist/delivery-lifecycle.js +0 -495
- package/dist/delivery-lifecycle.js.map +0 -1
- package/dist/delivery-merge.d.ts +0 -17
- package/dist/delivery-merge.d.ts.map +0 -1
- package/dist/delivery-merge.js +0 -95
- package/dist/delivery-merge.js.map +0 -1
- package/dist/delivery-reconciler-apply.d.ts.map +0 -1
- package/dist/delivery-reconciler-apply.js +0 -77
- package/dist/delivery-reconciler-apply.js.map +0 -1
- package/dist/delivery-reconciler-shadow.d.ts +0 -65
- package/dist/delivery-reconciler-shadow.d.ts.map +0 -1
- package/dist/delivery-reconciler-shadow.js +0 -126
- package/dist/delivery-reconciler-shadow.js.map +0 -1
- package/dist/delivery-reconciler.d.ts +0 -217
- package/dist/delivery-reconciler.d.ts.map +0 -1
- package/dist/delivery-reconciler.js +0 -249
- package/dist/delivery-reconciler.js.map +0 -1
- package/dist/dependency-resolver.d.ts +0 -77
- package/dist/dependency-resolver.d.ts.map +0 -1
- package/dist/dependency-resolver.js.map +0 -1
- package/dist/directive-executor.d.ts +0 -37
- package/dist/directive-executor.d.ts.map +0 -1
- package/dist/directive-executor.js +0 -241
- package/dist/directive-executor.js.map +0 -1
- package/dist/discovery-poll.d.ts +0 -23
- package/dist/discovery-poll.d.ts.map +0 -1
- package/dist/discovery-poll.js +0 -99
- package/dist/discovery-poll.js.map +0 -1
- package/dist/drain-teardown.d.ts.map +0 -1
- package/dist/drain-teardown.js.map +0 -1
- package/dist/drift-eval-loop.d.ts +0 -71
- package/dist/drift-eval-loop.d.ts.map +0 -1
- package/dist/drift-eval-loop.js +0 -259
- package/dist/drift-eval-loop.js.map +0 -1
- package/dist/drift-evaluator.d.ts.map +0 -1
- package/dist/drift-evaluator.js.map +0 -1
- package/dist/drift-ratify-policy.d.ts.map +0 -1
- package/dist/drift-ratify-policy.js.map +0 -1
- package/dist/escalation-provenance.d.ts +0 -64
- package/dist/escalation-provenance.d.ts.map +0 -1
- package/dist/escalation-provenance.js +0 -200
- package/dist/escalation-provenance.js.map +0 -1
- package/dist/escalations.d.ts +0 -85
- package/dist/escalations.d.ts.map +0 -1
- package/dist/escalations.js +0 -91
- package/dist/escalations.js.map +0 -1
- package/dist/evaluation-context.d.ts.map +0 -1
- package/dist/evaluation-context.js +0 -44
- package/dist/evaluation-context.js.map +0 -1
- package/dist/external-hold.d.ts +0 -146
- package/dist/external-hold.d.ts.map +0 -1
- package/dist/external-hold.js +0 -223
- package/dist/external-hold.js.map +0 -1
- package/dist/focus-branch-ahead.d.ts +0 -42
- package/dist/focus-branch-ahead.d.ts.map +0 -1
- package/dist/focus-branch-ahead.js +0 -45
- package/dist/focus-branch-ahead.js.map +0 -1
- package/dist/focus-branch-identity.d.ts +0 -62
- package/dist/focus-branch-identity.d.ts.map +0 -1
- package/dist/focus-branch-identity.js +0 -59
- package/dist/focus-branch-identity.js.map +0 -1
- package/dist/focus-engine.d.ts +0 -74
- package/dist/focus-engine.d.ts.map +0 -1
- package/dist/focus-engine.js +0 -528
- package/dist/focus-engine.js.map +0 -1
- package/dist/focus-executor.d.ts +0 -80
- package/dist/focus-executor.d.ts.map +0 -1
- package/dist/focus-executor.js +0 -420
- package/dist/focus-executor.js.map +0 -1
- package/dist/focus-lifecycle.d.ts +0 -60
- package/dist/focus-lifecycle.d.ts.map +0 -1
- package/dist/focus-lifecycle.js +0 -537
- package/dist/focus-lifecycle.js.map +0 -1
- package/dist/focus-loop-registry.d.ts +0 -52
- package/dist/focus-loop-registry.d.ts.map +0 -1
- package/dist/focus-loop-registry.js +0 -362
- package/dist/focus-loop-registry.js.map +0 -1
- package/dist/focus-loop.d.ts +0 -96
- package/dist/focus-loop.d.ts.map +0 -1
- package/dist/focus-loop.js +0 -364
- package/dist/focus-loop.js.map +0 -1
- package/dist/focus-merge.d.ts +0 -131
- package/dist/focus-merge.d.ts.map +0 -1
- package/dist/focus-merge.js +0 -556
- package/dist/focus-merge.js.map +0 -1
- package/dist/focus-phase.d.ts.map +0 -1
- package/dist/focus-phase.js.map +0 -1
- package/dist/focus-prompt-builder.d.ts +0 -35
- package/dist/focus-prompt-builder.d.ts.map +0 -1
- package/dist/focus-prompt-builder.js +0 -119
- package/dist/focus-prompt-builder.js.map +0 -1
- package/dist/focus-provisioning.d.ts +0 -16
- package/dist/focus-provisioning.d.ts.map +0 -1
- package/dist/focus-provisioning.js +0 -122
- package/dist/focus-provisioning.js.map +0 -1
- package/dist/focus-respawn-guard.d.ts +0 -27
- package/dist/focus-respawn-guard.d.ts.map +0 -1
- package/dist/focus-respawn-guard.js +0 -77
- package/dist/focus-respawn-guard.js.map +0 -1
- package/dist/focus-stage-lifecycle.d.ts +0 -63
- package/dist/focus-stage-lifecycle.d.ts.map +0 -1
- package/dist/focus-stage-lifecycle.js +0 -179
- package/dist/focus-stage-lifecycle.js.map +0 -1
- package/dist/focus-team-state.d.ts +0 -94
- package/dist/focus-team-state.d.ts.map +0 -1
- package/dist/focus-team-state.js +0 -182
- package/dist/focus-team-state.js.map +0 -1
- package/dist/focus-worktree-state.d.ts +0 -58
- package/dist/focus-worktree-state.d.ts.map +0 -1
- package/dist/focus-worktree-state.js +0 -115
- package/dist/focus-worktree-state.js.map +0 -1
- package/dist/git/merge-helpers.d.ts +0 -48
- package/dist/git/merge-helpers.d.ts.map +0 -1
- package/dist/git/merge-helpers.js +0 -107
- package/dist/git/merge-helpers.js.map +0 -1
- package/dist/git/merge-strategies.d.ts +0 -49
- package/dist/git/merge-strategies.d.ts.map +0 -1
- package/dist/git/merge-strategies.js +0 -137
- package/dist/git/merge-strategies.js.map +0 -1
- package/dist/git.d.ts +0 -24
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js +0 -114
- package/dist/git.js.map +0 -1
- package/dist/gitignore-convergence.d.ts.map +0 -1
- package/dist/gitignore-convergence.js.map +0 -1
- package/dist/guard-engine.d.ts +0 -19
- package/dist/guard-engine.d.ts.map +0 -1
- package/dist/guard-engine.js +0 -20
- package/dist/guard-engine.js.map +0 -1
- package/dist/guard-evaluator.d.ts +0 -47
- package/dist/guard-evaluator.d.ts.map +0 -1
- package/dist/guard-evaluator.js +0 -195
- package/dist/guard-evaluator.js.map +0 -1
- package/dist/health-events.d.ts.map +0 -1
- package/dist/health-events.js.map +0 -1
- package/dist/heartbeat.d.ts +0 -165
- package/dist/heartbeat.d.ts.map +0 -1
- package/dist/heartbeat.js +0 -501
- package/dist/heartbeat.js.map +0 -1
- package/dist/install-probe-tick.d.ts +0 -63
- package/dist/install-probe-tick.d.ts.map +0 -1
- package/dist/install-probe-tick.js +0 -139
- package/dist/install-probe-tick.js.map +0 -1
- package/dist/install-probe.d.ts.map +0 -1
- package/dist/install-probe.js.map +0 -1
- package/dist/intake-control.d.ts.map +0 -1
- package/dist/intake-control.js.map +0 -1
- package/dist/listener-auto-advance.d.ts +0 -115
- package/dist/listener-auto-advance.d.ts.map +0 -1
- package/dist/listener-auto-advance.js +0 -621
- package/dist/listener-auto-advance.js.map +0 -1
- package/dist/listener.d.ts +0 -101
- package/dist/listener.d.ts.map +0 -1
- package/dist/listener.js +0 -770
- package/dist/listener.js.map +0 -1
- package/dist/log-manager.d.ts +0 -18
- package/dist/log-manager.d.ts.map +0 -1
- package/dist/log-manager.js.map +0 -1
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js.map +0 -1
- package/dist/mcp-resolution.d.ts.map +0 -1
- package/dist/mcp-resolution.js.map +0 -1
- package/dist/merge-back-loop.d.ts +0 -109
- package/dist/merge-back-loop.d.ts.map +0 -1
- package/dist/merge-back-loop.js +0 -498
- package/dist/merge-back-loop.js.map +0 -1
- package/dist/merge-detector.d.ts +0 -55
- package/dist/merge-detector.d.ts.map +0 -1
- package/dist/merge-detector.js +0 -222
- package/dist/merge-detector.js.map +0 -1
- package/dist/merge-failure-classify.d.ts +0 -39
- package/dist/merge-failure-classify.d.ts.map +0 -1
- package/dist/merge-failure-classify.js +0 -58
- package/dist/merge-failure-classify.js.map +0 -1
- package/dist/model-resolution.d.ts.map +0 -1
- package/dist/model-resolution.js.map +0 -1
- package/dist/non-interactive-init.d.ts +0 -40
- package/dist/non-interactive-init.d.ts.map +0 -1
- package/dist/non-interactive-init.js.map +0 -1
- package/dist/onboarding-directive.d.ts.map +0 -1
- package/dist/onboarding-directive.js.map +0 -1
- package/dist/operator-hold.d.ts +0 -66
- package/dist/operator-hold.d.ts.map +0 -1
- package/dist/operator-hold.js +0 -99
- package/dist/operator-hold.js.map +0 -1
- package/dist/otlp/port-manager.d.ts +0 -26
- package/dist/otlp/port-manager.d.ts.map +0 -1
- package/dist/otlp/port-manager.js +0 -132
- package/dist/otlp/port-manager.js.map +0 -1
- package/dist/output-monitor.d.ts +0 -38
- package/dist/output-monitor.d.ts.map +0 -1
- package/dist/output-monitor.js +0 -92
- package/dist/output-monitor.js.map +0 -1
- package/dist/pipeline-config.d.ts +0 -72
- package/dist/pipeline-config.d.ts.map +0 -1
- package/dist/pipeline-config.js.map +0 -1
- package/dist/planning-prompt-builder.d.ts +0 -69
- package/dist/planning-prompt-builder.d.ts.map +0 -1
- package/dist/planning-prompt-builder.js +0 -517
- package/dist/planning-prompt-builder.js.map +0 -1
- package/dist/product-scaffold.d.ts +0 -56
- package/dist/product-scaffold.d.ts.map +0 -1
- package/dist/product-scaffold.js +0 -136
- package/dist/product-scaffold.js.map +0 -1
- package/dist/prompt-contradictions.d.ts.map +0 -1
- package/dist/prompt-contradictions.js.map +0 -1
- package/dist/prompt-listing.d.ts +0 -70
- package/dist/prompt-listing.d.ts.map +0 -1
- package/dist/prompt-listing.js.map +0 -1
- package/dist/realign-apply.d.ts +0 -65
- package/dist/realign-apply.d.ts.map +0 -1
- package/dist/realign-apply.js +0 -302
- package/dist/realign-apply.js.map +0 -1
- package/dist/reality-pole-capture.d.ts.map +0 -1
- package/dist/reality-pole-capture.js +0 -114
- package/dist/reality-pole-capture.js.map +0 -1
- package/dist/reality-pole.d.ts +0 -64
- package/dist/reality-pole.d.ts.map +0 -1
- package/dist/reality-pole.js +0 -101
- package/dist/reality-pole.js.map +0 -1
- package/dist/reality-writeback.d.ts.map +0 -1
- package/dist/reality-writeback.js.map +0 -1
- package/dist/resolver-dispatch.d.ts.map +0 -1
- package/dist/resolver-dispatch.js.map +0 -1
- package/dist/resolver-reach.d.ts +0 -192
- package/dist/resolver-reach.d.ts.map +0 -1
- package/dist/resolver-reach.js +0 -168
- package/dist/resolver-reach.js.map +0 -1
- package/dist/retention-observation.d.ts.map +0 -1
- package/dist/retention-observation.js.map +0 -1
- package/dist/retire-aware-restatement.d.ts.map +0 -1
- package/dist/retire-aware-restatement.js +0 -231
- package/dist/retire-aware-restatement.js.map +0 -1
- package/dist/review-defect-detector.d.ts +0 -82
- package/dist/review-defect-detector.d.ts.map +0 -1
- package/dist/review-defect-detector.js +0 -148
- package/dist/review-defect-detector.js.map +0 -1
- package/dist/review-spawn-coverage-guard.d.ts.map +0 -1
- package/dist/review-spawn-coverage-guard.js.map +0 -1
- package/dist/schema-version-gate.d.ts.map +0 -1
- package/dist/schema-version-gate.js +0 -220
- package/dist/schema-version-gate.js.map +0 -1
- package/dist/security-auto-inject.d.ts.map +0 -1
- package/dist/security-auto-inject.js +0 -168
- package/dist/security-auto-inject.js.map +0 -1
- package/dist/security-finding-gate.d.ts.map +0 -1
- package/dist/security-finding-gate.js +0 -84
- package/dist/security-finding-gate.js.map +0 -1
- package/dist/security-rescan-resolution.d.ts.map +0 -1
- package/dist/security-rescan-resolution.js +0 -117
- package/dist/security-rescan-resolution.js.map +0 -1
- package/dist/security-scan-engine.d.ts +0 -145
- package/dist/security-scan-engine.d.ts.map +0 -1
- package/dist/security-scan-engine.js +0 -271
- package/dist/security-scan-engine.js.map +0 -1
- package/dist/self-update.d.ts.map +0 -1
- package/dist/self-update.js +0 -565
- package/dist/self-update.js.map +0 -1
- package/dist/sensor-sweep.d.ts +0 -194
- package/dist/sensor-sweep.d.ts.map +0 -1
- package/dist/sensor-sweep.js +0 -458
- package/dist/sensor-sweep.js.map +0 -1
- package/dist/session-lineage.d.ts.map +0 -1
- package/dist/session-lineage.js.map +0 -1
- package/dist/session-stamp.d.ts +0 -63
- package/dist/session-stamp.d.ts.map +0 -1
- package/dist/session-stamp.js +0 -67
- package/dist/session-stamp.js.map +0 -1
- package/dist/shutdown-state.d.ts.map +0 -1
- package/dist/shutdown-state.js.map +0 -1
- package/dist/spawn-cooldown.d.ts.map +0 -1
- package/dist/spawn-cooldown.js +0 -53
- package/dist/spawn-cooldown.js.map +0 -1
- package/dist/spawn-environment.d.ts +0 -126
- package/dist/spawn-environment.d.ts.map +0 -1
- package/dist/spawn-environment.js +0 -177
- package/dist/spawn-environment.js.map +0 -1
- package/dist/spawn-sandbox.d.ts +0 -121
- package/dist/spawn-sandbox.d.ts.map +0 -1
- package/dist/spawn-sandbox.js.map +0 -1
- package/dist/spawner/guards.d.ts.map +0 -1
- package/dist/spawner/guards.js +0 -46
- package/dist/spawner/guards.js.map +0 -1
- package/dist/spawner/helpers.d.ts +0 -69
- package/dist/spawner/helpers.d.ts.map +0 -1
- package/dist/spawner/helpers.js +0 -215
- package/dist/spawner/helpers.js.map +0 -1
- package/dist/spawner/index.d.ts +0 -31
- package/dist/spawner/index.d.ts.map +0 -1
- package/dist/spawner/index.js +0 -39
- package/dist/spawner/index.js.map +0 -1
- package/dist/spawner/lifecycle.d.ts +0 -148
- package/dist/spawner/lifecycle.d.ts.map +0 -1
- package/dist/spawner/lifecycle.js +0 -413
- package/dist/spawner/lifecycle.js.map +0 -1
- package/dist/spawner/liveness.d.ts.map +0 -1
- package/dist/spawner/liveness.js +0 -41
- package/dist/spawner/liveness.js.map +0 -1
- package/dist/spawner/resolution.d.ts +0 -27
- package/dist/spawner/resolution.d.ts.map +0 -1
- package/dist/spawner/resolution.js +0 -101
- package/dist/spawner/resolution.js.map +0 -1
- package/dist/spawner/state.d.ts.map +0 -1
- package/dist/spawner/state.js.map +0 -1
- package/dist/spawner/stream-handlers.d.ts +0 -19
- package/dist/spawner/stream-handlers.d.ts.map +0 -1
- package/dist/spawner/stream-handlers.js +0 -34
- package/dist/spawner/stream-handlers.js.map +0 -1
- package/dist/spawner/worker-registry.d.ts.map +0 -1
- package/dist/spawner/worker-registry.js.map +0 -1
- package/dist/stage-classifier.d.ts +0 -32
- package/dist/stage-classifier.d.ts.map +0 -1
- package/dist/stage-classifier.js.map +0 -1
- package/dist/staleness-sensor.d.ts +0 -176
- package/dist/staleness-sensor.d.ts.map +0 -1
- package/dist/staleness-sensor.js +0 -335
- package/dist/staleness-sensor.js.map +0 -1
- package/dist/staleness.d.ts +0 -134
- package/dist/staleness.d.ts.map +0 -1
- package/dist/staleness.js +0 -249
- package/dist/staleness.js.map +0 -1
- package/dist/stall-detector-config.d.ts.map +0 -1
- package/dist/stall-detector-config.js.map +0 -1
- package/dist/stall-detectors.d.ts +0 -196
- package/dist/stall-detectors.d.ts.map +0 -1
- package/dist/stall-detectors.js +0 -348
- package/dist/stall-detectors.js.map +0 -1
- package/dist/state-cascade.d.ts +0 -90
- package/dist/state-cascade.d.ts.map +0 -1
- package/dist/state-cascade.js +0 -230
- package/dist/state-cascade.js.map +0 -1
- package/dist/stop-request.d.ts.map +0 -1
- package/dist/stop-request.js.map +0 -1
- package/dist/supabase.d.ts +0 -38
- package/dist/supabase.d.ts.map +0 -1
- package/dist/supabase.js +0 -52
- package/dist/supabase.js.map +0 -1
- package/dist/task-converter.d.ts +0 -61
- package/dist/task-converter.d.ts.map +0 -1
- package/dist/task-converter.js.map +0 -1
- package/dist/task-dag-builder.d.ts +0 -14
- package/dist/task-dag-builder.d.ts.map +0 -1
- package/dist/task-dag-builder.js +0 -17
- package/dist/task-dag-builder.js.map +0 -1
- package/dist/team-prompt-base.d.ts +0 -43
- package/dist/team-prompt-base.d.ts.map +0 -1
- package/dist/team-prompt-base.js +0 -123
- package/dist/team-prompt-base.js.map +0 -1
- package/dist/telemetry-writer.d.ts +0 -89
- package/dist/telemetry-writer.d.ts.map +0 -1
- package/dist/telemetry-writer.js +0 -212
- package/dist/telemetry-writer.js.map +0 -1
- package/dist/trigger-executor.d.ts +0 -85
- package/dist/trigger-executor.d.ts.map +0 -1
- package/dist/trigger-executor.js +0 -437
- package/dist/trigger-executor.js.map +0 -1
- package/dist/types.d.ts +0 -9
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -9
- package/dist/types.js.map +0 -1
- package/dist/unified-engine-lifecycle.d.ts +0 -186
- package/dist/unified-engine-lifecycle.d.ts.map +0 -1
- package/dist/unified-engine-lifecycle.js +0 -594
- package/dist/unified-engine-lifecycle.js.map +0 -1
- package/dist/unified-init.d.ts +0 -86
- package/dist/unified-init.d.ts.map +0 -1
- package/dist/unified-init.js +0 -313
- package/dist/unified-init.js.map +0 -1
- package/dist/unified-shell-config.d.ts +0 -103
- package/dist/unified-shell-config.d.ts.map +0 -1
- package/dist/unified-shell-config.js.map +0 -1
- package/dist/unified-shell-provisioning.d.ts.map +0 -1
- package/dist/unified-shell-provisioning.js +0 -277
- package/dist/unified-shell-provisioning.js.map +0 -1
- package/dist/unified-shell-status.d.ts.map +0 -1
- package/dist/unified-shell-status.js +0 -143
- package/dist/unified-shell-status.js.map +0 -1
- package/dist/unified-shell.d.ts.map +0 -1
- package/dist/unified-shell.js +0 -583
- package/dist/unified-shell.js.map +0 -1
- package/dist/verification-baseline.d.ts +0 -112
- package/dist/verification-baseline.d.ts.map +0 -1
- package/dist/verification-baseline.js +0 -267
- package/dist/verification-baseline.js.map +0 -1
- package/dist/verification-config.d.ts +0 -146
- package/dist/verification-config.d.ts.map +0 -1
- package/dist/verification-config.js.map +0 -1
- package/dist/verification-default-on.d.ts +0 -159
- package/dist/verification-default-on.d.ts.map +0 -1
- package/dist/verification-default-on.js +0 -272
- package/dist/verification-default-on.js.map +0 -1
- package/dist/verification-deps.d.ts +0 -190
- package/dist/verification-deps.d.ts.map +0 -1
- package/dist/verification-deps.js.map +0 -1
- package/dist/verification-deterministic.d.ts +0 -56
- package/dist/verification-deterministic.d.ts.map +0 -1
- package/dist/verification-deterministic.js +0 -153
- package/dist/verification-deterministic.js.map +0 -1
- package/dist/verification-engine.d.ts +0 -94
- package/dist/verification-engine.d.ts.map +0 -1
- package/dist/verification-engine.js +0 -716
- package/dist/verification-engine.js.map +0 -1
- package/dist/verification-evidence.d.ts +0 -106
- package/dist/verification-evidence.d.ts.map +0 -1
- package/dist/verification-evidence.js +0 -159
- package/dist/verification-evidence.js.map +0 -1
- package/dist/verification-failure-parser.d.ts.map +0 -1
- package/dist/verification-failure-parser.js.map +0 -1
- package/dist/verification-feedback.d.ts +0 -173
- package/dist/verification-feedback.d.ts.map +0 -1
- package/dist/verification-feedback.js +0 -442
- package/dist/verification-feedback.js.map +0 -1
- package/dist/verification-manifest.d.ts.map +0 -1
- package/dist/verification-manifest.js.map +0 -1
- package/dist/verify-reconciliation.d.ts.map +0 -1
- package/dist/verify-reconciliation.js.map +0 -1
- package/dist/verify-restatement.d.ts.map +0 -1
- package/dist/verify-restatement.js +0 -167
- package/dist/verify-restatement.js.map +0 -1
- package/dist/version-check.d.ts.map +0 -1
- package/dist/version-check.js +0 -115
- package/dist/version-check.js.map +0 -1
- package/dist/worker-pidfile.d.ts.map +0 -1
- package/dist/worker-pidfile.js.map +0 -1
- package/dist/workflow-engine.d.ts +0 -95
- package/dist/workflow-engine.d.ts.map +0 -1
- package/dist/workflow-engine.js.map +0 -1
- package/dist/worktree.d.ts +0 -147
- package/dist/worktree.d.ts.map +0 -1
- package/dist/worktree.js +0 -467
- package/dist/worktree.js.map +0 -1
- /package/dist/{audit-prompt.d.ts → audit/audit-prompt.d.ts} +0 -0
- /package/dist/{audit-prompt.js → audit/audit-prompt.js} +0 -0
- /package/dist/{audit-shape.d.ts → audit/audit-shape.d.ts} +0 -0
- /package/dist/{audit-shape.js → audit/audit-shape.js} +0 -0
- /package/dist/{ci-escalation.d.ts → ci/ci-escalation.d.ts} +0 -0
- /package/dist/{ci-status.js → ci/ci-status.js} +0 -0
- /package/dist/{review-spawn-coverage-guard.d.ts → completion/review-spawn-coverage-guard.d.ts} +0 -0
- /package/dist/{review-spawn-coverage-guard.js → completion/review-spawn-coverage-guard.js} +0 -0
- /package/dist/{context-audit.js → context/context-audit.js} +0 -0
- /package/dist/{context-lock.js → context/context-lock.js} +0 -0
- /package/dist/{delivery-reconciler-apply.d.ts → delivery/delivery-reconciler-apply.d.ts} +0 -0
- /package/dist/{resolver-dispatch.d.ts → directive/resolver-dispatch.d.ts} +0 -0
- /package/dist/{resolver-dispatch.js → directive/resolver-dispatch.js} +0 -0
- /package/dist/{drift-evaluator.d.ts → drift/drift-evaluator.d.ts} +0 -0
- /package/dist/{drift-evaluator.js → drift/drift-evaluator.js} +0 -0
- /package/dist/{drift-ratify-policy.d.ts → drift/drift-ratify-policy.d.ts} +0 -0
- /package/dist/{drift-ratify-policy.js → drift/drift-ratify-policy.js} +0 -0
- /package/dist/{retention-observation.d.ts → drift/retention-observation.d.ts} +0 -0
- /package/dist/{retention-observation.js → drift/retention-observation.js} +0 -0
- /package/dist/{focus-phase.d.ts → focus/focus-phase.d.ts} +0 -0
- /package/dist/{focus-phase.js → focus/focus-phase.js} +0 -0
- /package/dist/{evaluation-context.d.ts → guard/evaluation-context.d.ts} +0 -0
- /package/dist/{onboarding-directive.d.ts → prompt/onboarding-directive.d.ts} +0 -0
- /package/dist/{onboarding-directive.js → prompt/onboarding-directive.js} +0 -0
- /package/dist/{prompt-contradictions.d.ts → prompt/prompt-contradictions.d.ts} +0 -0
- /package/dist/{prompt-contradictions.js → prompt/prompt-contradictions.js} +0 -0
- /package/dist/{prompt-listing.js → prompt/prompt-listing.js} +0 -0
- /package/dist/{reality-pole-capture.d.ts → reality/reality-pole-capture.d.ts} +0 -0
- /package/dist/{reality-writeback.d.ts → reality/reality-writeback.d.ts} +0 -0
- /package/dist/{reality-writeback.js → reality/reality-writeback.js} +0 -0
- /package/dist/{security-auto-inject.d.ts → security/security-auto-inject.d.ts} +0 -0
- /package/dist/{security-finding-gate.d.ts → security/security-finding-gate.d.ts} +0 -0
- /package/dist/{security-rescan-resolution.d.ts → security/security-rescan-resolution.d.ts} +0 -0
- /package/dist/{session-lineage.d.ts → session/session-lineage.d.ts} +0 -0
- /package/dist/{session-lineage.js → session/session-lineage.js} +0 -0
- /package/dist/{activity-tracker.d.ts → shell/activity-tracker.d.ts} +0 -0
- /package/dist/{agent-state.d.ts → shell/agent-state.d.ts} +0 -0
- /package/dist/{agent-state.js → shell/agent-state.js} +0 -0
- /package/dist/{auth-liveness.d.ts → shell/auth-liveness.d.ts} +0 -0
- /package/dist/{auth-liveness.js → shell/auth-liveness.js} +0 -0
- /package/dist/{config-hot-reload.js → shell/config-hot-reload.js} +0 -0
- /package/dist/{constants.d.ts → shell/constants.d.ts} +0 -0
- /package/dist/{constants.js → shell/constants.js} +0 -0
- /package/dist/{daemon-logs.d.ts → shell/daemon-logs.d.ts} +0 -0
- /package/dist/{daemon-logs.js → shell/daemon-logs.js} +0 -0
- /package/dist/{daemon-process.d.ts → shell/daemon-process.d.ts} +0 -0
- /package/dist/{daemon-readiness.d.ts → shell/daemon-readiness.d.ts} +0 -0
- /package/dist/{daemon-readiness.js → shell/daemon-readiness.js} +0 -0
- /package/dist/{drain-teardown.d.ts → shell/drain-teardown.d.ts} +0 -0
- /package/dist/{drain-teardown.js → shell/drain-teardown.js} +0 -0
- /package/dist/{gitignore-convergence.d.ts → shell/gitignore-convergence.d.ts} +0 -0
- /package/dist/{gitignore-convergence.js → shell/gitignore-convergence.js} +0 -0
- /package/dist/{health-events.d.ts → shell/health-events.d.ts} +0 -0
- /package/dist/{health-events.js → shell/health-events.js} +0 -0
- /package/dist/{install-probe.d.ts → shell/install-probe.d.ts} +0 -0
- /package/dist/{install-probe.js → shell/install-probe.js} +0 -0
- /package/dist/{intake-control.d.ts → shell/intake-control.d.ts} +0 -0
- /package/dist/{intake-control.js → shell/intake-control.js} +0 -0
- /package/dist/{log-manager.js → shell/log-manager.js} +0 -0
- /package/dist/{log.d.ts → shell/log.d.ts} +0 -0
- /package/dist/{log.js → shell/log.js} +0 -0
- /package/dist/{mcp-resolution.d.ts → shell/mcp-resolution.d.ts} +0 -0
- /package/dist/{mcp-resolution.js → shell/mcp-resolution.js} +0 -0
- /package/dist/{model-resolution.d.ts → shell/model-resolution.d.ts} +0 -0
- /package/dist/{model-resolution.js → shell/model-resolution.js} +0 -0
- /package/dist/{non-interactive-init.js → shell/non-interactive-init.js} +0 -0
- /package/dist/{schema-version-gate.d.ts → shell/schema-version-gate.d.ts} +0 -0
- /package/dist/{shutdown-state.d.ts → shell/shutdown-state.d.ts} +0 -0
- /package/dist/{shutdown-state.js → shell/shutdown-state.js} +0 -0
- /package/dist/{stop-request.d.ts → shell/stop-request.d.ts} +0 -0
- /package/dist/{stop-request.js → shell/stop-request.js} +0 -0
- /package/dist/{unified-shell-config.js → shell/unified-shell-config.js} +0 -0
- /package/dist/{unified-shell-provisioning.d.ts → shell/unified-shell-provisioning.d.ts} +0 -0
- /package/dist/{unified-shell-status.d.ts → shell/unified-shell-status.d.ts} +0 -0
- /package/dist/{unified-shell.d.ts → shell/unified-shell.d.ts} +0 -0
- /package/dist/{worker-pidfile.d.ts → shell/worker-pidfile.d.ts} +0 -0
- /package/dist/{worker-pidfile.js → shell/worker-pidfile.js} +0 -0
- /package/dist/{dag-validator.js → spawn/dag-validator.js} +0 -0
- /package/dist/{dependency-resolver.js → spawn/dependency-resolver.js} +0 -0
- /package/dist/{spawner → spawn}/guards.d.ts +0 -0
- /package/dist/{spawner → spawn}/liveness.d.ts +0 -0
- /package/dist/{spawn-cooldown.d.ts → spawn/spawn-cooldown.d.ts} +0 -0
- /package/dist/{spawn-sandbox.js → spawn/spawn-sandbox.js} +0 -0
- /package/dist/{spawner → spawn}/state.d.ts +0 -0
- /package/dist/{spawner → spawn}/state.js +0 -0
- /package/dist/{task-converter.js → spawn/task-converter.js} +0 -0
- /package/dist/{spawner → spawn}/worker-registry.d.ts +0 -0
- /package/dist/{spawner → spawn}/worker-registry.js +0 -0
- /package/dist/{auto-update-idle.d.ts → update/auto-update-idle.d.ts} +0 -0
- /package/dist/{auto-update-idle.js → update/auto-update-idle.js} +0 -0
- /package/dist/{auto-update.d.ts → update/auto-update.d.ts} +0 -0
- /package/dist/{build-info.d.ts → update/build-info.d.ts} +0 -0
- /package/dist/{build-info.js → update/build-info.js} +0 -0
- /package/dist/{capability-pointer.d.ts → update/capability-pointer.d.ts} +0 -0
- /package/dist/{capability-pointer.js → update/capability-pointer.js} +0 -0
- /package/dist/{self-update.d.ts → update/self-update.d.ts} +0 -0
- /package/dist/{version-check.d.ts → update/version-check.d.ts} +0 -0
- /package/dist/{ai-inspection-runner.d.ts → verify/ai-inspection-runner.d.ts} +0 -0
- /package/dist/{cascade-restatement.d.ts → verify/cascade-restatement.d.ts} +0 -0
- /package/dist/{cascade-restatement.js → verify/cascade-restatement.js} +0 -0
- /package/dist/{de-restatement.d.ts → verify/de-restatement.d.ts} +0 -0
- /package/dist/{retire-aware-restatement.d.ts → verify/retire-aware-restatement.d.ts} +0 -0
- /package/dist/{stall-detector-config.d.ts → verify/stall-detector-config.d.ts} +0 -0
- /package/dist/{stall-detector-config.js → verify/stall-detector-config.js} +0 -0
- /package/dist/{verification-config.js → verify/verification-config.js} +0 -0
- /package/dist/{verification-deps.js → verify/verification-deps.js} +0 -0
- /package/dist/{verification-failure-parser.d.ts → verify/verification-failure-parser.d.ts} +0 -0
- /package/dist/{verification-failure-parser.js → verify/verification-failure-parser.js} +0 -0
- /package/dist/{verification-manifest.d.ts → verify/verification-manifest.d.ts} +0 -0
- /package/dist/{verification-manifest.js → verify/verification-manifest.js} +0 -0
- /package/dist/{verify-reconciliation.d.ts → verify/verify-reconciliation.d.ts} +0 -0
- /package/dist/{verify-reconciliation.js → verify/verify-reconciliation.js} +0 -0
- /package/dist/{verify-restatement.d.ts → verify/verify-restatement.d.ts} +0 -0
- /package/dist/{pipeline-config.js → workflow/pipeline-config.js} +0 -0
- /package/dist/{stage-classifier.js → workflow/stage-classifier.js} +0 -0
- /package/dist/{workflow-engine.js → workflow/workflow-engine.js} +0 -0
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polling-based listener for focus assignments.
|
|
3
|
+
*
|
|
4
|
+
* Since we're using HTTP API instead of direct Supabase access,
|
|
5
|
+
* we poll for ready focuses instead of using Realtime subscriptions.
|
|
6
|
+
* Agent assignment is at the focus level — the daemon spawns a
|
|
7
|
+
* single Agent Team per focus that manages all deliveries.
|
|
8
|
+
*/
|
|
9
|
+
import { getAgentRoles } from '../queries/roles.js';
|
|
10
|
+
import { checkDeliveryAutoAdvance, checkVerifyDeliveriesForOpenIssues, checkDeliveryWorkStart } from './listener-auto-advance.js';
|
|
11
|
+
import { runReconcilerShadow } from '../delivery/delivery-reconciler-shadow.js';
|
|
12
|
+
import { spawnFocusTeam, hasActiveTeam, getActiveTeamCount, getActiveTeams, checkAndMergeCompletedDeliveries } from './focus-executor.js';
|
|
13
|
+
import { applyRespawnGuard } from './focus-respawn-guard.js';
|
|
14
|
+
import { checkResolvedMergeConflicts } from '../merge/focus-merge.js';
|
|
15
|
+
import { runCascadeChecks } from '../completion/state-cascade.js';
|
|
16
|
+
import { runStageLifecycleTransitions } from '../focus-stage-lifecycle/index.js';
|
|
17
|
+
import { recordActivity } from '../shell/heartbeat.js';
|
|
18
|
+
import { safeInterval, withRetry } from '@telora/daemon-core';
|
|
19
|
+
import { getActiveSessions, updateSession } from '../queries/sessions.js';
|
|
20
|
+
import { ensureFocusWorktrees, checkForDeactivatedFocuses } from './focus-lifecycle.js';
|
|
21
|
+
import { detectGitStates } from '../git/index.js';
|
|
22
|
+
import { detectFocusMerges } from '../merge/merge-detector.js';
|
|
23
|
+
import { checkControlStateChanges, reapDisarmedTeams } from '../shell/control-state.js';
|
|
24
|
+
import { isDaemonShuttingDown } from '../shell/shutdown-state.js';
|
|
25
|
+
import { registerPollTrigger, triggerCheck } from '../poll-trigger.js';
|
|
26
|
+
// Re-exported for existing importers; the live trigger is registered below.
|
|
27
|
+
export { triggerCheck };
|
|
28
|
+
import { configForProduct, findProduct } from '../shell/config.js';
|
|
29
|
+
import { checkIncomingRequests } from '../nexus/index.js';
|
|
30
|
+
import { checkIntakePendingRequests } from '../nexus/index.js';
|
|
31
|
+
import { checkResolvedRequests } from '../nexus/index.js';
|
|
32
|
+
import { checkEndpointClearance } from '../nexus/index.js';
|
|
33
|
+
import { checkDirectives, seedLastProcessedStage, getPendingSpawnFocusIds, getPendingSpawnDirective, clearPendingSpawnDirective, shouldReapPendingSpawnDirective } from '../directive/directive-executor.js';
|
|
34
|
+
import { decideNullRoleSpawn, resolveReviewerFallbackRole, shouldWarnNullRoleSkip, DEFAULT_REVIEWER_ROLE_NAME } from '../spawn/review-role-fallback.js';
|
|
35
|
+
import { getActiveFocuses, getReadyFocuses, clearAnswerRearm } from '../queries/deliveries.js';
|
|
36
|
+
import { isAuditPhaseFocusRow } from '../audit/audit-shape.js';
|
|
37
|
+
import { isIntakeDraining } from '../shell/intake-control.js';
|
|
38
|
+
import { checkDiscoveryRequests } from '../host-control/discovery-poll.js';
|
|
39
|
+
// Track focuses that have been logged as idle (no actionable deliveries).
|
|
40
|
+
// Only log on state change: first skip after an active session or after startup.
|
|
41
|
+
const idleLoggedFocuses = new Set();
|
|
42
|
+
// Track focuses already warned this blocked episode for a null-role coding
|
|
43
|
+
// off-state pending directive (Play/queue toggle cleared, no operator stop).
|
|
44
|
+
// Without this, the "no assigned_agent_role_id; skipping spawn (coding off-state)"
|
|
45
|
+
// warning fires every 30s poll for as long as the directive sits queued. We warn
|
|
46
|
+
// once on entry and suppress until the focus resumes (role assigned, directive
|
|
47
|
+
// cleared, or focus leaves the active set), at which point it is removed so a
|
|
48
|
+
// later re-entry warns again. Operator-stop suppression does NOT use this set --
|
|
49
|
+
// it drops the directive, so it is inherently once-per-episode.
|
|
50
|
+
const nullRoleSkipWarnedFocuses = new Set();
|
|
51
|
+
// Depth of the ready-focus queue as of the most recent completed poll. Read by
|
|
52
|
+
// the auto-updater's batch-safe idle predicate (auto-update-idle.ts): a drained
|
|
53
|
+
// queue (0) plus no active team is a safe restart seam. Stale-but-recent is fine
|
|
54
|
+
// -- the idle gate is debounced well past the poll interval.
|
|
55
|
+
let lastReadyFocusCount = 0;
|
|
56
|
+
/**
|
|
57
|
+
* Number of focuses with actionable (queued) work as of the last poll. Zero
|
|
58
|
+
* means the focus queue is drained. Used by the batch-safe idle predicate so a
|
|
59
|
+
* transient between-delivery gap (which still has queued focuses) does not read
|
|
60
|
+
* as idle.
|
|
61
|
+
*/
|
|
62
|
+
export function getReadyFocusQueueDepth() {
|
|
63
|
+
return lastReadyFocusCount;
|
|
64
|
+
}
|
|
65
|
+
let config = null;
|
|
66
|
+
const roles = new Map();
|
|
67
|
+
let pollInterval = null;
|
|
68
|
+
let pollState = 'idle';
|
|
69
|
+
// Polling interval in milliseconds (default: 30 seconds)
|
|
70
|
+
const POLL_INTERVAL_MS = 30000;
|
|
71
|
+
// Roles refresh: re-fetch from DB periodically to pick up changes
|
|
72
|
+
const ROLES_REFRESH_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
|
|
73
|
+
let lastRolesRefreshAt = 0;
|
|
74
|
+
// Health check backoff: track consecutive failures to avoid hammering a broken API
|
|
75
|
+
let healthCheckConsecutiveFailures = 0;
|
|
76
|
+
const HEALTH_CHECK_MAX_SKIP_CYCLES = 10; // max backoff = 10 * 30s = 5 minutes
|
|
77
|
+
// Spawn cooldown imported from dedicated module (avoids circular deps)
|
|
78
|
+
import { isInSpawnCooldown } from '../spawn/spawn-cooldown.js';
|
|
79
|
+
import { shouldSkipPendingSpawn, recordPendingSpawnAttempt } from '../spawn/index.js';
|
|
80
|
+
import { createLogger } from '../shell/log.js';
|
|
81
|
+
const log = createLogger({ module: 'listener' });
|
|
82
|
+
/**
|
|
83
|
+
* Initialize the listener with configuration.
|
|
84
|
+
*/
|
|
85
|
+
export async function initListener(daemonConfig) {
|
|
86
|
+
config = daemonConfig;
|
|
87
|
+
// Load all roles
|
|
88
|
+
try {
|
|
89
|
+
const roleList = await getAgentRoles(config.organizationId);
|
|
90
|
+
roles.clear();
|
|
91
|
+
for (const role of roleList) {
|
|
92
|
+
roles.set(role.id, role);
|
|
93
|
+
}
|
|
94
|
+
lastRolesRefreshAt = Date.now();
|
|
95
|
+
log.info(`Loaded ${roles.size} agent roles`);
|
|
96
|
+
// Seed directive executor with current stage IDs to prevent
|
|
97
|
+
// re-firing directives for stages already processed before restart.
|
|
98
|
+
//
|
|
99
|
+
// Skip focuses with review_requested_at set: those need the
|
|
100
|
+
// reviewing-stage spawn directive to fire fresh on the next poll
|
|
101
|
+
// (the user clicked Review, the team was supposed to spawn, the
|
|
102
|
+
// pending-spawn map was wiped on restart). Without this skip, the
|
|
103
|
+
// directive sees the seeded stage as already processed and never
|
|
104
|
+
// fires -- leaving the focus stuck in `reviewing` indefinitely
|
|
105
|
+
// because nothing else routes verify deliveries to a terminal
|
|
106
|
+
// status.
|
|
107
|
+
let seededCount = 0;
|
|
108
|
+
let skippedReviewCount = 0;
|
|
109
|
+
for (const product of daemonConfig.products) {
|
|
110
|
+
try {
|
|
111
|
+
const focuses = await getActiveFocuses(daemonConfig.organizationId, product.id);
|
|
112
|
+
for (const focus of focuses) {
|
|
113
|
+
if (!focus.current_workflow_stage_id)
|
|
114
|
+
continue;
|
|
115
|
+
if (focus.review_requested_at) {
|
|
116
|
+
skippedReviewCount++;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
seedLastProcessedStage(focus.focus_id, focus.current_workflow_stage_id);
|
|
120
|
+
seededCount++;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
log.warn(`Failed to seed directive stages for product ${product.id}: ${err.message}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (seededCount > 0) {
|
|
128
|
+
log.info(`Seeded directive stage tracking for ${seededCount} active focuses`);
|
|
129
|
+
}
|
|
130
|
+
if (skippedReviewCount > 0) {
|
|
131
|
+
log.info(`Skipped seeding for ${skippedReviewCount} focus(es) with pending review request -- directive will re-fire`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
const msg = error.message ?? '';
|
|
136
|
+
if (msg.includes('API response validation failed for agent_role_list')) {
|
|
137
|
+
throw new Error('Agent role schema mismatch -- your Telora backend edge functions need to be redeployed. '
|
|
138
|
+
+ 'The daemon expects full role details (organizationId, description, allowedFilePatterns, '
|
|
139
|
+
+ 'allowedTools, systemPromptTemplate, color, icon) but the backend returned partial data. '
|
|
140
|
+
+ 'Redeploy your Supabase edge functions and restart the daemon.');
|
|
141
|
+
}
|
|
142
|
+
throw error;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Start polling for ready focuses.
|
|
147
|
+
*/
|
|
148
|
+
export function startDeliveryListener() {
|
|
149
|
+
if (!config) {
|
|
150
|
+
throw new Error('Listener not initialized. Call initListener first.');
|
|
151
|
+
}
|
|
152
|
+
// Initial check
|
|
153
|
+
processReadyFocuses();
|
|
154
|
+
// Start polling with error boundary — check for work and main advancement
|
|
155
|
+
// Per-product functions are called with product-scoped configs so that
|
|
156
|
+
// config.productId and config.repoPath resolve to the correct product.
|
|
157
|
+
pollInterval = safeInterval(async () => {
|
|
158
|
+
for (const product of config.products) {
|
|
159
|
+
const pc = configForProduct(config, product);
|
|
160
|
+
await ensureFocusWorktrees(pc, roles);
|
|
161
|
+
await checkForDeactivatedFocuses(pc);
|
|
162
|
+
await checkControlStateChanges(pc);
|
|
163
|
+
// Disarm reaper: clearing assigned_agent_role_id (dashboard Stop) only
|
|
164
|
+
// removes the focus from the spawn set; this stops the in-flight team via
|
|
165
|
+
// the same cooperative-stop -> SIGTERM path so Stop means stop. Runs after
|
|
166
|
+
// checkForDeactivatedFocuses (which owns genuine status!=active teardown).
|
|
167
|
+
await reapDisarmedTeams(pc);
|
|
168
|
+
await checkDeliveryAutoAdvance(pc);
|
|
169
|
+
await checkVerifyDeliveriesForOpenIssues(pc);
|
|
170
|
+
// Work-START edge: cross queued -> coding the moment a work issue is In
|
|
171
|
+
// Progress, during active execution (restores the deleted
|
|
172
|
+
// auto_advance_delivery_on_issue_active trigger via the single-writer
|
|
173
|
+
// reconciler). Runs for active-team focuses too, unlike checkDeliveryAutoAdvance.
|
|
174
|
+
await checkDeliveryWorkStart(pc);
|
|
175
|
+
// Single-writer consolidation (injection #10), SHADOW step: compute the
|
|
176
|
+
// reconciler's target for each delivery and log divergence from the live
|
|
177
|
+
// status. Writes nothing; default-OFF (opt-in via TELORA_RECONCILER_SHADOW),
|
|
178
|
+
// so this is a no-op until an operator enables it.
|
|
179
|
+
await runReconcilerShadow(pc);
|
|
180
|
+
// Nexus: pick up incoming cross-product requests and apply the accept gate.
|
|
181
|
+
await checkIncomingRequests(pc);
|
|
182
|
+
// Nexus: spawn a target-side scoping agent for each accepted, not-yet-
|
|
183
|
+
// materialized request so the receiving team authors a per-request focus
|
|
184
|
+
// (no server-side authoring, no dead-letter inbox).
|
|
185
|
+
await checkIntakePendingRequests(pc);
|
|
186
|
+
// Nexus: close the loop -- resolve done deliveries + notify blocked sources.
|
|
187
|
+
await checkResolvedRequests(pc);
|
|
188
|
+
// Nexus: clear externally-owned obstacles whose endpoint-typed request has
|
|
189
|
+
// been fulfilled (registry-shape), advancing the consumer's frontier.
|
|
190
|
+
await checkEndpointClearance(pc);
|
|
191
|
+
}
|
|
192
|
+
// Endpoint discovery (D5): org-scoped, once per cycle. Best-effort -- the
|
|
193
|
+
// daemon is the only LAN-reachable component, so it resolves the add-model
|
|
194
|
+
// form's pending {baseUrl}/models lookups. FIRE-AND-FORGET (TEL-7): never
|
|
195
|
+
// awaited, so a slow/blocked endpoint fetch can't delay spawn/merge work.
|
|
196
|
+
// Its own module-level re-entrancy guard drops overlapping cycles.
|
|
197
|
+
void checkDiscoveryRequests().catch((err) => log.warn('discovery poll failed:', err.message));
|
|
198
|
+
await processReadyFocuses();
|
|
199
|
+
await checkAndMergeCompletedDeliveries(config);
|
|
200
|
+
// checkDirectives runs syncFocusPhase (writing
|
|
201
|
+
// focus.current_workflow_stage_id) and fires stage-change directives
|
|
202
|
+
// -- including the spawn directive that starts the review team on
|
|
203
|
+
// entry to the `reviewing` phase. Run it before the cascade so phase
|
|
204
|
+
// and directive state are settled when the cascade reads them.
|
|
205
|
+
await checkDirectives(config);
|
|
206
|
+
// Pick up focuses that have a pending spawn directive but weren't
|
|
207
|
+
// surfaced by getReadyFocuses (e.g., review-stage spawns on focuses
|
|
208
|
+
// whose deliveries are all in verify).
|
|
209
|
+
await processPendingSpawnFocuses();
|
|
210
|
+
// The cascade no longer auto-completes reviews -- closing out a
|
|
211
|
+
// review and routing verify deliveries to done/verify_failed is the
|
|
212
|
+
// exclusive responsibility of focus-completion.ts's review exit
|
|
213
|
+
// handler, which gates on the exiting team's sessionType === 'review'
|
|
214
|
+
// (positive signal that an actual review ran).
|
|
215
|
+
await runCascadeChecks(config);
|
|
216
|
+
// New focus workflow lifecycle transitions (D2):
|
|
217
|
+
// - verify -> review when pipeline_config.review.enabled
|
|
218
|
+
// - review -> close_loop on state-based convergence
|
|
219
|
+
// - review -> review_nonconvergent escalation past the N-iter cap
|
|
220
|
+
// Runs after the legacy cascade so the new authoritative `stage`
|
|
221
|
+
// column reflects any updates the cascade may have made.
|
|
222
|
+
await runStageLifecycleTransitions(config);
|
|
223
|
+
await checkResolvedMergeConflicts(config);
|
|
224
|
+
await detectGitStates(config);
|
|
225
|
+
await detectFocusMerges(config);
|
|
226
|
+
// NOTE: the targeted daemon-owned stall detectors (verify_failed re-code cap
|
|
227
|
+
// + review-window staleness) run INSIDE runCascadeChecks above -- they ride
|
|
228
|
+
// its existing per-focus review-handling loop (reusing the deliveries +
|
|
229
|
+
// review phase it already fetched) rather than fanning out a second pass.
|
|
230
|
+
await checkSessionHealth();
|
|
231
|
+
}, POLL_INTERVAL_MS, 'focus-poll', { skipIfRunning: true });
|
|
232
|
+
log.info(`Started focus polling (every ${POLL_INTERVAL_MS / 1000}s)`);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Start session listener (no-op for polling mode).
|
|
236
|
+
* Kept for API compatibility with the original implementation.
|
|
237
|
+
*/
|
|
238
|
+
export function startSessionListener() {
|
|
239
|
+
if (!config) {
|
|
240
|
+
throw new Error('Listener not initialized. Call initListener first.');
|
|
241
|
+
}
|
|
242
|
+
// In polling mode, session changes are handled by checking ready focuses
|
|
243
|
+
log.info('Session monitoring via polling (included in focus polling)');
|
|
244
|
+
}
|
|
245
|
+
export function decideFocusSpawn(gate) {
|
|
246
|
+
if (!gate.hasRole)
|
|
247
|
+
return 'skip_unknown_role';
|
|
248
|
+
if (gate.hasActiveTeam)
|
|
249
|
+
return 'skip_active_team';
|
|
250
|
+
if (gate.inSpawnCooldown)
|
|
251
|
+
return 'skip_cooldown';
|
|
252
|
+
if (gate.activeTeamCount >= gate.maxTotalSessions)
|
|
253
|
+
return 'stop_capacity';
|
|
254
|
+
return 'spawn';
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Process any focuses ready for agent work.
|
|
258
|
+
*
|
|
259
|
+
* For each ready focus without an active team, spawns a single
|
|
260
|
+
* Agent Team that manages all deliveries within that focus.
|
|
261
|
+
* Also detects focuses that have been deactivated and shuts down
|
|
262
|
+
* their teams.
|
|
263
|
+
*/
|
|
264
|
+
export async function processReadyFocuses() {
|
|
265
|
+
if (!config)
|
|
266
|
+
return;
|
|
267
|
+
// Prevent concurrent processing, and skip cycles during health check backoff
|
|
268
|
+
if (pollState === 'processing' || pollState === 'backing_off') {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
pollState = 'processing';
|
|
272
|
+
try {
|
|
273
|
+
// Periodically refresh agent roles to pick up changes
|
|
274
|
+
if (Date.now() - lastRolesRefreshAt > ROLES_REFRESH_INTERVAL_MS) {
|
|
275
|
+
try {
|
|
276
|
+
const roleList = await getAgentRoles(config.organizationId);
|
|
277
|
+
roles.clear();
|
|
278
|
+
for (const role of roleList) {
|
|
279
|
+
roles.set(role.id, role);
|
|
280
|
+
}
|
|
281
|
+
lastRolesRefreshAt = Date.now();
|
|
282
|
+
log.info(`Refreshed agent roles (${roles.size} roles loaded)`);
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
log.warn(`Failed to refresh agent roles: ${err.message}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// Record activity: proves the poll ran even if no work was found
|
|
289
|
+
recordActivity();
|
|
290
|
+
// Snapshot active teams before processing (for idle detection)
|
|
291
|
+
const previouslyActiveIds = new Set(getActiveTeams().keys());
|
|
292
|
+
// Deactivation detection is now handled by checkForDeactivatedFocuses()
|
|
293
|
+
// in the poll loop (called before processReadyFocuses).
|
|
294
|
+
// Get ready focuses across all configured products
|
|
295
|
+
const readyFocuses = [];
|
|
296
|
+
for (const product of config.products) {
|
|
297
|
+
try {
|
|
298
|
+
const focuses = await getReadyFocuses(config.organizationId, product.id);
|
|
299
|
+
readyFocuses.push(...focuses);
|
|
300
|
+
}
|
|
301
|
+
catch (err) {
|
|
302
|
+
log.warn(`Failed to fetch ready focuses for product ${product.id}: ${err.message}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Publish the queue depth for the auto-updater's batch-safe idle predicate.
|
|
306
|
+
// Set before any early-return below so a drained queue is observable.
|
|
307
|
+
lastReadyFocusCount = readyFocuses.length;
|
|
308
|
+
// Track which focuses are ready this cycle (for idle logging)
|
|
309
|
+
const readyFocusIds = new Set(readyFocuses.map(s => s.focus_id));
|
|
310
|
+
// Idle queue logging: detect focuses that were previously active
|
|
311
|
+
// but now have no ready deliveries. Only log on state change.
|
|
312
|
+
for (const focusId of previouslyActiveIds) {
|
|
313
|
+
if (!readyFocusIds.has(focusId) && !hasActiveTeam(focusId) && !idleLoggedFocuses.has(focusId)) {
|
|
314
|
+
const nextPollSec = POLL_INTERVAL_MS / 1000;
|
|
315
|
+
log.info(`Focus queue idle: "${focusId}" -- no actionable deliveries, next poll in ${nextPollSec}s`);
|
|
316
|
+
idleLoggedFocuses.add(focusId);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (readyFocuses.length === 0) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
// Intake drain (auto-update delivery C): a pending update has been stale
|
|
323
|
+
// past threshold while the daemon stays busy, so we stop accepting new focus
|
|
324
|
+
// teams to let the current batch become the safe seam. Active teams continue
|
|
325
|
+
// to completion; we simply do not spawn more. The held queue does not block
|
|
326
|
+
// the batch boundary because isBatchSafeIdle honors isIntakeDraining().
|
|
327
|
+
if (isIntakeDraining()) {
|
|
328
|
+
log.info(`[listener] Intake drained for pending update -- holding ${readyFocuses.length} ready focus(es); no new teams will spawn`);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const productLabel = config.products.length > 1
|
|
332
|
+
? ` across ${config.products.length} product(s)`
|
|
333
|
+
: '';
|
|
334
|
+
log.info(`Found ${readyFocuses.length} ready focuses${productLabel}`);
|
|
335
|
+
for (const focus of readyFocuses) {
|
|
336
|
+
const role = roles.get(focus.assigned_agent_role_id);
|
|
337
|
+
// Resolve the per-focus spawn-gate decision (pure; see decideFocusSpawn).
|
|
338
|
+
// The capacity input is the LIVE team count sampled this iteration, so a
|
|
339
|
+
// spawn earlier in this loop is reflected for the next focus.
|
|
340
|
+
const action = decideFocusSpawn({
|
|
341
|
+
hasRole: role !== undefined,
|
|
342
|
+
hasActiveTeam: hasActiveTeam(focus.focus_id),
|
|
343
|
+
inSpawnCooldown: isInSpawnCooldown(focus.focus_id),
|
|
344
|
+
activeTeamCount: getActiveTeamCount(),
|
|
345
|
+
maxTotalSessions: config.maxTotalSessions,
|
|
346
|
+
});
|
|
347
|
+
if (action === 'skip_unknown_role') {
|
|
348
|
+
log.error(`Unknown agent role: ${focus.assigned_agent_role_id}`);
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
if (action === 'skip_active_team') {
|
|
352
|
+
// Focus is active -- clear idle state so we re-log if it goes idle again
|
|
353
|
+
idleLoggedFocuses.delete(focus.focus_id);
|
|
354
|
+
// A re-arm flag may have landed while a team is up. Do NOT clear it here:
|
|
355
|
+
// the answer is consumed only at (re)spawn time via the escalation.answers
|
|
356
|
+
// resolver, and a still-live team does not re-run assembly mid-session
|
|
357
|
+
// (the wake-message handoff does not carry answers). Leaving the flag set
|
|
358
|
+
// lets the force-spawn deliver the answer once this team exits; clearing
|
|
359
|
+
// it now would strand the answer. The clear happens on the force-spawn
|
|
360
|
+
// below (one answer -> one re-spawn).
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
// Skip focuses that were recently torn down (spawn cooldown).
|
|
364
|
+
if (action === 'skip_cooldown') {
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
// Total capacity reached -- stop the whole loop, not just this focus.
|
|
368
|
+
if (action === 'stop_capacity') {
|
|
369
|
+
log.info(`Total session limit reached, stopping`);
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
// action === 'spawn'. role is guaranteed defined (hasRole was true);
|
|
373
|
+
// this guard narrows the type and is otherwise unreachable.
|
|
374
|
+
if (!role)
|
|
375
|
+
continue;
|
|
376
|
+
const isRearm = focus.answer_rearm_requested_at != null;
|
|
377
|
+
// Clear idle state before spawn attempt -- if spawn succeeds,
|
|
378
|
+
// the focus is active. If it skips (no actionable deliveries),
|
|
379
|
+
// spawnFocusTeam logs the skip and we mark it idle here.
|
|
380
|
+
const wasIdle = idleLoggedFocuses.has(focus.focus_id);
|
|
381
|
+
idleLoggedFocuses.delete(focus.focus_id);
|
|
382
|
+
// Use product-scoped config so the team uses the correct repoPath
|
|
383
|
+
const productEntry = focus.product_id ? findProduct(config, focus.product_id) : undefined;
|
|
384
|
+
const spawnConfig = productEntry ? configForProduct(config, productEntry) : config;
|
|
385
|
+
// Spawn a focus team (one team per focus). forceSpawn lets a re-armed
|
|
386
|
+
// focus spawn past findActionableDeliveries' 'skip' to consume the
|
|
387
|
+
// pending escalation answer.
|
|
388
|
+
// Audit-phase focus (explicit read_only=true OR the second structural
|
|
389
|
+
// signal: audit_origin && not-yet-ratified, TEL-3) spawns read-only, so a
|
|
390
|
+
// flag-absent audit focus is not driven into scoping/write/commit ahead of
|
|
391
|
+
// ratification (2f253da6). See isAuditPhaseFocusRow.
|
|
392
|
+
await spawnFocusTeam({ config: spawnConfig, focusId: focus.focus_id, focusName: focus.focus_name, role, pipelineConfig: focus.pipeline_config, readOnly: isAuditPhaseFocusRow(focus), lastClaudeSessionId: focus.last_claude_session_id, claudeSessionIds: focus.claude_session_ids, engineOverride: focus.engine_override, localModelOverride: focus.local_model_override, orgDefaultEngine: focus.org_default_engine, pinnedBranch: focus.branch_name, forceSpawn: isRearm });
|
|
393
|
+
// Clear the re-arm flag only once a team is actually live to consume the
|
|
394
|
+
// answer: one answer -> one re-spawn. If the force-spawn did NOT produce an
|
|
395
|
+
// active team (worktree/governor failure, etc.), leave the flag set so a
|
|
396
|
+
// later poll retries delivery rather than stranding the answer. (Cooldown
|
|
397
|
+
// and capacity exit above without reaching here, so they also keep the
|
|
398
|
+
// flag.) Done before the idle check below so a consumed re-arm is not
|
|
399
|
+
// re-surfaced next poll.
|
|
400
|
+
if (isRearm && hasActiveTeam(focus.focus_id)) {
|
|
401
|
+
await clearAnswerRearm(focus.focus_id).catch((err) => log.warn(`Failed to clear answer re-arm for "${focus.focus_name}": ${err.message}`));
|
|
402
|
+
}
|
|
403
|
+
// If the spawn was skipped (no active team after spawn), mark as idle
|
|
404
|
+
if (!hasActiveTeam(focus.focus_id) && !wasIdle) {
|
|
405
|
+
const nextPollSec = POLL_INTERVAL_MS / 1000;
|
|
406
|
+
log.info(`Focus queue idle: "${focus.focus_name}" -- no actionable deliveries after pre-spawn check, next poll in ${nextPollSec}s`);
|
|
407
|
+
idleLoggedFocuses.add(focus.focus_id);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
log.error('Error processing ready focuses:', error);
|
|
413
|
+
}
|
|
414
|
+
finally {
|
|
415
|
+
pollState = healthCheckConsecutiveFailures > 0 ? 'backing_off' : 'idle';
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Spawn teams for focuses that have a pending spawn directive but were
|
|
420
|
+
* not surfaced by getReadyFocuses.
|
|
421
|
+
*
|
|
422
|
+
* getReadyFocuses (daemon-focus-handlers.ts) only returns focuses with
|
|
423
|
+
* queued/coding deliveries (or zero deliveries). A review-stage spawn
|
|
424
|
+
* directive on a focus whose deliveries are all in verify never makes
|
|
425
|
+
* it to processReadyFocuses -- the pending directive sits forever and
|
|
426
|
+
* the team never starts. This function bridges that gap: scan the
|
|
427
|
+
* pending-spawn map directly and spawn for any focus that's not
|
|
428
|
+
* already running.
|
|
429
|
+
*/
|
|
430
|
+
export async function processPendingSpawnFocuses() {
|
|
431
|
+
if (!config)
|
|
432
|
+
return;
|
|
433
|
+
if (isDaemonShuttingDown())
|
|
434
|
+
return;
|
|
435
|
+
const pendingIds = getPendingSpawnFocusIds().filter(id => !hasActiveTeam(id));
|
|
436
|
+
if (pendingIds.length === 0)
|
|
437
|
+
return;
|
|
438
|
+
// Fetch focus details for all configured products. getActiveFocuses
|
|
439
|
+
// returns the metadata spawnFocusTeam needs.
|
|
440
|
+
const focusDetailsById = new Map();
|
|
441
|
+
// Whether ANY product's getActiveFocuses read failed this tick. A fetch failure
|
|
442
|
+
// makes the active set incomplete, so a pending focus can look absent purely
|
|
443
|
+
// because its product's read failed -- absence is only trustworthy when this is
|
|
444
|
+
// false. Gates the zombie-directive reap below.
|
|
445
|
+
let anyFetchFailed = false;
|
|
446
|
+
for (const product of config.products) {
|
|
447
|
+
try {
|
|
448
|
+
const focuses = await getActiveFocuses(config.organizationId, product.id);
|
|
449
|
+
for (const f of focuses) {
|
|
450
|
+
if (pendingIds.includes(f.focus_id)) {
|
|
451
|
+
focusDetailsById.set(f.focus_id, f);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
catch (err) {
|
|
456
|
+
anyFetchFailed = true;
|
|
457
|
+
log.warn(`[listener] processPendingSpawnFocuses: failed to fetch active focuses for product ${product.id}: ${err.message}`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
for (const focusId of pendingIds) {
|
|
461
|
+
const focus = focusDetailsById.get(focusId);
|
|
462
|
+
if (!focus) {
|
|
463
|
+
// Focus is absent from the active set. If the read was complete this tick
|
|
464
|
+
// (no fetch failure), the focus has genuinely left the active set -- its
|
|
465
|
+
// directive is a zombie: reap it once instead of retrying forever. On a
|
|
466
|
+
// fetch-failure tick the absence is untrustworthy, so keep retrying.
|
|
467
|
+
if (shouldReapPendingSpawnDirective({ anyFetchFailed, focusPresentInActiveSet: false })) {
|
|
468
|
+
clearPendingSpawnDirective(focusId);
|
|
469
|
+
// Focus left the active set -- the blocked episode is over. Clear its
|
|
470
|
+
// once-per-episode warn marker so a future re-entry warns again.
|
|
471
|
+
nullRoleSkipWarnedFocuses.delete(focusId);
|
|
472
|
+
log.info(`[listener] Dropping stale spawn directive for focus ${focusId.slice(0, 8)}: ` +
|
|
473
|
+
`confirmed absent from every product's active set (focus completed/deactivated).`);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
log.warn(`[listener] Pending spawn directive for focus ${focusId.slice(0, 8)} but focus not found in active set; ` +
|
|
477
|
+
`active-set read incomplete this tick (fetch failure) -- retrying next poll.`);
|
|
478
|
+
}
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
let role;
|
|
482
|
+
if (!focus.assigned_agent_role_id) {
|
|
483
|
+
// A null assigned_agent_role_id now means ONE OF TWO things, and they are
|
|
484
|
+
// NOT interchangeable:
|
|
485
|
+
// - operator_stopped_at set => an operator pulled the Play toggle to
|
|
486
|
+
// halt the focus. Authoritative: it wins over the review fallback.
|
|
487
|
+
// - operator_stopped_at null => auto_terminate_focus_team() cleared the
|
|
488
|
+
// role at completion (lifecycle). Here the review fallback applies:
|
|
489
|
+
// a review is a SECOND team that must spawn AFTER completion; a coding
|
|
490
|
+
// directive is the intended off-state and must NOT auto-spawn.
|
|
491
|
+
// decideNullRoleSpawn disambiguates via operatorStopped; the listener then
|
|
492
|
+
// acts on the decision (drop the directive on a stop, throttle the
|
|
493
|
+
// off-state warning, or spawn the lifecycle review fallback).
|
|
494
|
+
const operatorStopped = !!focus.operator_stopped_at;
|
|
495
|
+
const pending = getPendingSpawnDirective(focus.focus_id);
|
|
496
|
+
const decision = decideNullRoleSpawn({
|
|
497
|
+
sessionType: pending?.sessionType,
|
|
498
|
+
fallbackRole: resolveReviewerFallbackRole(roles.values()),
|
|
499
|
+
operatorStopped,
|
|
500
|
+
});
|
|
501
|
+
if (decision.action === 'skip') {
|
|
502
|
+
if (operatorStopped) {
|
|
503
|
+
// Operator STOP wins over the review fallback. Drop any directive
|
|
504
|
+
// queued while stopped so it does not silently survive to resume and
|
|
505
|
+
// fire the path the stop was meant to prevent. Dropping also removes
|
|
506
|
+
// the focus from the pending set, so this suppression is logged once
|
|
507
|
+
// per focus (per stop), never once per poll.
|
|
508
|
+
if (pending)
|
|
509
|
+
clearPendingSpawnDirective(focus.focus_id);
|
|
510
|
+
nullRoleSkipWarnedFocuses.delete(focus.focus_id);
|
|
511
|
+
log.info(`[listener] Focus ${focusId.slice(0, 8)} ("${focus.focus_name}") is held by an operator stop; ` +
|
|
512
|
+
`suppressing the queued ${pending?.sessionType ?? 'spawn'} directive (dropped, not carried to resume).`);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
// Coding off-state (Play/queue toggle cleared, no operator stop): the
|
|
516
|
+
// directive legitimately stays queued. Bound the warning to once per
|
|
517
|
+
// blocked episode so a stopped focus does not spin-log every 30s poll.
|
|
518
|
+
if (shouldWarnNullRoleSkip(nullRoleSkipWarnedFocuses, focus.focus_id)) {
|
|
519
|
+
log.warn(`[listener] Pending spawn directive for focus ${focusId.slice(0, 8)} ("${focus.focus_name}") but no assigned_agent_role_id; ` +
|
|
520
|
+
`skipping spawn (coding off-state). Suppressing further per-poll warnings until it resumes.`);
|
|
521
|
+
}
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
// Past the skip paths: this is a genuine lifecycle clear (operatorStopped
|
|
525
|
+
// is false here). The episode is over either way, so clear the marker.
|
|
526
|
+
nullRoleSkipWarnedFocuses.delete(focus.focus_id);
|
|
527
|
+
if (decision.action === 'clear') {
|
|
528
|
+
// Review strand with no resolvable fallback role: drop the directive so
|
|
529
|
+
// the stranded-review re-fire suppression (directive-executor) cannot
|
|
530
|
+
// spin-log forever. review_window_stalled remains the escalation path,
|
|
531
|
+
// and now fires promptly rather than after 6h of churn.
|
|
532
|
+
clearPendingSpawnDirective(focus.focus_id);
|
|
533
|
+
log.warn(`[listener] Stranded review directive for focus ${focusId.slice(0, 8)} ("${focus.focus_name}") has a null assigned_agent_role_id ` +
|
|
534
|
+
`and no seeded '${DEFAULT_REVIEWER_ROLE_NAME}' fallback role resolved -- dropping the directive so it stops re-firing; ` +
|
|
535
|
+
`review_window_stalled will escalate.`);
|
|
536
|
+
continue;
|
|
537
|
+
}
|
|
538
|
+
role = decision.role;
|
|
539
|
+
// Reachable only when operatorStopped is false (an operator stop takes the
|
|
540
|
+
// skip path above), so "(coding team completed)" is a true provenance
|
|
541
|
+
// claim here rather than an assumption stamped on every null-role spawn.
|
|
542
|
+
log.info(`[listener] Review directive for focus ${focusId.slice(0, 8)} ("${focus.focus_name}") has a null assigned_agent_role_id ` +
|
|
543
|
+
`(coding team completed); spawning review with fallback role "${role.name}".`);
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
// Focus has a role again -- any prior null-role blocked episode is over.
|
|
547
|
+
nullRoleSkipWarnedFocuses.delete(focus.focus_id);
|
|
548
|
+
role = roles.get(focus.assigned_agent_role_id);
|
|
549
|
+
if (!role) {
|
|
550
|
+
log.warn(`[listener] Pending spawn directive for focus ${focusId.slice(0, 8)} ("${focus.focus_name}") references unknown role ${focus.assigned_agent_role_id}; ` +
|
|
551
|
+
`skipping spawn.`);
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
// Park focuses with an unhealed team_failure escalation BEFORE attempting
|
|
556
|
+
// the spawn. spawnFocusTeam applies the same guard, but it returns after
|
|
557
|
+
// the guard fires without consuming the pending directive -- so the
|
|
558
|
+
// directive stays queued and this loop re-attempts (and the guard re-logs)
|
|
559
|
+
// every poll. Checking here skips the misleading "Spawning team" log and
|
|
560
|
+
// the wasted spawn call; the directive intentionally stays queued so the
|
|
561
|
+
// (re)review resumes once a human resolves the escalation. The guard
|
|
562
|
+
// throttles its own log to once per blocked episode.
|
|
563
|
+
if (await applyRespawnGuard(focus.focus_id, focus.focus_name)) {
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
// Spawn cooldown: this path spawns teams for focuses that getReadyFocuses
|
|
567
|
+
// does NOT surface -- focuses with no actionable/queued deliveries (e.g. a
|
|
568
|
+
// reviewing-stage spawn over a focus whose deliveries are all in verify).
|
|
569
|
+
// Such a team idle-exits if its directive can't make progress; without a
|
|
570
|
+
// gate the directive re-fires every poll and the daemon respawns an
|
|
571
|
+
// immediately-idle team every cycle (the reinforcing auto-review/idle-spawn
|
|
572
|
+
// loop). See pending-spawn-guard.ts.
|
|
573
|
+
if (shouldSkipPendingSpawn(focus.focus_id)) {
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
if (getActiveTeamCount() >= config.maxTotalSessions) {
|
|
577
|
+
log.info(`Total session limit reached, deferring pending spawn for "${focus.focus_name}"`);
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
const productEntry = focus.product_id ? findProduct(config, focus.product_id) : undefined;
|
|
581
|
+
const spawnConfig = productEntry ? configForProduct(config, productEntry) : config;
|
|
582
|
+
log.info(`[listener] Spawning team for focus "${focus.focus_name}" via pending spawn directive ` +
|
|
583
|
+
`(no actionable deliveries, but directive is queued)`);
|
|
584
|
+
// Audit-phase => read-only spawn (see the processReadyFocuses spawn above).
|
|
585
|
+
// The pending-spawn focus comes from getActiveFocuses, which carries
|
|
586
|
+
// audit_origin + ratified_at, so the second signal (TEL-3) resolves here too.
|
|
587
|
+
await spawnFocusTeam({
|
|
588
|
+
config: spawnConfig,
|
|
589
|
+
focusId: focus.focus_id,
|
|
590
|
+
focusName: focus.focus_name,
|
|
591
|
+
role,
|
|
592
|
+
pipelineConfig: focus.pipeline_config,
|
|
593
|
+
readOnly: isAuditPhaseFocusRow(focus),
|
|
594
|
+
lastClaudeSessionId: null,
|
|
595
|
+
claudeSessionIds: focus.claude_session_ids,
|
|
596
|
+
engineOverride: focus.engine_override,
|
|
597
|
+
localModelOverride: focus.local_model_override,
|
|
598
|
+
orgDefaultEngine: focus.org_default_engine,
|
|
599
|
+
pinnedBranch: focus.branch_name,
|
|
600
|
+
});
|
|
601
|
+
// Record a teardown so repeated spawns through this no-actionable-work path
|
|
602
|
+
// back off exponentially instead of recurring every poll. A team that
|
|
603
|
+
// genuinely makes progress moves the focus into a state getReadyFocuses
|
|
604
|
+
// surfaces (and clearSpawnCooldown can reset it); a team that idle-exits is
|
|
605
|
+
// rate-limited by the growing cooldown. This bounds spawn count on a
|
|
606
|
+
// wedged-in-verify focus. See pending-spawn-guard.ts.
|
|
607
|
+
recordPendingSpawnAttempt(focus.focus_id);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Check that every session recorded as 'starting' or 'running' in the DB
|
|
612
|
+
* has a corresponding active team in memory.
|
|
613
|
+
*
|
|
614
|
+
* If a session has been in a live status for more than 2 minutes but no
|
|
615
|
+
* active team claims it (e.g. the process was OOM-killed or the close
|
|
616
|
+
* handler failed to update the DB), the session is marked as 'failed' so
|
|
617
|
+
* subsequent poll cycles can respawn the focus.
|
|
618
|
+
*/
|
|
619
|
+
export async function checkSessionHealth() {
|
|
620
|
+
const GRACE_PERIOD_MS = 2 * 60 * 1000; // 2 minutes
|
|
621
|
+
// Backoff: skip this cycle if we've had consecutive failures.
|
|
622
|
+
// After N failures, skip N poll cycles before retrying (capped at max).
|
|
623
|
+
if (healthCheckConsecutiveFailures > 0) {
|
|
624
|
+
// Use the failure count as the number of cycles to skip
|
|
625
|
+
const skipCycles = Math.min(healthCheckConsecutiveFailures, HEALTH_CHECK_MAX_SKIP_CYCLES);
|
|
626
|
+
healthCheckConsecutiveFailures++;
|
|
627
|
+
if (healthCheckConsecutiveFailures % skipCycles !== 0) {
|
|
628
|
+
return; // skip this cycle
|
|
629
|
+
}
|
|
630
|
+
log.info(`[health] Retrying after ${healthCheckConsecutiveFailures} consecutive failures (backoff: every ${skipCycles} cycles)`);
|
|
631
|
+
}
|
|
632
|
+
// Aggregate active sessions across all configured products
|
|
633
|
+
const activeSessions = [];
|
|
634
|
+
try {
|
|
635
|
+
for (const product of (config?.products ?? [])) {
|
|
636
|
+
const sessions = await getActiveSessions(product.id);
|
|
637
|
+
activeSessions.push(...sessions);
|
|
638
|
+
}
|
|
639
|
+
// Reset backoff on success
|
|
640
|
+
if (healthCheckConsecutiveFailures > 0) {
|
|
641
|
+
log.info(`[health] Session health check recovered after ${healthCheckConsecutiveFailures} failures`);
|
|
642
|
+
healthCheckConsecutiveFailures = 0;
|
|
643
|
+
pollState = 'idle';
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
catch (err) {
|
|
647
|
+
healthCheckConsecutiveFailures++;
|
|
648
|
+
pollState = 'backing_off';
|
|
649
|
+
log.warn(`[health] Failed to fetch active sessions (failure #${healthCheckConsecutiveFailures}): ${err.message}`);
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
if (activeSessions.length === 0) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
log.info(`[health] Checking ${activeSessions.length} active session(s) for orphaned processes`);
|
|
656
|
+
// Build a set of all leadSessionIds currently tracked in memory
|
|
657
|
+
const activeTeams = getActiveTeams();
|
|
658
|
+
const trackedSessionIds = new Set();
|
|
659
|
+
for (const team of activeTeams.values()) {
|
|
660
|
+
if (team.leadSessionId) {
|
|
661
|
+
trackedSessionIds.add(team.leadSessionId);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const now = Date.now();
|
|
665
|
+
const staleSessionIds = [];
|
|
666
|
+
for (const session of activeSessions) {
|
|
667
|
+
// Skip if this session is tracked by an active in-memory team
|
|
668
|
+
if (trackedSessionIds.has(session.id)) {
|
|
669
|
+
continue;
|
|
670
|
+
}
|
|
671
|
+
// Apply grace period: ignore sessions that started very recently
|
|
672
|
+
// (in case the team is still being set up and hasn't registered yet)
|
|
673
|
+
const startedAt = session.started_at ?? session.queued_at;
|
|
674
|
+
if (!startedAt) {
|
|
675
|
+
// Cannot determine session age — skip conservatively
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
const sessionAgeMs = now - new Date(startedAt).getTime();
|
|
679
|
+
if (sessionAgeMs < GRACE_PERIOD_MS) {
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
// PID liveness check: if the session's process is still alive,
|
|
683
|
+
// skip orphan detection. This prevents false positives when the
|
|
684
|
+
// in-memory tracking is stale but the process is genuinely running.
|
|
685
|
+
//
|
|
686
|
+
// Note: full re-registration into activeTeams is not attempted here because
|
|
687
|
+
// FocusTeamState requires stdin handles, execution config, pipeline config,
|
|
688
|
+
// and other fields that cannot be reconstructed from a DB session row alone.
|
|
689
|
+
// The process will continue running; the next daemon restart will recover state.
|
|
690
|
+
const pid = session.pid;
|
|
691
|
+
if (pid != null) {
|
|
692
|
+
try {
|
|
693
|
+
process.kill(pid, 0); // signal 0 = test if process exists
|
|
694
|
+
log.warn(`[health] Session ${session.id} not tracked in-memory but PID ${pid} is alive — skipping orphan detection` +
|
|
695
|
+
` (focus=${session.focus_id ?? 'none'})`);
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
catch (err) {
|
|
699
|
+
// process.kill throws if PID does not exist — proceed to mark as orphaned
|
|
700
|
+
log.debug('process.kill throws if PID does not exist — proceed to mark as orphaned', { error: String(err?.message ?? err) });
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
staleSessionIds.push(session.id);
|
|
704
|
+
log.warn(`[health] Orphaned session detected: ${session.id} ` +
|
|
705
|
+
`(status=${session.status}, age=${Math.round(sessionAgeMs / 1000)}s, ` +
|
|
706
|
+
`focus=${session.focus_id ?? 'none'}, delivery=${session.delivery_id ?? 'none'})`);
|
|
707
|
+
}
|
|
708
|
+
if (staleSessionIds.length === 0) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
log.info(`[health] Marking ${staleSessionIds.length} orphaned session(s) as failed`);
|
|
712
|
+
const updateResults = await Promise.allSettled(staleSessionIds.map(sessionId => withRetry(() => updateSession(sessionId, {
|
|
713
|
+
status: 'failed',
|
|
714
|
+
exit_reason: 'Session health check: no active team found for running session',
|
|
715
|
+
ended_at: new Date().toISOString(),
|
|
716
|
+
}), { maxAttempts: 3, baseDelayMs: 1000, label: 'health-check-session-update' })));
|
|
717
|
+
for (let i = 0; i < updateResults.length; i++) {
|
|
718
|
+
const result = updateResults[i];
|
|
719
|
+
if (result.status === 'rejected') {
|
|
720
|
+
log.error(`[health] Failed to mark session ${staleSessionIds[i]} as failed: ${result.reason.message}`);
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
log.info(`[health] Marked session ${staleSessionIds[i]} as failed`);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Stop all listeners.
|
|
729
|
+
*/
|
|
730
|
+
export async function stopListeners() {
|
|
731
|
+
if (pollInterval) {
|
|
732
|
+
clearInterval(pollInterval);
|
|
733
|
+
pollInterval = null;
|
|
734
|
+
}
|
|
735
|
+
log.info('Stopped polling');
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Refresh roles from API.
|
|
739
|
+
*/
|
|
740
|
+
export async function refreshRoles() {
|
|
741
|
+
if (!config)
|
|
742
|
+
return;
|
|
743
|
+
const roleList = await getAgentRoles(config.organizationId);
|
|
744
|
+
roles.clear();
|
|
745
|
+
for (const role of roleList) {
|
|
746
|
+
roles.set(role.id, role);
|
|
747
|
+
}
|
|
748
|
+
lastRolesRefreshAt = Date.now();
|
|
749
|
+
log.info(`Refreshed ${roles.size} agent roles`);
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Register the poll-loop trigger with the poll-trigger leaf so completion
|
|
753
|
+
* handling can nudge an immediate check for ready focuses after a session
|
|
754
|
+
* completes (to auto-advance to the next delivery) WITHOUT importing this
|
|
755
|
+
* module -- a direct completion -> listener import would close a static import
|
|
756
|
+
* cycle. No-ops during daemon shutdown to prevent spawn attempts after the
|
|
757
|
+
* resource governor has been shut down.
|
|
758
|
+
*/
|
|
759
|
+
registerPollTrigger(() => {
|
|
760
|
+
if (isDaemonShuttingDown())
|
|
761
|
+
return;
|
|
762
|
+
processReadyFocuses();
|
|
763
|
+
});
|
|
764
|
+
// Note: Detection of completed guard agents and re-evaluation of paused deliveries
|
|
765
|
+
// is handled by the Human Routing UI. When a human makes a routing decision,
|
|
766
|
+
// the UI updates the transition_blocks.decision_path and sets the delivery back to 'queued',
|
|
767
|
+
// which the normal poll loop picks up. For spawn_agent triggers, the spawned agent's
|
|
768
|
+
// completion triggers a re-poll via triggerCheck(), and the delivery will be re-evaluated
|
|
769
|
+
// on the next spawn cycle since it remains in 'paused' status until the human routes it.
|
|
770
|
+
//# sourceMappingURL=listener.js.map
|