jackherd 1.25.0 → 1.26.0

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.
@@ -23,6 +23,13 @@ import { isLaneModels, LANE_MODEL_EVENT, type LaneModelEvent, type LaneModels }
23
23
  import { isLaneParallels, LANE_PARALLEL_EVENT, type LaneParallelEvent, type LaneParallels } from './lane-parallel'
24
24
  import { isStallState, LANE_STALLED_EVENT, type LaneStalledEvent, type StallState } from './lane-stalled'
25
25
  import { type LaneSnapshot, type SeenSeqs, seenSeqsOf } from './lane-watch'
26
+ import {
27
+ isProposalState,
28
+ type ProposalState,
29
+ WAITING_OBSOLETE_EVENT,
30
+ type WaitingObsoleteEvent,
31
+ } from './obsolete-proposals'
32
+ import { WAITING_CLOSED_EVENT, type WaitingClosedEvent } from './obsolete-records'
26
33
  import { isPlanMissingState, PLAN_MISSING_EVENT, type PlanMissingEvent, type PlanMissingState } from './plan-missing'
27
34
  import { emptyPreviewState, isPreviewState, PREVIEW_EVENT, type PreviewEvent, type PreviewState } from './previews'
28
35
  import { PULL_REQUEST_STATE, type WatchedPullRequest } from './pull-requests'
@@ -71,6 +78,8 @@ export const WATCH_EVENT = {
71
78
  laneStalled: LANE_STALLED_EVENT,
72
79
  unlinkedArtifact: UNLINKED_ARTIFACT_EVENT,
73
80
  planMissing: PLAN_MISSING_EVENT,
81
+ waitingClosed: WAITING_CLOSED_EVENT,
82
+ waitingObsolete: WAITING_OBSOLETE_EVENT,
74
83
  approval: APPROVAL_EVENT,
75
84
  source: SOURCE_EVENT,
76
85
  due: APPOINTMENT_EVENT.due,
@@ -137,6 +146,10 @@ export type WatchState = {
137
146
  unlinkedArtifacts: UnlinkedState
138
147
  /** Per working lane whose board row links a plan the base ref lacks: the plan last reported as `plan missing on base`. */
139
148
  planMissing: PlanMissingState
149
+ /** The lanes of open waiting points whose directory was missing at the last heartbeat; missing twice in a row, a lane is gone. */
150
+ waitingMissingLanes: string[]
151
+ /** Per open waiting point (record id or board row key): the reasons already proposed as `waiting obsolete?`. */
152
+ waitingProposals: ProposalState
140
153
  /** The ids of the approval requests on disk when they were last read, each reported once while it is open. */
141
154
  approvals: string[]
142
155
  /** Per configured source of `watch.sources`: the entries seen (`[id, fingerprint]`) and the start of a failure streak. */
@@ -207,6 +220,8 @@ export type WatchEvent =
207
220
  | LaneStalledEvent
208
221
  | UnlinkedArtifactEvent
209
222
  | PlanMissingEvent
223
+ | WaitingClosedEvent
224
+ | WaitingObsoleteEvent
210
225
  | ApprovalEvent
211
226
  | SourceEvent
212
227
  | AppointmentEvent
@@ -248,6 +263,8 @@ export const emptyWatchState = (): WatchState => ({
248
263
  laneStalls: {},
249
264
  unlinkedArtifacts: {},
250
265
  planMissing: {},
266
+ waitingMissingLanes: [],
267
+ waitingProposals: {},
251
268
  approvals: [],
252
269
  sources: emptySourceState(),
253
270
  watchedSources: null,
@@ -304,6 +321,9 @@ const isWatchState = (value: Record<string, unknown>): value is WatchState =>
304
321
  isStallState(value.laneStalls) &&
305
322
  isUnlinkedState(value.unlinkedArtifacts) &&
306
323
  isPlanMissingState(value.planMissing) &&
324
+ Array.isArray(value.waitingMissingLanes) &&
325
+ value.waitingMissingLanes.every((lane) => typeof lane === 'string') &&
326
+ isProposalState(value.waitingProposals) &&
307
327
  Array.isArray(value.approvals) &&
308
328
  value.approvals.every((id) => typeof id === 'string') &&
309
329
  isSourceState(value.sources) &&