@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,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git trailer key that attributes a commit to the delivery whose work it is.
|
|
3
|
+
* Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
|
|
4
|
+
* template). The value is the delivery UUID. The trailer travels with the commit
|
|
5
|
+
* object, so it survives fast-forward and rebase exactly like the recorded commit
|
|
6
|
+
* set -- reading it is reading a durable fact, not re-deriving from branch topology.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DELIVERY_TRAILER_KEY = "Telora-Delivery";
|
|
9
|
+
/**
|
|
10
|
+
* The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
|
|
11
|
+
* belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
|
|
12
|
+
* capture, generated-lockfile remediation), or any genuinely delivery-less
|
|
13
|
+
* commit -- declares that by stamping `Telora-Delivery: none` rather than
|
|
14
|
+
* omitting the trailer or borrowing a real delivery id.
|
|
15
|
+
*
|
|
16
|
+
* It is a TRAILER value, not a bypass token: git's own trailer parser reads it
|
|
17
|
+
* back, so a sentinel commit is still a LABELLED commit. That keeps the verify
|
|
18
|
+
* gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
|
|
19
|
+
* and stays distinguishable from a legacy pre-convention batch where the
|
|
20
|
+
* trailer is genuinely absent. The single source of truth for the literal:
|
|
21
|
+
* both the commit-msg guard (audit-hooks) and the daemon-side stamp
|
|
22
|
+
* (worktree/scratch-guard) import it from here, and the partition read below
|
|
23
|
+
* classifies it as its own third state. Compared case-insensitively.
|
|
24
|
+
*/
|
|
25
|
+
export declare const NON_DELIVERY_SENTINEL = "none";
|
|
26
|
+
/**
|
|
27
|
+
* The trailer VALUE for delivery work the daemon captured without being able to
|
|
28
|
+
* tell which delivery it belongs to (an agent-exit or safety capture whose paths
|
|
29
|
+
* no delivery claims, or whose delivery read failed). Distinct from
|
|
30
|
+
* {@link NON_DELIVERY_SENTINEL} on purpose: `none` declares housekeeping that
|
|
31
|
+
* belongs to no delivery, while this declares real delivery work whose delivery
|
|
32
|
+
* is unknown. A capture stamped `none` held a delivery's whole implementation
|
|
33
|
+
* and verify dropped it as housekeeping on every pass (Tinker Tailor 1bc76c8e).
|
|
34
|
+
* Compared case-insensitively.
|
|
35
|
+
*/
|
|
36
|
+
export declare const UNATTRIBUTED_CAPTURE_SENTINEL = "unattributed";
|
|
37
|
+
/**
|
|
38
|
+
* Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
|
|
39
|
+
* string exactly as git's trailer parser returns it. That is a delivery UUID, the
|
|
40
|
+
* literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
|
|
41
|
+
* the commit carries no such trailer. Empty on any git failure.
|
|
42
|
+
*
|
|
43
|
+
* NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
|
|
44
|
+
* merge) and is distinct from the sentinel string. Callers that must reason about
|
|
45
|
+
* "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
|
|
46
|
+
* partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
|
|
47
|
+
* value into the three states explicitly rather than overloading this string.
|
|
48
|
+
* This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
|
|
49
|
+
* and the id-equality confirmation in resolveGitTrailerCommitSet.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readDeliveryTrailer(worktreePath: string, sha: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The four attribution states a commit's `Telora-Delivery` trailer can hold --
|
|
54
|
+
* the partition the verify gate reasons over.
|
|
55
|
+
*
|
|
56
|
+
* - `delivery`: attributed to a specific delivery (a UUID). Its work belongs to
|
|
57
|
+
* that delivery's evidence.
|
|
58
|
+
* - `sentinel`: the explicit non-delivery marker ({@link NON_DELIVERY_SENTINEL}).
|
|
59
|
+
* A DELIBERATELY unattributed commit -- daemon housekeeping (safety / WIP /
|
|
60
|
+
* lockfile). Fully accounted for, but belongs to NO delivery's evidence.
|
|
61
|
+
* - `unattributed_capture`: the {@link UNATTRIBUTED_CAPTURE_SENTINEL} marker. Delivery
|
|
62
|
+
* work the daemon captured without knowing its delivery. Labelled (so a batch
|
|
63
|
+
* of them is partitionable, like sentinels) and in NO delivery's evidence, but
|
|
64
|
+
* it is work, not housekeeping: verify names these commits instead of
|
|
65
|
+
* dropping them silently.
|
|
66
|
+
* - `unattributed`: no parseable trailer. A merge commit (exempt by shape at the
|
|
67
|
+
* hook), or a legacy / genuinely-negligent commit whose attribution is missing.
|
|
68
|
+
* This is the state the total-attribution-failure guard reacts to.
|
|
69
|
+
*
|
|
70
|
+
* The point of the discriminated result is that `sentinel` and `unattributed` are
|
|
71
|
+
* NOT the same fact, even though the raw trailer read collapses both toward ''
|
|
72
|
+
* (unattributed) vs the literal 'none' (sentinel): a batch of all-sentinel commits
|
|
73
|
+
* is COMPLETELY attributed and the gate can render a verdict, whereas a batch with
|
|
74
|
+
* genuinely `unattributed` commits (and no delivery anchor) is the loud
|
|
75
|
+
* total-attribution failure that must NOT be laundered into apparent completeness.
|
|
76
|
+
*/
|
|
77
|
+
export type TrailerAttribution = {
|
|
78
|
+
readonly kind: 'delivery';
|
|
79
|
+
readonly deliveryId: string;
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'sentinel';
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: 'unattributed_capture';
|
|
84
|
+
} | {
|
|
85
|
+
readonly kind: 'unattributed';
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Classify a single commit's `Telora-Delivery` trailer into its four-state
|
|
89
|
+
* attribution. Sentinel matches are case-insensitive (matching the commit-msg
|
|
90
|
+
* guard and the stamp). A merge commit carries no trailer, so it classifies as
|
|
91
|
+
* `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
|
|
92
|
+
* the read: both are excluded from every delivery's evidence, and both only feed
|
|
93
|
+
* the loudness check when there is no delivery anchor in the batch (so an
|
|
94
|
+
* incidental merge among real delivery commits never trips it).
|
|
95
|
+
*/
|
|
96
|
+
export declare function classifyDeliveryTrailer(worktreePath: string, sha: string): TrailerAttribution;
|
|
97
|
+
/** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
|
|
98
|
+
export declare function classifyTrailerValue(raw: string): TrailerAttribution;
|
|
99
|
+
//# sourceMappingURL=delivery-trailer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-trailer.d.ts","sourceRoot":"","sources":["../../../src/resolvers/shared/delivery-trailer.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAe7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GACzC;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAE7F;AAED,6GAA6G;AAC7G,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAKpE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/merge/attributed-capture-merge-gate.test.ts,
|
|
3
|
+
// packages/daemon/src/resolvers/git-diff-delivery-attribution.test.ts,
|
|
4
|
+
// packages/daemon/src/shell/safety-capture-entry-points.test.ts,
|
|
5
|
+
// packages/daemon/src/worktree/capture-attribution-commit.test.ts
|
|
6
|
+
// PINNED-BY-END
|
|
7
|
+
/**
|
|
8
|
+
* The Telora-Delivery trailer vocabulary: the trailer key, the sentinel values a
|
|
9
|
+
* commit may carry instead of a delivery id, and the one classification rule
|
|
10
|
+
* every reader of attribution applies.
|
|
11
|
+
*
|
|
12
|
+
* Split out of resolvers/shared/git-diff.ts (file-size limit), which re-exports
|
|
13
|
+
* every name here so existing importers keep working.
|
|
14
|
+
*/
|
|
15
|
+
import { execSync } from 'node:child_process';
|
|
16
|
+
/**
|
|
17
|
+
* The git trailer key that attributes a commit to the delivery whose work it is.
|
|
18
|
+
* Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
|
|
19
|
+
* template). The value is the delivery UUID. The trailer travels with the commit
|
|
20
|
+
* object, so it survives fast-forward and rebase exactly like the recorded commit
|
|
21
|
+
* set -- reading it is reading a durable fact, not re-deriving from branch topology.
|
|
22
|
+
*/
|
|
23
|
+
export const DELIVERY_TRAILER_KEY = 'Telora-Delivery';
|
|
24
|
+
/**
|
|
25
|
+
* The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
|
|
26
|
+
* belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
|
|
27
|
+
* capture, generated-lockfile remediation), or any genuinely delivery-less
|
|
28
|
+
* commit -- declares that by stamping `Telora-Delivery: none` rather than
|
|
29
|
+
* omitting the trailer or borrowing a real delivery id.
|
|
30
|
+
*
|
|
31
|
+
* It is a TRAILER value, not a bypass token: git's own trailer parser reads it
|
|
32
|
+
* back, so a sentinel commit is still a LABELLED commit. That keeps the verify
|
|
33
|
+
* gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
|
|
34
|
+
* and stays distinguishable from a legacy pre-convention batch where the
|
|
35
|
+
* trailer is genuinely absent. The single source of truth for the literal:
|
|
36
|
+
* both the commit-msg guard (audit-hooks) and the daemon-side stamp
|
|
37
|
+
* (worktree/scratch-guard) import it from here, and the partition read below
|
|
38
|
+
* classifies it as its own third state. Compared case-insensitively.
|
|
39
|
+
*/
|
|
40
|
+
export const NON_DELIVERY_SENTINEL = 'none';
|
|
41
|
+
/**
|
|
42
|
+
* The trailer VALUE for delivery work the daemon captured without being able to
|
|
43
|
+
* tell which delivery it belongs to (an agent-exit or safety capture whose paths
|
|
44
|
+
* no delivery claims, or whose delivery read failed). Distinct from
|
|
45
|
+
* {@link NON_DELIVERY_SENTINEL} on purpose: `none` declares housekeeping that
|
|
46
|
+
* belongs to no delivery, while this declares real delivery work whose delivery
|
|
47
|
+
* is unknown. A capture stamped `none` held a delivery's whole implementation
|
|
48
|
+
* and verify dropped it as housekeeping on every pass (Tinker Tailor 1bc76c8e).
|
|
49
|
+
* Compared case-insensitively.
|
|
50
|
+
*/
|
|
51
|
+
export const UNATTRIBUTED_CAPTURE_SENTINEL = 'unattributed';
|
|
52
|
+
/**
|
|
53
|
+
* Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
|
|
54
|
+
* string exactly as git's trailer parser returns it. That is a delivery UUID, the
|
|
55
|
+
* literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
|
|
56
|
+
* the commit carries no such trailer. Empty on any git failure.
|
|
57
|
+
*
|
|
58
|
+
* NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
|
|
59
|
+
* merge) and is distinct from the sentinel string. Callers that must reason about
|
|
60
|
+
* "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
|
|
61
|
+
* partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
|
|
62
|
+
* value into the three states explicitly rather than overloading this string.
|
|
63
|
+
* This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
|
|
64
|
+
* and the id-equality confirmation in resolveGitTrailerCommitSet.
|
|
65
|
+
*/
|
|
66
|
+
export function readDeliveryTrailer(worktreePath, sha) {
|
|
67
|
+
const clean = (sha ?? '').trim();
|
|
68
|
+
if (clean === '')
|
|
69
|
+
return '';
|
|
70
|
+
try {
|
|
71
|
+
// Single-quote the format: the `%(...)` parentheses are shell metacharacters.
|
|
72
|
+
const out = execSync(`git show -s '--format=%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly)' ${clean}^{commit}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
|
|
73
|
+
// A commit can in principle carry several trailer lines; take the first
|
|
74
|
+
// non-empty value -- attribution is single-delivery by construction.
|
|
75
|
+
return out.split('\n').map((l) => l.trim()).find((l) => l !== '') ?? '';
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Classify a single commit's `Telora-Delivery` trailer into its four-state
|
|
83
|
+
* attribution. Sentinel matches are case-insensitive (matching the commit-msg
|
|
84
|
+
* guard and the stamp). A merge commit carries no trailer, so it classifies as
|
|
85
|
+
* `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
|
|
86
|
+
* the read: both are excluded from every delivery's evidence, and both only feed
|
|
87
|
+
* the loudness check when there is no delivery anchor in the batch (so an
|
|
88
|
+
* incidental merge among real delivery commits never trips it).
|
|
89
|
+
*/
|
|
90
|
+
export function classifyDeliveryTrailer(worktreePath, sha) {
|
|
91
|
+
return classifyTrailerValue(readDeliveryTrailer(worktreePath, sha));
|
|
92
|
+
}
|
|
93
|
+
/** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
|
|
94
|
+
export function classifyTrailerValue(raw) {
|
|
95
|
+
if (raw === '')
|
|
96
|
+
return { kind: 'unattributed' };
|
|
97
|
+
if (raw.toLowerCase() === NON_DELIVERY_SENTINEL.toLowerCase())
|
|
98
|
+
return { kind: 'sentinel' };
|
|
99
|
+
if (raw.toLowerCase() === UNATTRIBUTED_CAPTURE_SENTINEL.toLowerCase())
|
|
100
|
+
return { kind: 'unattributed_capture' };
|
|
101
|
+
return { kind: 'delivery', deliveryId: raw };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=delivery-trailer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-trailer.js","sourceRoot":"","sources":["../../../src/resolvers/shared/delivery-trailer.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8EAA8E;AAC9E,yEAAyE;AACzE,mEAAmE;AACnE,oEAAoE;AACpE,gBAAgB;AAEhB;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAoB,EAAE,GAAW;IACnE,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,KAAK,KAAK,EAAE;QAAE,OA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KEY, NON_DELIVERY_SENTINEL, UNATTRIBUTED_CAPTURE_SENTINEL, readDeliveryTrailer, classifyDeliveryTrailer, classifyTrailerValue, type TrailerAttribution, } from './delivery-trailer.js';
|
|
1
2
|
export declare const MAX_DIFF_BYTES: number;
|
|
2
3
|
/**
|
|
3
4
|
* Run `git diff <range>` in a worktree. Returns the raw diff output, or empty
|
|
@@ -112,86 +113,6 @@ export declare function resolveRecordedCommitRange(worktreePath: string, commitS
|
|
|
112
113
|
* the reason this source exists rather than deriving the boundary from that array.
|
|
113
114
|
*/
|
|
114
115
|
export declare function resolveRecordedFastForwardRange(worktreePath: string, preMergeRef: string | null | undefined, mergeBackSha: string | null | undefined): string | null;
|
|
115
|
-
/**
|
|
116
|
-
* The git trailer key that attributes a commit to the delivery whose work it is.
|
|
117
|
-
* Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
|
|
118
|
-
* template). The value is the delivery UUID. The trailer travels with the commit
|
|
119
|
-
* object, so it survives fast-forward and rebase exactly like the recorded commit
|
|
120
|
-
* set -- reading it is reading a durable fact, not re-deriving from branch topology.
|
|
121
|
-
*/
|
|
122
|
-
export declare const DELIVERY_TRAILER_KEY = "Telora-Delivery";
|
|
123
|
-
/**
|
|
124
|
-
* The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
|
|
125
|
-
* belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
|
|
126
|
-
* capture, generated-lockfile remediation), or any genuinely delivery-less
|
|
127
|
-
* commit -- declares that by stamping `Telora-Delivery: none` rather than
|
|
128
|
-
* omitting the trailer or borrowing a real delivery id.
|
|
129
|
-
*
|
|
130
|
-
* It is a TRAILER value, not a bypass token: git's own trailer parser reads it
|
|
131
|
-
* back, so a sentinel commit is still a LABELLED commit. That keeps the verify
|
|
132
|
-
* gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
|
|
133
|
-
* and stays distinguishable from a legacy pre-convention batch where the
|
|
134
|
-
* trailer is genuinely absent. The single source of truth for the literal:
|
|
135
|
-
* both the commit-msg guard (audit-hooks) and the daemon-side stamp
|
|
136
|
-
* (worktree/scratch-guard) import it from here, and the partition read below
|
|
137
|
-
* classifies it as its own third state. Compared case-insensitively.
|
|
138
|
-
*/
|
|
139
|
-
export declare const NON_DELIVERY_SENTINEL = "none";
|
|
140
|
-
/**
|
|
141
|
-
* Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
|
|
142
|
-
* string exactly as git's trailer parser returns it. That is a delivery UUID, the
|
|
143
|
-
* literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
|
|
144
|
-
* the commit carries no such trailer. Empty on any git failure.
|
|
145
|
-
*
|
|
146
|
-
* NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
|
|
147
|
-
* merge) and is distinct from the sentinel string. Callers that must reason about
|
|
148
|
-
* "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
|
|
149
|
-
* partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
|
|
150
|
-
* value into the three states explicitly rather than overloading this string.
|
|
151
|
-
* This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
|
|
152
|
-
* and the id-equality confirmation in resolveGitTrailerCommitSet.
|
|
153
|
-
*/
|
|
154
|
-
export declare function readDeliveryTrailer(worktreePath: string, sha: string): string;
|
|
155
|
-
/**
|
|
156
|
-
* The three attribution states a commit's `Telora-Delivery` trailer can hold --
|
|
157
|
-
* the partition the verify gate reasons over.
|
|
158
|
-
*
|
|
159
|
-
* - `delivery`: attributed to a specific delivery (a UUID). Its work belongs to
|
|
160
|
-
* that delivery's evidence.
|
|
161
|
-
* - `sentinel`: the explicit non-delivery marker ({@link NON_DELIVERY_SENTINEL}).
|
|
162
|
-
* A DELIBERATELY unattributed commit -- daemon housekeeping (safety / WIP /
|
|
163
|
-
* lockfile). Fully accounted for, but belongs to NO delivery's evidence.
|
|
164
|
-
* - `unattributed`: no parseable trailer. A merge commit (exempt by shape at the
|
|
165
|
-
* hook), or a legacy / genuinely-negligent commit whose attribution is missing.
|
|
166
|
-
* This is the state the total-attribution-failure guard reacts to.
|
|
167
|
-
*
|
|
168
|
-
* The point of the discriminated result is that `sentinel` and `unattributed` are
|
|
169
|
-
* NOT the same fact, even though the raw trailer read collapses both toward ''
|
|
170
|
-
* (unattributed) vs the literal 'none' (sentinel): a batch of all-sentinel commits
|
|
171
|
-
* is COMPLETELY attributed and the gate can render a verdict, whereas a batch with
|
|
172
|
-
* genuinely `unattributed` commits (and no delivery anchor) is the loud
|
|
173
|
-
* total-attribution failure that must NOT be laundered into apparent completeness.
|
|
174
|
-
*/
|
|
175
|
-
export type TrailerAttribution = {
|
|
176
|
-
readonly kind: 'delivery';
|
|
177
|
-
readonly deliveryId: string;
|
|
178
|
-
} | {
|
|
179
|
-
readonly kind: 'sentinel';
|
|
180
|
-
} | {
|
|
181
|
-
readonly kind: 'unattributed';
|
|
182
|
-
};
|
|
183
|
-
/**
|
|
184
|
-
* Classify a single commit's `Telora-Delivery` trailer into its three-state
|
|
185
|
-
* attribution. Sentinel match is case-insensitive (matching the commit-msg guard
|
|
186
|
-
* and the stamp). A merge commit carries no trailer, so it classifies as
|
|
187
|
-
* `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
|
|
188
|
-
* the read: both are excluded from every delivery's evidence, and both only feed
|
|
189
|
-
* the loudness check when there is no delivery anchor in the batch (so an
|
|
190
|
-
* incidental merge among real delivery commits never trips it).
|
|
191
|
-
*/
|
|
192
|
-
export declare function classifyDeliveryTrailer(worktreePath: string, sha: string): TrailerAttribution;
|
|
193
|
-
/** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
|
|
194
|
-
export declare function classifyTrailerValue(raw: string): TrailerAttribution;
|
|
195
116
|
/** Outcome of a write-time trailer confirmation (confirmDeliveryTrailer). */
|
|
196
117
|
export interface TrailerConfirmation {
|
|
197
118
|
/** True when the commit's Telora-Delivery trailer parses AFTER this call. */
|
|
@@ -230,6 +151,12 @@ export interface TrailerConfirmation {
|
|
|
230
151
|
* a commit whose trailer already parses returns ok:true, amended:false untouched.
|
|
231
152
|
*/
|
|
232
153
|
export declare function confirmDeliveryTrailer(worktreePath: string, sha: string, expectedDeliveryId?: string): TrailerConfirmation;
|
|
154
|
+
/**
|
|
155
|
+
* Recorded commit credits (commit_attributions): sha (lower-case) -> the delivery
|
|
156
|
+
* the commit is credited to, whatever its trailer says. Read by the verify deps
|
|
157
|
+
* layer and passed into the selection functions below, which stay pure over it.
|
|
158
|
+
*/
|
|
159
|
+
export type CommitCredits = ReadonlyMap<string, string>;
|
|
233
160
|
/**
|
|
234
161
|
* Partition a RECORDED batch commit set (focus_merges.commit_shas, which spans
|
|
235
162
|
* every delivery merged together) down to the commits attributable to ONE
|
|
@@ -252,7 +179,7 @@ export declare function confirmDeliveryTrailer(worktreePath: string, sha: string
|
|
|
252
179
|
* Order is preserved (newest-first), so the result still forms the contiguous
|
|
253
180
|
* chain resolveRecordedCommitRange expects.
|
|
254
181
|
*/
|
|
255
|
-
export declare function filterCommitsByDelivery(worktreePath: string, commitShas: string[] | null | undefined, deliveryId: string): string[];
|
|
182
|
+
export declare function filterCommitsByDelivery(worktreePath: string, commitShas: string[] | null | undefined, deliveryId: string, credits?: CommitCredits): string[];
|
|
256
183
|
/**
|
|
257
184
|
* From a focus's WHOLE recorded merge history (every batch's commit set), return
|
|
258
185
|
* exactly THIS delivery's own commits -- the commits whose `Telora-Delivery`
|
|
@@ -279,7 +206,7 @@ export declare function filterCommitsByDelivery(worktreePath: string, commitShas
|
|
|
279
206
|
* expects; a delivery split across batches is non-contiguous and resolves to a
|
|
280
207
|
* `commits` source (diffed commit-by-commit) downstream.
|
|
281
208
|
*/
|
|
282
|
-
export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string, batches: (string[] | null | undefined)[], deliveryId: string): string[] | null;
|
|
209
|
+
export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string, batches: (string[] | null | undefined)[], deliveryId: string, credits?: CommitCredits): string[] | null;
|
|
283
210
|
/**
|
|
284
211
|
* Does ANY commit in a batch attribute to a real DELIVERY (a UUID trailer)?
|
|
285
212
|
*
|
|
@@ -294,7 +221,7 @@ export declare function selectDeliveryCommitsAcrossBatches(worktreePath: string,
|
|
|
294
221
|
* with unattributed commits and no delivery anchor is broken). The caller combines
|
|
295
222
|
* these.
|
|
296
223
|
*/
|
|
297
|
-
export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas: string[] | null | undefined): boolean;
|
|
224
|
+
export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas: string[] | null | undefined, credits?: CommitCredits): boolean;
|
|
298
225
|
/**
|
|
299
226
|
* Does ANY commit in a batch carry NO parseable attribution at all -- neither a
|
|
300
227
|
* delivery trailer nor the non-delivery sentinel?
|
|
@@ -305,7 +232,7 @@ export declare function batchHasDeliveryTrailer(worktreePath: string, commitShas
|
|
|
305
232
|
* work or an explicit sentinel. When it is true and the batch carries no delivery
|
|
306
233
|
* anchor, on a multi-delivery focus, that is the loud total-attribution failure.
|
|
307
234
|
*/
|
|
308
|
-
export declare function batchHasUnattributedCommit(worktreePath: string, commitShas: string[] | null | undefined): boolean;
|
|
235
|
+
export declare function batchHasUnattributedCommit(worktreePath: string, commitShas: string[] | null | undefined, credits?: CommitCredits): boolean;
|
|
309
236
|
/**
|
|
310
237
|
* The commit SHAs contained in a diff range (`git rev-list <range>`). Empty on
|
|
311
238
|
* failure. Used by the verify COMPLETENESS check to prove the resolved range
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../../src/resolvers/shared/git-diff.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-diff.d.ts","sourceRoot":"","sources":["../../../src/resolvers/shared/git-diff.ts"],"names":[],"mappings":"AA+BA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MA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,EAAE,CAG5F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGhF"}
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
* Git diff helpers shared across resolvers.
|
|
21
21
|
*/
|
|
22
22
|
import { execSync } from 'node:child_process';
|
|
23
|
+
import { DELIVERY_TRAILER_KEY, classifyDeliveryTrailer, readDeliveryTrailer, } from './delivery-trailer.js';
|
|
24
|
+
export { DELIVERY_TRAILER_KEY, NON_DELIVERY_SENTINEL, UNATTRIBUTED_CAPTURE_SENTINEL, readDeliveryTrailer, classifyDeliveryTrailer, classifyTrailerValue, } from './delivery-trailer.js';
|
|
23
25
|
export const MAX_DIFF_BYTES = 50 * 1024; // 50 KB truncation limit for git diffs
|
|
24
26
|
/**
|
|
25
27
|
* Run `git diff <range>` in a worktree. Returns the raw diff output, or empty
|
|
@@ -266,80 +268,6 @@ export function resolveRecordedFastForwardRange(worktreePath, preMergeRef, merge
|
|
|
266
268
|
}
|
|
267
269
|
return `${baseSha}...${tipSha}`;
|
|
268
270
|
}
|
|
269
|
-
/**
|
|
270
|
-
* The git trailer key that attributes a commit to the delivery whose work it is.
|
|
271
|
-
* Stamped by agents at commit time (see execution-sections / the agent CLAUDE.md
|
|
272
|
-
* template). The value is the delivery UUID. The trailer travels with the commit
|
|
273
|
-
* object, so it survives fast-forward and rebase exactly like the recorded commit
|
|
274
|
-
* set -- reading it is reading a durable fact, not re-deriving from branch topology.
|
|
275
|
-
*/
|
|
276
|
-
export const DELIVERY_TRAILER_KEY = 'Telora-Delivery';
|
|
277
|
-
/**
|
|
278
|
-
* The explicit non-delivery sentinel trailer VALUE. A commit that legitimately
|
|
279
|
-
* belongs to no delivery -- daemon housekeeping (safety commit, WIP-on-exit
|
|
280
|
-
* capture, generated-lockfile remediation), or any genuinely delivery-less
|
|
281
|
-
* commit -- declares that by stamping `Telora-Delivery: none` rather than
|
|
282
|
-
* omitting the trailer or borrowing a real delivery id.
|
|
283
|
-
*
|
|
284
|
-
* It is a TRAILER value, not a bypass token: git's own trailer parser reads it
|
|
285
|
-
* back, so a sentinel commit is still a LABELLED commit. That keeps the verify
|
|
286
|
-
* gate's partition TOTAL -- a batch of sentinel commits is fully accounted for
|
|
287
|
-
* and stays distinguishable from a legacy pre-convention batch where the
|
|
288
|
-
* trailer is genuinely absent. The single source of truth for the literal:
|
|
289
|
-
* both the commit-msg guard (audit-hooks) and the daemon-side stamp
|
|
290
|
-
* (worktree/scratch-guard) import it from here, and the partition read below
|
|
291
|
-
* classifies it as its own third state. Compared case-insensitively.
|
|
292
|
-
*/
|
|
293
|
-
export const NON_DELIVERY_SENTINEL = 'none';
|
|
294
|
-
/**
|
|
295
|
-
* Read the RAW `Telora-Delivery` trailer value of a single commit -- the trimmed
|
|
296
|
-
* string exactly as git's trailer parser returns it. That is a delivery UUID, the
|
|
297
|
-
* literal non-delivery sentinel {@link NON_DELIVERY_SENTINEL} (`none`), or '' when
|
|
298
|
-
* the commit carries no such trailer. Empty on any git failure.
|
|
299
|
-
*
|
|
300
|
-
* NOTE: '' here collapses TWO facts (no trailer at all -- a legacy commit or a
|
|
301
|
-
* merge) and is distinct from the sentinel string. Callers that must reason about
|
|
302
|
-
* "deliberately non-delivery" vs "genuinely unattributed" -- the verify-gate
|
|
303
|
-
* partition -- MUST use {@link classifyDeliveryTrailer}, which resolves the raw
|
|
304
|
-
* value into the three states explicitly rather than overloading this string.
|
|
305
|
-
* This raw reader is retained for the write-time round-trip (confirmDeliveryTrailer)
|
|
306
|
-
* and the id-equality confirmation in resolveGitTrailerCommitSet.
|
|
307
|
-
*/
|
|
308
|
-
export function readDeliveryTrailer(worktreePath, sha) {
|
|
309
|
-
const clean = (sha ?? '').trim();
|
|
310
|
-
if (clean === '')
|
|
311
|
-
return '';
|
|
312
|
-
try {
|
|
313
|
-
// Single-quote the format: the `%(...)` parentheses are shell metacharacters.
|
|
314
|
-
const out = execSync(`git show -s '--format=%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly)' ${clean}^{commit}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
|
|
315
|
-
// A commit can in principle carry several trailer lines; take the first
|
|
316
|
-
// non-empty value -- attribution is single-delivery by construction.
|
|
317
|
-
return out.split('\n').map((l) => l.trim()).find((l) => l !== '') ?? '';
|
|
318
|
-
}
|
|
319
|
-
catch {
|
|
320
|
-
return '';
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Classify a single commit's `Telora-Delivery` trailer into its three-state
|
|
325
|
-
* attribution. Sentinel match is case-insensitive (matching the commit-msg guard
|
|
326
|
-
* and the stamp). A merge commit carries no trailer, so it classifies as
|
|
327
|
-
* `unattributed` -- deliberately its own-and-same as a missing-trailer commit for
|
|
328
|
-
* the read: both are excluded from every delivery's evidence, and both only feed
|
|
329
|
-
* the loudness check when there is no delivery anchor in the batch (so an
|
|
330
|
-
* incidental merge among real delivery commits never trips it).
|
|
331
|
-
*/
|
|
332
|
-
export function classifyDeliveryTrailer(worktreePath, sha) {
|
|
333
|
-
return classifyTrailerValue(readDeliveryTrailer(worktreePath, sha));
|
|
334
|
-
}
|
|
335
|
-
/** The same rule over a trimmed value git's trailer parser already read (the batched review-window read). */
|
|
336
|
-
export function classifyTrailerValue(raw) {
|
|
337
|
-
if (raw === '')
|
|
338
|
-
return { kind: 'unattributed' };
|
|
339
|
-
if (raw.toLowerCase() === NON_DELIVERY_SENTINEL.toLowerCase())
|
|
340
|
-
return { kind: 'sentinel' };
|
|
341
|
-
return { kind: 'delivery', deliveryId: raw };
|
|
342
|
-
}
|
|
343
271
|
/**
|
|
344
272
|
* The intended delivery id carried by a commit whose `Telora-Delivery` trailer
|
|
345
273
|
* did NOT parse -- recovered from a `Telora-Delivery:` line sitting in the commit
|
|
@@ -431,6 +359,11 @@ export function confirmDeliveryTrailer(worktreePath, sha, expectedDeliveryId) {
|
|
|
431
359
|
}
|
|
432
360
|
return { ok: true, amended: true, deliveryId: reparsed };
|
|
433
361
|
}
|
|
362
|
+
/** A commit's attribution: its recorded credit when there is one, else its trailer. */
|
|
363
|
+
function classifyCredited(worktreePath, sha, credits) {
|
|
364
|
+
const credited = credits?.get(sha.toLowerCase());
|
|
365
|
+
return credited ? { kind: 'delivery', deliveryId: credited } : classifyDeliveryTrailer(worktreePath, sha);
|
|
366
|
+
}
|
|
434
367
|
/**
|
|
435
368
|
* Partition a RECORDED batch commit set (focus_merges.commit_shas, which spans
|
|
436
369
|
* every delivery merged together) down to the commits attributable to ONE
|
|
@@ -453,12 +386,12 @@ export function confirmDeliveryTrailer(worktreePath, sha, expectedDeliveryId) {
|
|
|
453
386
|
* Order is preserved (newest-first), so the result still forms the contiguous
|
|
454
387
|
* chain resolveRecordedCommitRange expects.
|
|
455
388
|
*/
|
|
456
|
-
export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId) {
|
|
389
|
+
export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId, credits) {
|
|
457
390
|
const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
|
|
458
391
|
if (shas.length === 0)
|
|
459
392
|
return [];
|
|
460
393
|
const wanted = (deliveryId ?? '').trim();
|
|
461
|
-
const classified = shas.map((sha) => ({ sha, attr:
|
|
394
|
+
const classified = shas.map((sha) => ({ sha, attr: classifyCredited(worktreePath, sha, credits) }));
|
|
462
395
|
// Partitionable when SOME commit carries attribution -- a delivery id or the
|
|
463
396
|
// sentinel. An all-`unattributed` batch is the un-partitionable legacy case.
|
|
464
397
|
const anyAttributed = classified.some((c) => c.attr.kind !== 'unattributed');
|
|
@@ -496,7 +429,7 @@ export function filterCommitsByDelivery(worktreePath, commitShas, deliveryId) {
|
|
|
496
429
|
* expects; a delivery split across batches is non-contiguous and resolves to a
|
|
497
430
|
* `commits` source (diffed commit-by-commit) downstream.
|
|
498
431
|
*/
|
|
499
|
-
export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, deliveryId) {
|
|
432
|
+
export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, deliveryId, credits) {
|
|
500
433
|
const wanted = (deliveryId ?? '').trim();
|
|
501
434
|
const seen = new Set();
|
|
502
435
|
const flat = [];
|
|
@@ -511,14 +444,14 @@ export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, delive
|
|
|
511
444
|
}
|
|
512
445
|
if (flat.length === 0)
|
|
513
446
|
return null; // nothing recorded -> caller uses single-row fallback
|
|
514
|
-
const classified = flat.map((sha) => ({ sha, attr:
|
|
447
|
+
const classified = flat.map((sha) => ({ sha, attr: classifyCredited(worktreePath, sha, credits) }));
|
|
515
448
|
const anyAttributed = classified.some((c) => c.attr.kind !== 'unattributed');
|
|
516
449
|
if (!anyAttributed)
|
|
517
450
|
return null; // un-partitionable legacy focus -> single-row fallback
|
|
518
451
|
if (wanted === '')
|
|
519
452
|
return null; // no delivery to attribute by -> single-row fallback
|
|
520
|
-
// Only this delivery's own commits: sentinel (housekeeping)
|
|
521
|
-
// and untrailered commits all fall out.
|
|
453
|
+
// Only this delivery's own commits: sentinel (housekeeping), unattributed
|
|
454
|
+
// capture, other-delivery and untrailered commits all fall out.
|
|
522
455
|
return classified
|
|
523
456
|
.filter((c) => c.attr.kind === 'delivery' && c.attr.deliveryId === wanted)
|
|
524
457
|
.map((c) => c.sha);
|
|
@@ -537,9 +470,9 @@ export function selectDeliveryCommitsAcrossBatches(worktreePath, batches, delive
|
|
|
537
470
|
* with unattributed commits and no delivery anchor is broken). The caller combines
|
|
538
471
|
* these.
|
|
539
472
|
*/
|
|
540
|
-
export function batchHasDeliveryTrailer(worktreePath, commitShas) {
|
|
473
|
+
export function batchHasDeliveryTrailer(worktreePath, commitShas, credits) {
|
|
541
474
|
const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
|
|
542
|
-
return shas.some((sha) =>
|
|
475
|
+
return shas.some((sha) => classifyCredited(worktreePath, sha, credits).kind === 'delivery');
|
|
543
476
|
}
|
|
544
477
|
/**
|
|
545
478
|
* Does ANY commit in a batch carry NO parseable attribution at all -- neither a
|
|
@@ -551,9 +484,9 @@ export function batchHasDeliveryTrailer(worktreePath, commitShas) {
|
|
|
551
484
|
* work or an explicit sentinel. When it is true and the batch carries no delivery
|
|
552
485
|
* anchor, on a multi-delivery focus, that is the loud total-attribution failure.
|
|
553
486
|
*/
|
|
554
|
-
export function batchHasUnattributedCommit(worktreePath, commitShas) {
|
|
487
|
+
export function batchHasUnattributedCommit(worktreePath, commitShas, credits) {
|
|
555
488
|
const shas = (commitShas ?? []).map((s) => s.trim()).filter((s) => s !== '');
|
|
556
|
-
return shas.some((sha) =>
|
|
489
|
+
return shas.some((sha) => classifyCredited(worktreePath, sha, credits).kind === 'unattributed');
|
|
557
490
|
}
|
|
558
491
|
/**
|
|
559
492
|
* The commit SHAs contained in a diff range (`git rev-list <range>`). Empty on
|