@telora/daemon 0.22.104 → 0.22.132
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/completion/commit-verdict-release.d.ts +49 -0
- package/dist/completion/commit-verdict-release.d.ts.map +1 -0
- package/dist/completion/commit-verdict-release.js +240 -0
- package/dist/completion/commit-verdict-release.js.map +1 -0
- package/dist/completion/completion-phase-registry.d.ts +10 -4
- package/dist/completion/completion-phase-registry.d.ts.map +1 -1
- package/dist/completion/completion-phase-registry.js +19 -7
- package/dist/completion/completion-phase-registry.js.map +1 -1
- package/dist/completion/detector.d.ts.map +1 -1
- package/dist/completion/detector.js +1 -0
- package/dist/completion/detector.js.map +1 -1
- package/dist/completion/event-entry-phases.d.ts +6 -3
- package/dist/completion/event-entry-phases.d.ts.map +1 -1
- package/dist/completion/event-entry-phases.js +135 -76
- package/dist/completion/event-entry-phases.js.map +1 -1
- package/dist/completion/event-phases.d.ts +24 -3
- package/dist/completion/event-phases.d.ts.map +1 -1
- package/dist/completion/event-phases.js +9 -9
- package/dist/completion/event-phases.js.map +1 -1
- package/dist/completion/event.d.ts +8 -0
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +47 -21
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/exit-classification.d.ts.map +1 -1
- package/dist/completion/exit-classification.js +1 -0
- package/dist/completion/exit-classification.js.map +1 -1
- package/dist/completion/merge-phase.d.ts +21 -9
- package/dist/completion/merge-phase.d.ts.map +1 -1
- package/dist/completion/merge-phase.js +35 -10
- package/dist/completion/merge-phase.js.map +1 -1
- package/dist/completion/review-auto-approval-record.d.ts +19 -0
- package/dist/completion/review-auto-approval-record.d.ts.map +1 -0
- package/dist/completion/review-auto-approval-record.js +102 -0
- package/dist/completion/review-auto-approval-record.js.map +1 -0
- package/dist/completion/review-cycle-cap.d.ts +62 -0
- package/dist/completion/review-cycle-cap.d.ts.map +1 -0
- package/dist/completion/review-cycle-cap.js +180 -0
- package/dist/completion/review-cycle-cap.js.map +1 -0
- package/dist/completion/review-exit-deps.d.ts +17 -2
- package/dist/completion/review-exit-deps.d.ts.map +1 -1
- package/dist/completion/review-exit-deps.js +19 -2
- package/dist/completion/review-exit-deps.js.map +1 -1
- package/dist/completion/review-exit-escalations.d.ts +45 -23
- package/dist/completion/review-exit-escalations.d.ts.map +1 -1
- package/dist/completion/review-exit-escalations.js +15 -74
- package/dist/completion/review-exit-escalations.js.map +1 -1
- package/dist/completion/review-exit-evidence.d.ts +9 -0
- package/dist/completion/review-exit-evidence.d.ts.map +1 -1
- package/dist/completion/review-exit-evidence.js +4 -1
- package/dist/completion/review-exit-evidence.js.map +1 -1
- package/dist/completion/review-exit-foreign-findings.d.ts +151 -0
- package/dist/completion/review-exit-foreign-findings.d.ts.map +1 -0
- package/dist/completion/review-exit-foreign-findings.js +474 -0
- package/dist/completion/review-exit-foreign-findings.js.map +1 -0
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +71 -64
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/review-exit-progress.d.ts +20 -0
- package/dist/completion/review-exit-progress.d.ts.map +1 -1
- package/dist/completion/review-exit-progress.js +28 -19
- package/dist/completion/review-exit-progress.js.map +1 -1
- package/dist/completion/review-exit-rehoming.d.ts +5 -0
- package/dist/completion/review-exit-rehoming.d.ts.map +1 -1
- package/dist/completion/review-exit-rehoming.js.map +1 -1
- package/dist/completion/review-exit-verdict-gate.d.ts +202 -0
- package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -0
- package/dist/completion/review-exit-verdict-gate.js +228 -0
- package/dist/completion/review-exit-verdict-gate.js.map +1 -0
- package/dist/completion/review-next-step.d.ts +62 -0
- package/dist/completion/review-next-step.d.ts.map +1 -0
- package/dist/completion/review-next-step.js +63 -0
- package/dist/completion/review-next-step.js.map +1 -0
- package/dist/completion/session-hold-sweep-deps.d.ts +17 -0
- package/dist/completion/session-hold-sweep-deps.d.ts.map +1 -0
- package/dist/completion/session-hold-sweep-deps.js +89 -0
- package/dist/completion/session-hold-sweep-deps.js.map +1 -0
- package/dist/completion/session-hold.d.ts +180 -0
- package/dist/completion/session-hold.d.ts.map +1 -0
- package/dist/completion/session-hold.js +238 -0
- package/dist/completion/session-hold.js.map +1 -0
- package/dist/completion/state-cascade.d.ts +19 -0
- package/dist/completion/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade.js +85 -31
- package/dist/completion/state-cascade.js.map +1 -1
- package/dist/completion/team-lifecycle.d.ts +35 -2
- package/dist/completion/team-lifecycle.d.ts.map +1 -1
- package/dist/completion/team-lifecycle.js +165 -94
- package/dist/completion/team-lifecycle.js.map +1 -1
- package/dist/completion/team-phase.d.ts +27 -15
- package/dist/completion/team-phase.d.ts.map +1 -1
- package/dist/completion/team-phase.js +34 -15
- package/dist/completion/team-phase.js.map +1 -1
- package/dist/delivery/commit-verdict-hold.d.ts +55 -0
- package/dist/delivery/commit-verdict-hold.d.ts.map +1 -0
- package/dist/delivery/commit-verdict-hold.js +118 -0
- package/dist/delivery/commit-verdict-hold.js.map +1 -0
- package/dist/directive/directive-dispatch.d.ts.map +1 -1
- package/dist/directive/directive-dispatch.js +10 -3
- package/dist/directive/directive-dispatch.js.map +1 -1
- package/dist/directive/directive-executor.d.ts.map +1 -1
- package/dist/directive/directive-executor.js +1 -0
- package/dist/directive/directive-executor.js.map +1 -1
- package/dist/directive/directive-queue.d.ts.map +1 -1
- package/dist/directive/directive-queue.js +6 -1
- package/dist/directive/directive-queue.js.map +1 -1
- package/dist/directive/phase-sync.d.ts +29 -2
- package/dist/directive/phase-sync.d.ts.map +1 -1
- package/dist/directive/phase-sync.js +30 -6
- package/dist/directive/phase-sync.js.map +1 -1
- package/dist/drift/artifact-ref-shape.d.ts +34 -0
- package/dist/drift/artifact-ref-shape.d.ts.map +1 -0
- package/dist/drift/artifact-ref-shape.js +94 -0
- package/dist/drift/artifact-ref-shape.js.map +1 -0
- package/dist/drift/drift-eval-loop.d.ts +7 -0
- package/dist/drift/drift-eval-loop.d.ts.map +1 -1
- package/dist/drift/drift-eval-loop.js +34 -5
- package/dist/drift/drift-eval-loop.js.map +1 -1
- package/dist/drift/drift-evaluator.d.ts.map +1 -1
- package/dist/drift/drift-evaluator.js +8 -3
- package/dist/drift/drift-evaluator.js.map +1 -1
- package/dist/focus/awaiting-slot.d.ts +34 -0
- package/dist/focus/awaiting-slot.d.ts.map +1 -0
- package/dist/focus/awaiting-slot.js +26 -0
- package/dist/focus/awaiting-slot.js.map +1 -0
- package/dist/focus/focus-lifecycle.js +2 -2
- package/dist/focus/focus-lifecycle.js.map +1 -1
- package/dist/focus/focus-phase.d.ts.map +1 -1
- package/dist/focus/focus-phase.js +3 -1
- package/dist/focus/focus-phase.js.map +1 -1
- package/dist/focus/focus-spawn-decision.d.ts +62 -0
- package/dist/focus/focus-spawn-decision.d.ts.map +1 -0
- package/dist/focus/focus-spawn-decision.js +41 -0
- package/dist/focus/focus-spawn-decision.js.map +1 -0
- package/dist/focus/focus-team-state.d.ts.map +1 -1
- package/dist/focus/focus-team-state.js +1 -13
- package/dist/focus/focus-team-state.js.map +1 -1
- package/dist/focus/listener-spawn.d.ts +16 -55
- package/dist/focus/listener-spawn.d.ts.map +1 -1
- package/dist/focus/listener-spawn.js +102 -64
- package/dist/focus/listener-spawn.js.map +1 -1
- package/dist/focus/listener-state.d.ts.map +1 -1
- package/dist/focus/listener-state.js +4 -1
- package/dist/focus/listener-state.js.map +1 -1
- package/dist/focus/listener.d.ts +41 -2
- package/dist/focus/listener.d.ts.map +1 -1
- package/dist/focus/listener.js +135 -83
- package/dist/focus/listener.js.map +1 -1
- package/dist/focus/pending-spawn-pass-deps.d.ts +69 -0
- package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -0
- package/dist/focus/pending-spawn-pass-deps.js +34 -0
- package/dist/focus/pending-spawn-pass-deps.js.map +1 -0
- package/dist/focus/pending-spawn-review-next-step.d.ts +83 -0
- package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -0
- package/dist/focus/pending-spawn-review-next-step.js +325 -0
- package/dist/focus/pending-spawn-review-next-step.js.map +1 -0
- package/dist/focus/review-cycle-cap-hold.d.ts +132 -0
- package/dist/focus/review-cycle-cap-hold.d.ts.map +1 -0
- package/dist/focus/review-cycle-cap-hold.js +178 -0
- package/dist/focus/review-cycle-cap-hold.js.map +1 -0
- package/dist/focus/team-actionable-work.js +2 -2
- package/dist/focus/verify-open-issues.d.ts +22 -0
- package/dist/focus/verify-open-issues.d.ts.map +1 -1
- package/dist/focus/verify-open-issues.js +118 -57
- package/dist/focus/verify-open-issues.js.map +1 -1
- package/dist/focus/verify-routing-passes.d.ts +32 -0
- package/dist/focus/verify-routing-passes.d.ts.map +1 -0
- package/dist/focus/verify-routing-passes.js +18 -0
- package/dist/focus/verify-routing-passes.js.map +1 -0
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +9 -5
- package/dist/git/index.js.map +1 -1
- package/dist/merge/focus-merge.d.ts +16 -2
- package/dist/merge/focus-merge.d.ts.map +1 -1
- package/dist/merge/focus-merge.js +53 -30
- package/dist/merge/focus-merge.js.map +1 -1
- package/dist/merge/merge-back-loop.d.ts +5 -0
- package/dist/merge/merge-back-loop.d.ts.map +1 -1
- package/dist/merge/merge-back-loop.js +17 -8
- package/dist/merge/merge-back-loop.js.map +1 -1
- package/dist/merge/merge-gate-coverage.d.ts +94 -0
- package/dist/merge/merge-gate-coverage.d.ts.map +1 -0
- package/dist/merge/merge-gate-coverage.js +217 -0
- package/dist/merge/merge-gate-coverage.js.map +1 -0
- package/dist/prompt/focus-prompt-builder.d.ts.map +1 -1
- package/dist/prompt/focus-prompt-builder.js +6 -0
- package/dist/prompt/focus-prompt-builder.js.map +1 -1
- package/dist/prompt/prompt-listing.d.ts.map +1 -1
- package/dist/prompt/prompt-listing.js +8 -0
- package/dist/prompt/prompt-listing.js.map +1 -1
- package/dist/prompt/team-prompt-base.d.ts.map +1 -1
- package/dist/prompt/team-prompt-base.js +5 -1
- package/dist/prompt/team-prompt-base.js.map +1 -1
- package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
- package/dist/prompt-sections/execution-sections.js +14 -39
- package/dist/prompt-sections/execution-sections.js.map +1 -1
- package/dist/prompt-sections/gate-ownership.d.ts +36 -0
- package/dist/prompt-sections/gate-ownership.d.ts.map +1 -0
- package/dist/prompt-sections/gate-ownership.js +68 -0
- package/dist/prompt-sections/gate-ownership.js.map +1 -0
- package/dist/prompt-sections/gate-verdict-section.d.ts +58 -0
- package/dist/prompt-sections/gate-verdict-section.d.ts.map +1 -0
- package/dist/prompt-sections/gate-verdict-section.js +88 -0
- package/dist/prompt-sections/gate-verdict-section.js.map +1 -0
- package/dist/prompt-sections/persona-sections.d.ts +10 -0
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +35 -11
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/prompt-sections/shared.js +1 -1
- package/dist/prompt-sections/shared.js.map +1 -1
- package/dist/queries/agent-resolvable-promotion.d.ts +6 -3
- package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
- package/dist/queries/agent-resolvable-promotion.js +20 -9
- package/dist/queries/agent-resolvable-promotion.js.map +1 -1
- package/dist/queries/deliveries.d.ts +46 -4
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +69 -16
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/delivery-gate-state.d.ts +151 -1
- package/dist/queries/delivery-gate-state.d.ts.map +1 -1
- package/dist/queries/delivery-gate-state.js +95 -14
- package/dist/queries/delivery-gate-state.js.map +1 -1
- package/dist/queries/delivery-write-discipline.d.ts +65 -0
- package/dist/queries/delivery-write-discipline.d.ts.map +1 -0
- package/dist/queries/delivery-write-discipline.js +101 -0
- package/dist/queries/delivery-write-discipline.js.map +1 -0
- package/dist/queries/escalation-consumption.d.ts +11 -0
- package/dist/queries/escalation-consumption.d.ts.map +1 -1
- package/dist/queries/escalation-consumption.js +22 -0
- package/dist/queries/escalation-consumption.js.map +1 -1
- package/dist/queries/escalation-spool.d.ts +75 -0
- package/dist/queries/escalation-spool.d.ts.map +1 -0
- package/dist/queries/escalation-spool.js +232 -0
- package/dist/queries/escalation-spool.js.map +1 -0
- package/dist/queries/escalation-suppression.d.ts.map +1 -1
- package/dist/queries/escalation-suppression.js +2 -0
- package/dist/queries/escalation-suppression.js.map +1 -1
- package/dist/queries/escalations.js +1 -1
- package/dist/queries/filing-observation.d.ts.map +1 -1
- package/dist/queries/filing-observation.js +2 -0
- package/dist/queries/filing-observation.js.map +1 -1
- package/dist/queries/focus-discovery.d.ts +4 -4
- package/dist/queries/focus-discovery.d.ts.map +1 -1
- package/dist/queries/focus-discovery.js +1 -0
- package/dist/queries/focus-discovery.js.map +1 -1
- package/dist/queries/focus-review-approval.d.ts +84 -0
- package/dist/queries/focus-review-approval.d.ts.map +1 -0
- package/dist/queries/focus-review-approval.js +158 -0
- package/dist/queries/focus-review-approval.js.map +1 -0
- package/dist/queries/focuses.d.ts +6 -5
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +9 -5
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/incident-correlation.d.ts +5 -4
- package/dist/queries/incident-correlation.d.ts.map +1 -1
- package/dist/queries/incident-correlation.js +11 -5
- package/dist/queries/incident-correlation.js.map +1 -1
- package/dist/queries/issues.d.ts.map +1 -1
- package/dist/queries/issues.js +2 -1
- package/dist/queries/issues.js.map +1 -1
- package/dist/queries/loop-refusal-observation.d.ts +64 -0
- package/dist/queries/loop-refusal-observation.d.ts.map +1 -0
- package/dist/queries/loop-refusal-observation.js +137 -0
- package/dist/queries/loop-refusal-observation.js.map +1 -0
- package/dist/queries/schemas.d.ts +9 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +11 -3
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/shared.js +1 -1
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +1 -15
- package/dist/queries/verification.js.map +1 -1
- package/dist/queries/wire-contract.generated.d.ts +3 -0
- package/dist/queries/wire-contract.generated.d.ts.map +1 -1
- package/dist/queries/wire-contract.generated.js +3 -0
- package/dist/queries/wire-contract.generated.js.map +1 -1
- package/dist/resolvers/assembly-engine.d.ts.map +1 -1
- package/dist/resolvers/assembly-engine.js +3 -1
- package/dist/resolvers/assembly-engine.js.map +1 -1
- package/dist/resolvers/git-diff-against-base.d.ts +5 -2
- package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +121 -39
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/shared/git-diff.d.ts +2 -0
- package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
- package/dist/resolvers/shared/git-diff.js +5 -1
- package/dist/resolvers/shared/git-diff.js.map +1 -1
- package/dist/resolvers/shared/review-window-commits.d.ts +96 -0
- package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -0
- package/dist/resolvers/shared/review-window-commits.js +262 -0
- package/dist/resolvers/shared/review-window-commits.js.map +1 -0
- package/dist/session/session-lineage.d.ts.map +1 -1
- package/dist/session/session-lineage.js +4 -1
- package/dist/session/session-lineage.js.map +1 -1
- package/dist/shell/fail-stop.d.ts +18 -0
- package/dist/shell/fail-stop.d.ts.map +1 -0
- package/dist/shell/fail-stop.js +53 -0
- package/dist/shell/fail-stop.js.map +1 -0
- package/dist/shell/graceful-shutdown.d.ts +48 -0
- package/dist/shell/graceful-shutdown.d.ts.map +1 -0
- package/dist/shell/graceful-shutdown.js +152 -0
- package/dist/shell/graceful-shutdown.js.map +1 -0
- package/dist/shell/heartbeat.d.ts.map +1 -1
- package/dist/shell/heartbeat.js +5 -4
- package/dist/shell/heartbeat.js.map +1 -1
- package/dist/shell/log.d.ts.map +1 -1
- package/dist/shell/log.js +4 -1
- package/dist/shell/log.js.map +1 -1
- package/dist/shell/stop-request.d.ts.map +1 -1
- package/dist/shell/stop-request.js +2 -1
- package/dist/shell/stop-request.js.map +1 -1
- package/dist/shell/unified-shell.d.ts.map +1 -1
- package/dist/shell/unified-shell.js +41 -114
- package/dist/shell/unified-shell.js.map +1 -1
- package/dist/spawn/lifecycle.d.ts +12 -0
- package/dist/spawn/lifecycle.d.ts.map +1 -1
- package/dist/spawn/lifecycle.js +25 -21
- package/dist/spawn/lifecycle.js.map +1 -1
- package/dist/spawn/prompt-assembly.d.ts +19 -1
- package/dist/spawn/prompt-assembly.d.ts.map +1 -1
- package/dist/spawn/prompt-assembly.js +70 -21
- package/dist/spawn/prompt-assembly.js.map +1 -1
- package/dist/spawn/review-hold-park.d.ts.map +1 -1
- package/dist/spawn/review-hold-park.js +18 -8
- package/dist/spawn/review-hold-park.js.map +1 -1
- package/dist/spawn/spawn-cooldown.d.ts.map +1 -1
- package/dist/spawn/spawn-cooldown.js +4 -0
- package/dist/spawn/spawn-cooldown.js.map +1 -1
- package/dist/spawn/spawn-decision.d.ts.map +1 -1
- package/dist/spawn/spawn-decision.js +2 -1
- package/dist/spawn/spawn-decision.js.map +1 -1
- package/dist/spawn/worktree-session.d.ts +6 -0
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +15 -2
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/testing/fixtures/index.d.ts +10 -1
- package/dist/testing/fixtures/index.d.ts.map +1 -1
- package/dist/testing/fixtures/index.js +59 -1
- package/dist/testing/fixtures/index.js.map +1 -1
- package/dist/testing/fixtures/pending-spawn-world.d.ts +34 -0
- package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -0
- package/dist/testing/fixtures/pending-spawn-world.js +92 -0
- package/dist/testing/fixtures/pending-spawn-world.js.map +1 -0
- package/dist/types/index.js +1 -1
- package/dist/verify/commit-gate-configured.d.ts +86 -0
- package/dist/verify/commit-gate-configured.d.ts.map +1 -0
- package/dist/verify/commit-gate-configured.js +234 -0
- package/dist/verify/commit-gate-configured.js.map +1 -0
- package/dist/verify/commit-verdict-record.d.ts +98 -0
- package/dist/verify/commit-verdict-record.d.ts.map +1 -0
- package/dist/verify/commit-verdict-record.js +297 -0
- package/dist/verify/commit-verdict-record.js.map +1 -0
- package/dist/verify/explicit-gate-outcome.d.ts +161 -0
- package/dist/verify/explicit-gate-outcome.d.ts.map +1 -0
- package/dist/verify/explicit-gate-outcome.js +215 -0
- package/dist/verify/explicit-gate-outcome.js.map +1 -0
- package/dist/verify/explicit-rearm.d.ts +27 -0
- package/dist/verify/explicit-rearm.d.ts.map +1 -0
- package/dist/verify/explicit-rearm.js +161 -0
- package/dist/verify/explicit-rearm.js.map +1 -0
- package/dist/verify/explicit-run-ledger.d.ts +26 -0
- package/dist/verify/explicit-run-ledger.d.ts.map +1 -0
- package/dist/verify/explicit-run-ledger.js +93 -0
- package/dist/verify/explicit-run-ledger.js.map +1 -0
- package/dist/verify/failure-signature.d.ts.map +1 -1
- package/dist/verify/failure-signature.js +5 -1
- package/dist/verify/failure-signature.js.map +1 -1
- package/dist/verify/gate-run-registry.d.ts +105 -0
- package/dist/verify/gate-run-registry.d.ts.map +1 -0
- package/dist/verify/gate-run-registry.js +111 -0
- package/dist/verify/gate-run-registry.js.map +1 -0
- package/dist/verify/gate-verdict-source.d.ts +68 -0
- package/dist/verify/gate-verdict-source.d.ts.map +1 -0
- package/dist/verify/gate-verdict-source.js +143 -0
- package/dist/verify/gate-verdict-source.js.map +1 -0
- package/dist/verify/judged-commit-gate.d.ts +11 -0
- package/dist/verify/judged-commit-gate.d.ts.map +1 -0
- package/dist/verify/judged-commit-gate.js +48 -0
- package/dist/verify/judged-commit-gate.js.map +1 -0
- package/dist/verify/rework-judgment.d.ts +58 -0
- package/dist/verify/rework-judgment.d.ts.map +1 -0
- package/dist/verify/rework-judgment.js +54 -0
- package/dist/verify/rework-judgment.js.map +1 -0
- package/dist/verify/verification-attribution.d.ts +105 -0
- package/dist/verify/verification-attribution.d.ts.map +1 -0
- package/dist/verify/verification-attribution.js +322 -0
- package/dist/verify/verification-attribution.js.map +1 -0
- package/dist/verify/verification-baseline-run.d.ts +123 -0
- package/dist/verify/verification-baseline-run.d.ts.map +1 -0
- package/dist/verify/verification-baseline-run.js +386 -0
- package/dist/verify/verification-baseline-run.js.map +1 -0
- package/dist/verify/verification-baseline.d.ts +79 -33
- package/dist/verify/verification-baseline.d.ts.map +1 -1
- package/dist/verify/verification-baseline.js +99 -106
- package/dist/verify/verification-baseline.js.map +1 -1
- package/dist/verify/verification-checkout.d.ts +13 -0
- package/dist/verify/verification-checkout.d.ts.map +1 -1
- package/dist/verify/verification-checkout.js +39 -2
- package/dist/verify/verification-checkout.js.map +1 -1
- package/dist/verify/verification-commit-sharing.d.ts +84 -0
- package/dist/verify/verification-commit-sharing.d.ts.map +1 -0
- package/dist/verify/verification-commit-sharing.js +416 -0
- package/dist/verify/verification-commit-sharing.js.map +1 -0
- package/dist/verify/verification-config.d.ts.map +1 -1
- package/dist/verify/verification-config.js +12 -2
- package/dist/verify/verification-config.js.map +1 -1
- package/dist/verify/verification-default-on.d.ts +27 -11
- package/dist/verify/verification-default-on.d.ts.map +1 -1
- package/dist/verify/verification-default-on.js +159 -29
- package/dist/verify/verification-default-on.js.map +1 -1
- package/dist/verify/verification-deps-default.d.ts.map +1 -1
- package/dist/verify/verification-deps-default.js +49 -42
- package/dist/verify/verification-deps-default.js.map +1 -1
- package/dist/verify/verification-deps.d.ts +69 -4
- package/dist/verify/verification-deps.d.ts.map +1 -1
- package/dist/verify/verification-deterministic.d.ts +15 -2
- package/dist/verify/verification-deterministic.d.ts.map +1 -1
- package/dist/verify/verification-deterministic.js +12 -3
- package/dist/verify/verification-deterministic.js.map +1 -1
- package/dist/verify/verification-diagnostics.d.ts +16 -0
- package/dist/verify/verification-diagnostics.d.ts.map +1 -0
- package/dist/verify/verification-diagnostics.js +219 -0
- package/dist/verify/verification-diagnostics.js.map +1 -0
- package/dist/verify/verification-engine.d.ts +12 -8
- package/dist/verify/verification-engine.d.ts.map +1 -1
- package/dist/verify/verification-engine.js +110 -92
- package/dist/verify/verification-engine.js.map +1 -1
- package/dist/verify/verification-evidence-unavailable-feedback.d.ts +2 -1
- package/dist/verify/verification-evidence-unavailable-feedback.d.ts.map +1 -1
- package/dist/verify/verification-evidence-unavailable-feedback.js +14 -4
- package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
- package/dist/verify/verification-failure-parser.d.ts +37 -3
- package/dist/verify/verification-failure-parser.d.ts.map +1 -1
- package/dist/verify/verification-failure-parser.js +66 -3
- package/dist/verify/verification-failure-parser.js.map +1 -1
- package/dist/verify/verification-feedback.d.ts +21 -34
- package/dist/verify/verification-feedback.d.ts.map +1 -1
- package/dist/verify/verification-feedback.js +37 -88
- package/dist/verify/verification-feedback.js.map +1 -1
- package/dist/verify/verification-gate-stages.d.ts +110 -0
- package/dist/verify/verification-gate-stages.d.ts.map +1 -0
- package/dist/verify/verification-gate-stages.js +179 -0
- package/dist/verify/verification-gate-stages.js.map +1 -0
- package/dist/verify/verification-history-reset.d.ts +61 -0
- package/dist/verify/verification-history-reset.d.ts.map +1 -0
- package/dist/verify/verification-history-reset.js +90 -0
- package/dist/verify/verification-history-reset.js.map +1 -0
- package/dist/verify/verification-manifest.d.ts.map +1 -1
- package/dist/verify/verification-manifest.js +2 -1
- package/dist/verify/verification-manifest.js.map +1 -1
- package/dist/verify/verification-rework-messages.d.ts +19 -0
- package/dist/verify/verification-rework-messages.d.ts.map +1 -0
- package/dist/verify/verification-rework-messages.js +52 -0
- package/dist/verify/verification-rework-messages.js.map +1 -0
- package/dist/worktree/install-inputs.d.ts +89 -0
- package/dist/worktree/install-inputs.d.ts.map +1 -0
- package/dist/worktree/install-inputs.js +625 -0
- package/dist/worktree/install-inputs.js.map +1 -0
- package/dist/worktree/install-script-effects.d.ts +30 -0
- package/dist/worktree/install-script-effects.d.ts.map +1 -0
- package/dist/worktree/install-script-effects.js +524 -0
- package/dist/worktree/install-script-effects.js.map +1 -0
- package/dist/worktree/install-script-tokens.d.ts +57 -0
- package/dist/worktree/install-script-tokens.d.ts.map +1 -0
- package/dist/worktree/install-script-tokens.js +299 -0
- package/dist/worktree/install-script-tokens.js.map +1 -0
- package/dist/worktree/provision.d.ts +27 -4
- package/dist/worktree/provision.d.ts.map +1 -1
- package/dist/worktree/provision.js +46 -7
- package/dist/worktree/provision.js.map +1 -1
- package/dist/worktree/safety.d.ts +11 -0
- package/dist/worktree/safety.d.ts.map +1 -1
- package/dist/worktree/safety.js +20 -3
- package/dist/worktree/safety.js.map +1 -1
- package/dist/worktree/verify-interlock.d.ts.map +1 -1
- package/dist/worktree/verify-interlock.js +3 -1
- package/dist/worktree/verify-interlock.js.map +1 -1
- package/dist/worktree/worktree-package-provisioning.d.ts +75 -0
- package/dist/worktree/worktree-package-provisioning.d.ts.map +1 -0
- package/dist/worktree/worktree-package-provisioning.js +362 -0
- package/dist/worktree/worktree-package-provisioning.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commit-verdict gate of the review exit: the verdict of the gate run judging a
|
|
3
|
+
* verify delivery's commit is read by the route the review exit takes for it.
|
|
4
|
+
*
|
|
5
|
+
* The observed failure (daemon log 2026-09-14 UTC): review exit routed deliveries
|
|
6
|
+
* on review evidence alone, so the gate run judging the same commit finished
|
|
7
|
+
* after its delivery had already left verify -- done 19:07:26 vs verdict
|
|
8
|
+
* 19:10:07, done 19:40:24 vs verdict 19:44:55, verify_failed 20:10:50 vs verdict
|
|
9
|
+
* 20:13:31 -- and its verdict routed nothing.
|
|
10
|
+
*
|
|
11
|
+
* Shape: the same "left in verify" fail-closed gate as the operator / external /
|
|
12
|
+
* shortfall holds, evaluated downstream of the reconciler's target. It only ever
|
|
13
|
+
* WITHHOLDS a route the review evidence already decided -- a verdict alone never
|
|
14
|
+
* moves anything -- and it withholds the two routes differently.
|
|
15
|
+
*
|
|
16
|
+
* DONE, only where the exit would actually write done (a passing report, or a
|
|
17
|
+
* coverage-complete clean review, with no shortfall), needs a PASSING verdict:
|
|
18
|
+
* - no gate configured (verify/commit-gate-configured.ts) -> not held; routing
|
|
19
|
+
* is exactly what it was before this gate;
|
|
20
|
+
* - a passing verdict recorded for the judged commit (the focus worktree HEAD)
|
|
21
|
+
* -> not held;
|
|
22
|
+
* - a FAILED verdict recorded for it -> held, and NOTHING is written: the
|
|
23
|
+
* verification feedback that recorded the failure routes the delivery to
|
|
24
|
+
* verify_failed, and a hold write re-asserting `verify` could land after that
|
|
25
|
+
* route and undo it (no double route, no clobber);
|
|
26
|
+
* - no verdict yet (or the judged commit unreadable) -> held, and the marker
|
|
27
|
+
* (delivery/commit-verdict-hold.ts) records the commit awaited and the review
|
|
28
|
+
* exit it held, which the release pass (completion/commit-verdict-release.ts)
|
|
29
|
+
* replays once the verdict lands.
|
|
30
|
+
*
|
|
31
|
+
* VERIFY_FAILED, for a verify delivery whose work review evidence sent back, waits
|
|
32
|
+
* only for a verdict that is actually coming: re-work toward intent must never
|
|
33
|
+
* strand behind a verdict nothing will render. It is held ONLY while a gate run
|
|
34
|
+
* that may judge the commit is selected or in flight (verify/gate-run-registry.ts)
|
|
35
|
+
* AND no verdict is recorded for the commit yet; the marker then records route
|
|
36
|
+
* verify_failed, and the release pass replays the exit once that run renders its
|
|
37
|
+
* verdict or ends without one. A recorded verdict, no run pending, or no gate
|
|
38
|
+
* configured routes verify_failed exactly as before. The in-flight read comes
|
|
39
|
+
* first, so with no run pending the gate is not even consulted. The live
|
|
40
|
+
* open-work pass (focus/verify-open-issues.ts) applies the same wait
|
|
41
|
+
* (awaitsInFlightGateRun), so it cannot route around a hold one poll later.
|
|
42
|
+
*
|
|
43
|
+
* A verdict is read from the delivery's OWN gate sources only. The per-commit
|
|
44
|
+
* record is read under the gate that governs the delivery (resolveCommitGate: its
|
|
45
|
+
* explicit command + timeout, or the default-on gate), so a sibling's verdict
|
|
46
|
+
* under another gate never governs it, and a delivery whose gate cannot be
|
|
47
|
+
* resolved matches no record. An explicit-method run's outcome is read
|
|
48
|
+
* (readDeliveryGateOutcome) only under the gate the resolution names for it
|
|
49
|
+
* (explicitGateKey), from this process, else from the delivery's gate_state
|
|
50
|
+
* (verify/explicit-gate-outcome.ts), which carries failures, no-SHA outcomes and
|
|
51
|
+
* the commit judged, so a daemon restart still reads it -- and which is removed
|
|
52
|
+
* before a replacement run starts, so a restart while that run is selected or in
|
|
53
|
+
* flight reads no verdict, never the older one. The pass the delivery row
|
|
54
|
+
* records carries no commit and approves nothing on its own: where no record of
|
|
55
|
+
* the run exists, the explicit re-arm scan (verify/explicit-rearm.ts) runs the gate
|
|
56
|
+
* for the judged commit instead. A delivery can carry a per-commit record beside its explicit outcome (a default-on
|
|
57
|
+
* run over its commit where the edge sends no method column, once its terminal
|
|
58
|
+
* explicit row left the pending list). Every source is read, and a FAILED verdict
|
|
59
|
+
* from any wins -- a pass needs no failure from another: each is a gate the work
|
|
60
|
+
* was judged by, and converging past a rendered failure is what this gate exists
|
|
61
|
+
* to prevent. An explicit outcome stands in for the per-commit record its run
|
|
62
|
+
* never writes, so an explicit delivery never waits on one.
|
|
63
|
+
*
|
|
64
|
+
* The route the gate lets through CARRIES what it judged. A verify_failed route
|
|
65
|
+
* for review-filed work stamps the commit the gate resolved for it -- the value
|
|
66
|
+
* holdForCommitVerdict returns, never a second HEAD read -- as the delivery's
|
|
67
|
+
* judged commit, with the verdict read for that commit from the same own-gate
|
|
68
|
+
* sources persisted beside it (reviewReworkGateState). The coding team resumed on
|
|
69
|
+
* that work is then shown that commit's outcome, failing stage and exact sha
|
|
70
|
+
* (spawn/prompt-assembly.ts) -- not whatever HEAD it resumes at, nor a sibling
|
|
71
|
+
* gate's verdict on the same commit. Before this, the route only carried history
|
|
72
|
+
* forward, so a resume after a passing gate plus a gaps_found review carried no
|
|
73
|
+
* gate verdict at all. The live open-work pass, the OTHER verify -> verify_failed
|
|
74
|
+
* writer for review-filed work, stamps the same judgment (openWorkReworkGateState)
|
|
75
|
+
* for the commit its in-flight wait read, over the gate_state as it stands: that
|
|
76
|
+
* route never cleared a verdict or hold, so it still clears none.
|
|
77
|
+
*
|
|
78
|
+
* The seams are optional on ReviewExitDeps like every other hold's: production
|
|
79
|
+
* wires them (review-exit-deps.ts); a partial test deps object omitting
|
|
80
|
+
* both resolveCommitGate and isCommitGateConfigured does not exercise the done
|
|
81
|
+
* gate, and one omitting hasPendingGateRun never waits on the verify_failed route.
|
|
82
|
+
*
|
|
83
|
+
* @module completion/review-exit-verdict-gate
|
|
84
|
+
*/
|
|
85
|
+
import type { updateDeliveryStatus } from '../queries/deliveries.js';
|
|
86
|
+
import { type DeliveryGateState, type GateVerdictSummary, type HeldReviewExit } from '../queries/delivery-gate-state.js';
|
|
87
|
+
import type { CommitGateSeams, CommitGateSubject } from '../verify/commit-gate-configured.js';
|
|
88
|
+
/** The seams the gate reads (a structural slice of ReviewExitDeps). */
|
|
89
|
+
export interface CommitVerdictGateDeps extends Partial<CommitGateSeams> {
|
|
90
|
+
updateDeliveryStatus: typeof updateDeliveryStatus;
|
|
91
|
+
}
|
|
92
|
+
/** The verdict reads, without the status writer. */
|
|
93
|
+
export type GateReads = Pick<CommitVerdictGateDeps, 'isCommitGateConfigured' | 'resolveCommitGate' | 'readCommitVerdict' | 'readDeliveryGateOutcome'>;
|
|
94
|
+
/** The review-exit params the gate reads and records (a structural slice of ReviewExitParams). */
|
|
95
|
+
export interface CommitVerdictGateParams {
|
|
96
|
+
focusId: string;
|
|
97
|
+
productId: string;
|
|
98
|
+
sessionId: string;
|
|
99
|
+
sessionType: 'coding' | 'review';
|
|
100
|
+
succeeded: boolean;
|
|
101
|
+
reviewSpawnTip?: string | null;
|
|
102
|
+
currentBranchTip?: string | null;
|
|
103
|
+
reviewInspected?: boolean;
|
|
104
|
+
reviewPriorWatermark?: string | null;
|
|
105
|
+
}
|
|
106
|
+
/** The review-exit routes the gate withholds. */
|
|
107
|
+
export type VerdictGatedRoute = 'done' | 'verify_failed';
|
|
108
|
+
/** What the gate knows about a commit: no gate configured, or the verdict recorded for it (pending = none yet). */
|
|
109
|
+
export type GateVerdictState = 'unconfigured' | 'passed' | 'failed' | 'pending';
|
|
110
|
+
/**
|
|
111
|
+
* Read the gate's state for one delivery at one judged commit from its own-gate
|
|
112
|
+
* sources (readOwnGateVerdict): unconfigured when no gate is configured (or no
|
|
113
|
+
* gate seam is wired), else the verdict, else pending. A resolution that throws
|
|
114
|
+
* holds (fail closed), and a null sha matches no per-commit record (a verdict
|
|
115
|
+
* cannot be matched to a commit nobody could name).
|
|
116
|
+
*/
|
|
117
|
+
export declare function readGateVerdictState(deps: GateReads, subject: CommitGateSubject, sha: string | null): Promise<GateVerdictState>;
|
|
118
|
+
/**
|
|
119
|
+
* Whether a verify_failed route must wait for a gate run: one that may judge
|
|
120
|
+
* `sha` is selected or in flight on the subject's focus, and the gate configured
|
|
121
|
+
* for the delivery has no verdict for that commit yet. The in-flight read comes
|
|
122
|
+
* first and is in memory; with no run pending the gate is never consulted.
|
|
123
|
+
*/
|
|
124
|
+
export declare function awaitsInFlightGateRun(deps: GateReads & Pick<CommitVerdictGateDeps, 'hasPendingGateRun'>, subject: CommitGateSubject, sha: string | null): Promise<boolean>;
|
|
125
|
+
/** The routing inputs of a review exit a later replay needs, JSON-safe (absent stays absent). */
|
|
126
|
+
export declare function heldReviewExitFrom(params: CommitVerdictGateParams): HeldReviewExit;
|
|
127
|
+
/** The commit a focus's deliveries are judged on, or null when it cannot be read. Never throws. */
|
|
128
|
+
export declare function readJudgedCommit(deps: Pick<CommitVerdictGateDeps, 'resolveJudgedCommit'>, focusId: string): string | null;
|
|
129
|
+
/** The commit a review exit judges: the focus worktree HEAD, else the exit's own branch-tip read. Never throws. */
|
|
130
|
+
export declare function reviewJudgedCommit(deps: Pick<CommitVerdictGateDeps, 'resolveJudgedCommit'>, params: Pick<CommitVerdictGateParams, 'focusId' | 'currentBranchTip'>): string | null;
|
|
131
|
+
/** What the gate decided for one route: whether it held, and the commit it judged (undefined where it resolved none). */
|
|
132
|
+
export interface CommitVerdictGateDecision {
|
|
133
|
+
held: boolean;
|
|
134
|
+
judgedSha?: string | null;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Whether the review exit must leave this delivery in verify instead of taking
|
|
138
|
+
* `route` (see the module header), and the commit the gate judged it on. Call for
|
|
139
|
+
* `done` ONLY where the exit would otherwise write done, and for `verify_failed`
|
|
140
|
+
* only for a delivery currently in verify. Writes the hold marker when it holds
|
|
141
|
+
* on a verdict still to come; writes nothing when done is held on a failed verdict.
|
|
142
|
+
*/
|
|
143
|
+
export declare function holdForCommitVerdict(deps: CommitVerdictGateDeps, params: CommitVerdictGateParams, focus: {
|
|
144
|
+
read_only?: boolean | null;
|
|
145
|
+
}, delivery: {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
injectionId?: string | null;
|
|
149
|
+
gateState?: unknown;
|
|
150
|
+
}, route?: VerdictGatedRoute): Promise<CommitVerdictGateDecision>;
|
|
151
|
+
/**
|
|
152
|
+
* The verdict for exactly `sha` from the same own-gate sources the gate reads
|
|
153
|
+
* (readOwnGateVerdict): the per-commit record's summary (with its failing stage)
|
|
154
|
+
* where the record is the deciding verdict, else the outcome alone. The gate is
|
|
155
|
+
* resolved without asking configured-ness -- a bare predicate carries no gate, and
|
|
156
|
+
* a resolution that cannot be read matches no record. Null when no source has one.
|
|
157
|
+
* Also the resume's read for a judged-commit stamp that persisted no verdict
|
|
158
|
+
* (spawn/prompt-assembly.ts), so that read is never gate-less either.
|
|
159
|
+
*/
|
|
160
|
+
export declare function ownGateVerdictFor(deps: GateReads, subject: CommitGateSubject, sha: string): Promise<GateVerdictSummary | null>;
|
|
161
|
+
/** The verdict reads a re-work stamp takes, and the judged-commit read for a route the gate did not see. */
|
|
162
|
+
type ReworkReads = GateReads & Pick<CommitVerdictGateDeps, 'resolveJudgedCommit'>;
|
|
163
|
+
/**
|
|
164
|
+
* The gate_state a review exit's verify_failed route writes (see the module
|
|
165
|
+
* header). The verdict is cleared, since the delivery is routing, and the
|
|
166
|
+
* verification history carries forward with its judged commit REPLACED by the
|
|
167
|
+
* commit this review exit judged, the delivery's own-gate verdict for it persisted
|
|
168
|
+
* beside it. `judgedSha` is the commit the gate resolved for the route
|
|
169
|
+
* (CommitVerdictGateDecision); only a route the gate did not see (a re-opened
|
|
170
|
+
* done delivery) resolves it here. A malformed or unreadable commit stamps
|
|
171
|
+
* nothing. Null when nothing is left to carry.
|
|
172
|
+
*/
|
|
173
|
+
export declare function reviewReworkGateState(deps: ReworkReads, params: Pick<CommitVerdictGateParams, 'productId' | 'focusId' | 'currentBranchTip'>, focus: {
|
|
174
|
+
read_only?: boolean | null;
|
|
175
|
+
}, delivery: {
|
|
176
|
+
id: string;
|
|
177
|
+
injectionId?: string | null;
|
|
178
|
+
gateState?: unknown;
|
|
179
|
+
}, judgedSha?: string | null, now?: () => string): Promise<DeliveryGateState | null>;
|
|
180
|
+
/**
|
|
181
|
+
* The gate_state the live open-work pass's verify_failed route writes
|
|
182
|
+
* (focus/verify-open-issues.ts): the same judged commit and own-gate verdict
|
|
183
|
+
* reviewReworkGateState stamps (reworkJudgment), over the delivery's gate_state
|
|
184
|
+
* AS IT STANDS. That route never cleared a verdict or a hold, so every other key
|
|
185
|
+
* is left exactly as it was and the verification history carries forward; only
|
|
186
|
+
* its judged commit is replaced. `judgedSha` is the commit the pass's in-flight
|
|
187
|
+
* wait read (the focus worktree HEAD; null when unreadable, which stamps nothing
|
|
188
|
+
* and removes an older judgment). Undefined -- leave gate_state unchanged -- when
|
|
189
|
+
* there is neither a commit to stamp nor an older judgment to remove; null when
|
|
190
|
+
* the removal leaves an empty clear.
|
|
191
|
+
*/
|
|
192
|
+
export declare function openWorkReworkGateState(deps: ReworkReads, params: Pick<CommitVerdictGateParams, 'productId' | 'focusId'>, focus: {
|
|
193
|
+
read_only?: boolean | null;
|
|
194
|
+
}, delivery: {
|
|
195
|
+
id: string;
|
|
196
|
+
injectionId?: string | null;
|
|
197
|
+
gateState?: unknown;
|
|
198
|
+
}, judgedSha: string | null, now?: () => string): Promise<DeliveryGateState | null | undefined>;
|
|
199
|
+
/** The review-exit tail line for an exit that held a delivery on its gate verdict. */
|
|
200
|
+
export declare function logCommitVerdictHeldExit(focusName: string): void;
|
|
201
|
+
export {};
|
|
202
|
+
//# sourceMappingURL=review-exit-verdict-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-exit-verdict-gate.d.ts","sourceRoot":"","sources":["../../src/completion/review-exit-verdict-gate.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAwB,eAAe,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AASpH,uEAAuE;AACvE,MAAM,WAAW,qBAAsB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACrE,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;CACnD;AAED,oDAAoD;AACpD,MAAM,MAAM,SAAS,GAAE,IAAI,CAAC,qBAAqB,EAAE,wBAAwB,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,yBAAyB,CAAC,CAAC;AAErJ,kGAAkG;AAClG,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAA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,uBAAuB,CAC3C,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,SAAS,CAAC,EAC9D,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,EACrC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,EAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,GAAG,GAAE,MAAM,MAAuC,GACjD,OAAO,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAW/C;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAKhE"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/completion/review-exit-verdict-gate.test.ts,
|
|
3
|
+
// packages/daemon/src/verify/verification-commit-sharing.test.ts
|
|
4
|
+
// PINNED-BY-END
|
|
5
|
+
import { carryVerificationHistory, readVerificationHistory, stampJudgedCommit, } from '../queries/delivery-gate-state.js';
|
|
6
|
+
import { gateVerdictFromCommitVerdict, judgedShaOfRun } from '../verify/gate-verdict-source.js';
|
|
7
|
+
import { describeCommitVerdictHold, writeCommitVerdictHoldGateState } from '../delivery/commit-verdict-hold.js';
|
|
8
|
+
import { createLogger } from '../shell/log.js';
|
|
9
|
+
const log = createLogger({ module: 'focus-executor' });
|
|
10
|
+
/** No gate to read a per-commit record under, and nothing configured. */
|
|
11
|
+
const NO_GATE = { configured: false, gate: null };
|
|
12
|
+
/**
|
|
13
|
+
* The resolution the gate reads take: a bare isCommitGateConfigured predicate,
|
|
14
|
+
* when supplied (a partial deps object; production wires resolveCommitGate only),
|
|
15
|
+
* answers configured-ness alone with no gate and wins over a resolver beside it --
|
|
16
|
+
* so an override is never silently shadowed by spread production seams. Null when
|
|
17
|
+
* neither seam is wired. A resolution that throws reads as configured with no gate
|
|
18
|
+
* (fail closed).
|
|
19
|
+
*/
|
|
20
|
+
async function resolveGateReads(deps, subject) {
|
|
21
|
+
const { isCommitGateConfigured } = deps;
|
|
22
|
+
const resolveGate = isCommitGateConfigured
|
|
23
|
+
? async (s) => ({ configured: await isCommitGateConfigured(s), gate: null })
|
|
24
|
+
: deps.resolveCommitGate;
|
|
25
|
+
if (!resolveGate)
|
|
26
|
+
return null;
|
|
27
|
+
try {
|
|
28
|
+
return await resolveGate(subject);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
log.warn(`[focus-executor] commit-gate predicate failed for delivery ${subject.deliveryId} -- holding (fail-closed): ${err.message}`);
|
|
32
|
+
return { configured: true, gate: null };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read every own-gate source for one delivery at one commit (see the module
|
|
37
|
+
* header): the per-commit record under `resolution.gate`, and the outcome its
|
|
38
|
+
* explicit-method run recorded for that commit -- failed when either failed, else
|
|
39
|
+
* passed when either passed, else null. A null sha matches no per-commit record,
|
|
40
|
+
* only an explicit outcome that judged no commit.
|
|
41
|
+
*/
|
|
42
|
+
function readOwnGateVerdict(deps, subject, sha, resolution) {
|
|
43
|
+
const record = sha && deps.readCommitVerdict ? deps.readCommitVerdict(subject.productId, subject.focusId, sha, resolution.gate) : null;
|
|
44
|
+
const explicit = deps.readDeliveryGateOutcome?.(subject.deliveryId, sha, subject.gateState, resolution.explicitGateKey) ?? null;
|
|
45
|
+
const outcomes = [record?.outcome ?? null, explicit];
|
|
46
|
+
const outcome = outcomes.includes('failed') ? 'failed' : outcomes.find((o) => o !== null) ?? null;
|
|
47
|
+
return outcome ? { outcome, record } : null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Read the gate's state for one delivery at one judged commit from its own-gate
|
|
51
|
+
* sources (readOwnGateVerdict): unconfigured when no gate is configured (or no
|
|
52
|
+
* gate seam is wired), else the verdict, else pending. A resolution that throws
|
|
53
|
+
* holds (fail closed), and a null sha matches no per-commit record (a verdict
|
|
54
|
+
* cannot be matched to a commit nobody could name).
|
|
55
|
+
*/
|
|
56
|
+
export async function readGateVerdictState(deps, subject, sha) {
|
|
57
|
+
const resolution = await resolveGateReads(deps, subject);
|
|
58
|
+
if (!resolution?.configured)
|
|
59
|
+
return 'unconfigured';
|
|
60
|
+
return readOwnGateVerdict(deps, subject, sha, resolution)?.outcome ?? 'pending';
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Whether a verify_failed route must wait for a gate run: one that may judge
|
|
64
|
+
* `sha` is selected or in flight on the subject's focus, and the gate configured
|
|
65
|
+
* for the delivery has no verdict for that commit yet. The in-flight read comes
|
|
66
|
+
* first and is in memory; with no run pending the gate is never consulted.
|
|
67
|
+
*/
|
|
68
|
+
export async function awaitsInFlightGateRun(deps, subject, sha) {
|
|
69
|
+
if (!deps.hasPendingGateRun?.(subject.focusId, sha))
|
|
70
|
+
return false;
|
|
71
|
+
return (await readGateVerdictState(deps, subject, sha)) === 'pending';
|
|
72
|
+
}
|
|
73
|
+
/** The routing inputs of a review exit a later replay needs, JSON-safe (absent stays absent). */
|
|
74
|
+
export function heldReviewExitFrom(params) {
|
|
75
|
+
return {
|
|
76
|
+
sessionId: params.sessionId,
|
|
77
|
+
sessionType: params.sessionType,
|
|
78
|
+
succeeded: params.succeeded,
|
|
79
|
+
reviewSpawnTip: params.reviewSpawnTip ?? null,
|
|
80
|
+
currentBranchTip: params.currentBranchTip ?? null,
|
|
81
|
+
...(params.reviewInspected !== undefined ? { reviewInspected: params.reviewInspected } : {}),
|
|
82
|
+
...(params.reviewPriorWatermark !== undefined ? { reviewPriorWatermark: params.reviewPriorWatermark } : {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** The commit a focus's deliveries are judged on, or null when it cannot be read. Never throws. */
|
|
86
|
+
export function readJudgedCommit(deps, focusId) {
|
|
87
|
+
try {
|
|
88
|
+
return deps.resolveJudgedCommit?.(focusId) ?? null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The commit a review exit judges: the focus worktree HEAD, else the exit's own branch-tip read. Never throws. */
|
|
95
|
+
export function reviewJudgedCommit(deps, params) {
|
|
96
|
+
return readJudgedCommit(deps, params.focusId) ?? params.currentBranchTip ?? null;
|
|
97
|
+
}
|
|
98
|
+
/** Write the hold marker for a held route and log it. */
|
|
99
|
+
async function recordHold(deps, params, delivery, sha, route) {
|
|
100
|
+
const hold = { sha, heldAt: new Date().toISOString(), route, review: heldReviewExitFrom(params) };
|
|
101
|
+
await writeCommitVerdictHoldGateState(deps, delivery.id, hold, delivery.gateState);
|
|
102
|
+
const when = route === 'verify_failed' ? 'when that run renders its verdict or ends without one' : 'when the verdict lands';
|
|
103
|
+
log.info(`[focus-executor] Delivery "${delivery.name}" NOT moved to ${route} -- ${describeCommitVerdictHold(hold)}. ` +
|
|
104
|
+
`Left in verify; the release pass routes it ${when}.`);
|
|
105
|
+
}
|
|
106
|
+
/** The delivery a review exit asks the gate about. */
|
|
107
|
+
function gateSubject(params, focus, delivery) {
|
|
108
|
+
return {
|
|
109
|
+
productId: params.productId,
|
|
110
|
+
focusId: params.focusId,
|
|
111
|
+
focusReadOnly: focus.read_only === true,
|
|
112
|
+
deliveryId: delivery.id,
|
|
113
|
+
injectionId: delivery.injectionId ?? null,
|
|
114
|
+
gateState: delivery.gateState,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Whether the review exit must leave this delivery in verify instead of taking
|
|
119
|
+
* `route` (see the module header), and the commit the gate judged it on. Call for
|
|
120
|
+
* `done` ONLY where the exit would otherwise write done, and for `verify_failed`
|
|
121
|
+
* only for a delivery currently in verify. Writes the hold marker when it holds
|
|
122
|
+
* on a verdict still to come; writes nothing when done is held on a failed verdict.
|
|
123
|
+
*/
|
|
124
|
+
export async function holdForCommitVerdict(deps, params, focus, delivery, route = 'done') {
|
|
125
|
+
if (route === 'done' && !deps.isCommitGateConfigured && !deps.resolveCommitGate)
|
|
126
|
+
return { held: false };
|
|
127
|
+
const sha = reviewJudgedCommit(deps, params);
|
|
128
|
+
const subject = gateSubject(params, focus, delivery);
|
|
129
|
+
if (route === 'verify_failed') {
|
|
130
|
+
if (!(await awaitsInFlightGateRun(deps, subject, sha)))
|
|
131
|
+
return { held: false, judgedSha: sha };
|
|
132
|
+
await recordHold(deps, params, delivery, sha, route);
|
|
133
|
+
return { held: true, judgedSha: sha };
|
|
134
|
+
}
|
|
135
|
+
const state = await readGateVerdictState(deps, subject, sha);
|
|
136
|
+
if (state === 'unconfigured' || state === 'passed')
|
|
137
|
+
return { held: false, judgedSha: sha };
|
|
138
|
+
if (state === 'failed') {
|
|
139
|
+
log.info(`[focus-executor] Delivery "${delivery.name}" NOT moved to done -- the gate FAILED on ${(sha ?? '').slice(0, 12)}; ` +
|
|
140
|
+
`verification feedback routes it to verify_failed (no hold written).`);
|
|
141
|
+
return { held: true, judgedSha: sha };
|
|
142
|
+
}
|
|
143
|
+
await recordHold(deps, params, delivery, sha, route);
|
|
144
|
+
return { held: true, judgedSha: sha };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The verdict for exactly `sha` from the same own-gate sources the gate reads
|
|
148
|
+
* (readOwnGateVerdict): the per-commit record's summary (with its failing stage)
|
|
149
|
+
* where the record is the deciding verdict, else the outcome alone. The gate is
|
|
150
|
+
* resolved without asking configured-ness -- a bare predicate carries no gate, and
|
|
151
|
+
* a resolution that cannot be read matches no record. Null when no source has one.
|
|
152
|
+
* Also the resume's read for a judged-commit stamp that persisted no verdict
|
|
153
|
+
* (spawn/prompt-assembly.ts), so that read is never gate-less either.
|
|
154
|
+
*/
|
|
155
|
+
export async function ownGateVerdictFor(deps, subject, sha) {
|
|
156
|
+
let resolution = NO_GATE;
|
|
157
|
+
if (!deps.isCommitGateConfigured && deps.resolveCommitGate) {
|
|
158
|
+
try {
|
|
159
|
+
resolution = await deps.resolveCommitGate(subject);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
// Unresolvable: no gate, so no per-commit record; the explicit outcome is still read.
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const verdict = readOwnGateVerdict(deps, subject, sha, resolution);
|
|
166
|
+
if (!verdict)
|
|
167
|
+
return null;
|
|
168
|
+
return verdict.record && verdict.record.outcome === verdict.outcome
|
|
169
|
+
? gateVerdictFromCommitVerdict(verdict.record)
|
|
170
|
+
: { outcome: verdict.outcome, sha };
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* What a review-filed re-work route stamps: the commit it judged (`judgedSha`,
|
|
174
|
+
* else resolved as the review exit resolves it; malformed or unreadable is null)
|
|
175
|
+
* and the delivery's own-gate verdict for exactly that commit (ownGateVerdictFor).
|
|
176
|
+
*/
|
|
177
|
+
async function reworkJudgment(deps, params, focus, delivery, judgedSha) {
|
|
178
|
+
const resolved = judgedSha === undefined ? reviewJudgedCommit(deps, params) : judgedSha;
|
|
179
|
+
const sha = judgedShaOfRun({ verifiedSha: resolved ?? undefined });
|
|
180
|
+
return { sha, verdict: sha ? await ownGateVerdictFor(deps, gateSubject(params, focus, delivery), sha) : null };
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The gate_state a review exit's verify_failed route writes (see the module
|
|
184
|
+
* header). The verdict is cleared, since the delivery is routing, and the
|
|
185
|
+
* verification history carries forward with its judged commit REPLACED by the
|
|
186
|
+
* commit this review exit judged, the delivery's own-gate verdict for it persisted
|
|
187
|
+
* beside it. `judgedSha` is the commit the gate resolved for the route
|
|
188
|
+
* (CommitVerdictGateDecision); only a route the gate did not see (a re-opened
|
|
189
|
+
* done delivery) resolves it here. A malformed or unreadable commit stamps
|
|
190
|
+
* nothing. Null when nothing is left to carry.
|
|
191
|
+
*/
|
|
192
|
+
export async function reviewReworkGateState(deps, params, focus, delivery, judgedSha, now = () => new Date().toISOString()) {
|
|
193
|
+
const { sha, verdict } = await reworkJudgment(deps, params, focus, delivery, judgedSha);
|
|
194
|
+
const judgedAt = now();
|
|
195
|
+
const carried = carryVerificationHistory(delivery.gateState) ?? { blocking: [], warnings: [], evaluatedAt: judgedAt };
|
|
196
|
+
return carryVerificationHistory(stampJudgedCommit(carried, sha, judgedAt, verdict));
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The gate_state the live open-work pass's verify_failed route writes
|
|
200
|
+
* (focus/verify-open-issues.ts): the same judged commit and own-gate verdict
|
|
201
|
+
* reviewReworkGateState stamps (reworkJudgment), over the delivery's gate_state
|
|
202
|
+
* AS IT STANDS. That route never cleared a verdict or a hold, so every other key
|
|
203
|
+
* is left exactly as it was and the verification history carries forward; only
|
|
204
|
+
* its judged commit is replaced. `judgedSha` is the commit the pass's in-flight
|
|
205
|
+
* wait read (the focus worktree HEAD; null when unreadable, which stamps nothing
|
|
206
|
+
* and removes an older judgment). Undefined -- leave gate_state unchanged -- when
|
|
207
|
+
* there is neither a commit to stamp nor an older judgment to remove; null when
|
|
208
|
+
* the removal leaves an empty clear.
|
|
209
|
+
*/
|
|
210
|
+
export async function openWorkReworkGateState(deps, params, focus, delivery, judgedSha, now = () => new Date().toISOString()) {
|
|
211
|
+
const { sha, verdict } = await reworkJudgment(deps, { ...params, currentBranchTip: null }, focus, delivery, judgedSha);
|
|
212
|
+
const prior = delivery.gateState !== null && typeof delivery.gateState === 'object' && !Array.isArray(delivery.gateState)
|
|
213
|
+
? delivery.gateState
|
|
214
|
+
: null;
|
|
215
|
+
if (!sha && !readVerificationHistory(prior).judgedCommit)
|
|
216
|
+
return undefined;
|
|
217
|
+
const judgedAt = now();
|
|
218
|
+
const stamped = stampJudgedCommit(prior ?? { blocking: [], warnings: [], evaluatedAt: judgedAt }, sha, judgedAt, verdict);
|
|
219
|
+
const emptyClear = Object.keys(stamped).every((k) => k === 'blocking' || k === 'warnings' || k === 'evaluatedAt')
|
|
220
|
+
&& (stamped.blocking?.length ?? 0) === 0 && (stamped.warnings?.length ?? 0) === 0;
|
|
221
|
+
return emptyClear ? null : stamped;
|
|
222
|
+
}
|
|
223
|
+
/** The review-exit tail line for an exit that held a delivery on its gate verdict. */
|
|
224
|
+
export function logCommitVerdictHeldExit(focusName) {
|
|
225
|
+
log.info(`[focus-executor] "${focusName}" review exit held: a verify delivery awaits the gate verdict for the commit it ` +
|
|
226
|
+
`judges. review_requested_at left set; the release pass routes it when the verdict lands (re-work: or when the run ends).`);
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=review-exit-verdict-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-exit-verdict-gate.js","sourceRoot":"","sources":["../../src/completion/review-exit-verdict-gate.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8EAA8E;AAC9E,mEAAmE;AACnE,gBAAgB;AAwFhB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,GAKlB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;AA6BvD,yEAAyE;AACzE,MAAM,OAAO,GAAyB,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAExE;;;;;;;GAOG;AACH,KAAK,UAAU,gBAAgB,CAAC,IAAe,EAAE,OAA0B;IACzE,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAI,C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,aAAa,CAAC;WAC5G,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IACpF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AACrC,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,wBAAwB,CAAC,SAAiB;IACxD,GAAG,CAAC,IAAI,CACN,qBAAqB,SAAS,kFAAkF;QAChH,0HAA0H,CAC3H,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PipelineConfig } from '../types/index.js';
|
|
2
|
+
import type { FocusExecutionPhase } from '../focus/focus-phase.js';
|
|
3
|
+
/** The delivery slice the review-next-step question reads (structural). */
|
|
4
|
+
export interface ReviewNextStepDelivery {
|
|
5
|
+
id: string;
|
|
6
|
+
executionStatus?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** The issue slice the review-next-step question reads (structural). */
|
|
9
|
+
export interface ReviewNextStepIssue {
|
|
10
|
+
deliveryId: string;
|
|
11
|
+
status: string;
|
|
12
|
+
issueType: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The complete review-next-step decision.
|
|
16
|
+
* - not_converged -- the focus is not in phase 'verifying' (nothing active,
|
|
17
|
+
* at least one verify): no review window opens here.
|
|
18
|
+
* - review_disabled -- converged, but pipeline_config.review.enabled === false:
|
|
19
|
+
* the verify deliveries reach done with no verdict.
|
|
20
|
+
* - open_work -- converged and review-enabled, but a verify delivery
|
|
21
|
+
* carries an open Task/Bug (To Do / In Progress /
|
|
22
|
+
* Blocked): a coding pass, not a review, is next.
|
|
23
|
+
* - issues_unreadable -- converged and review-enabled, but the issue read
|
|
24
|
+
* failed: the decision is unknown; each site fails open
|
|
25
|
+
* to its own pre-decision behaviour.
|
|
26
|
+
* - review -- converged, review-enabled, no open work: a review pass
|
|
27
|
+
* is the next actionable step.
|
|
28
|
+
* The issue list is read ONLY past the convergence + enablement checks, so an
|
|
29
|
+
* unconverged or review-disabled focus costs no issue fetch.
|
|
30
|
+
*/
|
|
31
|
+
export type ReviewNextStep<D extends ReviewNextStepDelivery> = {
|
|
32
|
+
step: 'not_converged';
|
|
33
|
+
} | {
|
|
34
|
+
step: 'review_disabled';
|
|
35
|
+
verifyDeliveries: D[];
|
|
36
|
+
} | {
|
|
37
|
+
step: 'open_work';
|
|
38
|
+
verifyDeliveries: D[];
|
|
39
|
+
openIssueCount: number;
|
|
40
|
+
} | {
|
|
41
|
+
step: 'issues_unreadable';
|
|
42
|
+
verifyDeliveries: D[];
|
|
43
|
+
error: Error;
|
|
44
|
+
} | {
|
|
45
|
+
step: 'review';
|
|
46
|
+
verifyDeliveries: D[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the review-next-step decision for a focus.
|
|
50
|
+
*
|
|
51
|
+
* `phase` is the caller's derived focus execution phase. The pending-spawn gate
|
|
52
|
+
* derives it with review_requested_at deliberately null (state, not stamp); the
|
|
53
|
+
* cascade passes the phase it already derived, whose only difference is that an
|
|
54
|
+
* already-stamped window reads 'reviewing' (not_converged: the window is open).
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveReviewNextStep<D extends ReviewNextStepDelivery>(input: {
|
|
57
|
+
phase: FocusExecutionPhase;
|
|
58
|
+
deliveries: readonly D[];
|
|
59
|
+
pipelineConfig: PipelineConfig | null | undefined;
|
|
60
|
+
readIssues: () => Promise<readonly ReviewNextStepIssue[]>;
|
|
61
|
+
}): Promise<ReviewNextStep<D>>;
|
|
62
|
+
//# sourceMappingURL=review-next-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-next-step.d.ts","sourceRoot":"","sources":["../../src/completion/review-next-step.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,m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|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/completion/review-next-step.test.ts
|
|
3
|
+
// PINNED-BY-END
|
|
4
|
+
/**
|
|
5
|
+
* "Is the next actionable step on this focus a review pass?" -- keyed on delivery
|
|
6
|
+
* and issue STATE, never on review_requested_at.
|
|
7
|
+
*
|
|
8
|
+
* Two sites ask the same question and must not drift:
|
|
9
|
+
* - the state cascade (completion/state-cascade.ts checkAutoReview), which OPENS
|
|
10
|
+
* the review window when the focus converges on verify; and
|
|
11
|
+
* - the pending-spawn pass (focus/pending-spawn-review-next-step.ts), which must
|
|
12
|
+
* not spawn a CODING lead into that same state -- a coding lead there has no
|
|
13
|
+
* work, holds the focus's single team slot, and deadlocks the review.
|
|
14
|
+
*
|
|
15
|
+
* Why state and not the stamp: on 2026-09-15 a queued coding directive was
|
|
16
|
+
* consumed at 03:08:29 while every delivery was already in verify with all issues
|
|
17
|
+
* Done; the cascade stamped review_requested_at at 03:08:30. The spawn decision
|
|
18
|
+
* ran BEFORE the stamp, so a check keyed on review_requested_at would have passed.
|
|
19
|
+
* The delivery aggregate that makes the cascade stamp the window was already true.
|
|
20
|
+
*
|
|
21
|
+
* Both sites consume ONE complete decision, resolveReviewNextStep: convergence on
|
|
22
|
+
* verify, review enablement, AND the open-work issue matrix. Before, the cascade
|
|
23
|
+
* consumed only the convergence half, so a verify delivery with a freshly opened
|
|
24
|
+
* Bug made the spawn gate say "coding is next" while the cascade still opened a
|
|
25
|
+
* review window. Each site maps the outcome onto its own action (and its own
|
|
26
|
+
* fail-open reading of an unreadable issue list); the decision itself is here.
|
|
27
|
+
*/
|
|
28
|
+
import { DELIVERY_STATUS } from '@telora/daemon-core';
|
|
29
|
+
import { isReviewEnabled } from '../workflow/pipeline-config.js';
|
|
30
|
+
import { CONTEXT_GROUP_TYPE, OPEN_ISSUE_STATUSES } from '../shell/constants.js';
|
|
31
|
+
/** Open work issues (Task/Bug in To Do / In Progress / Blocked) sitting on the given deliveries. */
|
|
32
|
+
function countOpenWorkIssues(verifyIds, issues) {
|
|
33
|
+
return issues.filter((i) => verifyIds.has(i.deliveryId) && i.issueType !== CONTEXT_GROUP_TYPE && OPEN_ISSUE_STATUSES.has(i.status)).length;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the review-next-step decision for a focus.
|
|
37
|
+
*
|
|
38
|
+
* `phase` is the caller's derived focus execution phase. The pending-spawn gate
|
|
39
|
+
* derives it with review_requested_at deliberately null (state, not stamp); the
|
|
40
|
+
* cascade passes the phase it already derived, whose only difference is that an
|
|
41
|
+
* already-stamped window reads 'reviewing' (not_converged: the window is open).
|
|
42
|
+
*/
|
|
43
|
+
export async function resolveReviewNextStep(input) {
|
|
44
|
+
if (input.phase !== 'verifying')
|
|
45
|
+
return { step: 'not_converged' };
|
|
46
|
+
const verifyDeliveries = input.deliveries.filter((d) => d.executionStatus === DELIVERY_STATUS.VERIFY);
|
|
47
|
+
if (verifyDeliveries.length === 0)
|
|
48
|
+
return { step: 'not_converged' };
|
|
49
|
+
if (!isReviewEnabled(input.pipelineConfig))
|
|
50
|
+
return { step: 'review_disabled', verifyDeliveries };
|
|
51
|
+
let issues;
|
|
52
|
+
try {
|
|
53
|
+
issues = await input.readIssues();
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
return { step: 'issues_unreadable', verifyDeliveries, error: err instanceof Error ? err : new Error(String(err)) };
|
|
57
|
+
}
|
|
58
|
+
const openIssueCount = countOpenWorkIssues(new Set(verifyDeliveries.map((d) => d.id)), issues);
|
|
59
|
+
if (openIssueCount > 0)
|
|
60
|
+
return { step: 'open_work', verifyDeliveries, openIssueCount };
|
|
61
|
+
return { step: 'review', verifyDeliveries };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=review-next-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-next-step.js","sourceRoot":"","s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C,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IACrH,CAAC;IACD,MAAM,cAAc,GAAG,mBAAmB,CAAC,IAAI,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/F,IAAI,cAAc,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACvF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CreateEscalationParams } from '../queries/escalations.js';
|
|
2
|
+
import { type ExpiredSessionHold, type SessionHoldSweepDeps } from './session-hold.js';
|
|
3
|
+
/** metadata.cause stamped on a session-hold expiry escalation. */
|
|
4
|
+
export declare const SESSION_HOLD_EXPIRED_CAUSE = "session_hold_expired";
|
|
5
|
+
/**
|
|
6
|
+
* File the ONE escalation a hold expiry owes: a still-active kept team, or a
|
|
7
|
+
* teardown that could not signal the lead and ended in a forced registration
|
|
8
|
+
* reap. Both are agent work (read the log / check for an orphan process) -- no
|
|
9
|
+
* human act -- so the filing chokepoint sends them to the machine lane as
|
|
10
|
+
* observations.
|
|
11
|
+
*/
|
|
12
|
+
export declare function fileSessionHoldExpiryEscalation(expired: ExpiredSessionHold, deps?: {
|
|
13
|
+
createEscalation: (params: CreateEscalationParams) => Promise<unknown>;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/** The production sweep deps; tests override individual collaborators. */
|
|
16
|
+
export declare function buildSessionHoldSweepDeps(overrides?: Partial<SessionHoldSweepDeps>): SessionHoldSweepDeps;
|
|
17
|
+
//# sourceMappingURL=session-hold-sweep-deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-hold-sweep-deps.d.ts","sourceRoot":"","sources":["../../src/completion/session-hold-sweep-deps.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA+C,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGrH,OAAO,EAAsC,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE3H,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAoCjE;;;;;;GAMG;AACH,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,kBAAkB,EAC3B,IAAI,GAAE;IAAE,gBAAgB,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAAkD,GAC/H,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,0EAA0E;AAC1E,wBAAgB,yBAAyB,CAAC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAAG,oBAAoB,CAc7G"}
|