@telora/daemon 0.22.289 → 0.22.293
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/README.md +2 -2
- package/build-info.json +2 -2
- package/dist/backends/agent-backend.d.ts +2 -0
- package/dist/backends/agent-backend.d.ts.map +1 -1
- package/dist/backends/availability.d.ts +14 -0
- package/dist/backends/availability.d.ts.map +1 -1
- package/dist/backends/availability.js +37 -0
- package/dist/backends/availability.js.map +1 -1
- package/dist/backends/claude/claude-backend.d.ts.map +1 -1
- package/dist/backends/claude/claude-backend.js +2 -0
- package/dist/backends/claude/claude-backend.js.map +1 -1
- package/dist/backends/codex/codex-backend.d.ts.map +1 -1
- package/dist/backends/codex/codex-backend.js +2 -0
- package/dist/backends/codex/codex-backend.js.map +1 -1
- package/dist/backends/index.d.ts +1 -1
- package/dist/backends/index.d.ts.map +1 -1
- package/dist/backends/index.js +2 -17
- package/dist/backends/index.js.map +1 -1
- package/dist/cli/connect/config-write.d.ts.map +1 -1
- package/dist/cli/connect/config-write.js +2 -1
- package/dist/cli/connect/config-write.js.map +1 -1
- package/dist/cli/status-commands.d.ts +7 -0
- package/dist/cli/status-commands.d.ts.map +1 -1
- package/dist/cli/status-commands.js +17 -0
- package/dist/cli/status-commands.js.map +1 -1
- package/dist/completion/completion-event/event.d.ts +1 -0
- package/dist/completion/completion-event/event.d.ts.map +1 -1
- package/dist/completion/completion-event/event.js +1 -0
- package/dist/completion/completion-event/event.js.map +1 -1
- package/dist/completion/review-exit/review-census-record.d.ts +4 -2
- package/dist/completion/review-exit/review-census-record.d.ts.map +1 -1
- package/dist/completion/review-exit/review-census-record.js +11 -3
- package/dist/completion/review-exit/review-census-record.js.map +1 -1
- package/dist/completion/review-exit/review-exit-deps.js +1 -1
- package/dist/completion/review-exit/review-exit-phase.d.ts +9 -0
- package/dist/completion/review-exit/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit/review-exit-phase.js +1 -1
- package/dist/completion/review-exit/review-exit-phase.js.map +1 -1
- package/dist/completion/review-exit-holds/commit-verdict-release.d.ts.map +1 -1
- package/dist/completion/review-exit-holds/commit-verdict-release.js +2 -1
- package/dist/completion/review-exit-holds/commit-verdict-release.js.map +1 -1
- package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts +1 -0
- package/dist/completion/review-exit-holds/review-exit-verdict-gate.d.ts.map +1 -1
- package/dist/completion/review-exit-holds/review-exit-verdict-gate.js +1 -0
- package/dist/completion/review-exit-holds/review-exit-verdict-gate.js.map +1 -1
- package/dist/completion/team-exit/team-completion.d.ts.map +1 -1
- package/dist/completion/team-exit/team-completion.js +3 -1
- package/dist/completion/team-exit/team-completion.js.map +1 -1
- package/dist/completion/team-liveness/liveness-firing.js +3 -3
- package/dist/completion/team-liveness/team-liveness-phase.d.ts +6 -1
- package/dist/completion/team-liveness/team-liveness-phase.d.ts.map +1 -1
- package/dist/completion/team-liveness/team-liveness-phase.js.map +1 -1
- package/dist/completion/team-outcome/apply-close.d.ts.map +1 -1
- package/dist/completion/team-outcome/apply-close.js +4 -1
- package/dist/completion/team-outcome/apply-close.js.map +1 -1
- package/dist/completion/team-outcome/apply-turn.d.ts.map +1 -1
- package/dist/completion/team-outcome/apply-turn.js +3 -1
- package/dist/completion/team-outcome/apply-turn.js.map +1 -1
- package/dist/completion/team-outcome/apply.d.ts.map +1 -1
- package/dist/completion/team-outcome/apply.js +3 -1
- package/dist/completion/team-outcome/apply.js.map +1 -1
- package/dist/completion/team-outcome/decide-shared.d.ts.map +1 -1
- package/dist/completion/team-outcome/decide-shared.js +3 -2
- package/dist/completion/team-outcome/decide-shared.js.map +1 -1
- package/dist/completion/team-outcome/exit-pipeline-state.d.ts.map +1 -1
- package/dist/completion/team-outcome/exit-pipeline-state.js +2 -1
- package/dist/completion/team-outcome/exit-pipeline-state.js.map +1 -1
- package/dist/completion/team-outcome/team-outcome.d.ts.map +1 -1
- package/dist/completion/team-outcome/team-outcome.js +3 -1
- package/dist/completion/team-outcome/team-outcome.js.map +1 -1
- package/dist/composition/execution-migrations-context.d.ts.map +1 -1
- package/dist/composition/execution-migrations-context.js +2 -0
- package/dist/composition/execution-migrations-context.js.map +1 -1
- package/dist/composition/execution-process-context.js +1 -1
- package/dist/composition/execution-spawn-context.d.ts.map +1 -1
- package/dist/composition/execution-spawn-context.js +3 -1
- package/dist/composition/execution-spawn-context.js.map +1 -1
- package/dist/composition/execution-spawn-process-context.d.ts.map +1 -1
- package/dist/composition/execution-spawn-process-context.js +3 -2
- package/dist/composition/execution-spawn-process-context.js.map +1 -1
- package/dist/composition/focus-activity-live-sources.d.ts +4 -0
- package/dist/composition/focus-activity-live-sources.d.ts.map +1 -0
- package/dist/composition/focus-activity-live-sources.js +68 -0
- package/dist/composition/focus-activity-live-sources.js.map +1 -0
- package/dist/composition/runtime-delivery-advance-context.d.ts +6 -1
- package/dist/composition/runtime-delivery-advance-context.d.ts.map +1 -1
- package/dist/composition/runtime-delivery-advance-context.js +14 -3
- package/dist/composition/runtime-delivery-advance-context.js.map +1 -1
- package/dist/composition/runtime-heartbeat-context.d.ts.map +1 -1
- package/dist/composition/runtime-heartbeat-context.js +3 -1
- package/dist/composition/runtime-heartbeat-context.js.map +1 -1
- package/dist/composition/team-lifecycle-context.d.ts.map +1 -1
- package/dist/composition/team-lifecycle-context.js +3 -1
- package/dist/composition/team-lifecycle-context.js.map +1 -1
- package/dist/composition/team-liveness-phase-sources.d.ts.map +1 -1
- package/dist/composition/team-liveness-phase-sources.js +1 -0
- package/dist/composition/team-liveness-phase-sources.js.map +1 -1
- package/dist/composition/verification-context.d.ts.map +1 -1
- package/dist/composition/verification-context.js +4 -1
- package/dist/composition/verification-context.js.map +1 -1
- package/dist/composition/verify-probe-context.d.ts +7 -0
- package/dist/composition/verify-probe-context.d.ts.map +1 -1
- package/dist/composition/verify-probe-context.js +55 -3
- package/dist/composition/verify-probe-context.js.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +4 -3
- package/dist/config/config.js.map +1 -1
- package/dist/config/session-cap.d.ts +89 -0
- package/dist/config/session-cap.d.ts.map +1 -0
- package/dist/config/session-cap.js +176 -0
- package/dist/config/session-cap.js.map +1 -0
- package/dist/daemon-state/awaiting-slot.d.ts +8 -2
- package/dist/daemon-state/awaiting-slot.d.ts.map +1 -1
- package/dist/daemon-state/awaiting-slot.js +21 -8
- package/dist/daemon-state/awaiting-slot.js.map +1 -1
- package/dist/daemon-state/engine-readiness.d.ts +73 -0
- package/dist/daemon-state/engine-readiness.d.ts.map +1 -0
- package/dist/daemon-state/engine-readiness.js +191 -0
- package/dist/daemon-state/engine-readiness.js.map +1 -0
- package/dist/daemon-state/focus-progress-clock.d.ts +34 -0
- package/dist/daemon-state/focus-progress-clock.d.ts.map +1 -0
- package/dist/daemon-state/focus-progress-clock.js +167 -0
- package/dist/daemon-state/focus-progress-clock.js.map +1 -0
- package/dist/daemon-state/focus-team-state.d.ts +32 -9
- package/dist/daemon-state/focus-team-state.d.ts.map +1 -1
- package/dist/daemon-state/focus-team-state.js +50 -9
- package/dist/daemon-state/focus-team-state.js.map +1 -1
- package/dist/daemon-state/provider-window.d.ts.map +1 -1
- package/dist/daemon-state/provider-window.js +5 -1
- package/dist/daemon-state/provider-window.js.map +1 -1
- package/dist/daemon-state/review-park-record.d.ts +36 -0
- package/dist/daemon-state/review-park-record.d.ts.map +1 -0
- package/dist/daemon-state/review-park-record.js +27 -0
- package/dist/daemon-state/review-park-record.js.map +1 -0
- package/dist/daemon-state/worker-pidfile.d.ts.map +1 -1
- package/dist/daemon-state/worker-pidfile.js +3 -1
- package/dist/daemon-state/worker-pidfile.js.map +1 -1
- package/dist/delivery/commit-verdict-hold.d.ts.map +1 -1
- package/dist/delivery/commit-verdict-hold.js +3 -1
- package/dist/delivery/commit-verdict-hold.js.map +1 -1
- package/dist/directive/directive-queue.js +1 -1
- package/dist/focus/focus-activity-held.d.ts +37 -0
- package/dist/focus/focus-activity-held.d.ts.map +1 -0
- package/dist/focus/focus-activity-held.js +89 -0
- package/dist/focus/focus-activity-held.js.map +1 -0
- package/dist/focus/focus-activity-poll-facts.d.ts +39 -0
- package/dist/focus/focus-activity-poll-facts.d.ts.map +1 -0
- package/dist/focus/focus-activity-poll-facts.js +110 -0
- package/dist/focus/focus-activity-poll-facts.js.map +1 -0
- package/dist/focus/focus-activity-producers.d.ts +43 -0
- package/dist/focus/focus-activity-producers.d.ts.map +1 -0
- package/dist/focus/focus-activity-producers.js +130 -0
- package/dist/focus/focus-activity-producers.js.map +1 -0
- package/dist/focus/focus-activity-record.d.ts +58 -0
- package/dist/focus/focus-activity-record.d.ts.map +1 -0
- package/dist/focus/focus-activity-record.js +141 -0
- package/dist/focus/focus-activity-record.js.map +1 -0
- package/dist/focus/focus-activity-sources.d.ts +99 -0
- package/dist/focus/focus-activity-sources.d.ts.map +1 -0
- package/dist/focus/focus-activity-sources.js +45 -0
- package/dist/focus/focus-activity-sources.js.map +1 -0
- package/dist/focus/focus-executor.js +1 -1
- package/dist/focus/focus-executor.js.map +1 -1
- package/dist/focus/focus-poller-auto-advance.d.ts.map +1 -1
- package/dist/focus/focus-poller-auto-advance.js +2 -0
- package/dist/focus/focus-poller-auto-advance.js.map +1 -1
- package/dist/focus/heartbeat-metadata.d.ts.map +1 -1
- package/dist/focus/heartbeat-metadata.js +6 -0
- package/dist/focus/heartbeat-metadata.js.map +1 -1
- package/dist/focus/heartbeat.d.ts +3 -0
- package/dist/focus/heartbeat.d.ts.map +1 -1
- package/dist/focus/heartbeat.js +31 -31
- package/dist/focus/heartbeat.js.map +1 -1
- package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
- package/dist/focus/pending-review-approved-head.js +4 -2
- package/dist/focus/pending-review-approved-head.js.map +1 -1
- package/dist/focus/unchanged-reviewed-head.d.ts.map +1 -1
- package/dist/focus/unchanged-reviewed-head.js +4 -2
- package/dist/focus/unchanged-reviewed-head.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/queries/deliveries/deliveries.d.ts +4 -0
- package/dist/queries/deliveries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries/deliveries.js +6 -0
- package/dist/queries/deliveries/deliveries.js.map +1 -1
- package/dist/queries/deliveries/issues.d.ts +3 -0
- package/dist/queries/deliveries/issues.d.ts.map +1 -1
- package/dist/queries/deliveries/issues.js +10 -2
- package/dist/queries/deliveries/issues.js.map +1 -1
- package/dist/queries/delivery-gate-state/delivery-gate-holds.d.ts +27 -1
- package/dist/queries/delivery-gate-state/delivery-gate-holds.d.ts.map +1 -1
- package/dist/queries/delivery-gate-state/delivery-gate-state.d.ts +3 -1
- package/dist/queries/delivery-gate-state/delivery-gate-state.d.ts.map +1 -1
- package/dist/queries/delivery-gate-state/delivery-gate-state.js.map +1 -1
- package/dist/queries/focuses/focus-discovery.d.ts.map +1 -1
- package/dist/queries/focuses/focus-discovery.js +2 -0
- package/dist/queries/focuses/focus-discovery.js.map +1 -1
- package/dist/queries/focuses/focuses.d.ts.map +1 -1
- package/dist/queries/focuses/focuses.js +2 -0
- package/dist/queries/focuses/focuses.js.map +1 -1
- package/dist/queries/sessions/daemon-connection.d.ts.map +1 -1
- package/dist/queries/sessions/daemon-connection.js +1 -0
- package/dist/queries/sessions/daemon-connection.js.map +1 -1
- package/dist/queries/workflow-transitions/workflows.d.ts.map +1 -1
- package/dist/queries/workflow-transitions/workflows.js +1 -0
- package/dist/queries/workflow-transitions/workflows.js.map +1 -1
- package/dist/shell/config-hot-reload.d.ts +11 -0
- package/dist/shell/config-hot-reload.d.ts.map +1 -1
- package/dist/shell/config-hot-reload.js +12 -0
- package/dist/shell/config-hot-reload.js.map +1 -1
- package/dist/shell/unified-engine-lifecycle.d.ts +8 -1
- package/dist/shell/unified-engine-lifecycle.d.ts.map +1 -1
- package/dist/shell/unified-engine-lifecycle.js +44 -24
- package/dist/shell/unified-engine-lifecycle.js.map +1 -1
- package/dist/shell/unified-init.d.ts +5 -1
- package/dist/shell/unified-init.d.ts.map +1 -1
- package/dist/shell/unified-init.js +2 -2
- package/dist/shell/unified-init.js.map +1 -1
- package/dist/shell/unified-shell-config.d.ts +2 -1
- package/dist/shell/unified-shell-config.d.ts.map +1 -1
- package/dist/shell/unified-shell-config.js +9 -3
- package/dist/shell/unified-shell-config.js.map +1 -1
- package/dist/shell/unified-shell-status.d.ts +11 -1
- package/dist/shell/unified-shell-status.d.ts.map +1 -1
- package/dist/shell/unified-shell-status.js +15 -1
- package/dist/shell/unified-shell-status.js.map +1 -1
- package/dist/shell/unified-shell.d.ts.map +1 -1
- package/dist/shell/unified-shell.js +25 -5
- package/dist/shell/unified-shell.js.map +1 -1
- package/dist/spawn/codex-auth.d.ts +32 -0
- package/dist/spawn/codex-auth.d.ts.map +1 -0
- package/dist/spawn/codex-auth.js +55 -0
- package/dist/spawn/codex-auth.js.map +1 -0
- package/dist/spawn/helpers.d.ts.map +1 -1
- package/dist/spawn/helpers.js +19 -3
- package/dist/spawn/helpers.js.map +1 -1
- package/dist/spawn/model-reached.d.ts +36 -0
- package/dist/spawn/model-reached.d.ts.map +1 -0
- package/dist/spawn/model-reached.js +43 -0
- package/dist/spawn/model-reached.js.map +1 -0
- package/dist/spawn/next-spawn-cooldown.d.ts +21 -2
- package/dist/spawn/next-spawn-cooldown.d.ts.map +1 -1
- package/dist/spawn/next-spawn-cooldown.js +65 -7
- package/dist/spawn/next-spawn-cooldown.js.map +1 -1
- package/dist/spawn/process-spawn.d.ts.map +1 -1
- package/dist/spawn/process-spawn.js +8 -5
- package/dist/spawn/process-spawn.js.map +1 -1
- package/dist/spawn/review-hold-park.d.ts +12 -1
- package/dist/spawn/review-hold-park.d.ts.map +1 -1
- package/dist/spawn/review-hold-park.js +25 -9
- package/dist/spawn/review-hold-park.js.map +1 -1
- package/dist/spawn/spawn-decision.d.ts.map +1 -1
- package/dist/spawn/spawn-decision.js +4 -0
- package/dist/spawn/spawn-decision.js.map +1 -1
- package/dist/spawn/team-working-delivery.d.ts +76 -0
- package/dist/spawn/team-working-delivery.d.ts.map +1 -0
- package/dist/spawn/team-working-delivery.js +76 -0
- package/dist/spawn/team-working-delivery.js.map +1 -0
- package/dist/spawn/worktree-session.d.ts +15 -0
- package/dist/spawn/worktree-session.d.ts.map +1 -1
- package/dist/spawn/worktree-session.js +25 -2
- package/dist/spawn/worktree-session.js.map +1 -1
- package/dist/supervision/spawn-cooldown-window.d.ts +15 -0
- package/dist/supervision/spawn-cooldown-window.d.ts.map +1 -0
- package/dist/supervision/spawn-cooldown-window.js +46 -0
- package/dist/supervision/spawn-cooldown-window.js.map +1 -0
- package/dist/supervision/spawn-cooldown.d.ts +3 -2
- package/dist/supervision/spawn-cooldown.d.ts.map +1 -1
- package/dist/supervision/spawn-cooldown.js +6 -1
- package/dist/supervision/spawn-cooldown.js.map +1 -1
- package/dist/supervision/stop-registry.d.ts +1 -0
- package/dist/supervision/stop-registry.d.ts.map +1 -1
- package/dist/supervision/stop-rows-spawn.d.ts +8 -0
- package/dist/supervision/stop-rows-spawn.d.ts.map +1 -1
- package/dist/supervision/stop-rows-spawn.js +28 -1
- package/dist/supervision/stop-rows-spawn.js.map +1 -1
- package/dist/testing/fake-npm-registry.d.ts +31 -0
- package/dist/testing/fake-npm-registry.d.ts.map +1 -0
- package/dist/testing/fake-npm-registry.js +127 -0
- package/dist/testing/fake-npm-registry.js.map +1 -0
- package/dist/testing/fixtures/approved-head-inert-deps.d.ts.map +1 -1
- package/dist/testing/fixtures/approved-head-inert-deps.js +4 -2
- package/dist/testing/fixtures/approved-head-inert-deps.js.map +1 -1
- package/dist/testing/fixtures/codex-stream-session.d.ts +4 -0
- package/dist/testing/fixtures/codex-stream-session.d.ts.map +1 -1
- package/dist/testing/fixtures/codex-stream-session.js +21 -5
- package/dist/testing/fixtures/codex-stream-session.js.map +1 -1
- package/dist/testing/fixtures/completion-event-deps.js +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/fixtures/process-close-context.d.ts.map +1 -1
- package/dist/testing/fixtures/process-close-context.js +2 -0
- package/dist/testing/fixtures/process-close-context.js.map +1 -1
- package/dist/testing/fixtures/recording-api-client.js +1 -1
- package/dist/testing/fixtures/review-exit-deps.js +1 -1
- package/dist/testing/fixtures/session-wire.d.ts.map +1 -1
- package/dist/testing/fixtures/session-wire.js +2 -1
- package/dist/testing/fixtures/session-wire.js.map +1 -1
- package/dist/testing/fixtures/verification-deps.d.ts.map +1 -1
- package/dist/testing/fixtures/verification-deps.js +4 -0
- package/dist/testing/fixtures/verification-deps.js.map +1 -1
- package/dist/types/config.d.ts +30 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/focus-team-state.d.ts +28 -2
- package/dist/types/focus-team-state.d.ts.map +1 -1
- package/dist/types/focus-team-state.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/verify/deterministic-gate/verification-checkout.d.ts +8 -4
- package/dist/verify/deterministic-gate/verification-checkout.d.ts.map +1 -1
- package/dist/verify/deterministic-gate/verification-checkout.js +50 -13
- package/dist/verify/deterministic-gate/verification-checkout.js.map +1 -1
- package/dist/verify/deterministic-gate/verification-deterministic.d.ts.map +1 -1
- package/dist/verify/deterministic-gate/verification-deterministic.js +3 -1
- package/dist/verify/deterministic-gate/verification-deterministic.js.map +1 -1
- package/dist/verify/engine/verification-deps.d.ts +7 -0
- package/dist/verify/engine/verification-deps.d.ts.map +1 -1
- package/dist/verify/engine/verification-deps.js +1 -1
- package/dist/verify/engine/verification-engine.d.ts.map +1 -1
- package/dist/verify/engine/verification-engine.js +107 -8
- package/dist/verify/engine/verification-engine.js.map +1 -1
- package/dist/verify/gate-config/verification-config.js +1 -1
- package/dist/verify/gate-verdicts/commit-verdict-record.js +1 -1
- package/dist/verify/gate-verdicts/gate-run-registry.d.ts +74 -3
- package/dist/verify/gate-verdicts/gate-run-registry.d.ts.map +1 -1
- package/dist/verify/gate-verdicts/gate-run-registry.js +41 -20
- package/dist/verify/gate-verdicts/gate-run-registry.js.map +1 -1
- package/dist/verify/install-probe/in-repo-publish.d.ts +154 -0
- package/dist/verify/install-probe/in-repo-publish.d.ts.map +1 -0
- package/dist/verify/install-probe/in-repo-publish.js +183 -0
- package/dist/verify/install-probe/in-repo-publish.js.map +1 -0
- package/dist/verify/install-probe/install-probe-tick.d.ts +23 -2
- package/dist/verify/install-probe/install-probe-tick.d.ts.map +1 -1
- package/dist/verify/install-probe/install-probe-tick.js +84 -12
- package/dist/verify/install-probe/install-probe-tick.js.map +1 -1
- package/dist/verify/install-probe/install-probe.d.ts +16 -0
- package/dist/verify/install-probe/install-probe.d.ts.map +1 -1
- package/dist/verify/install-probe/install-probe.js +35 -19
- package/dist/verify/install-probe/install-probe.js.map +1 -1
- package/dist/verify/install-probe/npm-unresolved.d.ts +37 -0
- package/dist/verify/install-probe/npm-unresolved.d.ts.map +1 -0
- package/dist/verify/install-probe/npm-unresolved.js +63 -0
- package/dist/verify/install-probe/npm-unresolved.js.map +1 -0
- package/dist/verify/run-selection/default-on-guards.d.ts.map +1 -1
- package/dist/verify/run-selection/default-on-guards.js +1 -19
- package/dist/verify/run-selection/default-on-guards.js.map +1 -1
- package/dist/worktree/verify-interlock.d.ts +23 -2
- package/dist/worktree/verify-interlock.d.ts.map +1 -1
- package/dist/worktree/verify-interlock.js +79 -2
- package/dist/worktree/verify-interlock.js.map +1 -1
- package/package.json +3 -3
|
@@ -12,7 +12,27 @@
|
|
|
12
12
|
* Once a run's detached checkout exists it names the commit it judges, so a
|
|
13
13
|
* wait keyed on one commit is not held by a run judging another; until then a
|
|
14
14
|
* registration may judge any commit on its focus (a dispatch reads HEAD only
|
|
15
|
-
* when it starts).
|
|
15
|
+
* when it starts). A run also carries what the heartbeat's focus activity
|
|
16
|
+
* record publishes about it: while it is queued, what it waits on -- the
|
|
17
|
+
* daemon-wide verification semaphore, or its focus worktree's verify
|
|
18
|
+
* interlock (another verify holds the worktree) and whom that hold judges;
|
|
19
|
+
* once it runs, the commit, the timeout and the start of its command.
|
|
20
|
+
*
|
|
21
|
+
* QUEUED UNTIL THE COMMAND STARTS. Holding a verification-semaphore slot is not
|
|
22
|
+
* running: after the slot is taken the dispatch still re-reads the delivery's
|
|
23
|
+
* status, looks for a verdict it can reuse, waits its turn on its focus, makes the
|
|
24
|
+
* checkout and resolves the config and boundary -- any of which may end the
|
|
25
|
+
* dispatch with no command run at all (a reused verdict never runs one). Nor is it
|
|
26
|
+
* waiting for a slot: the moment the slot is taken the registration says
|
|
27
|
+
* `preflight` (verify/engine/verification-engine.ts) -- it holds its slot and is
|
|
28
|
+
* preparing the run -- and it stays queued on that cause through all of the
|
|
29
|
+
* above. It turns running in ONE step immediately before the deterministic
|
|
30
|
+
* command is spawned ({@link startGateRunOf}, called by
|
|
31
|
+
* verify/deterministic-gate/verification-checkout.ts), which fixes the commit, the timeout
|
|
32
|
+
* and startedAt together: a running run never publishes a commit or timeout it
|
|
33
|
+
* has not yet chosen, and never runs without a commit -- a run with no judged
|
|
34
|
+
* commit is not started at all. ai_inspection and behavioral runs start no
|
|
35
|
+
* deterministic command and never turn running.
|
|
16
36
|
* - the outcome an EXPLICIT-METHOD run last recorded for its delivery. Such a run
|
|
17
37
|
* may execute in place or render a non-deterministic verdict, and neither
|
|
18
38
|
* writes a per-commit verdict record (verify/gate-verdicts/commit-verdict-record.ts), so its
|
|
@@ -32,10 +52,11 @@
|
|
|
32
52
|
* (verify/gate-verdicts/explicit-gate-outcome.ts), which is what routing reads after a restart,
|
|
33
53
|
* when this process has seen no explicit run for the delivery.
|
|
34
54
|
*
|
|
35
|
-
* A leaf with no imports.
|
|
55
|
+
* A leaf with no runtime imports.
|
|
36
56
|
*
|
|
37
57
|
* @module verify/gate-verdicts/gate-run-registry
|
|
38
58
|
*/
|
|
59
|
+
import type { GateQueueWait } from '@telora/daemon-core';
|
|
39
60
|
/** A candidate the verification tick selected. */
|
|
40
61
|
export interface GateRunSelection {
|
|
41
62
|
deliveryId: string;
|
|
@@ -43,12 +64,48 @@ export interface GateRunSelection {
|
|
|
43
64
|
/** An explicit-method row: its run supersedes the outcome the delivery's previous run recorded. */
|
|
44
65
|
explicit: boolean;
|
|
45
66
|
}
|
|
46
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Why a queued run has not started. The semaphore wait names no run ahead (the
|
|
69
|
+
* reader names the run holding the slot); an interlock wait names the verify
|
|
70
|
+
* holding the worktree, when the hold names the delivery it judges; a preflight
|
|
71
|
+
* run holds its slot and waits on nothing ahead of it.
|
|
72
|
+
*/
|
|
73
|
+
export type GateRunWait = {
|
|
74
|
+
on: Extract<GateQueueWait, 'verification_semaphore' | 'preflight'>;
|
|
75
|
+
} | {
|
|
76
|
+
on: Extract<GateQueueWait, 'worktree_interlock'>;
|
|
77
|
+
aheadFocusId: string | null;
|
|
78
|
+
aheadDeliveryId: string | null;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* What a run is judging the moment its command starts, fixed together (module
|
|
82
|
+
* header). The commit is required: a run path that cannot name the commit it
|
|
83
|
+
* judges does not start its command (verify/deterministic-gate/verification-checkout.ts).
|
|
84
|
+
*/
|
|
85
|
+
export interface GateRunStart {
|
|
86
|
+
sha: string;
|
|
87
|
+
timeoutMs: number;
|
|
88
|
+
}
|
|
89
|
+
/** The handle a selection is started and ended through. start and end are idempotent. */
|
|
47
90
|
export interface GateRunRegistration {
|
|
91
|
+
/** The run's command is starting now, judging `facts` (queued -> running, in one step). */
|
|
92
|
+
start: (facts: GateRunStart) => void;
|
|
48
93
|
end: () => void;
|
|
94
|
+
/** Why the still-queued run has not started now (a selection starts out waiting on the semaphore). */
|
|
95
|
+
waitOn: (wait: GateRunWait) => void;
|
|
49
96
|
}
|
|
50
97
|
/** The outcome kept for an explicit-method delivery. */
|
|
51
98
|
export type RecordedGateOutcome = 'passed' | 'failed';
|
|
99
|
+
/** A selected, unfinished gate run as the heartbeat reads it (focus/focus-activity-gate.ts). */
|
|
100
|
+
export interface GateRunView {
|
|
101
|
+
deliveryId: string;
|
|
102
|
+
focusId: string | null;
|
|
103
|
+
sha: string | null;
|
|
104
|
+
selectedAt: number;
|
|
105
|
+
startedAt: number | null;
|
|
106
|
+
timeoutMs: number | null;
|
|
107
|
+
wait: GateRunWait;
|
|
108
|
+
}
|
|
52
109
|
/** A verdict an explicit-method run rendered, the commit it applies to (null: it judged none, so it applies to any), and its gate. */
|
|
53
110
|
export interface RecordedExplicitOutcome {
|
|
54
111
|
outcome: RecordedGateOutcome;
|
|
@@ -60,6 +117,20 @@ export interface RecordedExplicitOutcome {
|
|
|
60
117
|
export declare function registerGateRun(selection: GateRunSelection): GateRunRegistration;
|
|
61
118
|
/** Name the commit a selected run judges (its detached checkout's sha). A no-op when the delivery has no selected run. */
|
|
62
119
|
export declare function noteGateRunCommit(deliveryId: string, sha: string): void;
|
|
120
|
+
/** Bind a candidate to the registration its selection made, so the run path can start exactly that run. */
|
|
121
|
+
export declare function bindGateRunCandidate(candidate: object, registration: GateRunRegistration): void;
|
|
122
|
+
/**
|
|
123
|
+
* The candidate's command is starting now, judging `facts`: its registration turns
|
|
124
|
+
* running (module header). A no-op for a candidate no tick selected.
|
|
125
|
+
*/
|
|
126
|
+
export declare function startGateRunOf(candidate: object, facts: GateRunStart): void;
|
|
127
|
+
/**
|
|
128
|
+
* Every selected, unfinished gate run, in selection order -- queued ones
|
|
129
|
+
* (startedAt null) and running ones. In-process facts only: nothing here is
|
|
130
|
+
* written to the database; the heartbeat publishes them as the focus activity
|
|
131
|
+
* record and a run drops out the moment its registration ends.
|
|
132
|
+
*/
|
|
133
|
+
export declare function gateRunSnapshot(): GateRunView[];
|
|
63
134
|
/**
|
|
64
135
|
* Whether a selected, unfinished gate run on the focus may judge `sha`: one that
|
|
65
136
|
* names that commit, or one that names none yet. A null `sha` (a judged commit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-run-registry.d.ts","sourceRoot":"","sources":["../../../src/verify/gate-verdicts/gate-run-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate-run-registry.d.ts","sourceRoot":"","sources":["../../../src/verify/gate-verd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;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAErE;AAED,6HAA6H;AAC7H,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvI;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI,GAAG,SAAS,CAE1G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,mBAAmB,GAAG,IAAI,CAI1G;AAED,iEAAiE;AACjE,wBAAgB,8BAA8B,IAAI,IAAI,CAGrD"}
|
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by: packages/daemon/src/
|
|
3
|
-
// packages/daemon/src/focus/focus-poller-product-poll.test.ts,
|
|
4
|
-
// packages/daemon/src/focus/verify-routing-passes.test.ts,
|
|
5
|
-
// packages/daemon/src/integration/delivery-gate-write-interleaving.test.ts,
|
|
6
|
-
// packages/daemon/src/integration/explicit-gate-identity-unreadable.test.ts,
|
|
7
|
-
// packages/daemon/src/integration/explicit-gate-outcome-restart.test.ts,
|
|
8
|
-
// packages/daemon/src/integration/explicit-verdict-departure-during-removal.test.ts,
|
|
9
|
-
// packages/daemon/src/integration/explicit-verdict-invalidation-restart.test.ts,
|
|
10
|
-
// packages/daemon/src/integration/explicit-verdict-reuse.test.ts,
|
|
11
|
-
// packages/daemon/src/integration/focus-commit-verdict-scenario.test.ts,
|
|
12
|
-
// packages/daemon/src/integration/held-route-pull-dispatch.test.ts,
|
|
13
|
-
// packages/daemon/src/integration/review-rework-resume-verdict.test.ts,
|
|
14
|
-
// packages/daemon/src/integration/review-verdict-ruling-release.test.ts,
|
|
15
|
-
// packages/daemon/src/integration/shortfall-ruling-disposes-proposals-regression.test.ts,
|
|
16
|
-
// packages/daemon/src/integration/shortfall-ruling-release.test.ts,
|
|
17
|
-
// packages/daemon/src/verify/engine/verification-commit-sharing.test.ts,
|
|
18
|
-
// packages/daemon/src/verify/gate-verdicts/explicit-run-ledger.test.ts,
|
|
19
|
-
// packages/daemon/src/verify/run-selection/commit-verdict-pull.test.ts,
|
|
20
|
-
// packages/daemon/src/verify/shortfalls/shortfall-rulings.test.ts
|
|
2
|
+
// Pinned by: 22 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/verify/gate-verdicts/gate-run-registry.ts
|
|
21
3
|
// PINNED-BY-END
|
|
4
|
+
const SEMAPHORE_WAIT = { on: 'verification_semaphore' };
|
|
22
5
|
const SHA_RE = /^[0-9a-f]{7,64}$/i;
|
|
23
6
|
const selectedRuns = new Set();
|
|
24
7
|
/** Per delivery this process has seen an explicit run for: its verdict, or null for "no verdict" (see the module header). */
|
|
25
8
|
const explicitOutcomes = new Map();
|
|
26
9
|
/** Register a candidate the tick selected; end the registration when its dispatch settles. */
|
|
27
10
|
export function registerGateRun(selection) {
|
|
28
|
-
const run = {
|
|
11
|
+
const run = {
|
|
12
|
+
deliveryId: selection.deliveryId, focusId: selection.focusId, sha: null, selectedAt: Date.now(), startedAt: null,
|
|
13
|
+
timeoutMs: null, wait: SEMAPHORE_WAIT,
|
|
14
|
+
};
|
|
29
15
|
selectedRuns.add(run);
|
|
30
16
|
if (selection.explicit)
|
|
31
17
|
explicitOutcomes.set(selection.deliveryId, null);
|
|
32
18
|
return {
|
|
19
|
+
start: ({ sha, timeoutMs }) => {
|
|
20
|
+
if (run.startedAt !== null)
|
|
21
|
+
return;
|
|
22
|
+
run.sha = sha;
|
|
23
|
+
run.timeoutMs = timeoutMs;
|
|
24
|
+
run.startedAt = Date.now();
|
|
25
|
+
},
|
|
33
26
|
end: () => {
|
|
34
27
|
selectedRuns.delete(run);
|
|
35
28
|
},
|
|
29
|
+
waitOn: (wait) => {
|
|
30
|
+
run.wait = wait;
|
|
31
|
+
},
|
|
36
32
|
};
|
|
37
33
|
}
|
|
38
34
|
/** Name the commit a selected run judges (its detached checkout's sha). A no-op when the delivery has no selected run. */
|
|
@@ -42,6 +38,31 @@ export function noteGateRunCommit(deliveryId, sha) {
|
|
|
42
38
|
run.sha = sha;
|
|
43
39
|
}
|
|
44
40
|
}
|
|
41
|
+
/** The registration each dispatched candidate was selected under, keyed by the candidate itself. */
|
|
42
|
+
const candidateRegistrations = new WeakMap();
|
|
43
|
+
/** Bind a candidate to the registration its selection made, so the run path can start exactly that run. */
|
|
44
|
+
export function bindGateRunCandidate(candidate, registration) {
|
|
45
|
+
candidateRegistrations.set(candidate, registration);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The candidate's command is starting now, judging `facts`: its registration turns
|
|
49
|
+
* running (module header). A no-op for a candidate no tick selected.
|
|
50
|
+
*/
|
|
51
|
+
export function startGateRunOf(candidate, facts) {
|
|
52
|
+
candidateRegistrations.get(candidate)?.start(facts);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Every selected, unfinished gate run, in selection order -- queued ones
|
|
56
|
+
* (startedAt null) and running ones. In-process facts only: nothing here is
|
|
57
|
+
* written to the database; the heartbeat publishes them as the focus activity
|
|
58
|
+
* record and a run drops out the moment its registration ends.
|
|
59
|
+
*/
|
|
60
|
+
export function gateRunSnapshot() {
|
|
61
|
+
return [...selectedRuns].map((r) => ({
|
|
62
|
+
deliveryId: r.deliveryId, focusId: r.focusId, sha: r.sha, selectedAt: r.selectedAt, startedAt: r.startedAt,
|
|
63
|
+
timeoutMs: r.timeoutMs, wait: r.wait,
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
45
66
|
/**
|
|
46
67
|
* Whether a selected, unfinished gate run on the focus may judge `sha`: one that
|
|
47
68
|
* names that commit, or one that names none yet. A null `sha` (a judged commit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-run-registry.js","sourceRoot":"","sources":["../../../src/verify/gate-verdicts/gate-run-registry.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,
|
|
1
|
+
{"version":3,"file":"gate-run-registry.js","sourceRoot":"","sources":["../../../src/verify/gate-verdicts/gate-run-registry.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,4HAA4H;AAC5H,gBAAgB;AAiFhB,MAAM,cAAc,GAAgB,EAAE,EAAE,EAAE,wBAAwB,EAAE,CAAC;AA0DrE,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAe,CAAC;AAC5C,6HAA6H;AAC7H,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA0C,CAAC;AAE3E,8FAA8F;AAC9F,MAAM,UAAU,eAAe,CAAC,SAA2B;IACzD,MAAM,GAAG,GAAgB;QACvB,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI;QAChH,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc;KACtC,CAAC;IACF,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,SAAS,CAAC,QAAQ;QAAE,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACzE,OAAO;QACL,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE;YAC5B,IAAI,GAAG,CAAC,SAAS,KAAK,IAAI;gBAAE,OAAO;YACnC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;YACd,GAAG,CAAC,SAAS,GAAG,SAAS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H;AACjH,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,KAAa;IAChE,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,6HAA6H;AAC7H,MAAM,UAAU,yBAAyB,CAAC,UAAkB,EAAE,MAAiD,EAAE,OAAgB;IAC/H,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB,EAAE,GAAkB;IAC5E,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO,QAAQ,CAAC,GAAG,KAAK,IAAI,IAAI,QAAQ,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACjF,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,8BAA8B;IAC5C,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,gBAAgB,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publish an in-repo @telora version a focus branch needs, from the branch itself.
|
|
3
|
+
*
|
|
4
|
+
* A focus branch that adds exports to an in-repo @telora package (daemon-core,
|
|
5
|
+
* mcp-products) must raise its consumers' range to a version that only /sync
|
|
6
|
+
* publishes, after merge to main. The clean-install probe then fails the
|
|
7
|
+
* branch's verify deliveries on a version nothing will publish until the branch
|
|
8
|
+
* merges -- which it cannot while verify holds. This module closes that loop:
|
|
9
|
+
* build and publish the version from the focus worktree under the `pending` dist-tag,
|
|
10
|
+
* regenerate the consumers' lockfiles, and commit them on the branch with the
|
|
11
|
+
* delivery's Telora-Delivery trailer. /sync still owns `latest` and the
|
|
12
|
+
* post-merge release; it adopts a pending version rather than bumping past it.
|
|
13
|
+
*
|
|
14
|
+
* It publishes ONLY when every failure the probe saw is such a version:
|
|
15
|
+
* - every non-passing package is resolution_failed (a registry outage is not
|
|
16
|
+
* published around),
|
|
17
|
+
* - npm named what it could not resolve for each (an unattributed failure is
|
|
18
|
+
* not guessed at),
|
|
19
|
+
* - every name is an in-repo @telora package (IN_REPO_PUBLISHABLE), and
|
|
20
|
+
* - the version each asks for is exactly the one on disk in the worktree.
|
|
21
|
+
* Anything else is declined with a note, and the probe keeps its verdict.
|
|
22
|
+
*
|
|
23
|
+
* A published version is irreversible, so it is built only from COMMITTED
|
|
24
|
+
* bytes. The build, pack and publish run in a detached checkout of the probed
|
|
25
|
+
* commit (InRepoPublishDeps.checkoutCommit), never in the live worktree a
|
|
26
|
+
* sibling may be editing: an edit made mid-build cannot reach the tarball, and
|
|
27
|
+
* neither can a dirty input outside the package directory (the daemon's publish
|
|
28
|
+
* stamps supabase/migrations into build-info.json). While a target's source or
|
|
29
|
+
* a consumer's manifest is uncommitted the publish is deferred as well
|
|
30
|
+
* (dirtyPublishInputs) -- that version is not final yet.
|
|
31
|
+
*
|
|
32
|
+
* Pure orchestration: every npm and git act runs through InRepoPublishDeps,
|
|
33
|
+
* bound at the composition root (composition/verify-probe-context.ts).
|
|
34
|
+
*
|
|
35
|
+
* History: docs/daemon/history-team-lifecycle.md (verify/install-probe/in-repo-publish.ts).
|
|
36
|
+
*
|
|
37
|
+
* @module in-repo-publish
|
|
38
|
+
*/
|
|
39
|
+
import type { InstallProbeResult } from './install-probe.js';
|
|
40
|
+
/**
|
|
41
|
+
* The dist-tag a branch-published version carries. NEVER `latest`: a daemon
|
|
42
|
+
* host or developer installing `@telora/<pkg>` without a version must keep
|
|
43
|
+
* getting what /sync released from main.
|
|
44
|
+
*/
|
|
45
|
+
export declare const PENDING_DIST_TAG = "pending";
|
|
46
|
+
/**
|
|
47
|
+
* The in-repo @telora packages the daemon may publish, in DEPENDENCY ORDER: a
|
|
48
|
+
* consumer is never published before a dependency it needs from the same pass.
|
|
49
|
+
*/
|
|
50
|
+
export declare const IN_REPO_PUBLISHABLE: ReadonlyArray<{
|
|
51
|
+
name: string;
|
|
52
|
+
dir: string;
|
|
53
|
+
}>;
|
|
54
|
+
/** One version to publish from the worktree. */
|
|
55
|
+
export interface PublishTarget {
|
|
56
|
+
name: string;
|
|
57
|
+
/** Repo-relative package dir. */
|
|
58
|
+
dir: string;
|
|
59
|
+
version: string;
|
|
60
|
+
}
|
|
61
|
+
/** What to do about a failed probe. */
|
|
62
|
+
export type InRepoPublishPlan = {
|
|
63
|
+
kind: 'publish';
|
|
64
|
+
publish: PublishTarget[];
|
|
65
|
+
relock: string[];
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'decline';
|
|
68
|
+
reason: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Decide whether a failed probe is ONLY unpublished in-repo versions, and if so
|
|
72
|
+
* what to publish (dependency order) and which package dirs to re-lock. Pure.
|
|
73
|
+
*
|
|
74
|
+
* `workspaceVersion(dir)` reads the `version` of `<worktree>/<dir>/package.json`
|
|
75
|
+
* (null when absent or unreadable).
|
|
76
|
+
*/
|
|
77
|
+
export declare function planInRepoPublish(result: InstallProbeResult, workspaceVersion: (dir: string) => string | null): InRepoPublishPlan;
|
|
78
|
+
/**
|
|
79
|
+
* The `npm publish` argv for a branch-published version. The dist-tag is fixed
|
|
80
|
+
* here and nowhere else, so no caller can publish a branch version as `latest`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function publishArgs(): string[];
|
|
83
|
+
/** The lockfile regeneration argv, run in the consumer's own directory. */
|
|
84
|
+
export declare function relockArgs(): string[];
|
|
85
|
+
/** Injected IO. */
|
|
86
|
+
export interface InRepoPublishDeps {
|
|
87
|
+
/** `version` from `<worktreePath>/<dir>/package.json`, or null. */
|
|
88
|
+
readWorkspaceVersion: (worktreePath: string, dir: string) => string | null;
|
|
89
|
+
/**
|
|
90
|
+
* A detached checkout of commit `sha` of the worktree's repository, with the
|
|
91
|
+
* worktree's installed dependencies reachable, to build from. `release`
|
|
92
|
+
* removes it. Null when it could not be made.
|
|
93
|
+
*/
|
|
94
|
+
checkoutCommit: (worktreePath: string, sha: string) => {
|
|
95
|
+
root: string;
|
|
96
|
+
release: () => void;
|
|
97
|
+
} | null;
|
|
98
|
+
/** Run `npm <args>` in `cwd`; exit code (null if it could not start) + combined output. */
|
|
99
|
+
runNpm: (cwd: string, args: string[]) => Promise<{
|
|
100
|
+
exitCode: number | null;
|
|
101
|
+
output: string;
|
|
102
|
+
}>;
|
|
103
|
+
/** Repo-relative paths with uncommitted changes, or null when git could not say. */
|
|
104
|
+
uncommittedPaths: (worktreePath: string) => string[] | null;
|
|
105
|
+
/**
|
|
106
|
+
* Commit exactly `paths` with `message` and a `Telora-Delivery: <deliveryId>`
|
|
107
|
+
* trailer. Returns the new HEAD sha, or null when git made no commit.
|
|
108
|
+
*/
|
|
109
|
+
commitPaths: (worktreePath: string, paths: string[], message: string, deliveryId: string) => string | null;
|
|
110
|
+
}
|
|
111
|
+
/** What the daemon did about a failed probe. `note` goes on the gate entry. */
|
|
112
|
+
export type InRepoPublishOutcome =
|
|
113
|
+
/** Published; `sha` is the lockfile commit, null when no lockfile changed. Re-probe. */
|
|
114
|
+
{
|
|
115
|
+
kind: 'resolved';
|
|
116
|
+
sha: string | null;
|
|
117
|
+
published: PublishTarget[];
|
|
118
|
+
note: string;
|
|
119
|
+
} | {
|
|
120
|
+
kind: 'declined';
|
|
121
|
+
note: string;
|
|
122
|
+
}
|
|
123
|
+
/** Nothing done: the publish's inputs are uncommitted right now. Retry on a later tick. */
|
|
124
|
+
| {
|
|
125
|
+
kind: 'deferred';
|
|
126
|
+
note: string;
|
|
127
|
+
} | {
|
|
128
|
+
kind: 'failed';
|
|
129
|
+
note: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* The uncommitted paths that would make a publish ship content branch HEAD does
|
|
133
|
+
* not hold. A published version is irreversible (/sync cannot replace it), so
|
|
134
|
+
* it is built only from committed inputs: nothing under a publish target's
|
|
135
|
+
* directory (its source, manifest, build config) and no consumer manifest,
|
|
136
|
+
* lockfile or .npmrc the re-lock reads may be dirty. Pure.
|
|
137
|
+
*/
|
|
138
|
+
export declare function dirtyPublishInputs(plan: {
|
|
139
|
+
publish: PublishTarget[];
|
|
140
|
+
relock: string[];
|
|
141
|
+
}, dirty: readonly string[]): string[];
|
|
142
|
+
/**
|
|
143
|
+
* Publish, re-lock and commit, when the plan says the failure is only
|
|
144
|
+
* unpublished in-repo versions. Never throws for an npm or git failure: each is
|
|
145
|
+
* an outcome with a note naming the step and npm's own words (a host with no
|
|
146
|
+
* registry credentials reads as `could not publish ...: ENEEDAUTH`).
|
|
147
|
+
*/
|
|
148
|
+
export declare function publishAroundUnpublished(input: {
|
|
149
|
+
worktreePath: string;
|
|
150
|
+
headSha: string;
|
|
151
|
+
result: InstallProbeResult;
|
|
152
|
+
deliveryId: string;
|
|
153
|
+
}, deps: InRepoPublishDeps): Promise<InRepoPublishOutcome>;
|
|
154
|
+
//# sourceMappingURL=in-repo-publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-repo-publish.d.ts","sourceRoot":"","sources":["../../../src/verify/install-probe/in-repo-publish.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7D;;;;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CAAE,EAChG,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,oBAAoB,CAAC,CAkC/B"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/integration/in-repo-publish-branch.test.ts,
|
|
3
|
+
// packages/daemon/src/verify/install-probe/in-repo-publish.test.ts
|
|
4
|
+
// PINNED-BY-END
|
|
5
|
+
import { formatUnresolved, pinnedVersion } from './npm-unresolved.js';
|
|
6
|
+
/**
|
|
7
|
+
* The dist-tag a branch-published version carries. NEVER `latest`: a daemon
|
|
8
|
+
* host or developer installing `@telora/<pkg>` without a version must keep
|
|
9
|
+
* getting what /sync released from main.
|
|
10
|
+
*/
|
|
11
|
+
export const PENDING_DIST_TAG = 'pending';
|
|
12
|
+
/**
|
|
13
|
+
* The in-repo @telora packages the daemon may publish, in DEPENDENCY ORDER: a
|
|
14
|
+
* consumer is never published before a dependency it needs from the same pass.
|
|
15
|
+
*/
|
|
16
|
+
export const IN_REPO_PUBLISHABLE = [
|
|
17
|
+
{ name: '@telora/daemon-core', dir: 'packages/daemon-core' },
|
|
18
|
+
{ name: '@telora/mcp-products', dir: 'mcp/telora-products' },
|
|
19
|
+
{ name: '@telora/daemon', dir: 'packages/daemon' },
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Decide whether a failed probe is ONLY unpublished in-repo versions, and if so
|
|
23
|
+
* what to publish (dependency order) and which package dirs to re-lock. Pure.
|
|
24
|
+
*
|
|
25
|
+
* `workspaceVersion(dir)` reads the `version` of `<worktree>/<dir>/package.json`
|
|
26
|
+
* (null when absent or unreadable).
|
|
27
|
+
*/
|
|
28
|
+
export function planInRepoPublish(result, workspaceVersion) {
|
|
29
|
+
if (result.verdict !== 'failed')
|
|
30
|
+
return { kind: 'decline', reason: 'the probe did not fail' };
|
|
31
|
+
const failing = result.packages.filter(p => p.outcome !== 'pass');
|
|
32
|
+
const unreachable = failing.filter(p => p.outcome === 'registry_unreachable');
|
|
33
|
+
if (unreachable.length > 0) {
|
|
34
|
+
return {
|
|
35
|
+
kind: 'decline',
|
|
36
|
+
reason: `not published around: the registry was unreachable for ${unreachable.map(p => p.packageDir).join(', ')}`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const wanted = new Map();
|
|
40
|
+
for (const pkg of failing) {
|
|
41
|
+
const unresolved = pkg.unresolved ?? [];
|
|
42
|
+
if (unresolved.length === 0) {
|
|
43
|
+
return { kind: 'decline', reason: `not published around: npm named no package it could not resolve for ${pkg.packageDir}` };
|
|
44
|
+
}
|
|
45
|
+
for (const u of unresolved) {
|
|
46
|
+
const label = formatUnresolved(u);
|
|
47
|
+
const inRepo = IN_REPO_PUBLISHABLE.find(p => p.name === u.name);
|
|
48
|
+
if (!inRepo)
|
|
49
|
+
return { kind: 'decline', reason: `not published around: ${label} is not an in-repo @telora package` };
|
|
50
|
+
const version = pinnedVersion(u.spec);
|
|
51
|
+
if (!version)
|
|
52
|
+
return { kind: 'decline', reason: `not published around: ${label} does not name one version` };
|
|
53
|
+
const onDisk = workspaceVersion(inRepo.dir);
|
|
54
|
+
if (onDisk !== version) {
|
|
55
|
+
return {
|
|
56
|
+
kind: 'decline',
|
|
57
|
+
reason: `not published around: ${label} does not exist on disk (${inRepo.dir} is ${onDisk ?? 'unreadable'})`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const prior = wanted.get(u.name);
|
|
61
|
+
if (prior && prior.version !== version) {
|
|
62
|
+
return { kind: 'decline', reason: `not published around: ${u.name} is asked for at ${prior.version} and ${version}` };
|
|
63
|
+
}
|
|
64
|
+
wanted.set(u.name, { name: u.name, dir: inRepo.dir, version });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const publish = IN_REPO_PUBLISHABLE.flatMap(p => {
|
|
68
|
+
const t = wanted.get(p.name);
|
|
69
|
+
return t ? [t] : [];
|
|
70
|
+
});
|
|
71
|
+
return { kind: 'publish', publish, relock: failing.map(p => p.packageDir) };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The `npm publish` argv for a branch-published version. The dist-tag is fixed
|
|
75
|
+
* here and nowhere else, so no caller can publish a branch version as `latest`.
|
|
76
|
+
*/
|
|
77
|
+
export function publishArgs() {
|
|
78
|
+
return ['publish', '--tag', PENDING_DIST_TAG];
|
|
79
|
+
}
|
|
80
|
+
/** The lockfile regeneration argv, run in the consumer's own directory. */
|
|
81
|
+
export function relockArgs() {
|
|
82
|
+
return ['install', '--package-lock-only', '--ignore-scripts', '--prefer-online', '--no-audit', '--no-fund'];
|
|
83
|
+
}
|
|
84
|
+
/** npm's answers that mean the version is already in the registry (a retry after a partial pass). */
|
|
85
|
+
const ALREADY_PUBLISHED = /E409|EPUBLISHCONFLICT|cannot publish over|previously published|already exists/i;
|
|
86
|
+
/**
|
|
87
|
+
* The uncommitted paths that would make a publish ship content branch HEAD does
|
|
88
|
+
* not hold. A published version is irreversible (/sync cannot replace it), so
|
|
89
|
+
* it is built only from committed inputs: nothing under a publish target's
|
|
90
|
+
* directory (its source, manifest, build config) and no consumer manifest,
|
|
91
|
+
* lockfile or .npmrc the re-lock reads may be dirty. Pure.
|
|
92
|
+
*/
|
|
93
|
+
export function dirtyPublishInputs(plan, dirty) {
|
|
94
|
+
const underTarget = (p) => plan.publish.some(t => p.startsWith(`${t.dir}/`));
|
|
95
|
+
const consumerInputs = new Set(plan.relock.flatMap(dir => ['package.json', 'package-lock.json', '.npmrc'].map(f => (dir === '.' ? f : `${dir}/${f}`))));
|
|
96
|
+
return dirty.filter(p => underTarget(p) || consumerInputs.has(p));
|
|
97
|
+
}
|
|
98
|
+
const joinPath = (worktreePath, dir) => (dir === '.' ? worktreePath : `${worktreePath}/${dir}`);
|
|
99
|
+
const lockfilePath = (dir) => (dir === '.' ? 'package-lock.json' : `${dir}/package-lock.json`);
|
|
100
|
+
const label = (t) => `${t.name}@${t.version}`;
|
|
101
|
+
/** First line of npm output that reads as an error, for a one-line note. */
|
|
102
|
+
function npmErrorLine(output) {
|
|
103
|
+
const lines = output.split('\n').map(l => l.trim()).filter(Boolean);
|
|
104
|
+
const code = lines.find(l => /\bcode\s+E[A-Z0-9]+/.test(l));
|
|
105
|
+
return (code ?? lines.find(l => /error|ERR!/i.test(l)) ?? lines[lines.length - 1] ?? 'no output').slice(0, 200);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Publish, re-lock and commit, when the plan says the failure is only
|
|
109
|
+
* unpublished in-repo versions. Never throws for an npm or git failure: each is
|
|
110
|
+
* an outcome with a note naming the step and npm's own words (a host with no
|
|
111
|
+
* registry credentials reads as `could not publish ...: ENEEDAUTH`).
|
|
112
|
+
*/
|
|
113
|
+
export async function publishAroundUnpublished(input, deps) {
|
|
114
|
+
const { worktreePath, headSha, result, deliveryId } = input;
|
|
115
|
+
const plan = planInRepoPublish(result, dir => deps.readWorkspaceVersion(worktreePath, dir));
|
|
116
|
+
if (plan.kind === 'decline')
|
|
117
|
+
return { kind: 'declined', note: plan.reason };
|
|
118
|
+
const lockfiles = plan.relock.map(lockfilePath);
|
|
119
|
+
const dirty = deps.uncommittedPaths(worktreePath);
|
|
120
|
+
if (dirty === null)
|
|
121
|
+
return { kind: 'deferred', note: 'could not read the focus worktree status; nothing published' };
|
|
122
|
+
const blocking = dirtyPublishInputs(plan, dirty);
|
|
123
|
+
if (blocking.length > 0) {
|
|
124
|
+
const shown = blocking.slice(0, 5).join(', ') + (blocking.length > 5 ? ` (+${blocking.length - 5} more)` : '');
|
|
125
|
+
return { kind: 'deferred', note: `nothing published: uncommitted publish inputs in the focus worktree: ${shown}` };
|
|
126
|
+
}
|
|
127
|
+
const failure = await publishFromCommit(worktreePath, headSha, plan, deps);
|
|
128
|
+
if (failure)
|
|
129
|
+
return failure;
|
|
130
|
+
for (const dir of plan.relock) {
|
|
131
|
+
const r = await deps.runNpm(joinPath(worktreePath, dir), relockArgs());
|
|
132
|
+
if (r.exitCode !== 0) {
|
|
133
|
+
return { kind: 'failed', note: `published ${plan.publish.map(label).join(', ')}; could not re-lock ${dir}: ${npmErrorLine(r.output)}` };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const published = plan.publish.map(label).join(', ');
|
|
137
|
+
const note = `daemon published ${published} under ${PENDING_DIST_TAG} and locked it`;
|
|
138
|
+
const relocked = deps.uncommittedPaths(worktreePath)?.filter(p => lockfiles.includes(p)) ?? null;
|
|
139
|
+
if (relocked === null)
|
|
140
|
+
return { kind: 'failed', note: `published ${published}; could not read the regenerated lockfiles' status` };
|
|
141
|
+
// Lockfiles that already named the version need no commit: the publish alone resolves them.
|
|
142
|
+
if (relocked.length === 0)
|
|
143
|
+
return { kind: 'resolved', sha: null, published: plan.publish, note };
|
|
144
|
+
const message = `chore(deps): lock ${published} published under the ${PENDING_DIST_TAG} tag`;
|
|
145
|
+
const sha = deps.commitPaths(worktreePath, relocked, message, deliveryId);
|
|
146
|
+
if (!sha)
|
|
147
|
+
return { kind: 'failed', note: `published ${published}; git refused the lockfile commit (${relocked.join(', ')})` };
|
|
148
|
+
return { kind: 'resolved', sha, published: plan.publish, note };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Build and publish each target from a detached checkout of `headSha`, in
|
|
152
|
+
* dependency order. Returns the outcome that stopped it, or null when every
|
|
153
|
+
* target is in the registry.
|
|
154
|
+
*/
|
|
155
|
+
async function publishFromCommit(worktreePath, headSha, plan, deps) {
|
|
156
|
+
const snapshot = deps.checkoutCommit(worktreePath, headSha);
|
|
157
|
+
if (!snapshot)
|
|
158
|
+
return { kind: 'deferred', note: `nothing published: could not check out ${headSha.slice(0, 12)} to build from` };
|
|
159
|
+
try {
|
|
160
|
+
for (const target of plan.publish) {
|
|
161
|
+
const committed = deps.readWorkspaceVersion(snapshot.root, target.dir);
|
|
162
|
+
if (committed !== target.version) {
|
|
163
|
+
return { kind: 'deferred', note: `nothing published: ${headSha.slice(0, 12)} holds ${target.dir} at ${committed ?? 'no version'}, not ${target.version}` };
|
|
164
|
+
}
|
|
165
|
+
const cwd = joinPath(snapshot.root, target.dir);
|
|
166
|
+
for (const args of [['run', 'clean', '--if-present'], ['run', 'build']]) {
|
|
167
|
+
const r = await deps.runNpm(cwd, args);
|
|
168
|
+
if (r.exitCode !== 0) {
|
|
169
|
+
return { kind: 'failed', note: `could not build ${label(target)} (npm ${args.join(' ')}): ${npmErrorLine(r.output)}` };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const pub = await deps.runNpm(cwd, publishArgs());
|
|
173
|
+
if (pub.exitCode !== 0 && !ALREADY_PUBLISHED.test(pub.output)) {
|
|
174
|
+
return { kind: 'failed', note: `could not publish ${label(target)} under ${PENDING_DIST_TAG}: ${npmErrorLine(pub.output)}` };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
snapshot.release();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=in-repo-publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-repo-publish.js","sourceRoot":"","sources":["../../../src/verify/install-probe/in-repo-publish.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,6EAA6E;AAC7E,qEAAqE;AACrE,gBAAgB;AA0ChB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiD;IAC/E,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE,sBAAsB,EAAE;IAC5D,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,EAAE,qBAAqB,EAAE;IAC5D,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE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,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;gBACxE,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBACvC,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;oBACrB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACzH,CAAC;YACH,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;YAClD,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,KAAK,CAAC,MAAM,CAAC,UAAU,gBAAgB,KAAK,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YAC/H,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -24,16 +24,25 @@ import type { DaemonConfig } from '../../types/index.js';
|
|
|
24
24
|
import type { getActiveFocuses } from '../../queries/focuses/focus-discovery.js';
|
|
25
25
|
import type { getFocusDeliveries } from '../../queries/focuses/focuses.js';
|
|
26
26
|
import { type DeliveryGateState } from '../../queries/delivery-gate-state/delivery-gate-state.js';
|
|
27
|
+
import type { InstallProbeDetail } from '../../queries/delivery-gate-state/delivery-gate-holds.js';
|
|
27
28
|
import { type InstallProbeResult } from './install-probe.js';
|
|
29
|
+
import type { InRepoPublishOutcome } from './in-repo-publish.js';
|
|
28
30
|
/** The gate_state guard name the probe reports under. */
|
|
29
31
|
export declare const INSTALL_PROBE_GUARD = "clean_install_probe";
|
|
30
32
|
/**
|
|
31
33
|
* Build the gate_state entry for a probe result. resolution_failed -> a blocking
|
|
32
|
-
* condition (holds/surfaces on "Waiting on"
|
|
34
|
+
* condition (holds/surfaces on "Waiting on", naming what npm could not resolve
|
|
35
|
+
* under `installProbe`); unverifiable (registry unreachable)
|
|
33
36
|
* -> a non-blocking WARNING (probe infra, not a delivery failure); pass/skipped
|
|
34
37
|
* -> null (clear any prior probe gate). Pure -- exported for testing.
|
|
35
38
|
*/
|
|
36
|
-
export declare function probeGateState(result: InstallProbeResult, evaluatedAt: string): DeliveryGateState | null;
|
|
39
|
+
export declare function probeGateState(result: InstallProbeResult, evaluatedAt: string, note?: string): DeliveryGateState | null;
|
|
40
|
+
/**
|
|
41
|
+
* What a failed probe waits on: each package@spec npm named, per probed package,
|
|
42
|
+
* and the packages whose failure named none. `note` records what the daemon did
|
|
43
|
+
* about it (install-probe/in-repo-publish.ts). Pure -- exported for testing.
|
|
44
|
+
*/
|
|
45
|
+
export declare function installProbeDetail(result: InstallProbeResult, note?: string): InstallProbeDetail;
|
|
37
46
|
/**
|
|
38
47
|
* The probe's production gate_state write: WITHOUT changing execution_status
|
|
39
48
|
* (stays verify) or logging a transition. Passing the same status is idempotent;
|
|
@@ -53,6 +62,18 @@ export interface InstallProbeTickDeps {
|
|
|
53
62
|
runProbe: (changedFiles: string[], repoPath: string) => Promise<InstallProbeResult>;
|
|
54
63
|
writeGateState: (deliveryId: string, gateState: DeliveryGateState | null, organizationId: string) => Promise<void>;
|
|
55
64
|
now: () => string;
|
|
65
|
+
/**
|
|
66
|
+
* Close a failure that is ONLY unpublished in-repo @telora versions: publish
|
|
67
|
+
* them under the pending tag and commit the regenerated lockfiles
|
|
68
|
+
* (in-repo-publish.ts), built from the probed commit `headSha`. Absent, a
|
|
69
|
+
* failed probe just blocks.
|
|
70
|
+
*/
|
|
71
|
+
publishAround?: (input: {
|
|
72
|
+
worktreePath: string;
|
|
73
|
+
headSha: string;
|
|
74
|
+
result: InstallProbeResult;
|
|
75
|
+
deliveryId: string;
|
|
76
|
+
}) => Promise<InRepoPublishOutcome>;
|
|
56
77
|
}
|
|
57
78
|
/** Test hook to reset the cache. */
|
|
58
79
|
export declare function __resetInstallProbeCacheForTests(): void;
|