@telora/daemon 0.20.54 → 0.20.60

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.
Files changed (87) hide show
  1. package/build-info.json +6 -3
  2. package/dist/cli/session-state.d.ts +9 -0
  3. package/dist/cli/session-state.d.ts.map +1 -1
  4. package/dist/cli/session-state.js.map +1 -1
  5. package/dist/completion/review-exit-escalations.d.ts +85 -0
  6. package/dist/completion/review-exit-escalations.d.ts.map +1 -0
  7. package/dist/completion/review-exit-escalations.js +203 -0
  8. package/dist/completion/review-exit-escalations.js.map +1 -0
  9. package/dist/completion/review-exit-phase.d.ts.map +1 -1
  10. package/dist/completion/review-exit-phase.js +43 -135
  11. package/dist/completion/review-exit-phase.js.map +1 -1
  12. package/dist/delivery-advance-block.d.ts.map +1 -1
  13. package/dist/delivery-advance-block.js +8 -1
  14. package/dist/delivery-advance-block.js.map +1 -1
  15. package/dist/external-hold.d.ts +104 -0
  16. package/dist/external-hold.d.ts.map +1 -0
  17. package/dist/external-hold.js +149 -0
  18. package/dist/external-hold.js.map +1 -0
  19. package/dist/listener-auto-advance.d.ts.map +1 -1
  20. package/dist/listener-auto-advance.js +12 -0
  21. package/dist/listener-auto-advance.js.map +1 -1
  22. package/dist/listener.d.ts.map +1 -1
  23. package/dist/listener.js +56 -11
  24. package/dist/listener.js.map +1 -1
  25. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  26. package/dist/prompt-sections/execution-sections.js +25 -23
  27. package/dist/prompt-sections/execution-sections.js.map +1 -1
  28. package/dist/queries/deliveries.d.ts +62 -0
  29. package/dist/queries/deliveries.d.ts.map +1 -1
  30. package/dist/queries/deliveries.js +1 -0
  31. package/dist/queries/deliveries.js.map +1 -1
  32. package/dist/queries/holds.d.ts +177 -0
  33. package/dist/queries/holds.d.ts.map +1 -0
  34. package/dist/queries/holds.js +232 -0
  35. package/dist/queries/holds.js.map +1 -0
  36. package/dist/queries/issues.d.ts +3 -99
  37. package/dist/queries/issues.d.ts.map +1 -1
  38. package/dist/queries/issues.js +4 -137
  39. package/dist/queries/issues.js.map +1 -1
  40. package/dist/queries/schemas.d.ts +2 -0
  41. package/dist/queries/schemas.d.ts.map +1 -1
  42. package/dist/queries/schemas.js +5 -0
  43. package/dist/queries/schemas.js.map +1 -1
  44. package/dist/resolver-dispatch.d.ts +108 -0
  45. package/dist/resolver-dispatch.d.ts.map +1 -0
  46. package/dist/resolver-dispatch.js +83 -0
  47. package/dist/resolver-dispatch.js.map +1 -0
  48. package/dist/resolver-reach.d.ts +192 -0
  49. package/dist/resolver-reach.d.ts.map +1 -0
  50. package/dist/resolver-reach.js +168 -0
  51. package/dist/resolver-reach.js.map +1 -0
  52. package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
  53. package/dist/resolvers/git-diff-against-base.js +8 -2
  54. package/dist/resolvers/git-diff-against-base.js.map +1 -1
  55. package/dist/resolvers/index.d.ts +1 -1
  56. package/dist/resolvers/index.d.ts.map +1 -1
  57. package/dist/resolvers/index.js +1 -1
  58. package/dist/resolvers/index.js.map +1 -1
  59. package/dist/resolvers/shared/git-diff.d.ts +47 -0
  60. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  61. package/dist/resolvers/shared/git-diff.js +103 -15
  62. package/dist/resolvers/shared/git-diff.js.map +1 -1
  63. package/dist/spawn/review-role-fallback.d.ts +37 -3
  64. package/dist/spawn/review-role-fallback.d.ts.map +1 -1
  65. package/dist/spawn/review-role-fallback.js +38 -3
  66. package/dist/spawn/review-role-fallback.js.map +1 -1
  67. package/dist/stall-detectors.d.ts +33 -4
  68. package/dist/stall-detectors.d.ts.map +1 -1
  69. package/dist/stall-detectors.js +64 -5
  70. package/dist/stall-detectors.js.map +1 -1
  71. package/dist/verification-engine.d.ts +10 -0
  72. package/dist/verification-engine.d.ts.map +1 -1
  73. package/dist/verification-engine.js +142 -96
  74. package/dist/verification-engine.js.map +1 -1
  75. package/dist/verification-feedback.d.ts +44 -1
  76. package/dist/verification-feedback.d.ts.map +1 -1
  77. package/dist/verification-feedback.js +130 -1
  78. package/dist/verification-feedback.js.map +1 -1
  79. package/dist/verify-reconciliation.d.ts +25 -1
  80. package/dist/verify-reconciliation.d.ts.map +1 -1
  81. package/dist/verify-reconciliation.js +64 -2
  82. package/dist/verify-reconciliation.js.map +1 -1
  83. package/dist/verify-restatement.d.ts +22 -4
  84. package/dist/verify-restatement.d.ts.map +1 -1
  85. package/dist/verify-restatement.js +18 -1
  86. package/dist/verify-restatement.js.map +1 -1
  87. package/package.json +2 -2
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Delivery hold-lookup queries.
3
+ *
4
+ * "Is something holding this delivery out of done, and what?" -- the escalation
5
+ * side of that question. Two disposition-keyed families live here:
6
+ *
7
+ * - OPERATOR holds (needs_operator / external_wait): a human or an external
8
+ * party must act before the declared work counts as real. Fails CLOSED at
9
+ * its call site.
10
+ * - DIRECTED holds (needs_intent / needs_clarification): an unanswered
11
+ * question the daemon reads back to the asking agent. Fails OPEN at its
12
+ * call site.
13
+ *
14
+ * Plus SELF_REPORT_STALL_HOLD_KINDS: the kinds that are machine-filed alarms
15
+ * ABOUT a delivery's own cycling, excluded from the operator predicate so an
16
+ * alarm cannot constitute the condition it reports.
17
+ *
18
+ * Extracted from queries/issues.ts to keep that file under the daemon
19
+ * file-size limit -- the self-referential-alarm fix pushed it to 844. Bodies
20
+ * verbatim; issues.ts re-exports this surface so existing importers are
21
+ * unaffected.
22
+ *
23
+ * @module queries/holds
24
+ */
25
+ import { callApi } from './shared.js';
26
+ /** Escalation statuses that count as OPEN for every hold lookup here. */
27
+ export const OPEN_ESCALATION_STATUSES = new Set(['pending', 'in_review']);
28
+ /**
29
+ * The escalation dispositions that mean "a human operator or an external party
30
+ * must act before this delivery's declared work can be considered real":
31
+ * needs_operator (operator/infra/security action) and external_wait (blocked on
32
+ * a third party). Distinct from needs_intent / needs_clarification (a steering
33
+ * question, not a blocked-on-reality signal) and agent_resolvable (no human at
34
+ * all). Keyed on the DISPOSITION axis so ANY escalation kind carrying one of
35
+ * these holds its delivery -- the gate must not enumerate kinds.
36
+ *
37
+ * Declared as daemon-local string literals (not imported from @telora/daemon-core's
38
+ * ESCALATION_DISPOSITIONS) on purpose, mirroring MERGE_CONFLICT_ESCALATION_KIND
39
+ * below: a bare `@telora/*` VALUE import in a query module pulled into a mocked
40
+ * node:test fails to resolve under the module-mock loader (the daemon-local-copy
41
+ * rule). The canonical enum lives in packages/daemon-core/src/disposition.ts and
42
+ * the DB CHECK on agent_escalations.disposition is the real constraint; these
43
+ * strings must stay in sync with it.
44
+ */
45
+ export const OPERATOR_HOLD_DISPOSITIONS = [
46
+ 'needs_operator',
47
+ 'external_wait',
48
+ ];
49
+ /**
50
+ * escalation_kind discriminators that are SELF-REFERENTIAL stall alarms: a
51
+ * machine-filed escalation ABOUT a delivery's own cycling, which must NOT be
52
+ * allowed to satisfy the operator-hold predicate that holds that same delivery.
53
+ *
54
+ * The fixpoint this removes (observed 2026-07-26, delivery 50131436, escalations
55
+ * 96262dfa -> 43c4dade): the verify_failed cap detector files
56
+ * verify_gate_unclearable (disposition needs_operator, anchored to the delivery)
57
+ * when iteration_count exceeds the cap. findOpenOperatorHoldForDelivery matched
58
+ * on disposition ONLY, so that alarm satisfied the very hold predicate it was
59
+ * raised about; the delivery was held out of `done`; `done` is the only
60
+ * non-cancelled terminal that makes exceedsVerifyFailedCap stop firing; and
61
+ * iteration_count is monotonic -- so the alarm blocked the only exit that would
62
+ * silence it, and resolving one let the detector file the next on the following
63
+ * tick.
64
+ *
65
+ * ENUMERATION -- every machine-filed, delivery-anchored needs_operator kind, and
66
+ * whether it is a genuine hold or a self-referential stall alarm. The exclusion
67
+ * criterion is narrow and precise: exclude a kind IFF (a) it re-arms while the
68
+ * delivery is non-terminal AND (b) its ONLY silencing is the delivery reaching
69
+ * the terminal state the hold blocks. A kind that describes external reality an
70
+ * operator must change, or that is filed once and silenced by operator
71
+ * resolution, is a GENUINE hold and stays.
72
+ *
73
+ * verify_gate_unclearable (stall-detectors.ts) -- SELF-REFERENTIAL. Trigger
74
+ * (iteration_count) is monotonic and re-arms every tick while non-terminal;
75
+ * silenced only by done/cancelled, which the hold blocks. EXCLUDE.
76
+ * verify_evidence_unavailable (verification-feedback.ts) -- self-REPORT of an
77
+ * instrument fault, but filed ONCE per delivery (idempotent, never re-armed)
78
+ * and silenced by operator resolution, not by `done`. It also already holds
79
+ * the delivery via its OWN gate_state.blocking guard, so it does not lean on
80
+ * this predicate. Not a fixpoint -> KEEP as a hold.
81
+ * schema_drift_blocked (listener-auto-advance.ts) -- operator must apply a
82
+ * migration (external reality). KEEP.
83
+ * advance_blocked (delivery-advance-block.ts) -- dirty worktree / lockfile
84
+ * state an operator or agent must resolve. KEEP.
85
+ * cd_push_failed (ci-escalation.ts) / ci_run_red (ci-sensor-loop.ts) --
86
+ * external CI/CD state. KEEP.
87
+ * propagation_stale (staleness-sensor.ts) -- external propagation state. KEEP.
88
+ *
89
+ * (Focus-anchored kinds -- merge_conflict, merge_refused_dirty,
90
+ * review_window_stalled, stuck_focus_branch -- are never matched by
91
+ * findOpenOperatorHoldForDelivery, which keys on deliveryId, so they need no
92
+ * exclusion here.)
93
+ *
94
+ * Daemon-local literal for the same reason as OPERATOR_HOLD_DISPOSITIONS above:
95
+ * a bare `@telora/*` value import mis-resolves under the node:test module-mock
96
+ * loader, and importing stall-detectors.VERIFY_GATE_UNCLEARABLE_KIND would also
97
+ * form an import cycle (stall-detectors imports from this module). Keep in sync
98
+ * with stall-detectors.VERIFY_GATE_UNCLEARABLE_KIND and the DB CHECK.
99
+ */
100
+ export const SELF_REPORT_STALL_HOLD_KINDS = [
101
+ 'verify_gate_unclearable',
102
+ ];
103
+ /**
104
+ * Returns the OPEN (pending|in_review) operator-hold escalation anchored to the
105
+ * given delivery, or null when none is open.
106
+ *
107
+ * DISPOSITION-keyed sibling of hasOpenEscalationForDelivery (which is KIND-keyed):
108
+ * it matches ANY escalation_kind whose disposition is in OPERATOR_HOLD_DISPOSITIONS
109
+ * (needs_operator / external_wait). This is the vocabulary the verify->done gate
110
+ * previously lacked -- an operator blocked ON a delivery (e.g. "the host restore
111
+ * was NOT executed") could not hold that delivery out of done, so a clean review
112
+ * auto-approved it. Returning the matching row (id + kind + disposition), not a
113
+ * bare boolean, lets the gate write the block into the delivery's gate_state.
114
+ *
115
+ * Matches on the typed delivery_id + disposition COLUMNS in preference to the
116
+ * metadata bag, with a metadata fallback (metadata.deliveryId / metadata.disposition)
117
+ * for rows already open at deploy time. The status is re-checked client-side as
118
+ * defense-in-depth against a deploy-lagged edge fn returning resolved rows.
119
+ *
120
+ * escalation_list has NO server-side delivery_id filter, so the delivery match is
121
+ * applied client-side over the org's open rows. Pass `focusId` to narrow the page
122
+ * server-side (the same busy-org paging concern hasOpenWorktreeDirtyEscalation
123
+ * addresses); omit it and the lookup reads the newest 500 open org rows.
124
+ *
125
+ * FAIL-CLOSED is the CALLER's responsibility. This function reports what it finds
126
+ * and THROWS on a hard API error. The verify->done gate that consumes it exists
127
+ * precisely to fail closed, so it must treat a lookup error as "held" -- the
128
+ * opposite of the other escalation lookups (dedup/auto-close), which fail OPEN
129
+ * because a spurious park is worse than a missed dedup. Here a missed hold lets an
130
+ * operator-blocked delivery reach done, which is the failure this gate prevents.
131
+ */
132
+ export async function findOpenOperatorHoldForDelivery(deliveryId, focusId) {
133
+ return findOpenHoldForDelivery(deliveryId, OPERATOR_HOLD_DISPOSITIONS, focusId,
134
+ // A machine-filed alarm ABOUT this delivery's own cycling must not satisfy
135
+ // the predicate that holds it -- see SELF_REPORT_STALL_HOLD_KINDS.
136
+ new Set(SELF_REPORT_STALL_HOLD_KINDS));
137
+ }
138
+ /**
139
+ * Boolean convenience over findOpenOperatorHoldForDelivery for call sites that
140
+ * only need to know whether the hold exists (not which escalation it is).
141
+ */
142
+ export async function hasOpenOperatorHoldForDelivery(deliveryId, focusId) {
143
+ return (await findOpenOperatorHoldForDelivery(deliveryId, focusId)) !== null;
144
+ }
145
+ /**
146
+ * The escalation dispositions that mean "a human must STEER before this team's
147
+ * work can proceed": needs_intent (scope/direction/priority) and
148
+ * needs_clarification (ambiguity to resolve). These are exactly the two the
149
+ * escalation tool documents as answerable via the `answer` field -- a DIRECTED
150
+ * question the daemon reads back to the asking agent, distinct from the
151
+ * operator-hold dispositions (needs_operator / external_wait, a blocked-on-reality
152
+ * signal) and agent_resolvable (no human at all).
153
+ *
154
+ * Daemon-local literals for the same reason as OPERATOR_HOLD_DISPOSITIONS above:
155
+ * a bare `@telora/*` value import in a query module pulled into a mocked
156
+ * node:test fails to resolve under the module-mock loader. The canonical enum is
157
+ * packages/daemon-core/src/disposition.ts and the DB CHECK on
158
+ * agent_escalations.disposition is the real constraint; these strings must stay
159
+ * in sync with it.
160
+ */
161
+ export const DIRECTED_HOLD_DISPOSITIONS = [
162
+ 'needs_intent',
163
+ 'needs_clarification',
164
+ ];
165
+ /**
166
+ * Returns the OPEN (pending|in_review) DIRECTED-hold escalation anchored to the
167
+ * given delivery, or null when none is open. Disposition-keyed sibling of
168
+ * findOpenOperatorHoldForDelivery, keyed on DIRECTED_HOLD_DISPOSITIONS
169
+ * (needs_intent / needs_clarification) instead of the operator-hold set.
170
+ *
171
+ * This is the vocabulary the completion-event no-progress guard previously
172
+ * lacked: a team parked on its own unanswered directed question could not be
173
+ * told apart from a team that has stalled, so the scope-coverage guard counted
174
+ * the wait as no-progress, re-engaged the team (real model spend), and
175
+ * eventually filed a team_failure ON TOP of the question.
176
+ *
177
+ * FAIL DIRECTION IS THE OPPOSITE of findOpenOperatorHoldForDelivery. The
178
+ * operator-hold gate's CALLER fails CLOSED (a lookup error => held) because a
179
+ * missed hold lets an operator-blocked delivery reach done. HERE the consuming
180
+ * guard must fail OPEN: a lookup error must NOT suppress a genuine stall
181
+ * escalation, so the caller treats an error as "not blocked". This function
182
+ * still reports what it finds and THROWS on a hard API error; the fail-open
183
+ * decision lives at the call site (completion/event-phases.computeCompletionFacts),
184
+ * which catches and defaults to not-blocked.
185
+ */
186
+ export async function findOpenDirectedHoldForDelivery(deliveryId, focusId) {
187
+ return findOpenHoldForDelivery(deliveryId, DIRECTED_HOLD_DISPOSITIONS, focusId);
188
+ }
189
+ /**
190
+ * Shared body for the disposition-keyed open-hold lookups
191
+ * (findOpenOperatorHoldForDelivery / findOpenDirectedHoldForDelivery). Reads the
192
+ * newest 500 open (pending|in_review) escalations -- narrowed server-side by
193
+ * focusId when supplied, the same busy-org paging concern the sibling lookups
194
+ * address -- and returns the first whose delivery matches (typed delivery_id
195
+ * COLUMN preferred, metadata.deliveryId fallback for rows open at deploy time)
196
+ * AND whose disposition (typed column preferred, metadata fallback) is in the
197
+ * given set. Status is re-checked client-side as defense-in-depth against a
198
+ * deploy-lagged edge fn returning resolved rows. THROWS on a hard API error;
199
+ * fail-open/closed is the CALLER's choice.
200
+ *
201
+ * `excludeKinds` (optional) drops any otherwise-matching escalation whose
202
+ * escalation_kind is in the set BEFORE it is returned -- used by the operator-hold
203
+ * lookup to skip self-referential stall alarms (SELF_REPORT_STALL_HOLD_KINDS) so an
204
+ * alarm about a delivery's own cycling cannot hold that delivery. The kind is read
205
+ * from the typed column with a metadata.kind fallback (parity with the disposition
206
+ * fallback), so an excluded kind is dropped regardless of column promotion.
207
+ */
208
+ async function findOpenHoldForDelivery(deliveryId, dispositions, focusId, excludeKinds) {
209
+ const holdSet = new Set(dispositions);
210
+ const fields = { statuses: ['pending', 'in_review'] };
211
+ if (focusId)
212
+ fields.focusId = focusId;
213
+ const result = await callApi('escalation_list', { fields, limit: 500 });
214
+ for (const e of result.escalations ?? []) {
215
+ if (e.status && !OPEN_ESCALATION_STATUSES.has(e.status))
216
+ continue;
217
+ const meta = e.metadata ?? null;
218
+ const disposition = (typeof e.disposition === 'string' ? e.disposition : null) ??
219
+ (typeof meta?.disposition === 'string' ? meta.disposition : null);
220
+ const matchedDelivery = e.deliveryId === deliveryId || meta?.deliveryId === deliveryId;
221
+ if (matchedDelivery && disposition !== null && holdSet.has(disposition)) {
222
+ const kind = (typeof e.escalationKind === 'string' ? e.escalationKind : null) ??
223
+ (typeof meta?.kind === 'string' ? meta.kind : null);
224
+ // A self-referential stall alarm about this delivery must not hold it.
225
+ if (excludeKinds && kind !== null && excludeKinds.has(kind))
226
+ continue;
227
+ return { id: e.id, escalationKind: e.escalationKind ?? null, disposition };
228
+ }
229
+ }
230
+ return null;
231
+ }
232
+ //# sourceMappingURL=holds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holds.js","sourceRoot":"","sources":["../../src/queries/holds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAE/F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IAC3D,gBAAgB;IAChB,eAAe;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,yBAAyB;CAC1B,CAAC;AASF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,UAAkB,EAClB,OAAgB;IAEhB,OAAO,uBAAuB,CAC5B,UAAU,EACV,0BAA0B,EAC1B,OAAO;IACP,2EAA2E;IAC3E,mEAAmE;IACnE,IAAI,GAAG,CAAC,4BAA4B,CAAC,CACtC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,UAAkB,EAClB,OAAgB;IAEhB,OAAO,CAAC,MAAM,+BAA+B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAA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pE,MAAM,eAAe,GACnB,CAAC,CAAC,UAAU,KAAK,UAAU,IAAI,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC;QACjE,IAAI,eAAe,IAAI,WAAW,KAAK,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,GACR,CAAC,OAAO,CAAC,CAAC,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;gBAChE,CAAC,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAI,CAAC,IAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAClE,uEAAuE;YACvE,IAAI,YAAY,IAAI,IAAI,KAAK,IAAI,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAS;YACtE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,IAAI,EAAE,WAAW,EAAE,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -147,104 +147,9 @@ export declare function hasOpenTeamFailureEscalation(focusId: string): Promise<b
147
147
  * polls files exactly one open escalation instead of one per tick.
148
148
  */
149
149
  export declare function hasOpenEscalationForDelivery(deliveryId: string, escalationKind: string): Promise<boolean>;
150
- /**
151
- * The escalation dispositions that mean "a human operator or an external party
152
- * must act before this delivery's declared work can be considered real":
153
- * needs_operator (operator/infra/security action) and external_wait (blocked on
154
- * a third party). Distinct from needs_intent / needs_clarification (a steering
155
- * question, not a blocked-on-reality signal) and agent_resolvable (no human at
156
- * all). Keyed on the DISPOSITION axis so ANY escalation kind carrying one of
157
- * these holds its delivery -- the gate must not enumerate kinds.
158
- *
159
- * Declared as daemon-local string literals (not imported from @telora/daemon-core's
160
- * ESCALATION_DISPOSITIONS) on purpose, mirroring MERGE_CONFLICT_ESCALATION_KIND
161
- * below: a bare `@telora/*` VALUE import in a query module pulled into a mocked
162
- * node:test fails to resolve under the module-mock loader (the daemon-local-copy
163
- * rule). The canonical enum lives in packages/daemon-core/src/disposition.ts and
164
- * the DB CHECK on agent_escalations.disposition is the real constraint; these
165
- * strings must stay in sync with it.
166
- */
167
- export declare const OPERATOR_HOLD_DISPOSITIONS: readonly string[];
168
- /** The open operator-hold escalation a delivery is blocked on (for gate_state). */
169
- export interface OperatorHoldEscalation {
170
- id: string;
171
- escalationKind: string | null;
172
- disposition: string;
173
- }
174
- /**
175
- * Returns the OPEN (pending|in_review) operator-hold escalation anchored to the
176
- * given delivery, or null when none is open.
177
- *
178
- * DISPOSITION-keyed sibling of hasOpenEscalationForDelivery (which is KIND-keyed):
179
- * it matches ANY escalation_kind whose disposition is in OPERATOR_HOLD_DISPOSITIONS
180
- * (needs_operator / external_wait). This is the vocabulary the verify->done gate
181
- * previously lacked -- an operator blocked ON a delivery (e.g. "the host restore
182
- * was NOT executed") could not hold that delivery out of done, so a clean review
183
- * auto-approved it. Returning the matching row (id + kind + disposition), not a
184
- * bare boolean, lets the gate write the block into the delivery's gate_state.
185
- *
186
- * Matches on the typed delivery_id + disposition COLUMNS in preference to the
187
- * metadata bag, with a metadata fallback (metadata.deliveryId / metadata.disposition)
188
- * for rows already open at deploy time. The status is re-checked client-side as
189
- * defense-in-depth against a deploy-lagged edge fn returning resolved rows.
190
- *
191
- * escalation_list has NO server-side delivery_id filter, so the delivery match is
192
- * applied client-side over the org's open rows. Pass `focusId` to narrow the page
193
- * server-side (the same busy-org paging concern hasOpenWorktreeDirtyEscalation
194
- * addresses); omit it and the lookup reads the newest 500 open org rows.
195
- *
196
- * FAIL-CLOSED is the CALLER's responsibility. This function reports what it finds
197
- * and THROWS on a hard API error. The verify->done gate that consumes it exists
198
- * precisely to fail closed, so it must treat a lookup error as "held" -- the
199
- * opposite of the other escalation lookups (dedup/auto-close), which fail OPEN
200
- * because a spurious park is worse than a missed dedup. Here a missed hold lets an
201
- * operator-blocked delivery reach done, which is the failure this gate prevents.
202
- */
203
- export declare function findOpenOperatorHoldForDelivery(deliveryId: string, focusId?: string): Promise<OperatorHoldEscalation | null>;
204
- /**
205
- * Boolean convenience over findOpenOperatorHoldForDelivery for call sites that
206
- * only need to know whether the hold exists (not which escalation it is).
207
- */
208
- export declare function hasOpenOperatorHoldForDelivery(deliveryId: string, focusId?: string): Promise<boolean>;
209
- /**
210
- * The escalation dispositions that mean "a human must STEER before this team's
211
- * work can proceed": needs_intent (scope/direction/priority) and
212
- * needs_clarification (ambiguity to resolve). These are exactly the two the
213
- * escalation tool documents as answerable via the `answer` field -- a DIRECTED
214
- * question the daemon reads back to the asking agent, distinct from the
215
- * operator-hold dispositions (needs_operator / external_wait, a blocked-on-reality
216
- * signal) and agent_resolvable (no human at all).
217
- *
218
- * Daemon-local literals for the same reason as OPERATOR_HOLD_DISPOSITIONS above:
219
- * a bare `@telora/*` value import in a query module pulled into a mocked
220
- * node:test fails to resolve under the module-mock loader. The canonical enum is
221
- * packages/daemon-core/src/disposition.ts and the DB CHECK on
222
- * agent_escalations.disposition is the real constraint; these strings must stay
223
- * in sync with it.
224
- */
225
- export declare const DIRECTED_HOLD_DISPOSITIONS: readonly string[];
226
- /**
227
- * Returns the OPEN (pending|in_review) DIRECTED-hold escalation anchored to the
228
- * given delivery, or null when none is open. Disposition-keyed sibling of
229
- * findOpenOperatorHoldForDelivery, keyed on DIRECTED_HOLD_DISPOSITIONS
230
- * (needs_intent / needs_clarification) instead of the operator-hold set.
231
- *
232
- * This is the vocabulary the completion-event no-progress guard previously
233
- * lacked: a team parked on its own unanswered directed question could not be
234
- * told apart from a team that has stalled, so the scope-coverage guard counted
235
- * the wait as no-progress, re-engaged the team (real model spend), and
236
- * eventually filed a team_failure ON TOP of the question.
237
- *
238
- * FAIL DIRECTION IS THE OPPOSITE of findOpenOperatorHoldForDelivery. The
239
- * operator-hold gate's CALLER fails CLOSED (a lookup error => held) because a
240
- * missed hold lets an operator-blocked delivery reach done. HERE the consuming
241
- * guard must fail OPEN: a lookup error must NOT suppress a genuine stall
242
- * escalation, so the caller treats an error as "not blocked". This function
243
- * still reports what it finds and THROWS on a hard API error; the fail-open
244
- * decision lives at the call site (completion/event-phases.computeCompletionFacts),
245
- * which catches and defaults to not-blocked.
246
- */
247
- export declare function findOpenDirectedHoldForDelivery(deliveryId: string, focusId?: string): Promise<OperatorHoldEscalation | null>;
150
+ import { OPERATOR_HOLD_DISPOSITIONS, SELF_REPORT_STALL_HOLD_KINDS, DIRECTED_HOLD_DISPOSITIONS, findOpenOperatorHoldForDelivery, hasOpenOperatorHoldForDelivery, findOpenDirectedHoldForDelivery, type OperatorHoldEscalation } from './holds.js';
151
+ export { OPERATOR_HOLD_DISPOSITIONS, SELF_REPORT_STALL_HOLD_KINDS, DIRECTED_HOLD_DISPOSITIONS, findOpenOperatorHoldForDelivery, hasOpenOperatorHoldForDelivery, findOpenDirectedHoldForDelivery, };
152
+ export type { OperatorHoldEscalation };
248
153
  /**
249
154
  * escalation_kind discriminators for the two focus-merge worktree-dirty
250
155
  * classes. Declared as daemon-local string constants (not imported from
@@ -382,5 +287,4 @@ export declare function markEscalationResolved(escalationId: string, resolutionN
382
287
  * Create an issue on a delivery (for create_issue trigger action).
383
288
  */
384
289
  export declare function createIssue(deliveryId: string, title: string, description: string | null, issueType: string, priority: string | null): Promise<string>;
385
- export {};
386
290
  //# sourceMappingURL=issues.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/queries/issues.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAIL,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBA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pB,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,MAAM,CAAC,CAejB"}
@@ -156,141 +156,10 @@ export async function hasOpenEscalationForDelivery(deliveryId, escalationKind) {
156
156
  return meta?.kind === escalationKind && meta?.deliveryId === deliveryId;
157
157
  });
158
158
  }
159
- /**
160
- * The escalation dispositions that mean "a human operator or an external party
161
- * must act before this delivery's declared work can be considered real":
162
- * needs_operator (operator/infra/security action) and external_wait (blocked on
163
- * a third party). Distinct from needs_intent / needs_clarification (a steering
164
- * question, not a blocked-on-reality signal) and agent_resolvable (no human at
165
- * all). Keyed on the DISPOSITION axis so ANY escalation kind carrying one of
166
- * these holds its delivery -- the gate must not enumerate kinds.
167
- *
168
- * Declared as daemon-local string literals (not imported from @telora/daemon-core's
169
- * ESCALATION_DISPOSITIONS) on purpose, mirroring MERGE_CONFLICT_ESCALATION_KIND
170
- * below: a bare `@telora/*` VALUE import in a query module pulled into a mocked
171
- * node:test fails to resolve under the module-mock loader (the daemon-local-copy
172
- * rule). The canonical enum lives in packages/daemon-core/src/disposition.ts and
173
- * the DB CHECK on agent_escalations.disposition is the real constraint; these
174
- * strings must stay in sync with it.
175
- */
176
- export const OPERATOR_HOLD_DISPOSITIONS = [
177
- 'needs_operator',
178
- 'external_wait',
179
- ];
180
- /**
181
- * Returns the OPEN (pending|in_review) operator-hold escalation anchored to the
182
- * given delivery, or null when none is open.
183
- *
184
- * DISPOSITION-keyed sibling of hasOpenEscalationForDelivery (which is KIND-keyed):
185
- * it matches ANY escalation_kind whose disposition is in OPERATOR_HOLD_DISPOSITIONS
186
- * (needs_operator / external_wait). This is the vocabulary the verify->done gate
187
- * previously lacked -- an operator blocked ON a delivery (e.g. "the host restore
188
- * was NOT executed") could not hold that delivery out of done, so a clean review
189
- * auto-approved it. Returning the matching row (id + kind + disposition), not a
190
- * bare boolean, lets the gate write the block into the delivery's gate_state.
191
- *
192
- * Matches on the typed delivery_id + disposition COLUMNS in preference to the
193
- * metadata bag, with a metadata fallback (metadata.deliveryId / metadata.disposition)
194
- * for rows already open at deploy time. The status is re-checked client-side as
195
- * defense-in-depth against a deploy-lagged edge fn returning resolved rows.
196
- *
197
- * escalation_list has NO server-side delivery_id filter, so the delivery match is
198
- * applied client-side over the org's open rows. Pass `focusId` to narrow the page
199
- * server-side (the same busy-org paging concern hasOpenWorktreeDirtyEscalation
200
- * addresses); omit it and the lookup reads the newest 500 open org rows.
201
- *
202
- * FAIL-CLOSED is the CALLER's responsibility. This function reports what it finds
203
- * and THROWS on a hard API error. The verify->done gate that consumes it exists
204
- * precisely to fail closed, so it must treat a lookup error as "held" -- the
205
- * opposite of the other escalation lookups (dedup/auto-close), which fail OPEN
206
- * because a spurious park is worse than a missed dedup. Here a missed hold lets an
207
- * operator-blocked delivery reach done, which is the failure this gate prevents.
208
- */
209
- export async function findOpenOperatorHoldForDelivery(deliveryId, focusId) {
210
- return findOpenHoldForDelivery(deliveryId, OPERATOR_HOLD_DISPOSITIONS, focusId);
211
- }
212
- /**
213
- * Boolean convenience over findOpenOperatorHoldForDelivery for call sites that
214
- * only need to know whether the hold exists (not which escalation it is).
215
- */
216
- export async function hasOpenOperatorHoldForDelivery(deliveryId, focusId) {
217
- return (await findOpenOperatorHoldForDelivery(deliveryId, focusId)) !== null;
218
- }
219
- /**
220
- * The escalation dispositions that mean "a human must STEER before this team's
221
- * work can proceed": needs_intent (scope/direction/priority) and
222
- * needs_clarification (ambiguity to resolve). These are exactly the two the
223
- * escalation tool documents as answerable via the `answer` field -- a DIRECTED
224
- * question the daemon reads back to the asking agent, distinct from the
225
- * operator-hold dispositions (needs_operator / external_wait, a blocked-on-reality
226
- * signal) and agent_resolvable (no human at all).
227
- *
228
- * Daemon-local literals for the same reason as OPERATOR_HOLD_DISPOSITIONS above:
229
- * a bare `@telora/*` value import in a query module pulled into a mocked
230
- * node:test fails to resolve under the module-mock loader. The canonical enum is
231
- * packages/daemon-core/src/disposition.ts and the DB CHECK on
232
- * agent_escalations.disposition is the real constraint; these strings must stay
233
- * in sync with it.
234
- */
235
- export const DIRECTED_HOLD_DISPOSITIONS = [
236
- 'needs_intent',
237
- 'needs_clarification',
238
- ];
239
- /**
240
- * Returns the OPEN (pending|in_review) DIRECTED-hold escalation anchored to the
241
- * given delivery, or null when none is open. Disposition-keyed sibling of
242
- * findOpenOperatorHoldForDelivery, keyed on DIRECTED_HOLD_DISPOSITIONS
243
- * (needs_intent / needs_clarification) instead of the operator-hold set.
244
- *
245
- * This is the vocabulary the completion-event no-progress guard previously
246
- * lacked: a team parked on its own unanswered directed question could not be
247
- * told apart from a team that has stalled, so the scope-coverage guard counted
248
- * the wait as no-progress, re-engaged the team (real model spend), and
249
- * eventually filed a team_failure ON TOP of the question.
250
- *
251
- * FAIL DIRECTION IS THE OPPOSITE of findOpenOperatorHoldForDelivery. The
252
- * operator-hold gate's CALLER fails CLOSED (a lookup error => held) because a
253
- * missed hold lets an operator-blocked delivery reach done. HERE the consuming
254
- * guard must fail OPEN: a lookup error must NOT suppress a genuine stall
255
- * escalation, so the caller treats an error as "not blocked". This function
256
- * still reports what it finds and THROWS on a hard API error; the fail-open
257
- * decision lives at the call site (completion/event-phases.computeCompletionFacts),
258
- * which catches and defaults to not-blocked.
259
- */
260
- export async function findOpenDirectedHoldForDelivery(deliveryId, focusId) {
261
- return findOpenHoldForDelivery(deliveryId, DIRECTED_HOLD_DISPOSITIONS, focusId);
262
- }
263
- /**
264
- * Shared body for the disposition-keyed open-hold lookups
265
- * (findOpenOperatorHoldForDelivery / findOpenDirectedHoldForDelivery). Reads the
266
- * newest 500 open (pending|in_review) escalations -- narrowed server-side by
267
- * focusId when supplied, the same busy-org paging concern the sibling lookups
268
- * address -- and returns the first whose delivery matches (typed delivery_id
269
- * COLUMN preferred, metadata.deliveryId fallback for rows open at deploy time)
270
- * AND whose disposition (typed column preferred, metadata fallback) is in the
271
- * given set. Status is re-checked client-side as defense-in-depth against a
272
- * deploy-lagged edge fn returning resolved rows. THROWS on a hard API error;
273
- * fail-open/closed is the CALLER's choice.
274
- */
275
- async function findOpenHoldForDelivery(deliveryId, dispositions, focusId) {
276
- const holdSet = new Set(dispositions);
277
- const fields = { statuses: ['pending', 'in_review'] };
278
- if (focusId)
279
- fields.focusId = focusId;
280
- const result = await callApi('escalation_list', { fields, limit: 500 });
281
- for (const e of result.escalations ?? []) {
282
- if (e.status && !OPEN_ESCALATION_STATUSES.has(e.status))
283
- continue;
284
- const meta = e.metadata ?? null;
285
- const disposition = (typeof e.disposition === 'string' ? e.disposition : null) ??
286
- (typeof meta?.disposition === 'string' ? meta.disposition : null);
287
- const matchedDelivery = e.deliveryId === deliveryId || meta?.deliveryId === deliveryId;
288
- if (matchedDelivery && disposition !== null && holdSet.has(disposition)) {
289
- return { id: e.id, escalationKind: e.escalationKind ?? null, disposition };
290
- }
291
- }
292
- return null;
293
- }
159
+ import { OPEN_ESCALATION_STATUSES, OPERATOR_HOLD_DISPOSITIONS, SELF_REPORT_STALL_HOLD_KINDS, DIRECTED_HOLD_DISPOSITIONS, findOpenOperatorHoldForDelivery, hasOpenOperatorHoldForDelivery, findOpenDirectedHoldForDelivery, } from './holds.js';
160
+ // The delivery hold-lookup family moved to queries/holds.ts (file-size limit).
161
+ // Re-exported here so every existing importer of queries/issues.js keeps working.
162
+ export { OPERATOR_HOLD_DISPOSITIONS, SELF_REPORT_STALL_HOLD_KINDS, DIRECTED_HOLD_DISPOSITIONS, findOpenOperatorHoldForDelivery, hasOpenOperatorHoldForDelivery, findOpenDirectedHoldForDelivery, };
294
163
  /**
295
164
  * escalation_kind discriminators for the two focus-merge worktree-dirty
296
165
  * classes. Declared as daemon-local string constants (not imported from
@@ -320,8 +189,6 @@ export const WORKTREE_DIRTY_ESCALATION_KINDS = [
320
189
  MERGE_CONFLICT_ESCALATION_KIND,
321
190
  MERGE_REFUSED_DIRTY_ESCALATION_KIND,
322
191
  ];
323
- /** Open escalation statuses (anything not yet resolved/dismissed). */
324
- const OPEN_ESCALATION_STATUSES = new Set(['pending', 'in_review']);
325
192
  /**
326
193
  * True when `e` is an OPEN worktree-dirty-class escalation for `focusId` whose
327
194
  * kind is in `kindSet`. Shared by hasOpenWorktreeDirtyEscalation (dedup) and
@@ -1 +1 @@
1
- {"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/queries/issues.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,yBAAyB,GAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAyB,MAAM,6BAA6B,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;AAKpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,UAAkB;IACxD,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,YAAY,EACZ,4BAA4B,EAC5B,EAAE,UAAU,EAAE,CACf,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,UAAkB;IAC9D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,mCAAmC,EACnC,kCAAkC,EAClC,EAAE,UAAU,EAAE,CACf,CAAC;IACF,OAA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,EAAE;YACN,KAAK;YACL,WAAW;YACX,SAAS;YACT,QAAQ,EAAE,QAAQ,IAAI,SAAS;SAChC;KACF,CACF,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACzB,CAAC"}
@@ -365,6 +365,7 @@ export declare const ActiveFocusSchema: z.ZodObject<{
365
365
  ratifiedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
366
366
  assignedAgentRoleId: z.ZodNullable<z.ZodString>;
367
367
  agentRoleName: z.ZodNullable<z.ZodString>;
368
+ operatorStoppedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
368
369
  currentWorkflowStageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
369
370
  reviewRequestedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
370
371
  reviewedThroughSha: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -408,6 +409,7 @@ export declare const ActiveFocusesResponseSchema: z.ZodObject<{
408
409
  ratifiedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
409
410
  assignedAgentRoleId: z.ZodNullable<z.ZodString>;
410
411
  agentRoleName: z.ZodNullable<z.ZodString>;
412
+ operatorStoppedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
411
413
  currentWorkflowStageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
414
  reviewRequestedAt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
413
415
  reviewedThroughSha: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/queries/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa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EjB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAExB,CAAC;AAEjB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAExB,CAAC;AAIjB,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAUf,CAAC;AAEjB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;iBAErB,CAAC;AAEjB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAEpB,CAAC;AAiBjB,eAAO,MAAM,sBAAsB;;;;;;;;;iBASnB,CAAC;AAEjB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;iBAUrB,CAAC;AAEjB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI3B,CAAC;AAEjB,eAAO,MAAM,kCAAkC;;iBAE/B,CAAC;AAEjB,eAAO,MAAM,6BAA6B;;iBAE1B,CAAC;AAEjB,eAAO,MAAM,2BAA2B;;;;;;;iBAOxB,CAAC;AAEjB,eAAO,MAAM,mCAAmC;;;;;;;;;iBAEhC,CAAC;AAEjB,eAAO,MAAM,6BAA6B;;;;iBAI1B,CAAC;AAEjB,eAAO,MAAM,qCAAqC;;;;;;;iBAGlC,CAAC"}
@@ -227,6 +227,11 @@ export const ActiveFocusSchema = z.object({
227
227
  ratifiedAt: nullableString.optional().default(null),
228
228
  assignedAgentRoleId: nullableString,
229
229
  agentRoleName: nullableString,
230
+ // Operator STOP marker (product_focuses.operator_stopped_at): non-null => an
231
+ // operator halted the focus (cleared the role via the update path), distinct
232
+ // from auto_terminate_focus_team()'s lifecycle clear. Absent on backends
233
+ // predating the column -> null. Read by decideNullRoleSpawn so the stop wins.
234
+ operatorStoppedAt: nullableString.optional().default(null),
230
235
  currentWorkflowStageId: nullableString.optional(),
231
236
  reviewRequestedAt: nullableString.optional().default(null),
232
237
  // Review coverage watermark (product_focuses.reviewed_through_sha): the