@telora/daemon 0.22.132 → 0.22.136
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 +6 -3
- package/dist/audit/audit-hooks.d.ts +6 -2
- package/dist/audit/audit-hooks.d.ts.map +1 -1
- package/dist/audit/audit-hooks.js +12 -5
- package/dist/audit/audit-hooks.js.map +1 -1
- package/dist/audit/audit-phase.js +1 -1
- package/dist/audit/audit-phase.js.map +1 -1
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +1 -0
- package/dist/backends/index.js.map +1 -1
- package/dist/completion/completion-phase-registry.d.ts +4 -0
- package/dist/completion/completion-phase-registry.d.ts.map +1 -1
- package/dist/completion/completion-phase-registry.js +63 -18
- package/dist/completion/completion-phase-registry.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/review-approved-head-gate.d.ts +53 -0
- package/dist/completion/review-approved-head-gate.d.ts.map +1 -0
- package/dist/completion/review-approved-head-gate.js +124 -0
- package/dist/completion/review-approved-head-gate.js.map +1 -0
- package/dist/completion/review-census-record.d.ts +52 -0
- package/dist/completion/review-census-record.d.ts.map +1 -0
- package/dist/completion/review-census-record.js +145 -0
- package/dist/completion/review-census-record.js.map +1 -0
- package/dist/completion/review-exit-deps.d.ts +5 -1
- package/dist/completion/review-exit-deps.d.ts.map +1 -1
- package/dist/completion/review-exit-deps.js +7 -2
- package/dist/completion/review-exit-deps.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +29 -16
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/review-exit-progress.d.ts +8 -0
- package/dist/completion/review-exit-progress.d.ts.map +1 -1
- package/dist/completion/review-exit-progress.js +14 -0
- package/dist/completion/review-exit-progress.js.map +1 -1
- package/dist/completion/review-exit-shortfall-park.d.ts +14 -0
- package/dist/completion/review-exit-shortfall-park.d.ts.map +1 -0
- package/dist/completion/review-exit-shortfall-park.js +52 -0
- package/dist/completion/review-exit-shortfall-park.js.map +1 -0
- package/dist/completion/review-exit-shortfall.js +1 -1
- package/dist/completion/review-exit-shortfall.js.map +1 -1
- package/dist/completion/review-exit-verdict-gate.d.ts +58 -0
- package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
- package/dist/completion/review-exit-verdict-gate.js +68 -8
- package/dist/completion/review-exit-verdict-gate.js.map +1 -1
- package/dist/completion/review-next-step.d.ts +15 -3
- package/dist/completion/review-next-step.d.ts.map +1 -1
- package/dist/completion/review-next-step.js +7 -2
- package/dist/completion/review-next-step.js.map +1 -1
- package/dist/completion/standing-approval-convergence.d.ts +68 -0
- package/dist/completion/standing-approval-convergence.d.ts.map +1 -0
- package/dist/completion/standing-approval-convergence.js +230 -0
- package/dist/completion/standing-approval-convergence.js.map +1 -0
- package/dist/completion/standing-approval-deps.d.ts +5 -0
- package/dist/completion/standing-approval-deps.d.ts.map +1 -0
- package/dist/completion/standing-approval-deps.js +37 -0
- package/dist/completion/standing-approval-deps.js.map +1 -0
- package/dist/completion/state-cascade.d.ts +11 -0
- package/dist/completion/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade.js +40 -1
- package/dist/completion/state-cascade.js.map +1 -1
- package/dist/completion/team-lifecycle.d.ts +14 -2
- package/dist/completion/team-lifecycle.d.ts.map +1 -1
- package/dist/completion/team-lifecycle.js +36 -36
- package/dist/completion/team-lifecycle.js.map +1 -1
- package/dist/completion/terminated-work-reconcile.d.ts +3 -1
- package/dist/completion/terminated-work-reconcile.d.ts.map +1 -1
- package/dist/completion/terminated-work-reconcile.js +24 -11
- package/dist/completion/terminated-work-reconcile.js.map +1 -1
- package/dist/delivery/delivery-advance-block.d.ts +6 -0
- package/dist/delivery/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery/delivery-advance-block.js +29 -3
- package/dist/delivery/delivery-advance-block.js.map +1 -1
- package/dist/delivery/delivery-reconciler.d.ts.map +1 -1
- package/dist/delivery/delivery-reconciler.js +4 -1
- package/dist/delivery/delivery-reconciler.js.map +1 -1
- package/dist/delivery/operator-hold.d.ts.map +1 -1
- package/dist/delivery/operator-hold.js +3 -1
- package/dist/delivery/operator-hold.js.map +1 -1
- package/dist/directive/directive-executor.d.ts.map +1 -1
- package/dist/directive/directive-executor.js +6 -0
- package/dist/directive/directive-executor.js.map +1 -1
- package/dist/directive/directive-queue.d.ts +8 -0
- package/dist/directive/directive-queue.d.ts.map +1 -1
- package/dist/directive/directive-queue.js +20 -0
- package/dist/directive/directive-queue.js.map +1 -1
- package/dist/directive/phase-sync.d.ts +5 -0
- package/dist/directive/phase-sync.d.ts.map +1 -1
- package/dist/directive/phase-sync.js +11 -1
- package/dist/directive/phase-sync.js.map +1 -1
- package/dist/directive/stranded-review-reroute.d.ts +37 -0
- package/dist/directive/stranded-review-reroute.d.ts.map +1 -0
- package/dist/directive/stranded-review-reroute.js +150 -0
- package/dist/directive/stranded-review-reroute.js.map +1 -0
- package/dist/focus/focus-engine.d.ts.map +1 -1
- package/dist/focus/focus-engine.js +15 -3
- package/dist/focus/focus-engine.js.map +1 -1
- package/dist/focus/focus-executor.d.ts.map +1 -1
- package/dist/focus/focus-executor.js +9 -65
- package/dist/focus/focus-executor.js.map +1 -1
- package/dist/focus/focus-lifecycle.d.ts +12 -0
- package/dist/focus/focus-lifecycle.d.ts.map +1 -1
- package/dist/focus/focus-lifecycle.js +66 -37
- 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 +6 -0
- package/dist/focus/focus-phase.js.map +1 -1
- package/dist/focus/focus-spawn-decision.d.ts.map +1 -1
- package/dist/focus/focus-spawn-decision.js +1 -0
- package/dist/focus/focus-spawn-decision.js.map +1 -1
- package/dist/focus/focus-team-state.d.ts +10 -0
- package/dist/focus/focus-team-state.d.ts.map +1 -1
- package/dist/focus/focus-team-state.js +19 -1
- package/dist/focus/focus-team-state.js.map +1 -1
- package/dist/focus/listener-auto-advance.d.ts.map +1 -1
- package/dist/focus/listener-auto-advance.js +1 -0
- package/dist/focus/listener-auto-advance.js.map +1 -1
- package/dist/focus/listener-spawn.d.ts +10 -0
- package/dist/focus/listener-spawn.d.ts.map +1 -1
- package/dist/focus/listener-spawn.js +46 -4
- 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 +11 -1
- package/dist/focus/listener-state.js.map +1 -1
- package/dist/focus/listener.d.ts +42 -0
- package/dist/focus/listener.d.ts.map +1 -1
- package/dist/focus/listener.js +62 -33
- package/dist/focus/listener.js.map +1 -1
- package/dist/focus/pending-review-approved-head.d.ts +41 -0
- package/dist/focus/pending-review-approved-head.d.ts.map +1 -0
- package/dist/focus/pending-review-approved-head.js +198 -0
- package/dist/focus/pending-review-approved-head.js.map +1 -0
- package/dist/focus/pending-spawn-pass-deps.d.ts +5 -0
- package/dist/focus/pending-spawn-pass-deps.d.ts.map +1 -1
- package/dist/focus/pending-spawn-pass-deps.js +2 -1
- package/dist/focus/pending-spawn-pass-deps.js.map +1 -1
- package/dist/focus/pending-spawn-review-next-step.d.ts.map +1 -1
- package/dist/focus/pending-spawn-review-next-step.js +26 -4
- package/dist/focus/pending-spawn-review-next-step.js.map +1 -1
- package/dist/focus/review-spawn-coverage.d.ts +87 -0
- package/dist/focus/review-spawn-coverage.d.ts.map +1 -0
- package/dist/focus/review-spawn-coverage.js +104 -0
- package/dist/focus/review-spawn-coverage.js.map +1 -0
- package/dist/focus/session-health.d.ts +5 -2
- package/dist/focus/session-health.d.ts.map +1 -1
- package/dist/focus/session-health.js +2 -1
- package/dist/focus/session-health.js.map +1 -1
- package/dist/focus/session-process-reap.d.ts +50 -0
- package/dist/focus/session-process-reap.d.ts.map +1 -0
- package/dist/focus/session-process-reap.js +77 -0
- package/dist/focus/session-process-reap.js.map +1 -0
- package/dist/focus/unchanged-reviewed-head.d.ts +40 -0
- package/dist/focus/unchanged-reviewed-head.d.ts.map +1 -0
- package/dist/focus/unchanged-reviewed-head.js +84 -0
- package/dist/focus/unchanged-reviewed-head.js.map +1 -0
- package/dist/focus/verify-open-issues.d.ts +4 -19
- package/dist/focus/verify-open-issues.d.ts.map +1 -1
- package/dist/focus/verify-open-issues.js +83 -41
- package/dist/focus/verify-open-issues.js.map +1 -1
- package/dist/git/focus-integration-sync.d.ts +61 -0
- package/dist/git/focus-integration-sync.d.ts.map +1 -0
- package/dist/git/focus-integration-sync.js +73 -0
- package/dist/git/focus-integration-sync.js.map +1 -0
- package/dist/git/focus-own-delta.d.ts +38 -0
- package/dist/git/focus-own-delta.d.ts.map +1 -0
- package/dist/git/focus-own-delta.js +193 -0
- package/dist/git/focus-own-delta.js.map +1 -0
- package/dist/git/index.d.ts +2 -0
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +4 -0
- package/dist/git/index.js.map +1 -1
- package/dist/git/merge.d.ts.map +1 -1
- package/dist/git/merge.js +11 -1
- package/dist/git/merge.js.map +1 -1
- package/dist/git/resolution-restore.d.ts +66 -0
- package/dist/git/resolution-restore.d.ts.map +1 -0
- package/dist/git/resolution-restore.js +331 -0
- package/dist/git/resolution-restore.js.map +1 -0
- package/dist/loops/engine.d.ts.map +1 -1
- package/dist/loops/engine.js.map +1 -1
- package/dist/merge/abandoned-merge-recovery.d.ts +72 -0
- package/dist/merge/abandoned-merge-recovery.d.ts.map +1 -0
- package/dist/merge/abandoned-merge-recovery.js +117 -0
- package/dist/merge/abandoned-merge-recovery.js.map +1 -0
- package/dist/merge/focus-merge.d.ts +19 -0
- package/dist/merge/focus-merge.d.ts.map +1 -1
- package/dist/merge/focus-merge.js +136 -99
- package/dist/merge/focus-merge.js.map +1 -1
- package/dist/merge/merge-back-activity.d.ts +11 -0
- package/dist/merge/merge-back-activity.d.ts.map +1 -0
- package/dist/merge/merge-back-activity.js +57 -0
- package/dist/merge/merge-back-activity.js.map +1 -0
- package/dist/merge/merge-back-conflict.d.ts +119 -0
- package/dist/merge/merge-back-conflict.d.ts.map +1 -0
- package/dist/merge/merge-back-conflict.js +178 -0
- package/dist/merge/merge-back-conflict.js.map +1 -0
- package/dist/merge/merge-back-followup.d.ts +109 -0
- package/dist/merge/merge-back-followup.d.ts.map +1 -0
- package/dist/merge/merge-back-followup.js +316 -0
- package/dist/merge/merge-back-followup.js.map +1 -0
- package/dist/merge/merge-back-loop.d.ts +2 -0
- package/dist/merge/merge-back-loop.d.ts.map +1 -1
- package/dist/merge/merge-back-loop.js +14 -15
- package/dist/merge/merge-back-loop.js.map +1 -1
- package/dist/merge/merge-conflict-escalation.d.ts +12 -0
- package/dist/merge/merge-conflict-escalation.d.ts.map +1 -1
- package/dist/merge/merge-conflict-escalation.js +37 -2
- package/dist/merge/merge-conflict-escalation.js.map +1 -1
- package/dist/merge/merge-gate-coverage.d.ts.map +1 -1
- package/dist/merge/merge-gate-coverage.js +1 -0
- package/dist/merge/merge-gate-coverage.js.map +1 -1
- package/dist/prompt/prompt-listing.d.ts +5 -0
- package/dist/prompt/prompt-listing.d.ts.map +1 -1
- package/dist/prompt/prompt-listing.js +35 -0
- package/dist/prompt/prompt-listing.js.map +1 -1
- package/dist/prompt-sections/routing-decider-sections.d.ts.map +1 -1
- package/dist/prompt-sections/routing-decider-sections.js +2 -0
- package/dist/prompt-sections/routing-decider-sections.js.map +1 -1
- package/dist/prompt-sections/shortfall-park-section.d.ts +43 -0
- package/dist/prompt-sections/shortfall-park-section.d.ts.map +1 -0
- package/dist/prompt-sections/shortfall-park-section.js +36 -0
- package/dist/prompt-sections/shortfall-park-section.js.map +1 -0
- package/dist/queries/agent-resolvable-promotion.d.ts +16 -2
- package/dist/queries/agent-resolvable-promotion.d.ts.map +1 -1
- package/dist/queries/agent-resolvable-promotion.js +30 -3
- package/dist/queries/agent-resolvable-promotion.js.map +1 -1
- package/dist/queries/cause-key.d.ts +17 -22
- package/dist/queries/cause-key.d.ts.map +1 -1
- package/dist/queries/cause-key.js +50 -1
- package/dist/queries/cause-key.js.map +1 -1
- package/dist/queries/commit-attributions.d.ts +18 -0
- package/dist/queries/commit-attributions.d.ts.map +1 -0
- package/dist/queries/commit-attributions.js +39 -0
- package/dist/queries/commit-attributions.js.map +1 -0
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +3 -1
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/delivery-gate-state.d.ts +21 -5
- package/dist/queries/delivery-gate-state.d.ts.map +1 -1
- package/dist/queries/delivery-gate-state.js +35 -9
- package/dist/queries/delivery-gate-state.js.map +1 -1
- package/dist/queries/escalation-consumption.d.ts.map +1 -1
- package/dist/queries/escalation-consumption.js +2 -1
- package/dist/queries/escalation-consumption.js.map +1 -1
- package/dist/queries/escalation-field-bounds.d.ts +48 -0
- package/dist/queries/escalation-field-bounds.d.ts.map +1 -0
- package/dist/queries/escalation-field-bounds.js +83 -0
- package/dist/queries/escalation-field-bounds.js.map +1 -0
- package/dist/queries/escalation-refusal.d.ts +88 -0
- package/dist/queries/escalation-refusal.d.ts.map +1 -0
- package/dist/queries/escalation-refusal.js +217 -0
- package/dist/queries/escalation-refusal.js.map +1 -0
- package/dist/queries/escalation-suppression.d.ts +6 -0
- package/dist/queries/escalation-suppression.d.ts.map +1 -1
- package/dist/queries/escalation-suppression.js +4 -13
- package/dist/queries/escalation-suppression.js.map +1 -1
- package/dist/queries/escalations.d.ts +5 -13
- package/dist/queries/escalations.d.ts.map +1 -1
- package/dist/queries/escalations.js +25 -30
- package/dist/queries/escalations.js.map +1 -1
- package/dist/queries/filing-observation.d.ts.map +1 -1
- package/dist/queries/filing-observation.js +3 -1
- package/dist/queries/filing-observation.js.map +1 -1
- package/dist/queries/focus-review-approval.d.ts +2 -0
- package/dist/queries/focus-review-approval.d.ts.map +1 -1
- package/dist/queries/focus-review-approval.js +7 -2
- package/dist/queries/focus-review-approval.js.map +1 -1
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +2 -1
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/incident-correlation.d.ts.map +1 -1
- package/dist/queries/incident-correlation.js +4 -1
- package/dist/queries/incident-correlation.js.map +1 -1
- package/dist/queries/misattributed-commits-record.d.ts +26 -0
- package/dist/queries/misattributed-commits-record.d.ts.map +1 -0
- package/dist/queries/misattributed-commits-record.js +5 -0
- package/dist/queries/misattributed-commits-record.js.map +1 -0
- package/dist/queries/reality-tree.d.ts.map +1 -1
- package/dist/queries/reality-tree.js +2 -1
- package/dist/queries/reality-tree.js.map +1 -1
- package/dist/queries/schemas.d.ts +3 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +1 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/queries/shared.js +1 -1
- package/dist/queries/shortfall-park-record.d.ts +48 -0
- package/dist/queries/shortfall-park-record.d.ts.map +1 -0
- package/dist/queries/shortfall-park-record.js +31 -0
- package/dist/queries/shortfall-park-record.js.map +1 -0
- package/dist/queries/shortfall-rulings.d.ts +71 -0
- package/dist/queries/shortfall-rulings.d.ts.map +1 -0
- package/dist/queries/shortfall-rulings.js +53 -0
- package/dist/queries/shortfall-rulings.js.map +1 -0
- package/dist/queries/verification.d.ts +20 -1
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +48 -8
- package/dist/queries/verification.js.map +1 -1
- package/dist/resolvers/index.d.ts +2 -2
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -1
- package/dist/resolvers/index.js.map +1 -1
- package/dist/resolvers/shared/delivery-trailer.d.ts +99 -0
- package/dist/resolvers/shared/delivery-trailer.d.ts.map +1 -0
- package/dist/resolvers/shared/delivery-trailer.js +103 -0
- package/dist/resolvers/shared/delivery-trailer.js.map +1 -0
- package/dist/resolvers/shared/git-diff.d.ts +11 -84
- package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
- package/dist/resolvers/shared/git-diff.js +17 -84
- package/dist/resolvers/shared/git-diff.js.map +1 -1
- package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
- package/dist/resolvers/shared/review-window-commits.js +1 -0
- package/dist/resolvers/shared/review-window-commits.js.map +1 -1
- package/dist/session/session-lineage.d.ts.map +1 -1
- package/dist/session/session-lineage.js +1 -0
- package/dist/session/session-lineage.js.map +1 -1
- package/dist/shell/config.d.ts +2 -1
- package/dist/shell/config.d.ts.map +1 -1
- package/dist/shell/config.js +21 -4
- package/dist/shell/config.js.map +1 -1
- package/dist/shell/crash-recovery.d.ts +3 -7
- package/dist/shell/crash-recovery.d.ts.map +1 -1
- package/dist/shell/crash-recovery.js +28 -31
- package/dist/shell/crash-recovery.js.map +1 -1
- package/dist/shell/orphan-capture.d.ts +42 -0
- package/dist/shell/orphan-capture.d.ts.map +1 -0
- package/dist/shell/orphan-capture.js +53 -0
- package/dist/shell/orphan-capture.js.map +1 -0
- package/dist/shell/worker-pidfile.d.ts +22 -4
- package/dist/shell/worker-pidfile.d.ts.map +1 -1
- package/dist/shell/worker-pidfile.js +51 -13
- package/dist/shell/worker-pidfile.js.map +1 -1
- package/dist/spawn/helpers.d.ts +3 -0
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +28 -9
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/lead-launch.d.ts +34 -0
- package/dist/spawn/lead-launch.d.ts.map +1 -0
- package/dist/spawn/lead-launch.js +34 -0
- package/dist/spawn/lead-launch.js.map +1 -0
- package/dist/spawn/lead-process-ownership.d.ts +91 -0
- package/dist/spawn/lead-process-ownership.d.ts.map +1 -0
- package/dist/spawn/lead-process-ownership.js +120 -0
- package/dist/spawn/lead-process-ownership.js.map +1 -0
- package/dist/spawn/lifecycle.d.ts +43 -3
- package/dist/spawn/lifecycle.d.ts.map +1 -1
- package/dist/spawn/lifecycle.js +75 -44
- package/dist/spawn/lifecycle.js.map +1 -1
- package/dist/spawn/liveness.d.ts.map +1 -1
- package/dist/spawn/liveness.js +5 -1
- package/dist/spawn/liveness.js.map +1 -1
- package/dist/spawn/one-shot-process-ownership.d.ts +48 -0
- package/dist/spawn/one-shot-process-ownership.d.ts.map +1 -0
- package/dist/spawn/one-shot-process-ownership.js +44 -0
- package/dist/spawn/one-shot-process-ownership.js.map +1 -0
- package/dist/spawn/process-group-kill.d.ts +79 -0
- package/dist/spawn/process-group-kill.d.ts.map +1 -0
- package/dist/spawn/process-group-kill.js +210 -0
- package/dist/spawn/process-group-kill.js.map +1 -0
- package/dist/spawn/process-spawn.d.ts +18 -1
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +51 -20
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/resolution-budget.d.ts +38 -0
- package/dist/spawn/resolution-budget.d.ts.map +1 -0
- package/dist/spawn/resolution-budget.js +87 -0
- package/dist/spawn/resolution-budget.js.map +1 -0
- package/dist/spawn/review-hold-park.d.ts.map +1 -1
- package/dist/spawn/review-hold-park.js +37 -5
- 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 +9 -0
- package/dist/spawn/spawn-cooldown.js.map +1 -1
- package/dist/spawn/untracked-lead-sweep.d.ts +29 -0
- package/dist/spawn/untracked-lead-sweep.d.ts.map +1 -0
- package/dist/spawn/untracked-lead-sweep.js +100 -0
- package/dist/spawn/untracked-lead-sweep.js.map +1 -0
- package/dist/spawn/worker-registry.d.ts.map +1 -1
- package/dist/spawn/worker-registry.js +4 -1
- package/dist/spawn/worker-registry.js.map +1 -1
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +8 -6
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/testing/fixtures/exit-capture-verify.d.ts +41 -0
- package/dist/testing/fixtures/exit-capture-verify.d.ts.map +1 -0
- package/dist/testing/fixtures/exit-capture-verify.js +152 -0
- package/dist/testing/fixtures/exit-capture-verify.js.map +1 -0
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/fixtures/pending-spawn-world.d.ts +7 -0
- package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
- package/dist/testing/fixtures/pending-spawn-world.js +21 -1
- package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
- package/dist/testing/fixtures/stubborn-lead-process.d.ts +22 -0
- package/dist/testing/fixtures/stubborn-lead-process.d.ts.map +1 -0
- package/dist/testing/fixtures/stubborn-lead-process.js +68 -0
- package/dist/testing/fixtures/stubborn-lead-process.js.map +1 -0
- package/dist/types/config.d.ts +13 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/focus.d.ts +7 -0
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/verify/commit-verdict-record.d.ts +13 -3
- package/dist/verify/commit-verdict-record.d.ts.map +1 -1
- package/dist/verify/commit-verdict-record.js +45 -25
- package/dist/verify/commit-verdict-record.js.map +1 -1
- package/dist/verify/credit-rearm.d.ts +18 -0
- package/dist/verify/credit-rearm.d.ts.map +1 -0
- package/dist/verify/credit-rearm.js +69 -0
- package/dist/verify/credit-rearm.js.map +1 -0
- package/dist/verify/delivery-commit-set.d.ts +10 -0
- package/dist/verify/delivery-commit-set.d.ts.map +1 -0
- package/dist/verify/delivery-commit-set.js +82 -0
- package/dist/verify/delivery-commit-set.js.map +1 -0
- package/dist/verify/explicit-rearm.d.ts.map +1 -1
- package/dist/verify/explicit-rearm.js +2 -0
- package/dist/verify/explicit-rearm.js.map +1 -1
- package/dist/verify/failure-signature.d.ts.map +1 -1
- package/dist/verify/failure-signature.js +1 -0
- package/dist/verify/failure-signature.js.map +1 -1
- package/dist/verify/gate-run-registry.d.ts.map +1 -1
- package/dist/verify/gate-run-registry.js +3 -0
- package/dist/verify/gate-run-registry.js.map +1 -1
- package/dist/verify/injection-stamp.d.ts +29 -0
- package/dist/verify/injection-stamp.d.ts.map +1 -0
- package/dist/verify/injection-stamp.js +139 -0
- package/dist/verify/injection-stamp.js.map +1 -0
- package/dist/verify/misattributed-commits-read.d.ts +31 -0
- package/dist/verify/misattributed-commits-read.d.ts.map +1 -0
- package/dist/verify/misattributed-commits-read.js +47 -0
- package/dist/verify/misattributed-commits-read.js.map +1 -0
- package/dist/verify/misattributed-commits.d.ts +52 -0
- package/dist/verify/misattributed-commits.d.ts.map +1 -0
- package/dist/verify/misattributed-commits.js +148 -0
- package/dist/verify/misattributed-commits.js.map +1 -0
- package/dist/verify/no-own-delta-verdict.d.ts +47 -0
- package/dist/verify/no-own-delta-verdict.d.ts.map +1 -0
- package/dist/verify/no-own-delta-verdict.js +74 -0
- package/dist/verify/no-own-delta-verdict.js.map +1 -0
- package/dist/verify/shortfall-park-escalation.d.ts +41 -0
- package/dist/verify/shortfall-park-escalation.d.ts.map +1 -0
- package/dist/verify/shortfall-park-escalation.js +177 -0
- package/dist/verify/shortfall-park-escalation.js.map +1 -0
- package/dist/verify/shortfall-park.d.ts +109 -0
- package/dist/verify/shortfall-park.d.ts.map +1 -0
- package/dist/verify/shortfall-park.js +208 -0
- package/dist/verify/shortfall-park.js.map +1 -0
- package/dist/verify/shortfall-repeat.d.ts +47 -16
- package/dist/verify/shortfall-repeat.d.ts.map +1 -1
- package/dist/verify/shortfall-repeat.js +77 -23
- package/dist/verify/shortfall-repeat.js.map +1 -1
- package/dist/verify/shortfall-rulings.d.ts +106 -0
- package/dist/verify/shortfall-rulings.d.ts.map +1 -0
- package/dist/verify/shortfall-rulings.js +118 -0
- package/dist/verify/shortfall-rulings.js.map +1 -0
- package/dist/verify/stall-detectors.d.ts.map +1 -1
- package/dist/verify/stall-detectors.js +10 -4
- package/dist/verify/stall-detectors.js.map +1 -1
- package/dist/verify/verification-attribution-base.d.ts +26 -0
- package/dist/verify/verification-attribution-base.d.ts.map +1 -0
- package/dist/verify/verification-attribution-base.js +127 -0
- package/dist/verify/verification-attribution-base.js.map +1 -0
- package/dist/verify/verification-attribution-deps.d.ts +32 -0
- package/dist/verify/verification-attribution-deps.d.ts.map +1 -0
- package/dist/verify/verification-attribution-deps.js +209 -0
- package/dist/verify/verification-attribution-deps.js.map +1 -0
- package/dist/verify/verification-baseline.d.ts +6 -0
- package/dist/verify/verification-baseline.d.ts.map +1 -1
- package/dist/verify/verification-baseline.js +27 -11
- package/dist/verify/verification-baseline.js.map +1 -1
- package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
- package/dist/verify/verification-commit-sharing.js +30 -8
- package/dist/verify/verification-commit-sharing.js.map +1 -1
- package/dist/verify/verification-config.d.ts.map +1 -1
- package/dist/verify/verification-config.js +2 -0
- package/dist/verify/verification-config.js.map +1 -1
- package/dist/verify/verification-default-on.d.ts +3 -0
- package/dist/verify/verification-default-on.d.ts.map +1 -1
- package/dist/verify/verification-default-on.js +5 -1
- 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 +61 -120
- package/dist/verify/verification-deps-default.js.map +1 -1
- package/dist/verify/verification-deps.d.ts +26 -4
- package/dist/verify/verification-deps.d.ts.map +1 -1
- package/dist/verify/verification-deterministic.d.ts +15 -0
- package/dist/verify/verification-deterministic.d.ts.map +1 -1
- package/dist/verify/verification-deterministic.js +1 -12
- package/dist/verify/verification-deterministic.js.map +1 -1
- package/dist/verify/verification-engine.d.ts +9 -6
- package/dist/verify/verification-engine.d.ts.map +1 -1
- package/dist/verify/verification-engine.js +43 -62
- 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 +19 -1
- package/dist/verify/verification-evidence-unavailable-feedback.js.map +1 -1
- package/dist/verify/verification-failure-parser.d.ts +57 -1
- package/dist/verify/verification-failure-parser.d.ts.map +1 -1
- package/dist/verify/verification-failure-parser.js +116 -10
- package/dist/verify/verification-failure-parser.js.map +1 -1
- package/dist/verify/verification-feedback.d.ts +60 -43
- package/dist/verify/verification-feedback.d.ts.map +1 -1
- package/dist/verify/verification-feedback.js +115 -120
- package/dist/verify/verification-feedback.js.map +1 -1
- package/dist/verify/verification-history-reset.d.ts +2 -1
- package/dist/verify/verification-history-reset.d.ts.map +1 -1
- package/dist/verify/verification-history-reset.js +4 -2
- package/dist/verify/verification-history-reset.js.map +1 -1
- package/dist/verify/verification-rework-issue.d.ts +87 -0
- package/dist/verify/verification-rework-issue.d.ts.map +1 -0
- package/dist/verify/verification-rework-issue.js +212 -0
- package/dist/verify/verification-rework-issue.js.map +1 -0
- package/dist/verify/verification-rework-messages.d.ts.map +1 -1
- package/dist/verify/verification-rework-messages.js +10 -0
- package/dist/verify/verification-rework-messages.js.map +1 -1
- package/dist/verify/verify-gate-stall.d.ts +2 -0
- package/dist/verify/verify-gate-stall.d.ts.map +1 -1
- package/dist/verify/verify-gate-stall.js +35 -9
- package/dist/verify/verify-gate-stall.js.map +1 -1
- package/dist/verify/verify-restatement.d.ts.map +1 -1
- package/dist/verify/verify-restatement.js +9 -2
- package/dist/verify/verify-restatement.js.map +1 -1
- package/dist/worktree/capture-attribution-read.d.ts +47 -0
- package/dist/worktree/capture-attribution-read.d.ts.map +1 -0
- package/dist/worktree/capture-attribution-read.js +98 -0
- package/dist/worktree/capture-attribution-read.js.map +1 -0
- package/dist/worktree/capture-attribution.d.ts +26 -0
- package/dist/worktree/capture-attribution.d.ts.map +1 -0
- package/dist/worktree/capture-attribution.js +111 -0
- package/dist/worktree/capture-attribution.js.map +1 -0
- package/dist/worktree/index.d.ts.map +1 -1
- package/dist/worktree/index.js +2 -1
- package/dist/worktree/index.js.map +1 -1
- package/dist/worktree/provision.d.ts.map +1 -1
- package/dist/worktree/provision.js +23 -6
- package/dist/worktree/provision.js.map +1 -1
- package/dist/worktree/safety.d.ts +14 -4
- package/dist/worktree/safety.d.ts.map +1 -1
- package/dist/worktree/safety.js +37 -7
- package/dist/worktree/safety.js.map +1 -1
- package/dist/worktree/scratch-guard.d.ts +53 -2
- package/dist/worktree/scratch-guard.d.ts.map +1 -1
- package/dist/worktree/scratch-guard.js +115 -30
- package/dist/worktree/scratch-guard.js.map +1 -1
- package/dist/worktree/unmerged-capture-escalation.d.ts +52 -0
- package/dist/worktree/unmerged-capture-escalation.d.ts.map +1 -0
- package/dist/worktree/unmerged-capture-escalation.js +64 -0
- package/dist/worktree/unmerged-capture-escalation.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,124 @@
|
|
|
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-approved-head-gate.test.ts,
|
|
3
|
+
// packages/daemon/src/integration/approved-head-gate-failure-respawn-regression.test.ts,
|
|
4
|
+
// packages/daemon/src/integration/approved-head-hold-release-regression.test.ts,
|
|
5
|
+
// packages/daemon/src/integration/fully-merged-focus-sibling-red-scenario.test.ts,
|
|
6
|
+
// packages/daemon/src/integration/shortfall-ruling-disposes-proposals-regression.test.ts,
|
|
7
|
+
// packages/daemon/src/integration/standing-approval-release-regression.test.ts
|
|
8
|
+
// PINNED-BY-END
|
|
9
|
+
/**
|
|
10
|
+
* Review runs once per distinct focus head: an unchanged head since the focus's
|
|
11
|
+
* current approval draws no new review window.
|
|
12
|
+
*
|
|
13
|
+
* checkAutoReview (state-cascade.ts) opens the review window when a focus
|
|
14
|
+
* converges on verify. Its only in-memory backoff is a signature over the delivery
|
|
15
|
+
* aggregate (status, updated_at, merge commit, git state) -- and a verify delivery
|
|
16
|
+
* held by a repeating shortfall has its gate_state rewritten every pass, which
|
|
17
|
+
* bumps updated_at and invalidates that signature. Each rewrite re-opened the
|
|
18
|
+
* window at the SAME focus head, a review team spawned, and it approved the same
|
|
19
|
+
* commit again: daemon 0.22.132 stamped 9 approvals in ~40 minutes at one
|
|
20
|
+
* reviewedSha.
|
|
21
|
+
*
|
|
22
|
+
* The approval that makes a re-review pointless is the one the merge gate already
|
|
23
|
+
* reads (queries/focus-review-approval.ts readLatestApprovedReviewSha): the newest
|
|
24
|
+
* CURRENT approval -- an approved focus_reviews row or a recorded clean
|
|
25
|
+
* full-coverage auto-approval (completion/review-auto-approval-record.ts) -- which
|
|
26
|
+
* a newer gaps_found review of the same commit revokes. The head is the focus
|
|
27
|
+
* branch tip a review spawn would pin as its coverage anchor (focus-executor.ts
|
|
28
|
+
* captureReviewSpawnCoverage resolves the branch ref; a review spawn skips the
|
|
29
|
+
* rebase, and worktrees share the repo's refs).
|
|
30
|
+
*
|
|
31
|
+
* So the window is declined only when the head and the current approval are both
|
|
32
|
+
* KNOWN and name the same commit. A new commit on the focus, a newer gaps_found at
|
|
33
|
+
* that commit (approval revoked -> null), or no approval at all leaves review
|
|
34
|
+
* eligible exactly as before.
|
|
35
|
+
*
|
|
36
|
+
* FAILS OPEN: an unresolvable head, an unreadable review history, or a thrown read
|
|
37
|
+
* lets the window open. A missed skip costs one review pass; a false skip would
|
|
38
|
+
* strand a verify delivery that still needs its verdict.
|
|
39
|
+
*
|
|
40
|
+
* NO SAME-HEAD EXCEPTION: a verify delivery that becomes closable at the approved
|
|
41
|
+
* head with no new commit (a ruling released its shortfall park and verify then
|
|
42
|
+
* passed) does NOT re-open the window -- that re-ran review and stamped another
|
|
43
|
+
* approval of the unchanged commit. It converges on the STANDING approval instead
|
|
44
|
+
* (completion/standing-approval-convergence.ts), through the review exit's own
|
|
45
|
+
* holds, with no review run and no approval written.
|
|
46
|
+
*
|
|
47
|
+
* @module completion/review-approved-head-gate
|
|
48
|
+
*/
|
|
49
|
+
import { resolveRef as defaultResolveRef } from '../git/index.js';
|
|
50
|
+
import { readLatestApprovedReviewSha, sameCommit } from '../queries/focus-review-approval.js';
|
|
51
|
+
import { listReviewAutoApprovals } from './review-auto-approval-record.js';
|
|
52
|
+
import { isForeignOnlyExtension } from '../git/focus-own-delta.js';
|
|
53
|
+
import { getFocusDeliveries } from '../queries/focuses.js';
|
|
54
|
+
import { createLogger } from '../shell/log.js';
|
|
55
|
+
const log = createLogger({ module: 'state-cascade' });
|
|
56
|
+
/**
|
|
57
|
+
* The production ownership proof: `repoPath` is the product checkout (its HEAD is
|
|
58
|
+
* not the focus branch), so provenance is read from the NAMED focus branch, with the
|
|
59
|
+
* focus's delivery ids from `listDeliveryIds` (the product-api by default).
|
|
60
|
+
*/
|
|
61
|
+
export function makeHeadAddsNoOwnWork(listDeliveryIds = async (focusId) => (await getFocusDeliveries(focusId)).map((d) => d.id)) {
|
|
62
|
+
return async (target, approved, head) => isForeignOnlyExtension(target.repoPath, target.integrationBranch, approved, head, new Set(await listDeliveryIds(target.focusId)), { focusBranch: target.branchName ?? undefined });
|
|
63
|
+
}
|
|
64
|
+
const defaultReadDeps = {
|
|
65
|
+
resolveRef: defaultResolveRef,
|
|
66
|
+
readApprovedReviewSha: (target) => readLatestApprovedReviewSha(target.focusId, {
|
|
67
|
+
autoApprovals: listReviewAutoApprovals(target.productId, target.focusId),
|
|
68
|
+
}),
|
|
69
|
+
addsNoOwnWork: makeHeadAddsNoOwnWork(),
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Read the focus head and its current approval. The approval is read only once
|
|
73
|
+
* the head resolves (with no head there is nothing to compare, so the product-api
|
|
74
|
+
* call is skipped). Throws when the approval read throws.
|
|
75
|
+
*/
|
|
76
|
+
export async function readReviewHeadApproval(target, deps = defaultReadDeps) {
|
|
77
|
+
const headSha = target.branchName ? deps.resolveRef(target.repoPath, target.branchName) : null;
|
|
78
|
+
if (!headSha)
|
|
79
|
+
return { headSha: null, approvedSha: null };
|
|
80
|
+
const approvedSha = await deps.readApprovedReviewSha(target);
|
|
81
|
+
const { integrationBranch } = target;
|
|
82
|
+
if (approvedSha && integrationBranch && deps.addsNoOwnWork && !sameCommit(headSha, approvedSha)) {
|
|
83
|
+
// A focus whose commits are all on integration, moved past its approved commit
|
|
84
|
+
// only by other foci's commits, has no own work to review: its OWN head is the
|
|
85
|
+
// approved commit. Unprovable (or a failed read) keeps the branch tip.
|
|
86
|
+
const noOwnWork = await deps.addsNoOwnWork({ ...target, integrationBranch }, approvedSha, headSha).catch(() => false);
|
|
87
|
+
if (noOwnWork) {
|
|
88
|
+
log.info(`[state-cascade] Focus ${target.focusId}: head ${headSha.slice(0, 12)} adds only other foci's commits (already on ` +
|
|
89
|
+
`integration) to its approved commit ${approvedSha.slice(0, 12)} -- read as that approved head, no review over them`);
|
|
90
|
+
return { headSha: approvedSha, approvedSha };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return { headSha, approvedSha };
|
|
94
|
+
}
|
|
95
|
+
/** Whether the focus head is the commit its current approval already judged. Pure. */
|
|
96
|
+
export function isHeadAlreadyApproved(read) {
|
|
97
|
+
return read.headSha !== null && read.approvedSha !== null && sameCommit(read.headSha, read.approvedSha);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Whether checkAutoReview must decline to open the review window because the focus
|
|
101
|
+
* head is unchanged since its current approval. Logs the decline (info). Fails
|
|
102
|
+
* OPEN: an absent reader, an unknown head or approval, or a thrown read returns
|
|
103
|
+
* false (a thrown read is logged at warn).
|
|
104
|
+
*/
|
|
105
|
+
export async function declinesReviewAtApprovedHead(focusId, read) {
|
|
106
|
+
if (!read)
|
|
107
|
+
return false;
|
|
108
|
+
let result;
|
|
109
|
+
try {
|
|
110
|
+
result = await read(focusId);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
log.warn(`[state-cascade] Could not read the approved review head for focus ${focusId}; ` +
|
|
114
|
+
`opening the review window as before: ${err.message}`);
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
if (!isHeadAlreadyApproved(result))
|
|
118
|
+
return false;
|
|
119
|
+
log.info(`[state-cascade] Not opening a review window on focus ${focusId}: its head ` +
|
|
120
|
+
`${(result.headSha ?? '').slice(0, 12)} is the commit its current approval already judged ` +
|
|
121
|
+
`-- review runs once per distinct focus head.`);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=review-approved-head-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-approved-head-gate.js","sourceRoot":"","sources":["../../src/completion/review-approved-head-gate.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,2FAA2F;AAC3F,mFAAmF;AACnF,qFAAqF;AACrF,4FAA4F;AAC5F,iFAAiF;AACjF,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;AAkCtD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,kBAAmE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE1I,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAC7D,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,eAAe,CAA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AI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** A delivery a census saw in verify. */
|
|
2
|
+
export interface CensusDelivery {
|
|
3
|
+
id: string;
|
|
4
|
+
iterationCount: number;
|
|
5
|
+
}
|
|
6
|
+
/** One review exit's census of a focus commit. */
|
|
7
|
+
export interface ReviewCensus {
|
|
8
|
+
productId: string;
|
|
9
|
+
focusId: string;
|
|
10
|
+
/** The commit the review covered (its spawn tip, else its exit tip). */
|
|
11
|
+
sha: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
/** Whether the exit's own verdict approved `sha` (an approved report, or a clean full-coverage inspected exit). */
|
|
14
|
+
approving: boolean;
|
|
15
|
+
/** The deliveries in verify when the exit ran, each with its re-code iteration count then. */
|
|
16
|
+
verifyDeliveries: CensusDelivery[];
|
|
17
|
+
recordedAt: string;
|
|
18
|
+
}
|
|
19
|
+
/** Record a census atomically, replacing the commit's previous one. Best-effort: false (and logged) on a malformed sha or a failed write. */
|
|
20
|
+
export declare function writeReviewCensus(census: ReviewCensus, dir?: string): boolean;
|
|
21
|
+
/** Every census recorded for the focus, newest first. Empty when none can be read: a missing census covers nothing. */
|
|
22
|
+
export declare function listReviewCensuses(productId: string, focusId: string, dir?: string): ReviewCensus[];
|
|
23
|
+
/** The review-exit facts a census is taken from (a structural slice of the exit's params + derived evidence). */
|
|
24
|
+
export interface ReviewExitCensusInput {
|
|
25
|
+
productId: string;
|
|
26
|
+
focusId: string;
|
|
27
|
+
sessionId: string;
|
|
28
|
+
sessionType: 'coding' | 'review';
|
|
29
|
+
succeeded: boolean;
|
|
30
|
+
reviewInspected?: boolean;
|
|
31
|
+
windowOpen: boolean;
|
|
32
|
+
coveredSha: string | null;
|
|
33
|
+
coverageComplete: boolean;
|
|
34
|
+
reportExists: boolean;
|
|
35
|
+
reviewOutcome: 'approved' | 'gaps_found' | null;
|
|
36
|
+
deliveries: ReadonlyArray<{
|
|
37
|
+
id: string;
|
|
38
|
+
executionStatus?: string | null;
|
|
39
|
+
iterationCount?: number | null;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Take the census of a review exit (see the module header). Only a REVIEW session
|
|
44
|
+
* exiting with its window open and a known covered commit judges anything; any
|
|
45
|
+
* other exit records nothing. The exit approves the commit when its report says
|
|
46
|
+
* approved, or when it is a clean (no report), succeeded, inspected,
|
|
47
|
+
* coverage-complete review -- the two shapes that approve a commit
|
|
48
|
+
* (queries/focus-review-approval.ts). No-op without a writer (a partial test deps
|
|
49
|
+
* object). Never throws.
|
|
50
|
+
*/
|
|
51
|
+
export declare function recordReviewExitCensus(write: ((census: ReviewCensus) => boolean) | undefined, input: ReviewExitCensusInput): void;
|
|
52
|
+
//# sourceMappingURL=review-census-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-census-record.d.ts","sourceRoot":"","sources":["../../src/completion/review-census-record.ts"],"names":[],"mappings":"AAkDA,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,mHAAmH;IACnH,SAAS,EAAE,OAAO,CAAC;IACnB,8FAA8F;IAC9F,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AA8BD,6IAA6I;AAC7I,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,GAAE,MAAoB,GAAG,OAAO,CAa1F;AAED,uHAAuH;AACvH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAoB,GAAG,YAAY,EAAE,CAkBhH;AAED,iHAAiH;AACjH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAAC;IAChD,UAAU,EAAE,aAAa,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CAC5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,SAAS,EACtD,KAAK,EAAE,qBAAqB,GAC3B,IAAI,CAkBN"}
|
|
@@ -0,0 +1,145 @@
|
|
|
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/standing-approval-convergence.test.ts,
|
|
3
|
+
// packages/daemon/src/focus/unchanged-reviewed-head.test.ts,
|
|
4
|
+
// packages/daemon/src/integration/approved-head-hold-release-regression.test.ts,
|
|
5
|
+
// packages/daemon/src/integration/failed-verdict-review-exit-respawn-regression.test.ts,
|
|
6
|
+
// packages/daemon/src/integration/failed-verdict-review-loop-regression.test.ts,
|
|
7
|
+
// packages/daemon/src/integration/shortfall-ruling-disposes-proposals-regression.test.ts,
|
|
8
|
+
// packages/daemon/src/integration/standing-approval-release-regression.test.ts
|
|
9
|
+
// PINNED-BY-END
|
|
10
|
+
/**
|
|
11
|
+
* Which verify deliveries a review exit saw at the commit it covered, and whether
|
|
12
|
+
* that exit's own verdict approved the commit -- recorded durably.
|
|
13
|
+
*
|
|
14
|
+
* Review runs once per distinct focus head (completion/review-approved-head-gate.ts),
|
|
15
|
+
* so a verify delivery that becomes closable at an ALREADY-APPROVED head (a ruling
|
|
16
|
+
* released its shortfall park and verify then passed, with no new commit) converges
|
|
17
|
+
* on the standing approval instead of drawing another review
|
|
18
|
+
* (completion/standing-approval-convergence.ts). That is honest only for a delivery
|
|
19
|
+
* the approving review actually judged. The approval read names a commit, not the
|
|
20
|
+
* deliveries it judged, and no delivery read carries when it reached verify -- so a
|
|
21
|
+
* delivery that reached verify AFTER the approval at the same head (work that
|
|
22
|
+
* committed nothing) would be indistinguishable from one the review held. This
|
|
23
|
+
* record is the distinguishing fact: the review exit writes the verify deliveries
|
|
24
|
+
* it saw (with each one's re-code iteration count), the commit it covered and
|
|
25
|
+
* whether its verdict approved that commit. The iteration count is what makes the
|
|
26
|
+
* census about THAT pass of the delivery: org_nodes.iteration_count climbs on every
|
|
27
|
+
* verify_failed re-code cycle, so a delivery the exit (or anything after it) sent
|
|
28
|
+
* back to coding returns to verify with a different count and is no longer covered.
|
|
29
|
+
*
|
|
30
|
+
* One file per (product, focus, sha) under the global state dir, written atomically
|
|
31
|
+
* (temp + rename) and OVERWRITTEN by each later review exit covering the same
|
|
32
|
+
* commit: only the newest exit's census speaks for the commit, so a gaps_found exit
|
|
33
|
+
* after an approving one withdraws it, and a re-approval that no longer saw a
|
|
34
|
+
* delivery in verify does not carry an older census for it. A record that is
|
|
35
|
+
* missing, unreadable or malformed covers nothing (the convergence leaves the
|
|
36
|
+
* delivery in verify -- the safe direction). Host-local like the auto-approval
|
|
37
|
+
* record (completion/review-auto-approval-record.ts).
|
|
38
|
+
*
|
|
39
|
+
* @module completion/review-census-record
|
|
40
|
+
*/
|
|
41
|
+
import { DELIVERY_STATUS } from '@telora/daemon-core';
|
|
42
|
+
import { mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
43
|
+
import { resolve } from 'node:path';
|
|
44
|
+
import { resolveGlobalStateDir } from '../shell/daemon-process.js';
|
|
45
|
+
import { createLogger } from '../shell/log.js';
|
|
46
|
+
const log = createLogger({ module: 'focus-executor' });
|
|
47
|
+
const SHA_RE = /^[0-9a-f]{7,64}$/i;
|
|
48
|
+
function censusDir() {
|
|
49
|
+
return resolve(resolveGlobalStateDir(), 'review-census');
|
|
50
|
+
}
|
|
51
|
+
function filePrefix(productId, focusId) {
|
|
52
|
+
return `${productId}-${focusId}-`.replace(/[^a-zA-Z0-9._-]/g, '_');
|
|
53
|
+
}
|
|
54
|
+
function isCensusDelivery(raw) {
|
|
55
|
+
if (typeof raw !== 'object' || raw === null)
|
|
56
|
+
return false;
|
|
57
|
+
const r = raw;
|
|
58
|
+
return typeof r.id === 'string' && typeof r.iterationCount === 'number' && Number.isInteger(r.iterationCount);
|
|
59
|
+
}
|
|
60
|
+
function parseCensus(raw) {
|
|
61
|
+
if (typeof raw !== 'object' || raw === null)
|
|
62
|
+
return null;
|
|
63
|
+
const r = raw;
|
|
64
|
+
if (typeof r.productId !== 'string' || typeof r.focusId !== 'string' || typeof r.sessionId !== 'string')
|
|
65
|
+
return null;
|
|
66
|
+
if (typeof r.sha !== 'string' || !SHA_RE.test(r.sha) || typeof r.approving !== 'boolean' || typeof r.recordedAt !== 'string')
|
|
67
|
+
return null;
|
|
68
|
+
if (!Array.isArray(r.verifyDeliveries) || !r.verifyDeliveries.every(isCensusDelivery))
|
|
69
|
+
return null;
|
|
70
|
+
return {
|
|
71
|
+
productId: r.productId, focusId: r.focusId, sha: r.sha, sessionId: r.sessionId,
|
|
72
|
+
approving: r.approving, verifyDeliveries: r.verifyDeliveries, recordedAt: r.recordedAt,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Record a census atomically, replacing the commit's previous one. Best-effort: false (and logged) on a malformed sha or a failed write. */
|
|
76
|
+
export function writeReviewCensus(census, dir = censusDir()) {
|
|
77
|
+
if (!SHA_RE.test(census.sha))
|
|
78
|
+
return false;
|
|
79
|
+
const path = resolve(dir, `${filePrefix(census.productId, census.focusId)}${census.sha.replace(/[^a-zA-Z0-9]/g, '_')}.json`);
|
|
80
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
81
|
+
try {
|
|
82
|
+
mkdirSync(dir, { recursive: true });
|
|
83
|
+
writeFileSync(tmp, JSON.stringify(census, null, 2), { mode: 0o600 });
|
|
84
|
+
renameSync(tmp, path);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
log.warn(`[focus-executor] failed to record the review census of ${census.focusId}@${census.sha.slice(0, 8)}: ${err.message}`);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Every census recorded for the focus, newest first. Empty when none can be read: a missing census covers nothing. */
|
|
93
|
+
export function listReviewCensuses(productId, focusId, dir = censusDir()) {
|
|
94
|
+
const prefix = filePrefix(productId, focusId);
|
|
95
|
+
let names;
|
|
96
|
+
try {
|
|
97
|
+
names = readdirSync(dir).filter((name) => name.startsWith(prefix) && name.endsWith('.json'));
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
const censuses = [];
|
|
103
|
+
for (const name of names) {
|
|
104
|
+
try {
|
|
105
|
+
const parsed = parseCensus(JSON.parse(readFileSync(resolve(dir, name), 'utf8')));
|
|
106
|
+
if (parsed && parsed.productId === productId && parsed.focusId === focusId)
|
|
107
|
+
censuses.push(parsed);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// Unreadable or malformed: covers nothing.
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return censuses.sort((a, b) => Date.parse(b.recordedAt) - Date.parse(a.recordedAt));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Take the census of a review exit (see the module header). Only a REVIEW session
|
|
117
|
+
* exiting with its window open and a known covered commit judges anything; any
|
|
118
|
+
* other exit records nothing. The exit approves the commit when its report says
|
|
119
|
+
* approved, or when it is a clean (no report), succeeded, inspected,
|
|
120
|
+
* coverage-complete review -- the two shapes that approve a commit
|
|
121
|
+
* (queries/focus-review-approval.ts). No-op without a writer (a partial test deps
|
|
122
|
+
* object). Never throws.
|
|
123
|
+
*/
|
|
124
|
+
export function recordReviewExitCensus(write, input) {
|
|
125
|
+
if (!write || input.sessionType !== 'review' || !input.windowOpen || !input.coveredSha)
|
|
126
|
+
return;
|
|
127
|
+
const cleanApproval = !input.reportExists && input.succeeded && input.reviewInspected !== false && input.coverageComplete;
|
|
128
|
+
try {
|
|
129
|
+
write({
|
|
130
|
+
productId: input.productId,
|
|
131
|
+
focusId: input.focusId,
|
|
132
|
+
sha: input.coveredSha,
|
|
133
|
+
sessionId: input.sessionId,
|
|
134
|
+
approving: input.reviewOutcome === 'approved' || cleanApproval,
|
|
135
|
+
verifyDeliveries: input.deliveries
|
|
136
|
+
.filter((d) => d.executionStatus === DELIVERY_STATUS.VERIFY)
|
|
137
|
+
.map((d) => ({ id: d.id, iterationCount: d.iterationCount ?? 0 })),
|
|
138
|
+
recordedAt: new Date().toISOString(),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
log.warn(`[focus-executor] review census not recorded for ${input.focusId}: ${err.message}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=review-census-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-census-record.js","sourceRoot":"","sources":["../../src/completion/review-census-record.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,mFAAmF;AACnF,+DAA+D;AAC/D,mFAAmF;AACnF,2FAA2F;AAC3F,mFAAmF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AAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,CAAC,EAAE,CAAC,CAAC;YACpE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,mDAAmD,KAAK,CAAC,OAAO,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;AACH,CAAC"}
|
|
@@ -21,8 +21,9 @@ import { getDeliveryIssues, rehomeIssueToDelivery } from '../queries/issues.js';
|
|
|
21
21
|
import { createEscalation, hasOpenFocusEscalation, hasOpenEscalationForDelivery } from '../queries/escalations.js';
|
|
22
22
|
import { findOpenOperatorHoldForDelivery } from '../queries/holds.js';
|
|
23
23
|
import { listOpenShortfallProposalIds } from '../queries/reality-tree.js';
|
|
24
|
-
import type { CommitVerdictGateDeps } from './review-exit-verdict-gate.js';
|
|
24
|
+
import type { CommitVerdictGateDeps, FailedGateVerdict } from './review-exit-verdict-gate.js';
|
|
25
25
|
import { type ReviewAutoApproval } from './review-auto-approval-record.js';
|
|
26
|
+
import { type ReviewCensus } from './review-census-record.js';
|
|
26
27
|
/**
|
|
27
28
|
* Dependencies for runReviewExitHandler. Defaults to real implementations;
|
|
28
29
|
* overridable in tests via the optional `deps` argument.
|
|
@@ -36,7 +37,10 @@ export interface ReviewExitDeps {
|
|
|
36
37
|
updateDeliveryStatus: typeof updateDeliveryStatus;
|
|
37
38
|
markDeliveryAutoApproved: typeof markDeliveryAutoApproved;
|
|
38
39
|
recordReviewAutoApproval?: (approval: ReviewAutoApproval) => boolean;
|
|
40
|
+
recordReviewCensus?: (census: ReviewCensus) => boolean;
|
|
39
41
|
clearReviewRequestedAt: typeof clearReviewRequestedAt;
|
|
42
|
+
fileReworkForFailedVerdict?: (focusId: string, verdict: FailedGateVerdict) => Promise<number>;
|
|
43
|
+
clearPendingReviewDirective?: (focusId: string) => boolean;
|
|
40
44
|
setReviewedThroughSha: typeof setReviewedThroughSha;
|
|
41
45
|
setReviewCycleCount?: typeof setReviewCycleCount;
|
|
42
46
|
resolveReviewCycleCap?: typeof resolveReviewCycleCap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-exit-deps.d.ts","sourceRoot":"","sources":["../../src/completion/review-exit-deps.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAsB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEhI,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClI,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"review-exit-deps.d.ts","sourceRoot":"","sources":["../../src/completion/review-exit-deps.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAsB,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEhI,OAAO,EAA6C,KAAK,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClI,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAA+B,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAA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AAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAClH,sBAAsB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxE,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,CAAC;IAC3C,4BAA4B,CAAC,EAAE,OAAO,4BAA4B,CAAC;IACnE,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;IAC1D,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,8BAA8B,EAAE,OAAO,8BAA8B,CAAC;IAMtE,2BAA2B,CAAC,EAAE,OAAO,2BAA2B,CAAC;IACjE,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;CAC3C;AAED,eAAO,MAAM,qBAAqB,EAAE,cA0CnC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by:
|
|
2
|
+
// Pinned by: packages/daemon/src/integration/failed-verdict-review-exit-respawn-regression.test.ts
|
|
3
3
|
// PINNED-BY-END
|
|
4
4
|
/**
|
|
5
5
|
* Dependency contract + default wiring for the review-exit phase.
|
|
@@ -17,7 +17,7 @@ import { updateDeliveryStatus, markDeliveryAutoApproved, getDeliveryContext, get
|
|
|
17
17
|
import { getFocusWorktree } from '../focus/focus-worktree-state.js';
|
|
18
18
|
import { blameLineCommits, listReviewWindowCommits } from '../resolvers/shared/review-window-commits.js';
|
|
19
19
|
import { getActiveFocuses } from '../queries/focus-discovery.js';
|
|
20
|
-
import { hasPendingSpawnDirective } from '../directive/directive-queue.js';
|
|
20
|
+
import { clearPendingReviewDirective, hasPendingSpawnDirective } from '../directive/directive-queue.js';
|
|
21
21
|
import { emitLoopTrigger } from '../loops/index.js';
|
|
22
22
|
import { getFocusDeliveries, getFocusIssues, clearReviewRequestedAt, setReviewedThroughSha, setReviewCycleCount, setReviewHandoffCount, getFocusReviewReportForSession, getFocusReviewFiledIssueIds, } from '../queries/focuses.js';
|
|
23
23
|
import { resolveReviewCycleCap, resolveReviewHandoffCap } from '../verify/stall-detector-config.js';
|
|
@@ -27,6 +27,8 @@ import { findOpenOperatorHoldForDelivery } from '../queries/holds.js';
|
|
|
27
27
|
import { listOpenShortfallProposalIds } from '../queries/reality-tree.js';
|
|
28
28
|
import { commitGateSeams } from '../verify/commit-gate-configured.js';
|
|
29
29
|
import { writeReviewAutoApproval } from './review-auto-approval-record.js';
|
|
30
|
+
import { writeReviewCensus } from './review-census-record.js';
|
|
31
|
+
import { fileReworkForFailedVerdict } from '../verify/verification-rework-issue.js';
|
|
30
32
|
export const defaultReviewExitDeps = {
|
|
31
33
|
getActiveFocuses,
|
|
32
34
|
getFocusDeliveries,
|
|
@@ -36,7 +38,10 @@ export const defaultReviewExitDeps = {
|
|
|
36
38
|
updateDeliveryStatus,
|
|
37
39
|
markDeliveryAutoApproved,
|
|
38
40
|
recordReviewAutoApproval: (approval) => writeReviewAutoApproval(approval),
|
|
41
|
+
recordReviewCensus: (census) => writeReviewCensus(census),
|
|
39
42
|
clearReviewRequestedAt,
|
|
43
|
+
fileReworkForFailedVerdict: (focusId, verdict) => fileReworkForFailedVerdict(focusId, verdict),
|
|
44
|
+
clearPendingReviewDirective,
|
|
40
45
|
setReviewedThroughSha,
|
|
41
46
|
setReviewCycleCount,
|
|
42
47
|
resolveReviewCycleCap,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-exit-deps.js","sourceRoot":"","sources":["../../src/completion/review-exit-deps.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,
|
|
1
|
+
{"version":3,"file":"review-exit-deps.js","sourceRoot":"","sources":["../../src/completion/review-exit-deps.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,mGAAmG;AACnG,gBAAgB;AAEhB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,sBA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AAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,IAAI;IACvG,gBAAgB;IAChB,4BAA4B;IAC5B,wBAAwB;IACxB,eAAe;IACf,8BAA8B;IAC9B,2BAA2B;IAC3B,gBAAgB;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-exit-phase.d.ts","sourceRoot":"","sources":["../../src/completion/review-exit-phase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"review-exit-phase.d.ts","sourceRoot":"","sources":["../../src/completion/review-exit-phase.ts"],"names":[],"mappings":"AAiDA,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAMD,OAAO,EACL,iCAAiC,EACjC,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,gGAAgG;AAChG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAMnE;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,IAAI,GAAE,cAAsC,GAC3C,OAAO,CAAC,IAAI,CAAC,CA8lBf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by:
|
|
2
|
+
// Pinned by: 34 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/completion/review-exit-phase.ts
|
|
3
3
|
// PINNED-BY-END
|
|
4
4
|
/**
|
|
5
5
|
* Review-exit phase of the team completion flow.
|
|
@@ -22,12 +22,14 @@ import { resolveShortfallHold, writeShortfallGateState, describeShortfallHold, }
|
|
|
22
22
|
import { recordReviewCycleAndMaybeHold } from './review-cycle-cap.js';
|
|
23
23
|
import { fileCoverageIncompleteEscalation, fileGapsWithoutIssueEscalation, fileMissingReportNotice, recordHandoffAndMaybeTerminate, } from './review-exit-escalations.js';
|
|
24
24
|
import { forceFullPassReviewFocuses, recordBelowCoverageDrift, resetCoverageDriftState } from './coverage-drift-state.js';
|
|
25
|
-
import { resolveReviewCycleProgress, emitReviewCompleted } from './review-exit-progress.js';
|
|
26
|
-
import { holdForCommitVerdict, logCommitVerdictHeldExit, reviewReworkGateState } from './review-exit-verdict-gate.js';
|
|
25
|
+
import { resolveReviewCycleProgress, emitReviewCompleted, logLeftInVerifyWithoutSignal } from './review-exit-progress.js';
|
|
26
|
+
import { closeFailedVerdictExit, holdForCommitVerdict, logCommitVerdictHeldExit, reviewReworkGateState } from './review-exit-verdict-gate.js';
|
|
27
|
+
import { refusesReworkOnShortfallPark, logShortfallParkedExit } from './review-exit-shortfall-park.js';
|
|
27
28
|
import { resolveGapsAttribution } from './review-exit-attribution.js';
|
|
28
29
|
import { resolveOutsideWindowFindings, rehomeOutsideWindowFindings } from './review-exit-rehoming.js';
|
|
29
30
|
import { scopeReviewEvidenceToOwnWork } from './review-exit-foreign-findings.js';
|
|
30
31
|
import { gatherReviewExitEvidence } from './review-exit-evidence.js';
|
|
32
|
+
import { recordReviewExitCensus } from './review-census-record.js';
|
|
31
33
|
import { createLogger } from '../shell/log.js';
|
|
32
34
|
import { defaultReviewExitDeps } from './review-exit-deps.js';
|
|
33
35
|
const log = createLogger({ module: 'focus-executor' });
|
|
@@ -170,6 +172,8 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
170
172
|
// team that left pre-existing open work behind no longer needs the review
|
|
171
173
|
// agent to file fresh defects before the loop can correct itself.
|
|
172
174
|
const reviewDeliveries = await deps.getFocusDeliveries(focusId);
|
|
175
|
+
// Which verify deliveries this review saw at the commit it covered (review-census-record.ts): the standing-approval convergence reads it.
|
|
176
|
+
recordReviewExitCensus(deps.recordReviewCensus, { ...params, windowOpen, coveredSha, coverageComplete, reportExists, reviewOutcome, deliveries: reviewDeliveries });
|
|
173
177
|
// Judge only THIS focus's work: a blocking finding about another focus's commit (by Telora-Delivery
|
|
174
178
|
// trailer) is moved to its owner and leaves the target sets; an all-foreign gaps_found verdict resolves
|
|
175
179
|
// (not 'unresolvable'), so the in-verify delivery converges on merit (review-exit-foreign-findings.ts).
|
|
@@ -205,6 +209,9 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
205
209
|
// Set when a delivery's done / verify_failed route is held on the gate verdict for the
|
|
206
210
|
// commit it judges (review-exit-verdict-gate.ts). Keeps the review window open.
|
|
207
211
|
let verdictHeldAny = false;
|
|
212
|
+
let verdictFailed = null; // held on a verdict to come / on a FAILED one
|
|
213
|
+
// Set when a verify delivery's verify_failed route is refused by a shortfall park (review-exit-shortfall-park.ts).
|
|
214
|
+
let parkedAny = false;
|
|
208
215
|
// attributionResolvable (scoped above): whether the gaps_found verdict resolved
|
|
209
216
|
// to ANY delivery (or only to relocated foreign findings). When false, every
|
|
210
217
|
// delivery reads 'unresolvable' -- absence of attribution holds toward intent.
|
|
@@ -318,12 +325,19 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
318
325
|
continue;
|
|
319
326
|
}
|
|
320
327
|
}
|
|
328
|
+
if (isVerify && target === DELIVERY_STATUS.VERIFY_FAILED && refusesReworkOnShortfallPark(d)) {
|
|
329
|
+
parkedAny = true;
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
321
332
|
// Commit-verdict gate (review-exit-verdict-gate.ts): done where a done write follows; a verify delivery's verify_failed.
|
|
322
333
|
const verdictGatedRoute = target === DELIVERY_STATUS.DONE ? (shortfallsClear && (reportExists || coverageComplete) ? 'done' : null)
|
|
323
334
|
: isVerify && target === DELIVERY_STATUS.VERIFY_FAILED ? 'verify_failed' : null;
|
|
324
335
|
const verdictGate = verdictGatedRoute ? await holdForCommitVerdict(deps, params, current, d, verdictGatedRoute) : null;
|
|
325
336
|
if (verdictGate?.held) {
|
|
326
|
-
|
|
337
|
+
if (verdictGate.failed !== undefined)
|
|
338
|
+
verdictFailed = verdictGate;
|
|
339
|
+
else
|
|
340
|
+
verdictHeldAny = true;
|
|
327
341
|
continue;
|
|
328
342
|
}
|
|
329
343
|
if (target === DELIVERY_STATUS.VERIFY_FAILED) {
|
|
@@ -398,14 +412,8 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
398
412
|
}
|
|
399
413
|
}
|
|
400
414
|
else {
|
|
401
|
-
// No signal to auto-approve
|
|
402
|
-
|
|
403
|
-
// only when the window CLOSES (review_complete or the silence/staleness deadline).
|
|
404
|
-
const reason = sessionType !== 'review'
|
|
405
|
-
? `${sessionType} session exited (not eligible for auto-approve)`
|
|
406
|
-
: 'review session did not succeed';
|
|
407
|
-
log.info(`[focus-executor] Delivery "${d.name}" left in verify: ${reason} ` +
|
|
408
|
-
`(verify-cycling; review_requested_at still set -> auto-review suppressed until the window closes).`);
|
|
415
|
+
// No signal to auto-approve; the window stays set (review-exit-progress.ts logLeftInVerifyWithoutSignal).
|
|
416
|
+
logLeftInVerifyWithoutSignal(d.name, sessionType);
|
|
409
417
|
}
|
|
410
418
|
}
|
|
411
419
|
catch (err) {
|
|
@@ -422,6 +430,8 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
422
430
|
// reportExists=true, and that notice requires !reportExists, so the two can
|
|
423
431
|
// never double-fire for one exit.
|
|
424
432
|
const gapsWithoutIssue = reviewOutcome === 'gaps_found' && !hasBlockingIssueEvidence;
|
|
433
|
+
if (verdictFailed)
|
|
434
|
+
await closeFailedVerdictExit(deps, params, verdictFailed, verdictHeldAny);
|
|
425
435
|
if (routedAny) {
|
|
426
436
|
// A delivery held on its gate verdict still owns this window: the release replay converges it.
|
|
427
437
|
if (!verdictHeldAny)
|
|
@@ -496,9 +506,12 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
496
506
|
gapsWithoutIssue, reportExists, hasBlockingIssueEvidence, sessionType, succeeded, reviewInspected,
|
|
497
507
|
});
|
|
498
508
|
}
|
|
499
|
-
else if (verdictHeldAny) {
|
|
500
|
-
// Ahead of the hand-off bound: a gate run, not an incoming team, owns this wait
|
|
501
|
-
|
|
509
|
+
else if (verdictHeldAny || parkedAny || verdictFailed) {
|
|
510
|
+
// Ahead of the hand-off bound: a gate run or a verify re-judgement, not an incoming team, owns this wait.
|
|
511
|
+
if (verdictHeldAny)
|
|
512
|
+
logCommitVerdictHeldExit(focusName);
|
|
513
|
+
else if (parkedAny)
|
|
514
|
+
logShortfallParkedExit(focusName);
|
|
502
515
|
}
|
|
503
516
|
else if (deps.hasPendingSpawnDirective(focusId)) {
|
|
504
517
|
// Nothing routed AND a spawn directive is pending: the team was torn down
|
|
@@ -626,7 +639,7 @@ export async function runReviewExitHandler(params, deps = defaultReviewExitDeps)
|
|
|
626
639
|
// converged focus carries no pending operator rows (the 2026-09-10 stranded
|
|
627
640
|
// review-family rows and the 2026-09-09 team_failure-after-last-delivery row).
|
|
628
641
|
if (convergedAny && !anyReopenedToVerifyFailed && !operatorHeldAny &&
|
|
629
|
-
!externalHeldAny && !shortfallHold && !belowCoverageHold && !verdictHeldAny &&
|
|
642
|
+
!externalHeldAny && !shortfallHold && !belowCoverageHold && !verdictHeldAny && !verdictFailed &&
|
|
630
643
|
deps.resolveConvergedFocusEscalations &&
|
|
631
644
|
reviewDeliveries.every(d => d.executionStatus === DELIVERY_STATUS.DONE ||
|
|
632
645
|
d.executionStatus === DELIVERY_STATUS.CANCELLED ||
|