@telora/daemon 0.19.47 → 0.19.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 +8 -3
- package/dist/assembly-engine.d.ts +9 -0
- package/dist/assembly-engine.d.ts.map +1 -1
- package/dist/assembly-engine.js.map +1 -1
- package/dist/audit-hooks.js +1 -1
- package/dist/branch-status.js +2 -2
- package/dist/branch-status.js.map +1 -1
- package/dist/ci-sensor-loop.d.ts +47 -0
- package/dist/ci-sensor-loop.d.ts.map +1 -0
- package/dist/ci-sensor-loop.js +116 -0
- package/dist/ci-sensor-loop.js.map +1 -0
- package/dist/ci-status-git.d.ts +52 -0
- package/dist/ci-status-git.d.ts.map +1 -0
- package/dist/ci-status-git.js +86 -0
- package/dist/ci-status-git.js.map +1 -0
- package/dist/ci-status.d.ts +122 -0
- package/dist/ci-status.d.ts.map +1 -0
- package/dist/ci-status.js +114 -0
- package/dist/ci-status.js.map +1 -0
- package/dist/cli/connect/agents.d.ts +24 -0
- package/dist/cli/connect/agents.d.ts.map +1 -0
- package/dist/cli/connect/agents.js +65 -0
- package/dist/cli/connect/agents.js.map +1 -0
- package/dist/cli/connect/claude.d.ts +31 -0
- package/dist/cli/connect/claude.d.ts.map +1 -0
- package/dist/cli/connect/claude.js +104 -0
- package/dist/cli/connect/claude.js.map +1 -0
- package/dist/cli/connect/cline.d.ts +37 -0
- package/dist/cli/connect/cline.d.ts.map +1 -0
- package/dist/cli/connect/cline.js +115 -0
- package/dist/cli/connect/cline.js.map +1 -0
- package/dist/cli/connect/codex.d.ts +44 -0
- package/dist/cli/connect/codex.d.ts.map +1 -0
- package/dist/cli/connect/codex.js +111 -0
- package/dist/cli/connect/codex.js.map +1 -0
- package/dist/cli/connect/ide.d.ts +69 -0
- package/dist/cli/connect/ide.d.ts.map +1 -0
- package/dist/cli/connect/ide.js +134 -0
- package/dist/cli/connect/ide.js.map +1 -0
- package/dist/cli/connect/scaffolding.d.ts +31 -0
- package/dist/cli/connect/scaffolding.d.ts.map +1 -0
- package/dist/cli/connect/scaffolding.js +52 -0
- package/dist/cli/connect/scaffolding.js.map +1 -0
- package/dist/cli/connect/shared.d.ts +30 -0
- package/dist/cli/connect/shared.d.ts.map +1 -0
- package/dist/cli/connect/shared.js +11 -0
- package/dist/cli/connect/shared.js.map +1 -0
- package/dist/cli/connect.d.ts +9 -210
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +10 -526
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/open.js +2 -2
- package/dist/completion/event.d.ts +2 -0
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +19 -2
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/merge-phase.d.ts +3 -0
- package/dist/completion/merge-phase.d.ts.map +1 -1
- package/dist/completion/merge-phase.js +35 -3
- package/dist/completion/merge-phase.js.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 +1 -1
- package/dist/completion/read-only-pristine.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts +30 -3
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +203 -15
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/status-advance-phase.js +1 -1
- package/dist/completion/status-advance-phase.js.map +1 -1
- package/dist/completion/team-completion.d.ts.map +1 -1
- package/dist/completion/team-completion.js +22 -2
- package/dist/completion/team-completion.js.map +1 -1
- package/dist/completion/team-lifecycle.js +1 -1
- package/dist/completion/terminated-work-reconcile.js +1 -1
- package/dist/completion/terminated-work-reconcile.js.map +1 -1
- package/dist/condition-evaluators.d.ts +41 -2
- package/dist/condition-evaluators.d.ts.map +1 -1
- package/dist/condition-evaluators.js +37 -288
- package/dist/condition-evaluators.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -1
- package/dist/context-audit.d.ts +1 -1
- package/dist/context-audit.d.ts.map +1 -1
- package/dist/context-lock.d.ts +1 -1
- package/dist/context-lock.d.ts.map +1 -1
- package/dist/control-state.d.ts +2 -2
- package/dist/control-state.d.ts.map +1 -1
- package/dist/control-state.js +4 -3
- package/dist/control-state.js.map +1 -1
- package/dist/daemon-process.d.ts +1 -1
- package/dist/daemon-process.d.ts.map +1 -1
- package/dist/delivery-advance-block.d.ts +1 -1
- package/dist/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery-advance-block.js +1 -1
- package/dist/delivery-advance-block.js.map +1 -1
- package/dist/delivery-lifecycle.js +1 -1
- package/dist/delivery-reconciler-shadow.d.ts +1 -1
- package/dist/delivery-reconciler-shadow.d.ts.map +1 -1
- package/dist/delivery-reconciler-shadow.js +1 -1
- package/dist/delivery-reconciler-shadow.js.map +1 -1
- package/dist/directive-executor.js +1 -1
- package/dist/directive-executor.js.map +1 -1
- package/dist/drift-eval-loop.d.ts.map +1 -1
- package/dist/drift-eval-loop.js +6 -14
- package/dist/drift-eval-loop.js.map +1 -1
- package/dist/escalations.d.ts +1 -1
- package/dist/escalations.d.ts.map +1 -1
- package/dist/escalations.js +1 -1
- package/dist/escalations.js.map +1 -1
- package/dist/evaluation-context.d.ts +2 -33
- package/dist/evaluation-context.d.ts.map +1 -1
- package/dist/evaluation-context.js +2 -56
- package/dist/evaluation-context.js.map +1 -1
- package/dist/focus-engine.d.ts +14 -5
- package/dist/focus-engine.d.ts.map +1 -1
- package/dist/focus-engine.js +35 -289
- package/dist/focus-engine.js.map +1 -1
- package/dist/focus-executor.d.ts +10 -791
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +81 -1572
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-lifecycle.js +2 -2
- package/dist/focus-lifecycle.js.map +1 -1
- package/dist/focus-loop-registry.d.ts +52 -0
- package/dist/focus-loop-registry.d.ts.map +1 -0
- package/dist/focus-loop-registry.js +328 -0
- package/dist/focus-loop-registry.js.map +1 -0
- package/dist/focus-merge.d.ts +1 -1
- package/dist/focus-merge.d.ts.map +1 -1
- package/dist/focus-merge.js +6 -6
- package/dist/focus-merge.js.map +1 -1
- package/dist/focus-phase.d.ts +4 -0
- package/dist/focus-phase.d.ts.map +1 -1
- package/dist/focus-phase.js +3 -3
- package/dist/focus-phase.js.map +1 -1
- package/dist/focus-prompt-builder.d.ts.map +1 -1
- package/dist/focus-prompt-builder.js +4 -1
- package/dist/focus-prompt-builder.js.map +1 -1
- package/dist/focus-stage-lifecycle/planning-release.d.ts +197 -0
- package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/planning-release.js +312 -0
- package/dist/focus-stage-lifecycle/planning-release.js.map +1 -0
- package/dist/focus-stage-lifecycle/review-convergence.d.ts +133 -0
- package/dist/focus-stage-lifecycle/review-convergence.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/review-convergence.js +235 -0
- package/dist/focus-stage-lifecycle/review-convergence.js.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +133 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.js +365 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -0
- package/dist/focus-stage-lifecycle.d.ts +22 -421
- package/dist/focus-stage-lifecycle.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle.js +24 -832
- package/dist/focus-stage-lifecycle.js.map +1 -1
- package/dist/{git-activity.d.ts → git/activity.d.ts} +1 -1
- package/dist/git/activity.d.ts.map +1 -0
- package/dist/{git-activity.js → git/activity.js} +2 -2
- package/dist/git/activity.js.map +1 -0
- package/dist/{git-branch.d.ts → git/branch.d.ts} +2 -2
- package/dist/git/branch.d.ts.map +1 -0
- package/dist/{git-branch.js → git/branch.js} +2 -2
- package/dist/git/branch.js.map +1 -0
- package/dist/{git-fetch.d.ts → git/fetch.d.ts} +2 -2
- package/dist/git/fetch.d.ts.map +1 -0
- package/dist/{git-fetch.js → git/fetch.js} +1 -1
- package/dist/git/fetch.js.map +1 -0
- package/dist/{git-genesis.d.ts → git/genesis.d.ts} +3 -3
- package/dist/git/genesis.d.ts.map +1 -0
- package/dist/{git-genesis.js → git/genesis.js} +5 -5
- package/dist/git/genesis.js.map +1 -0
- package/dist/git/index.d.ts +36 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +36 -0
- package/dist/git/index.js.map +1 -0
- package/dist/{git-integration.d.ts → git/integration.d.ts} +2 -2
- package/dist/git/integration.d.ts.map +1 -0
- package/dist/{git-integration.js → git/integration.js} +4 -4
- package/dist/git/integration.js.map +1 -0
- package/dist/{git-merge-helpers.d.ts → git/merge-helpers.d.ts} +3 -3
- package/dist/git/merge-helpers.d.ts.map +1 -0
- package/dist/{git-merge-helpers.js → git/merge-helpers.js} +3 -3
- package/dist/git/merge-helpers.js.map +1 -0
- package/dist/{git-merge-lock.d.ts → git/merge-lock.d.ts} +1 -1
- package/dist/git/merge-lock.d.ts.map +1 -0
- package/dist/{git-merge-lock.js → git/merge-lock.js} +1 -1
- package/dist/git/merge-lock.js.map +1 -0
- package/dist/{git-merge-strategies.d.ts → git/merge-strategies.d.ts} +2 -2
- package/dist/git/merge-strategies.d.ts.map +1 -0
- package/dist/{git-merge-strategies.js → git/merge-strategies.js} +3 -3
- package/dist/git/merge-strategies.js.map +1 -0
- package/dist/{git-merge.d.ts → git/merge.d.ts} +4 -4
- package/dist/git/merge.d.ts.map +1 -0
- package/dist/{git-merge.js → git/merge.js} +4 -4
- package/dist/git/merge.js.map +1 -0
- package/dist/{git-state-detector.d.ts → git/state-detector.d.ts} +2 -2
- package/dist/git/state-detector.d.ts.map +1 -0
- package/dist/{git-state-detector.js → git/state-detector.js} +7 -7
- package/dist/git/state-detector.js.map +1 -0
- package/dist/{git-types.d.ts → git/types.d.ts} +2 -2
- package/dist/git/types.d.ts.map +1 -0
- package/dist/{git-types.js → git/types.js} +1 -1
- package/dist/git/types.js.map +1 -0
- package/dist/{git-utils.d.ts → git/utils.d.ts} +1 -1
- package/dist/git/utils.d.ts.map +1 -0
- package/dist/{git-utils.js → git/utils.js} +2 -2
- package/dist/git/utils.js.map +1 -0
- package/dist/git.d.ts +5 -5
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +10 -10
- package/dist/git.js.map +1 -1
- package/dist/guard-engine.d.ts +3 -2
- package/dist/guard-engine.d.ts.map +1 -1
- package/dist/guard-engine.js +2 -2
- package/dist/guard-engine.js.map +1 -1
- package/dist/install-probe-tick.d.ts +63 -0
- package/dist/install-probe-tick.d.ts.map +1 -0
- package/dist/install-probe-tick.js +137 -0
- package/dist/install-probe-tick.js.map +1 -0
- package/dist/install-probe.d.ts +115 -0
- package/dist/install-probe.d.ts.map +1 -0
- package/dist/install-probe.js +197 -0
- package/dist/install-probe.js.map +1 -0
- package/dist/listener-auto-advance.d.ts.map +1 -1
- package/dist/listener-auto-advance.js +31 -0
- package/dist/listener-auto-advance.js.map +1 -1
- package/dist/listener.js +5 -5
- package/dist/listener.js.map +1 -1
- package/dist/{loop-context-audit-pass.d.ts → loops/context-audit-pass.d.ts} +4 -4
- package/dist/loops/context-audit-pass.d.ts.map +1 -0
- package/dist/{loop-context-audit-pass.js → loops/context-audit-pass.js} +7 -7
- package/dist/loops/context-audit-pass.js.map +1 -0
- package/dist/{loop-engine-types.d.ts → loops/engine-types.d.ts} +1 -1
- package/dist/loops/engine-types.d.ts.map +1 -0
- package/dist/{loop-engine-types.js → loops/engine-types.js} +1 -1
- package/dist/loops/engine-types.js.map +1 -0
- package/dist/{loop-engine.d.ts → loops/engine.d.ts} +6 -6
- package/dist/loops/engine.d.ts.map +1 -0
- package/dist/{loop-engine.js → loops/engine.js} +13 -13
- package/dist/loops/engine.js.map +1 -0
- package/dist/{loop-event-bus.d.ts → loops/event-bus.d.ts} +1 -1
- package/dist/loops/event-bus.d.ts.map +1 -0
- package/dist/{loop-event-bus.js → loops/event-bus.js} +1 -1
- package/dist/loops/event-bus.js.map +1 -0
- package/dist/loops/index.d.ts +33 -0
- package/dist/loops/index.d.ts.map +1 -0
- package/dist/loops/index.js +32 -0
- package/dist/loops/index.js.map +1 -0
- package/dist/{loop-llm-client.d.ts → loops/llm-client.d.ts} +3 -3
- package/dist/loops/llm-client.d.ts.map +1 -0
- package/dist/{loop-llm-client.js → loops/llm-client.js} +3 -3
- package/dist/loops/llm-client.js.map +1 -0
- package/dist/{loop-llm-flag.d.ts → loops/llm-flag.d.ts} +1 -1
- package/dist/loops/llm-flag.d.ts.map +1 -0
- package/dist/{loop-llm-flag.js → loops/llm-flag.js} +1 -1
- package/dist/loops/llm-flag.js.map +1 -0
- package/dist/{loop-operational-block.d.ts → loops/operational-block.d.ts} +1 -1
- package/dist/loops/operational-block.d.ts.map +1 -0
- package/dist/{loop-operational-block.js → loops/operational-block.js} +1 -1
- package/dist/loops/operational-block.js.map +1 -0
- package/dist/{loop-prompt-builder.d.ts → loops/prompt-builder.d.ts} +2 -2
- package/dist/loops/prompt-builder.d.ts.map +1 -0
- package/dist/{loop-prompt-builder.js → loops/prompt-builder.js} +1 -1
- package/dist/loops/prompt-builder.js.map +1 -0
- package/dist/{loop-variance.d.ts → loops/variance.d.ts} +1 -1
- package/dist/loops/variance.d.ts.map +1 -0
- package/dist/{loop-variance.js → loops/variance.js} +1 -1
- package/dist/loops/variance.js.map +1 -0
- package/dist/merge-back-loop.d.ts.map +1 -1
- package/dist/merge-back-loop.js +4 -3
- package/dist/merge-back-loop.js.map +1 -1
- package/dist/merge-detector.js +2 -2
- package/dist/merge-detector.js.map +1 -1
- package/dist/{nexus-endpoint-clearance.d.ts → nexus/endpoint-clearance.d.ts} +2 -2
- package/dist/nexus/endpoint-clearance.d.ts.map +1 -0
- package/dist/{nexus-endpoint-clearance.js → nexus/endpoint-clearance.js} +2 -2
- package/dist/nexus/endpoint-clearance.js.map +1 -0
- package/dist/{nexus-escalation-bridge.d.ts → nexus/escalation-bridge.d.ts} +1 -1
- package/dist/nexus/escalation-bridge.d.ts.map +1 -0
- package/dist/{nexus-escalation-bridge.js → nexus/escalation-bridge.js} +2 -2
- package/dist/nexus/escalation-bridge.js.map +1 -0
- package/dist/{nexus-incoming.d.ts → nexus/incoming.d.ts} +2 -2
- package/dist/nexus/incoming.d.ts.map +1 -0
- package/dist/{nexus-incoming.js → nexus/incoming.js} +2 -2
- package/dist/nexus/incoming.js.map +1 -0
- package/dist/nexus/index.d.ts +20 -0
- package/dist/nexus/index.d.ts.map +1 -0
- package/dist/nexus/index.js +20 -0
- package/dist/nexus/index.js.map +1 -0
- package/dist/{nexus-intake-spawn.d.ts → nexus/intake-spawn.d.ts} +3 -3
- package/dist/nexus/intake-spawn.d.ts.map +1 -0
- package/dist/{nexus-intake-spawn.js → nexus/intake-spawn.js} +1 -1
- package/dist/nexus/intake-spawn.js.map +1 -0
- package/dist/{nexus-intake.d.ts → nexus/intake.d.ts} +2 -2
- package/dist/nexus/intake.d.ts.map +1 -0
- package/dist/{nexus-intake.js → nexus/intake.js} +4 -4
- package/dist/nexus/intake.js.map +1 -0
- package/dist/{nexus-return.d.ts → nexus/return.d.ts} +3 -3
- package/dist/nexus/return.d.ts.map +1 -0
- package/dist/{nexus-return.js → nexus/return.js} +4 -4
- package/dist/nexus/return.js.map +1 -0
- package/dist/otlp/index.d.ts +19 -0
- package/dist/otlp/index.d.ts.map +1 -0
- package/dist/otlp/index.js +19 -0
- package/dist/otlp/index.js.map +1 -0
- package/dist/{otlp-log-parser.d.ts → otlp/log-parser.d.ts} +2 -2
- package/dist/otlp/log-parser.d.ts.map +1 -0
- package/dist/{otlp-log-parser.js → otlp/log-parser.js} +5 -6
- package/dist/otlp/log-parser.js.map +1 -0
- package/dist/{otlp-metric-parser.d.ts → otlp/metric-parser.d.ts} +2 -2
- package/dist/otlp/metric-parser.d.ts.map +1 -0
- package/dist/{otlp-metric-parser.js → otlp/metric-parser.js} +4 -5
- package/dist/otlp/metric-parser.js.map +1 -0
- package/dist/{otlp-port-manager.d.ts → otlp/port-manager.d.ts} +1 -1
- package/dist/otlp/port-manager.d.ts.map +1 -0
- package/dist/{otlp-port-manager.js → otlp/port-manager.js} +1 -1
- package/dist/otlp/port-manager.js.map +1 -0
- package/dist/{otlp-receiver.d.ts → otlp/receiver.d.ts} +2 -2
- package/dist/otlp/receiver.d.ts.map +1 -0
- package/dist/{otlp-receiver.js → otlp/receiver.js} +5 -33
- package/dist/otlp/receiver.js.map +1 -0
- package/dist/{otlp-types.d.ts → otlp/types.d.ts} +1 -9
- package/dist/otlp/types.d.ts.map +1 -0
- package/dist/{otlp-types.js → otlp/types.js} +1 -27
- package/dist/otlp/types.js.map +1 -0
- package/dist/pipeline-config.d.ts +1 -1
- package/dist/{prd-controller.d.ts → prd/controller.d.ts} +7 -7
- package/dist/prd/controller.d.ts.map +1 -0
- package/dist/{prd-controller.js → prd/controller.js} +11 -11
- package/dist/prd/controller.js.map +1 -0
- package/dist/{prd-divergence.d.ts → prd/divergence.d.ts} +2 -2
- package/dist/prd/divergence.d.ts.map +1 -0
- package/dist/{prd-divergence.js → prd/divergence.js} +1 -1
- package/dist/prd/divergence.js.map +1 -0
- package/dist/{prd-focus-pushdown.d.ts → prd/focus-pushdown.d.ts} +2 -2
- package/dist/prd/focus-pushdown.d.ts.map +1 -0
- package/dist/{prd-focus-pushdown.js → prd/focus-pushdown.js} +3 -3
- package/dist/prd/focus-pushdown.js.map +1 -0
- package/dist/{prd-frontier.d.ts → prd/frontier.d.ts} +2 -2
- package/dist/prd/frontier.d.ts.map +1 -0
- package/dist/{prd-frontier.js → prd/frontier.js} +1 -1
- package/dist/prd/frontier.js.map +1 -0
- package/dist/prd/index.d.ts +26 -0
- package/dist/prd/index.d.ts.map +1 -0
- package/dist/prd/index.js +25 -0
- package/dist/prd/index.js.map +1 -0
- package/dist/{prd-steward.d.ts → prd/steward.d.ts} +4 -4
- package/dist/prd/steward.d.ts.map +1 -0
- package/dist/{prd-steward.js → prd/steward.js} +4 -4
- package/dist/prd/steward.js.map +1 -0
- package/dist/{prd-viability.d.ts → prd/viability.d.ts} +2 -2
- package/dist/prd/viability.d.ts.map +1 -0
- package/dist/{prd-viability.js → prd/viability.js} +1 -1
- package/dist/prd/viability.js.map +1 -0
- package/dist/product-scaffold.js +2 -2
- package/dist/product-scaffold.js.map +1 -1
- package/dist/prompt-contradictions.d.ts +55 -0
- package/dist/prompt-contradictions.d.ts.map +1 -0
- package/dist/prompt-contradictions.js +114 -0
- package/dist/prompt-contradictions.js.map +1 -0
- package/dist/prompt-listing.d.ts +19 -0
- package/dist/prompt-listing.d.ts.map +1 -1
- package/dist/prompt-listing.js +49 -0
- package/dist/prompt-listing.js.map +1 -1
- package/dist/prompt-sections/execution-sections.d.ts +3 -2
- package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
- package/dist/prompt-sections/execution-sections.js +70 -97
- package/dist/prompt-sections/execution-sections.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +12 -0
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +29 -2
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/prompt-sections/role-sections.js +2 -2
- package/dist/prompt-sections/role-sections.js.map +1 -1
- package/dist/queries/context-assembly.d.ts +14 -4
- package/dist/queries/context-assembly.d.ts.map +1 -1
- package/dist/queries/context-assembly.js +14 -4
- package/dist/queries/context-assembly.js.map +1 -1
- package/dist/queries/context-lock-queries.js +1 -1
- package/dist/queries/context-lock-queries.js.map +1 -1
- package/dist/queries/deliveries.d.ts +45 -0
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +2 -0
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/focuses.d.ts +17 -7
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +27 -9
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/index.d.ts +1 -1
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/schemas.d.ts +4 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +8 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/reality-pole.js +1 -1
- package/dist/resolvers/escalation-answers.d.ts +40 -0
- package/dist/resolvers/escalation-answers.d.ts.map +1 -1
- package/dist/resolvers/escalation-answers.js +54 -35
- package/dist/resolvers/escalation-answers.js.map +1 -1
- package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +4 -1
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/prd-context.js +1 -1
- package/dist/resolvers/shared/wiki.d.ts +27 -0
- package/dist/resolvers/shared/wiki.d.ts.map +1 -1
- package/dist/resolvers/shared/wiki.js +39 -0
- package/dist/resolvers/shared/wiki.js.map +1 -1
- package/dist/sensor-sweep.js +1 -1
- package/dist/spawn/delivered-manifest.d.ts +42 -0
- package/dist/spawn/delivered-manifest.d.ts.map +1 -0
- package/dist/spawn/delivered-manifest.js +64 -0
- package/dist/spawn/delivered-manifest.js.map +1 -0
- package/dist/spawn/model-routing.d.ts +277 -0
- package/dist/spawn/model-routing.d.ts.map +1 -0
- package/dist/spawn/model-routing.js +464 -0
- package/dist/spawn/model-routing.js.map +1 -0
- package/dist/spawn/process-spawn.d.ts +137 -0
- package/dist/spawn/process-spawn.d.ts.map +1 -0
- package/dist/spawn/process-spawn.js +385 -0
- package/dist/spawn/process-spawn.js.map +1 -0
- package/dist/spawn/prompt-assembly.d.ts +170 -0
- package/dist/spawn/prompt-assembly.d.ts.map +1 -0
- package/dist/spawn/prompt-assembly.js +272 -0
- package/dist/spawn/prompt-assembly.js.map +1 -0
- package/dist/spawn/shared.d.ts +96 -0
- package/dist/spawn/shared.d.ts.map +1 -0
- package/dist/spawn/shared.js +14 -0
- package/dist/spawn/shared.js.map +1 -0
- package/dist/spawn/spawn-decision.d.ts +239 -0
- package/dist/spawn/spawn-decision.d.ts.map +1 -0
- package/dist/spawn/spawn-decision.js +437 -0
- package/dist/spawn/spawn-decision.js.map +1 -0
- package/dist/spawn/worktree-session.d.ts +105 -0
- package/dist/spawn/worktree-session.d.ts.map +1 -0
- package/dist/spawn/worktree-session.js +216 -0
- package/dist/spawn/worktree-session.js.map +1 -0
- package/dist/spawner/lifecycle.js +5 -5
- package/dist/spawner/lifecycle.js.map +1 -1
- package/dist/spawner/resolution.js +4 -4
- package/dist/spawner/resolution.js.map +1 -1
- package/dist/stall-detector-config.d.ts +4 -0
- package/dist/stall-detector-config.d.ts.map +1 -1
- package/dist/stall-detector-config.js +6 -0
- package/dist/stall-detector-config.js.map +1 -1
- package/dist/state-cascade.js +1 -1
- package/dist/state-cascade.js.map +1 -1
- package/dist/trigger-executor.d.ts +5 -9
- package/dist/trigger-executor.d.ts.map +1 -1
- package/dist/trigger-executor.js +14 -36
- package/dist/trigger-executor.js.map +1 -1
- package/dist/types/config.d.ts +44 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/focus.d.ts +13 -0
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/types/workflow.d.ts +1 -3
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/unified-engine-lifecycle.js +1 -1
- package/dist/unified-init.d.ts +3 -3
- package/dist/unified-init.d.ts.map +1 -1
- package/dist/unified-init.js +9 -25
- package/dist/unified-init.js.map +1 -1
- package/dist/unified-shell.d.ts +3 -3
- package/dist/unified-shell.js +4 -4
- package/dist/unified-shell.js.map +1 -1
- package/dist/verification-baseline.d.ts +112 -0
- package/dist/verification-baseline.d.ts.map +1 -0
- package/dist/verification-baseline.js +264 -0
- package/dist/verification-baseline.js.map +1 -0
- package/dist/verification-config.d.ts +53 -0
- package/dist/verification-config.d.ts.map +1 -0
- package/dist/verification-config.js +72 -0
- package/dist/verification-config.js.map +1 -0
- package/dist/verification-default-on.d.ts +87 -0
- package/dist/verification-default-on.d.ts.map +1 -0
- package/dist/verification-default-on.js +186 -0
- package/dist/verification-default-on.js.map +1 -0
- package/dist/verification-deterministic.d.ts +56 -0
- package/dist/verification-deterministic.d.ts.map +1 -0
- package/dist/verification-deterministic.js +123 -0
- package/dist/verification-deterministic.js.map +1 -0
- package/dist/verification-engine.d.ts +22 -15
- package/dist/verification-engine.d.ts.map +1 -1
- package/dist/verification-engine.js +94 -65
- package/dist/verification-engine.js.map +1 -1
- package/dist/verification-failure-parser.d.ts +48 -0
- package/dist/verification-failure-parser.d.ts.map +1 -0
- package/dist/verification-failure-parser.js +102 -0
- package/dist/verification-failure-parser.js.map +1 -0
- package/dist/verification-feedback.d.ts +58 -0
- package/dist/verification-feedback.d.ts.map +1 -0
- package/dist/verification-feedback.js +110 -0
- package/dist/verification-feedback.js.map +1 -0
- package/dist/{worktree-focus.d.ts → worktree/focus.d.ts} +2 -2
- package/dist/worktree/focus.d.ts.map +1 -0
- package/dist/{worktree-focus.js → worktree/focus.js} +7 -7
- package/dist/worktree/focus.js.map +1 -0
- package/dist/worktree/index.d.ts +16 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/worktree/index.js +16 -0
- package/dist/worktree/index.js.map +1 -0
- package/dist/{worktree-safety.d.ts → worktree/safety.d.ts} +1 -1
- package/dist/worktree/safety.d.ts.map +1 -0
- package/dist/{worktree-safety.js → worktree/safety.js} +2 -2
- package/dist/worktree/safety.js.map +1 -0
- package/dist/{worktree-state.d.ts → worktree/state.d.ts} +1 -1
- package/dist/worktree/state.d.ts.map +1 -0
- package/dist/{worktree-state.js → worktree/state.js} +6 -6
- package/dist/worktree/state.js.map +1 -0
- package/dist/worktree.d.ts +1 -1
- package/dist/worktree.js +5 -5
- package/dist/worktree.js.map +1 -1
- package/package.json +5 -4
- package/dist/git-activity.d.ts.map +0 -1
- package/dist/git-activity.js.map +0 -1
- package/dist/git-branch.d.ts.map +0 -1
- package/dist/git-branch.js.map +0 -1
- package/dist/git-fetch.d.ts.map +0 -1
- package/dist/git-fetch.js.map +0 -1
- package/dist/git-genesis.d.ts.map +0 -1
- package/dist/git-genesis.js.map +0 -1
- package/dist/git-integration.d.ts.map +0 -1
- package/dist/git-integration.js.map +0 -1
- package/dist/git-merge-helpers.d.ts.map +0 -1
- package/dist/git-merge-helpers.js.map +0 -1
- package/dist/git-merge-lock.d.ts.map +0 -1
- package/dist/git-merge-lock.js.map +0 -1
- package/dist/git-merge-strategies.d.ts.map +0 -1
- package/dist/git-merge-strategies.js.map +0 -1
- package/dist/git-merge.d.ts.map +0 -1
- package/dist/git-merge.js.map +0 -1
- package/dist/git-state-detector.d.ts.map +0 -1
- package/dist/git-state-detector.js.map +0 -1
- package/dist/git-types.d.ts.map +0 -1
- package/dist/git-types.js.map +0 -1
- package/dist/git-utils.d.ts.map +0 -1
- package/dist/git-utils.js.map +0 -1
- package/dist/loop-context-audit-pass.d.ts.map +0 -1
- package/dist/loop-context-audit-pass.js.map +0 -1
- package/dist/loop-engine-types.d.ts.map +0 -1
- package/dist/loop-engine-types.js.map +0 -1
- package/dist/loop-engine.d.ts.map +0 -1
- package/dist/loop-engine.js.map +0 -1
- package/dist/loop-event-bus.d.ts.map +0 -1
- package/dist/loop-event-bus.js.map +0 -1
- package/dist/loop-llm-client.d.ts.map +0 -1
- package/dist/loop-llm-client.js.map +0 -1
- package/dist/loop-llm-flag.d.ts.map +0 -1
- package/dist/loop-llm-flag.js.map +0 -1
- package/dist/loop-operational-block.d.ts.map +0 -1
- package/dist/loop-operational-block.js.map +0 -1
- package/dist/loop-prompt-builder.d.ts.map +0 -1
- package/dist/loop-prompt-builder.js.map +0 -1
- package/dist/loop-variance.d.ts.map +0 -1
- package/dist/loop-variance.js.map +0 -1
- package/dist/nexus-endpoint-clearance.d.ts.map +0 -1
- package/dist/nexus-endpoint-clearance.js.map +0 -1
- package/dist/nexus-escalation-bridge.d.ts.map +0 -1
- package/dist/nexus-escalation-bridge.js.map +0 -1
- package/dist/nexus-incoming.d.ts.map +0 -1
- package/dist/nexus-incoming.js.map +0 -1
- package/dist/nexus-intake-spawn.d.ts.map +0 -1
- package/dist/nexus-intake-spawn.js.map +0 -1
- package/dist/nexus-intake.d.ts.map +0 -1
- package/dist/nexus-intake.js.map +0 -1
- package/dist/nexus-return.d.ts.map +0 -1
- package/dist/nexus-return.js.map +0 -1
- package/dist/otlp-log-parser.d.ts.map +0 -1
- package/dist/otlp-log-parser.js.map +0 -1
- package/dist/otlp-metric-parser.d.ts.map +0 -1
- package/dist/otlp-metric-parser.js.map +0 -1
- package/dist/otlp-port-manager.d.ts.map +0 -1
- package/dist/otlp-port-manager.js.map +0 -1
- package/dist/otlp-receiver.d.ts.map +0 -1
- package/dist/otlp-receiver.js.map +0 -1
- package/dist/otlp-types.d.ts.map +0 -1
- package/dist/otlp-types.js.map +0 -1
- package/dist/prd-controller.d.ts.map +0 -1
- package/dist/prd-controller.js.map +0 -1
- package/dist/prd-divergence.d.ts.map +0 -1
- package/dist/prd-divergence.js.map +0 -1
- package/dist/prd-focus-pushdown.d.ts.map +0 -1
- package/dist/prd-focus-pushdown.js.map +0 -1
- package/dist/prd-frontier.d.ts.map +0 -1
- package/dist/prd-frontier.js.map +0 -1
- package/dist/prd-steward.d.ts.map +0 -1
- package/dist/prd-steward.js.map +0 -1
- package/dist/prd-viability.d.ts.map +0 -1
- package/dist/prd-viability.js.map +0 -1
- package/dist/worktree-focus.d.ts.map +0 -1
- package/dist/worktree-focus.js.map +0 -1
- package/dist/worktree-safety.d.ts.map +0 -1
- package/dist/worktree-safety.js.map +0 -1
- package/dist/worktree-state.d.ts.map +0 -1
- package/dist/worktree-state.js.map +0 -1
|
@@ -20,431 +20,32 @@
|
|
|
20
20
|
* (Issue 3: review_nonconvergent escalation, focus
|
|
21
21
|
* stays at review until a human intervenes).
|
|
22
22
|
*
|
|
23
|
-
* This module owns
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* This module owns the poll-loop dispatcher `runStageLifecycleTransitions` and
|
|
24
|
+
* re-exports the decomposed transition logic, which lives in three cohesive
|
|
25
|
+
* submodules:
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import { createEscalation as defaultCreateEscalation, hasOpenWedgedFocusEscalation as defaultHasOpenWedgedFocusEscalation } from './queries/issues.js';
|
|
34
|
-
import { emitLoopTrigger } from './loop-event-bus.js';
|
|
35
|
-
/**
|
|
36
|
-
* Default cap on review iterations before the daemon files a
|
|
37
|
-
* `review_nonconvergent` escalation and pauses the focus.
|
|
38
|
-
*
|
|
39
|
-
* Configurable per focus via `pipeline_config.review.maxIterations`.
|
|
40
|
-
*/
|
|
41
|
-
export declare const DEFAULT_REVIEW_MAX_ITERATIONS = 3;
|
|
42
|
-
/**
|
|
43
|
-
* Decide whether a focus has converged out of review. Convergence is
|
|
44
|
-
* deterministic and state-based:
|
|
45
|
-
*
|
|
46
|
-
* - If there are no in-flight remediation deliveries created during/after
|
|
47
|
-
* the latest review pass, the focus has converged.
|
|
48
|
-
*
|
|
49
|
-
* Pure function: takes the in-flight count and returns the decision.
|
|
50
|
-
* Exported so tests can drive it with synthetic counts.
|
|
51
|
-
*/
|
|
52
|
-
export declare function hasReviewConverged(inFlightRemediationCount: number): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Compute the configured review iteration cap for a focus. Pulls
|
|
55
|
-
* `pipeline_config.review.maxIterations` and falls back to
|
|
56
|
-
* `DEFAULT_REVIEW_MAX_ITERATIONS` when unset or non-positive.
|
|
57
|
-
*
|
|
58
|
-
* Exported for unit testing.
|
|
59
|
-
*/
|
|
60
|
-
export declare function getReviewIterationCap(pipelineConfig: PipelineConfig | null | undefined): number;
|
|
61
|
-
/**
|
|
62
|
-
* Returns true when the focus has any in-flight remediation deliveries
|
|
63
|
-
* created during/after the latest review pass.
|
|
64
|
-
*
|
|
65
|
-
* "Latest review pass" is the `started_at` of the most recent focus_reviews
|
|
66
|
-
* row; when no review has run yet, this returns false (no remediation
|
|
67
|
-
* deliveries can exist before a review pass).
|
|
68
|
-
*
|
|
69
|
-
* In-flight means execution_status is NOT one of done/cancelled/verify.
|
|
70
|
-
*
|
|
71
|
-
* Exported for unit testing the convergence query independently of the
|
|
72
|
-
* surrounding transition logic.
|
|
73
|
-
*/
|
|
74
|
-
export declare function hasInFlightRemediations(focusId: string, latestReviewPassTimestamp: string | null, deps?: {
|
|
75
|
-
getInFlightRemediationCount: typeof defaultGetInFlightRemediationCount;
|
|
76
|
-
}): Promise<boolean>;
|
|
77
|
-
/**
|
|
78
|
-
* Dependencies for `advanceVerifyToReviewIfEnabled`. Defaults reach for the
|
|
79
|
-
* real query module; tests can pass stub implementations.
|
|
80
|
-
*/
|
|
81
|
-
export interface VerifyToReviewDeps {
|
|
82
|
-
updateFocusStage: typeof defaultUpdateFocusStage;
|
|
83
|
-
emitLoopTrigger: typeof emitLoopTrigger;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* When a focus's stage is `verify` and auto-review is enabled, advance it to
|
|
87
|
-
* `review`. Auto-review is default-on (`isReviewEnabled`): only an explicit
|
|
88
|
-
* `pipeline_config.review.enabled === false` keeps the focus at `verify` until
|
|
89
|
-
* a human signals review. A focus with no stored review key auto-advances.
|
|
90
|
-
*
|
|
91
|
-
* Returns true when an advance was performed.
|
|
92
|
-
*/
|
|
93
|
-
export declare function advanceVerifyToReviewIfEnabled(focus: {
|
|
94
|
-
focusId: string;
|
|
95
|
-
focusName: string;
|
|
96
|
-
stage: string;
|
|
97
|
-
pipelineConfig: PipelineConfig | null;
|
|
98
|
-
}, deps?: VerifyToReviewDeps): Promise<boolean>;
|
|
99
|
-
/**
|
|
100
|
-
* Dependencies for `advanceReviewToCloseLoopIfConverged`. Defaults reach for
|
|
101
|
-
* the real query modules; tests can pass stub implementations.
|
|
102
|
-
*/
|
|
103
|
-
export interface ReviewConvergeDeps {
|
|
104
|
-
getLatestCompletedFocusReview: typeof defaultGetLatestCompletedFocusReview;
|
|
105
|
-
getInFlightRemediationCount: typeof defaultGetInFlightRemediationCount;
|
|
106
|
-
getFocusReviewIterationCount: typeof defaultGetFocusReviewIterationCount;
|
|
107
|
-
updateFocusStage: typeof defaultUpdateFocusStage;
|
|
108
|
-
createEscalation: typeof defaultCreateEscalation;
|
|
109
|
-
emitLoopTrigger: typeof emitLoopTrigger;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Outcome of an attempt to advance a focus past the review stage.
|
|
113
|
-
*/
|
|
114
|
-
export type ReviewTransitionOutcome = {
|
|
115
|
-
kind: 'no_action';
|
|
116
|
-
reason: string;
|
|
117
|
-
} | {
|
|
118
|
-
kind: 'converged';
|
|
119
|
-
from: 'review';
|
|
120
|
-
to: 'close_loop';
|
|
121
|
-
} | {
|
|
122
|
-
kind: 'nonconvergent';
|
|
123
|
-
iterations: number;
|
|
124
|
-
cap: number;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Evaluate the review -> close_loop transition for a focus and apply the
|
|
128
|
-
* appropriate action. Returns a structured outcome so callers can log /
|
|
129
|
-
* test the decision path.
|
|
27
|
+
* - `focus-stage-lifecycle/review-convergence` -- the verify->review and
|
|
28
|
+
* review->close_loop transitions plus their pure convergence helpers.
|
|
29
|
+
* - `focus-stage-lifecycle/planning-release` -- the ratify-to-execute and
|
|
30
|
+
* writable-focus planning->queued delivery releases.
|
|
31
|
+
* - `focus-stage-lifecycle/wedge-watchdog` -- the planning-wedge watchdog +
|
|
32
|
+
* zero-actionable log.
|
|
130
33
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* `review_nonconvergent` escalation (idempotent best-effort) and
|
|
135
|
-
* LEAVE the focus stage at `review`. The focus is paused until a
|
|
136
|
-
* human intervenes.
|
|
137
|
-
* 3. Otherwise, check in-flight remediations against the latest review
|
|
138
|
-
* pass. If zero, advance stage `review -> close_loop`.
|
|
139
|
-
* 4. Otherwise, do nothing -- remediations are still in flight.
|
|
34
|
+
* It does not advance `current_workflow_stage_id` directly -- the existing
|
|
35
|
+
* `syncFocusPhase` does that on the next poll, after the daemon's `stage` write
|
|
36
|
+
* lands.
|
|
140
37
|
*
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
export declare function advanceReviewToCloseLoopIfConverged(focus: {
|
|
144
|
-
focusId: string;
|
|
145
|
-
focusName: string;
|
|
146
|
-
organizationId: string;
|
|
147
|
-
stage: string;
|
|
148
|
-
pipelineConfig: PipelineConfig | null;
|
|
149
|
-
}, deps?: ReviewConvergeDeps): Promise<ReviewTransitionOutcome>;
|
|
150
|
-
/**
|
|
151
|
-
* Pure predicate: a read-only focus is ready to cross planning->execution
|
|
152
|
-
* exactly when a human has ratified its remediation plan.
|
|
153
|
-
*
|
|
154
|
-
* read_only === true => the focus is in the audit/read-only phase, its
|
|
155
|
-
* remediation deliveries held in 'planning'.
|
|
156
|
-
* ratified_at != null => a human stamped the distinct ratification signal.
|
|
157
|
-
*
|
|
158
|
-
* Both must hold. read_only=false (already crossed / a normal execute focus)
|
|
159
|
-
* fails the predicate, which is what makes the release idempotent: after the
|
|
160
|
-
* crossing flips read_only=false the predicate no longer holds, so re-runs are
|
|
161
|
-
* no-ops. A null ratified_at means the gate has NOT been crossed -- the human
|
|
162
|
-
* signal is absent -- so the focus stays held.
|
|
163
|
-
*
|
|
164
|
-
* Exported so tests can drive it with synthetic focus shapes.
|
|
165
|
-
*/
|
|
166
|
-
export declare function isFocusRatifiedForExecute(focus: {
|
|
167
|
-
readOnly?: boolean;
|
|
168
|
-
ratifiedAt?: string | null;
|
|
169
|
-
}): boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Dependencies for `releaseRatifiedReadOnlyFocus`. Defaults reach for the real
|
|
172
|
-
* query modules; tests pass stub implementations.
|
|
173
|
-
*/
|
|
174
|
-
export interface RatifyReleaseDeps {
|
|
175
|
-
getFocusDeliveries: typeof defaultGetFocusDeliveries;
|
|
176
|
-
updateFocusReadOnly: typeof defaultUpdateFocusReadOnly;
|
|
177
|
-
updateDeliveryStatus: typeof defaultUpdateDeliveryStatus;
|
|
178
|
-
emitLoopTrigger: typeof emitLoopTrigger;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* The SOLE planning->execution crossing for a read-only audit focus.
|
|
182
|
-
*
|
|
183
|
-
* When `isFocusRatifiedForExecute(focus)` holds (read_only=true AND a human
|
|
184
|
-
* stamped ratified_at), atomically-in-effect:
|
|
185
|
-
* (a) flip read_only=false, and
|
|
186
|
-
* (b) release every held delivery (execution_status 'planning') to 'queued'.
|
|
187
|
-
*
|
|
188
|
-
* This is the ONLY path that does either, which is what makes the gate
|
|
189
|
-
* non-procedural: the gate cannot be crossed by an agent or a stage transition;
|
|
190
|
-
* it requires the distinct human ratification signal that this function reads.
|
|
191
|
-
*
|
|
192
|
-
* Idempotent by construction:
|
|
193
|
-
* - flipping read_only=false first means the predicate fails on re-entry, so a
|
|
194
|
-
* second tick is a no-op;
|
|
195
|
-
* - the delivery move is guarded to ONLY touch 'planning' rows, so deliveries
|
|
196
|
-
* already queued (or further along) are left untouched.
|
|
197
|
-
*
|
|
198
|
-
* Returns the number of deliveries released (0 when the predicate does not hold
|
|
199
|
-
* or there were no held deliveries).
|
|
200
|
-
*
|
|
201
|
-
* Runs regardless of stage: a read-only audit focus may sit at planning/queued/
|
|
202
|
-
* in_progress, so this is NOT gated on focus.stage.
|
|
203
|
-
*/
|
|
204
|
-
export declare function releaseRatifiedReadOnlyFocus(focus: {
|
|
205
|
-
focusId: string;
|
|
206
|
-
focusName: string;
|
|
207
|
-
organizationId: string;
|
|
208
|
-
readOnly?: boolean;
|
|
209
|
-
ratifiedAt?: string | null;
|
|
210
|
-
}, deps?: RatifyReleaseDeps): Promise<number>;
|
|
211
|
-
/**
|
|
212
|
-
* Pure predicate: a writable focus is PAST its planning/kickoff window -- i.e. a
|
|
213
|
-
* lingering 'planning' delivery on it is a WEDGE to release, not work a scoping
|
|
214
|
-
* team is still shaping.
|
|
215
|
-
*
|
|
216
|
-
* Stage-column-INDEPENDENT by design. The previous version gated on
|
|
217
|
-
* `isPostPlanning(focus.stage)`, but `product_focuses.stage` is a documented-stale
|
|
218
|
-
* column: NO live path advances it to 'queued'/'in_progress' (the daemon writes
|
|
219
|
-
* only review/close_loop/done; everything else keeps the 'planning' default).
|
|
220
|
-
* supabase/.../focus/lifecycle.ts says so explicitly ("nothing advances `stage`
|
|
221
|
-
* to 'verify'"), which is why the newer code (checkAutoReview, focus_transition_stage)
|
|
222
|
-
* gates on the DERIVED phase instead. The old stage gate therefore NEVER fired for
|
|
223
|
-
* the founding wedge -- a post-backfill writable focus whose stage stays 'planning'
|
|
224
|
-
* forever (review finding, delivery 18055ddd). Worse, it was self-defeating: a
|
|
225
|
-
* delivery is born 'planning' PRECISELY because focus.stage was not post-planning
|
|
226
|
-
* (MCP resolveDefaultExecutionStatus reads the same column), and nothing changes
|
|
227
|
-
* the column before this tick -- so the release could never see a post-planning
|
|
228
|
-
* stage for exactly the focuses that have born-planning deliveries.
|
|
229
|
-
*
|
|
230
|
-
* The replacement uses two stage-free signals:
|
|
231
|
-
* 1. read_only === false -- a NORMAL execute focus, not a read-only audit focus
|
|
232
|
-
* (whose held planning deliveries are released only by the human-ratified
|
|
233
|
-
* `releaseRatifiedReadOnlyFocus`).
|
|
234
|
-
* 2. "past kickoff" via the delivery aggregate + active-team:
|
|
235
|
-
* - deriveFocusPhase(deliveries) !== 'kickoff' => real work already exists
|
|
236
|
-
* (some delivery is queued/coding/verify/done), so a lingering 'planning'
|
|
237
|
-
* row is a wedge behind/ahead of it -> past kickoff.
|
|
238
|
-
* - phase === 'kickoff' (all deliveries planning/draft, or none): genuinely
|
|
239
|
-
* ambiguous between a live scoping window and a full wedge. An ACTIVE TEAM
|
|
240
|
-
* is the discriminator -- a scoping team running for the focus is (or just
|
|
241
|
-
* was) creating/releasing deliveries, so DON'T pre-empt it; no team means
|
|
242
|
-
* nothing can make progress (the rank-0 planning delivery blocks the ready
|
|
243
|
-
* selector so no team will ever spawn) -> wedge -> past kickoff.
|
|
244
|
-
*
|
|
245
|
-
* Second discovery-only signal (injection #7, TEL-3): signal 1 is widened from a
|
|
246
|
-
* bare `read_only === false` to "NOT audit-phase". An audit-origin, not-yet-
|
|
247
|
-
* ratified focus whose `read_only` is silently absent (coerced false) is STILL an
|
|
248
|
-
* audit focus -- its born-planning remediation deliveries are owned by the ratify
|
|
249
|
-
* path and must NOT be swept to queued here, or the remediation executes ahead of
|
|
250
|
-
* the human ratify gate (2f253da6). `isAuditPhaseFocus` captures read_only===true
|
|
251
|
-
* OR (audit_origin AND !ratified); a RATIFIED audit focus (read_only=false,
|
|
252
|
-
* ratified_at set) is NOT audit-phase and IS released normally, and a NORMAL focus
|
|
253
|
-
* (audit_origin=false) is unaffected. Keyed on audit_origin + ratified_at
|
|
254
|
-
* (provenance + phase) -- it never writes read_only, so it is not a second source
|
|
255
|
-
* of truth for the flag.
|
|
256
|
-
*
|
|
257
|
-
* Exported so tests can drive it with synthetic shapes.
|
|
258
|
-
*/
|
|
259
|
-
export declare function isWritableFocusPastKickoff(input: {
|
|
260
|
-
readOnly?: boolean;
|
|
261
|
-
auditOrigin?: boolean;
|
|
262
|
-
ratifiedAt?: string | null;
|
|
263
|
-
deliveries: ReadonlyArray<{
|
|
264
|
-
executionStatus: string | null;
|
|
265
|
-
}>;
|
|
266
|
-
reviewRequestedAt?: string | null;
|
|
267
|
-
hasActiveTeam: boolean;
|
|
268
|
-
}): boolean;
|
|
269
|
-
/**
|
|
270
|
-
* Dependencies for `releaseWritableFocusPlanningDeliveries`. A strict subset of
|
|
271
|
-
* `RatifyReleaseDeps` -- there is no read_only flip here (the focus is already
|
|
272
|
-
* writable), so no `updateFocusReadOnly`. `hasActiveTeam` is the kickoff-window
|
|
273
|
-
* discriminator (see `isWritableFocusPastKickoff`); injected so tests can drive it.
|
|
274
|
-
*/
|
|
275
|
-
export interface WritableReleaseDeps {
|
|
276
|
-
getFocusDeliveries: typeof defaultGetFocusDeliveries;
|
|
277
|
-
updateDeliveryStatus: typeof defaultUpdateDeliveryStatus;
|
|
278
|
-
emitLoopTrigger: typeof emitLoopTrigger;
|
|
279
|
-
hasActiveTeam: (focusId: string) => boolean;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* The writable-focus analogue of `releaseRatifiedReadOnlyFocus`: the missing
|
|
283
|
-
* planning->queued release for a NORMAL (read_only=false) executing focus.
|
|
284
|
-
*
|
|
285
|
-
* Closes the silent wedge: a writable focus whose deliveries were born
|
|
286
|
-
* 'planning' (created during the planning stage, or via the MCP focus_list
|
|
287
|
-
* lookup falling back to 'planning') has NO transition that releases them once
|
|
288
|
-
* the focus is past planning -- the only planning->queued release in the
|
|
289
|
-
* codebase (`releaseRatifiedReadOnlyFocus`) is gated to ratified read-only audit
|
|
290
|
-
* focuses, and listener-auto-advance only moves queued/coding -> verify. So
|
|
291
|
-
* `daemon_get_ready_focuses` hits the rank-0 'planning' delivery, treats it as a
|
|
292
|
-
* hard block, and the focus never spawns a team.
|
|
293
|
-
*
|
|
294
|
-
* Fetch the focus's deliveries, and when `isWritableFocusPastKickoff` holds (the
|
|
295
|
-
* stage-column-independent gate), sweep every held delivery (execution_status
|
|
296
|
-
* 'planning') to 'queued'. Guarded so ONLY 'planning' rows move --
|
|
297
|
-
* draft/paused/queued/further-along are left untouched, which also makes the
|
|
298
|
-
* release idempotent: once swept, there are no 'planning' rows left so a re-run is
|
|
299
|
-
* a no-op. Unlike the ratify path there is no read_only flip to defer, so each
|
|
300
|
-
* delivery move stands on its own; a per-delivery failure is logged and retried on
|
|
301
|
-
* the next tick.
|
|
302
|
-
*
|
|
303
|
-
* FRT effect #6 (a completed/merged delivery stuck in 'planning' must advance out
|
|
304
|
-
* of 'planning' and never block at rank 0): planning's ONLY valid forward
|
|
305
|
-
* transition is 'queued' (DELIVERY_STATUS machine: planning -> queued|cancelled;
|
|
306
|
-
* planning -> done is illegal). So 'queued' is the correct -- and only -- forward
|
|
307
|
-
* move here even for a complete-but-mislabeled row: it advances out of 'planning'
|
|
308
|
-
* and re-enters the normal lifecycle, which re-settles already-done work quickly
|
|
309
|
-
* (its issues are already Done -> coding -> verify -> done). Re-running merged work
|
|
310
|
-
* is bounded by that; skipping the row instead would leave it 'planning' and
|
|
311
|
-
* re-wedge the focus, which is worse.
|
|
312
|
-
*
|
|
313
|
-
* Returns the number of deliveries released (0 when the gate does not hold or
|
|
314
|
-
* there were no held deliveries).
|
|
315
|
-
*/
|
|
316
|
-
export declare function releaseWritableFocusPlanningDeliveries(focus: {
|
|
317
|
-
focusId: string;
|
|
318
|
-
focusName: string;
|
|
319
|
-
organizationId: string;
|
|
320
|
-
readOnly?: boolean;
|
|
321
|
-
/** Immutable audit-origin provenance (second discovery-only signal, TEL-3). */
|
|
322
|
-
auditOrigin?: boolean;
|
|
323
|
-
/** Human ratification signal; the execute-phase discriminator (TEL-3). */
|
|
324
|
-
ratifiedAt?: string | null;
|
|
325
|
-
/** Display-only (logging); NOT used for gating -- the stage column is stale. */
|
|
326
|
-
stage?: string | null;
|
|
327
|
-
reviewRequestedAt?: string | null;
|
|
328
|
-
}, deps?: WritableReleaseDeps): Promise<number>;
|
|
329
|
-
/** A delivery as seen by the actionability classifier (rank-ascending walk). */
|
|
330
|
-
export interface WedgeBlockingDelivery {
|
|
331
|
-
id: string;
|
|
332
|
-
name: string;
|
|
333
|
-
status: string;
|
|
334
|
-
priorityRank: number;
|
|
335
|
-
/**
|
|
336
|
-
* The blocking delivery's last-updated timestamp (ISO), or null. Used by the
|
|
337
|
-
* watchdog as a RESTART-DURABLE proxy for how long the row has sat held -- so a
|
|
338
|
-
* daemon restart cannot reset the wedge clock (review finding, delivery 66c7d4d8).
|
|
339
|
-
*/
|
|
340
|
-
updatedAt: string | null;
|
|
341
|
-
}
|
|
342
|
-
/** Pure classification of a focus's deliveries against the ready-focus walk. */
|
|
343
|
-
export interface FocusActionability {
|
|
344
|
-
totalCount: number;
|
|
345
|
-
/** True iff the daemon would surface an actionable delivery (first non-terminal in rank order is actionable). */
|
|
346
|
-
surfacesActionable: boolean;
|
|
347
|
-
/** The first non-terminal, non-actionable delivery in rank order (planning/draft/paused), or null. */
|
|
348
|
-
blockingDelivery: WedgeBlockingDelivery | null;
|
|
349
|
-
/** True iff every delivery is terminal-ish (done/cancelled/verify) or there are none. */
|
|
350
|
-
allTerminal: boolean;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Replicate the server-side ready-focus rank-walk to decide whether a focus
|
|
354
|
-
* surfaces actionable work, and if not, which delivery blocks it.
|
|
355
|
-
*
|
|
356
|
-
* The walk (rank-ascending, matching the edge): skip terminal-ish deliveries;
|
|
357
|
-
* the FIRST non-terminal delivery decides -- actionable => the focus surfaces
|
|
358
|
-
* (not wedged); non-actionable (planning/draft/paused) => that delivery blocks
|
|
359
|
-
* the focus and everything behind it. This is why a low-rank 'planning' delivery
|
|
360
|
-
* wedges a focus even when a higher-rank 'queued' delivery exists.
|
|
361
|
-
*
|
|
362
|
-
* Pure and exported for unit testing. Expects deliveries pre-sorted by
|
|
363
|
-
* priorityRank ascending (as daemon_get_focus_deliveries returns them); it does
|
|
364
|
-
* not re-sort, mirroring the edge which relies on the query's ORDER BY.
|
|
365
|
-
*/
|
|
366
|
-
export declare function classifyFocusActionability(deliveries: ReadonlyArray<{
|
|
367
|
-
id: string;
|
|
368
|
-
name: string;
|
|
369
|
-
executionStatus: string | null;
|
|
370
|
-
priorityRank: number;
|
|
371
|
-
updatedAt?: string | null;
|
|
372
|
-
}>): FocusActionability;
|
|
373
|
-
/**
|
|
374
|
-
* Evict watchdog state for any focus NOT in `liveFocusIds`. A focus that goes
|
|
375
|
-
* terminal (complete/cancelled) or whose product is unclaimed simply stops being
|
|
376
|
-
* returned by getActiveFocuses, so `evaluateFocusWedge` never runs again to clear
|
|
377
|
-
* its entry -- leaving a slow unbounded leak keyed by focusId (review finding,
|
|
378
|
-
* delivery 66c7d4d8). The poll loop calls this once per run with the set of
|
|
379
|
-
* focusIds it actually saw, bounding both maps to currently-active focuses.
|
|
380
|
-
*/
|
|
381
|
-
export declare function pruneWedgeWatchdogState(liveFocusIds: ReadonlySet<string>): void;
|
|
382
|
-
/** Test seam: reset all watchdog state between cases. */
|
|
383
|
-
export declare function __resetWedgeWatchdogState(): void;
|
|
384
|
-
/**
|
|
385
|
-
* Dependencies for `evaluateFocusWedge`. Defaults reach the real query modules
|
|
386
|
-
* and the canonical clock/threshold; tests inject stubs + a synthetic clock.
|
|
387
|
-
*/
|
|
388
|
-
export interface WedgeWatchdogDeps {
|
|
389
|
-
getFocusDeliveries: typeof defaultGetFocusDeliveries;
|
|
390
|
-
hasOpenWedgedFocusEscalation: typeof defaultHasOpenWedgedFocusEscalation;
|
|
391
|
-
createEscalation: typeof defaultCreateEscalation;
|
|
392
|
-
/** Kickoff-window discriminator: a running scoping team means "not a wedge". */
|
|
393
|
-
hasActiveTeam: (focusId: string) => boolean;
|
|
394
|
-
now: () => number;
|
|
395
|
-
thresholdMs: number;
|
|
396
|
-
}
|
|
397
|
-
/** Structured outcome of one wedge evaluation, for logging / tests. */
|
|
398
|
-
export type WedgeOutcome = {
|
|
399
|
-
kind: 'skipped';
|
|
400
|
-
reason: string;
|
|
401
|
-
} | {
|
|
402
|
-
kind: 'surfaces_actionable';
|
|
403
|
-
} | {
|
|
404
|
-
kind: 'zero_actionable';
|
|
405
|
-
escalated: boolean;
|
|
406
|
-
wedged: boolean;
|
|
407
|
-
blockingStatus: string;
|
|
408
|
-
};
|
|
409
|
-
/**
|
|
410
|
-
* Per-focus, per-tick evaluation of the planning-wedge condition. Does two
|
|
411
|
-
* things off ONE actionability classification:
|
|
412
|
-
*
|
|
413
|
-
* D3 (log): when an active, role-assigned focus surfaces zero actionable
|
|
414
|
-
* deliveries, name the rank-0 blocking delivery + its state in the daemon
|
|
415
|
-
* log -- so a wedge is visible in ~/.telora/daemon.log, not only the
|
|
416
|
-
* edge-function log. Dampened to once per focus per state change.
|
|
417
|
-
*
|
|
418
|
-
* D2 (escalate): when that focus is ALSO writable, the block is a WEDGE
|
|
419
|
-
* (planning/draft, not a human pause), NO team is running, and the wedge
|
|
420
|
-
* persists past the threshold, file a deduped wedged_focus escalation --
|
|
421
|
-
* defense-in-depth for wedge classes the rank-respecting release (D1) does
|
|
422
|
-
* not resolve (e.g. a 'draft' block, which D1 does not sweep).
|
|
423
|
-
*
|
|
424
|
-
* Runs AFTER the D1 release in the poll loop, so a focus D1 just unwedged is
|
|
425
|
-
* already surfacing actionable work here and neither logs nor escalates.
|
|
426
|
-
*
|
|
427
|
-
* Gating (escalation): status active + assigned_agent_role_id set + read_only
|
|
428
|
-
* false + wedge-held block + NO active team. The "no active team" check replaces
|
|
429
|
-
* the old (broken) isPostPlanning(stage) gate -- the stage column is stale and
|
|
430
|
-
* never reaches post-planning, so that gate never fired for the founding wedge
|
|
431
|
-
* (review finding, delivery 66c7d4d8). It is the same kickoff-window discriminator
|
|
432
|
-
* D1 uses: a running scoping team is shaping/releasing deliveries (don't escalate);
|
|
433
|
-
* no team means nothing can make progress (the rank-0 block stops the ready
|
|
434
|
-
* selector from spawning one) -- a true wedge. Zero-delivery focuses (planning
|
|
435
|
-
* teams) and all-paused focuses (human hold) are excluded by the classifier (no
|
|
436
|
-
* wedge-held blocking delivery).
|
|
38
|
+
* @module focus-stage-lifecycle
|
|
437
39
|
*/
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}, deps?: WedgeWatchdogDeps): Promise<WedgeOutcome>;
|
|
40
|
+
import type { DaemonConfig, FocusDeliveryInfo } from './types.js';
|
|
41
|
+
import { getActiveFocuses as defaultGetActiveFocuses } from './supabase.js';
|
|
42
|
+
import { getFocusDeliveries as defaultGetFocusDeliveries } from './queries/focuses.js';
|
|
43
|
+
import { advanceVerifyToReviewIfEnabled, advanceReviewToCloseLoopIfConverged, type ReviewTransitionOutcome } from './focus-stage-lifecycle/review-convergence.js';
|
|
44
|
+
import { releaseRatifiedReadOnlyFocus, releaseWritableFocusPlanningDeliveries } from './focus-stage-lifecycle/planning-release.js';
|
|
45
|
+
import { evaluateFocusWedge, type WedgeOutcome } from './focus-stage-lifecycle/wedge-watchdog.js';
|
|
46
|
+
export * from './focus-stage-lifecycle/review-convergence.js';
|
|
47
|
+
export * from './focus-stage-lifecycle/planning-release.js';
|
|
48
|
+
export * from './focus-stage-lifecycle/wedge-watchdog.js';
|
|
448
49
|
/**
|
|
449
50
|
* Per-product per-focus tick for the new stage lifecycle transitions.
|
|
450
51
|
* Wired into the daemon poll loop alongside the existing cascade checks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-stage-lifecycle.d.ts","sourceRoot":"","sources":["../src/focus-stage-lifecycle.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"focus-stage-lifecycle.d.ts","sourceRoot":"","sources":["../src/focus-stage-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,gBAAgB,IAAI,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,kBAAkB,IAAI,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,EACnC,KAAK,uBAAuB,EAC7B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,sCAAsC,EACvC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,kBAAkB,EAElB,KAAK,YAAY,EAClB,MAAM,2CAA2C,CAAC;AAInD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAI1D;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE;IACJ,gBAAgB,EAAE,OAAO,uBAAuB,CAAC;IACjD,kBAAkB,EAAE,OAAO,yBAAyB,CAAC;IACrD,qBAAqB,EAAE,CACrB,KAAK,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,CAAC,CAAC,KACxD,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,wBAAwB,EAAE,CACxB,KAAK,EAAE,UAAU,CAAC,OAAO,mCAAmC,CAAC,CAAC,CAAC,CAAC,KAC7D,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,uBAAuB,EAAE,CACvB,KAAK,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC,KACtD,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,uBAAuB,EAAE,CACvB,KAAK,EAAE,UAAU,CAAC,OAAO,sCAAsC,CAAC,CAAC,CAAC,CAAC,KAChE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,aAAa,EAAE,CACb,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,KAC5C,OAAO,CAAC,YAAY,CAAC,CAAC;CAS5B,GACA,OAAO,CAAC,IAAI,CAAC,CA2Hf;AAGD,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|