wicked-crew 0.7.13 → 0.7.15
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/dist/api/delivery-cache.d.ts +135 -0
- package/dist/api/delivery-cache.d.ts.map +1 -0
- package/dist/api/delivery-cache.js +245 -0
- package/dist/api/delivery-cache.js.map +1 -0
- package/dist/api/delivery-index.d.ts +45 -14
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +107 -55
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/endpoint-manifest-live.d.ts.map +1 -1
- package/dist/api/endpoint-manifest-live.js +0 -1
- package/dist/api/endpoint-manifest-live.js.map +1 -1
- package/dist/api/gate-cache.d.ts +24 -0
- package/dist/api/gate-cache.d.ts.map +1 -1
- package/dist/api/gate-cache.js +35 -0
- package/dist/api/gate-cache.js.map +1 -1
- package/dist/api/routes.d.ts +14 -7
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +64 -17
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-health.d.ts +0 -25
- package/dist/api/seat-health.d.ts.map +1 -1
- package/dist/api/seat-health.js +6 -81
- package/dist/api/seat-health.js.map +1 -1
- package/dist/api/server.d.ts +18 -15
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +87 -36
- package/dist/api/server.js.map +1 -1
- package/dist/api/stall-watchdog.d.ts +40 -3
- package/dist/api/stall-watchdog.d.ts.map +1 -1
- package/dist/api/stall-watchdog.js +94 -15
- package/dist/api/stall-watchdog.js.map +1 -1
- package/dist/campaigns/rollup.d.ts +3 -0
- package/dist/campaigns/rollup.d.ts.map +1 -1
- package/dist/campaigns/rollup.js +17 -2
- package/dist/campaigns/rollup.js.map +1 -1
- package/dist/campaigns/routes.d.ts +4 -4
- package/dist/core/deliver.d.ts +5 -5
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +59 -14
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/types.d.ts +20 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +20 -1
- package/dist/core/types.js.map +1 -1
- package/endpoint-manifest.json +3 -2
- package/package.json +2 -2
|
@@ -7,8 +7,12 @@ export interface ExecutingRun {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** The run's CURSOR unit ord when the caller knows it — what `reassignUnit` must name. */
|
|
9
9
|
ord?: number;
|
|
10
|
-
/** The cursor unit's assigned seat
|
|
10
|
+
/** The cursor unit's assigned seat — the seat a reassign moves AWAY from. Absent = unknown
|
|
11
|
+
* (a reassign then lets the engine's council pick). */
|
|
11
12
|
cli?: string;
|
|
13
|
+
/** The run's own seat pool (`session.clis`), in roster order — the failover candidates a
|
|
14
|
+
* reassign may route to (perf#4). Absent/empty = no pool known: reassign in place. */
|
|
15
|
+
seats?: string[];
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* The escalation stage's per-sweep configuration (crew#341), resolved live so a PUT /settings
|
|
@@ -37,13 +41,29 @@ export interface StallWatchdogDeps {
|
|
|
37
41
|
/** Resolved per sweep; `minutes` absent/0/invalid keeps escalation OFF. */
|
|
38
42
|
config: () => StallEscalationConfig | undefined | Promise<StallEscalationConfig | undefined>;
|
|
39
43
|
/**
|
|
40
|
-
* Recycle the wedged cursor unit
|
|
41
|
-
*
|
|
44
|
+
* Recycle the wedged cursor unit (the daemon wires `adapter.reassignUnit`). `cli` names
|
|
45
|
+
* the seat to re-dispatch to — the watchdog passes its failover TARGET (a different seat
|
|
46
|
+
* from the run's pool when one exists, else the current seat recycled in place); absent =
|
|
47
|
+
* the engine re-runs the council.
|
|
42
48
|
*/
|
|
43
49
|
reassign: (runId: string, ord: number, cli?: string) => Promise<void>;
|
|
44
50
|
/** Audit sink — the server appends `run.stall.escalated` to the crew audit trail. */
|
|
45
51
|
audit?: (frame: WorkerStallEscalatedFrame) => void;
|
|
46
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Called when a relayed `unitOutputCaptured` carries `stepStatus: "timed_out"` — the ENGINE's
|
|
55
|
+
* own turn ceiling fired (the run is terminating; the last-resort backstop the silence ladder
|
|
56
|
+
* exists to preempt). The server wires an audit entry + warn log so the timeout is
|
|
57
|
+
* operator-visible as WHAT IT IS rather than as an anonymous cancel. Versioned safely: an
|
|
58
|
+
* older engine never sends the value, so this never fires — and `"cancelled"` (ambiguous on
|
|
59
|
+
* old engines: operator OR timeout) deliberately triggers NOTHING, because acting on an
|
|
60
|
+
* operator's cancel is the failure mode this whole seam exists to prevent.
|
|
61
|
+
*/
|
|
62
|
+
onTurnTimeout?: (info: {
|
|
63
|
+
session: string;
|
|
64
|
+
ord?: number;
|
|
65
|
+
attempt?: number;
|
|
66
|
+
}) => void;
|
|
47
67
|
/** Clock (tests stub it). */
|
|
48
68
|
now?: () => number;
|
|
49
69
|
/** Wired to the daemon's warn logger — a stall is an operator-attention signal. */
|
|
@@ -61,6 +81,14 @@ export declare class WorkerStallWatchdog {
|
|
|
61
81
|
private readonly escalated;
|
|
62
82
|
/** run id → automatic reassigns consumed (the crew#341 budget). Pruned with the run. */
|
|
63
83
|
private readonly escalationCount;
|
|
84
|
+
/**
|
|
85
|
+
* run id → seats already stall-reassigned AWAY from on this run, so consecutive escalations
|
|
86
|
+
* rotate through the pool instead of bouncing back to a seat that already wedged (perf#4).
|
|
87
|
+
* WATCHDOG-LOCAL BY DESIGN: a stalled seat is not an errored seat — this memory must never
|
|
88
|
+
* reach the engine's `worker_failed_clis` (resume-path exclusion) or the SeatHealthTracker.
|
|
89
|
+
* Pruned with the run, like the budget.
|
|
90
|
+
*/
|
|
91
|
+
private readonly stalledSeats;
|
|
64
92
|
private readonly now;
|
|
65
93
|
private readonly log;
|
|
66
94
|
private handle;
|
|
@@ -83,5 +111,14 @@ export declare class WorkerStallWatchdog {
|
|
|
83
111
|
private escalationArmed;
|
|
84
112
|
/** Perform one escalation for `run`, emit its `workerStallEscalated` frame, audit, log. */
|
|
85
113
|
private escalate;
|
|
114
|
+
/**
|
|
115
|
+
* The failover TARGET for a stall reassign (perf#4): the first seat of the run's own pool
|
|
116
|
+
* that is neither the currently-stalled seat nor one this run already stall-reassigned away
|
|
117
|
+
* from. `undefined` = no distinct candidate (no pool known, a single-seat pool, or every
|
|
118
|
+
* other seat already stalled here) — the caller then recycles in place, which is today's
|
|
119
|
+
* (still safe) behaviour. Pool order is `session.clis` order: deterministic, no health
|
|
120
|
+
* heuristics — the per-run budget bounds how far the rotation can walk.
|
|
121
|
+
*/
|
|
122
|
+
private pickFailoverSeat;
|
|
86
123
|
}
|
|
87
124
|
//# sourceMappingURL=stall-watchdog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stall-watchdog.d.ts","sourceRoot":"","sources":["../../src/api/stall-watchdog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stall-watchdog.d.ts","sourceRoot":"","sources":["../../src/api/stall-watchdog.ts"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AASjG,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,CAAC;AAE9D,uFAAuF;AACvF,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAKhD,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,0FAA0F;IAC1F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;4DACwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2FACuF;IACvF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,gFAAgF;IAChF,SAAS,CA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,CAAC,OAAO,CAA6B;IACrD,oFAAoF;IACpF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,sFAAsF;IACtF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,wFAAwF;IACxF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAC7D;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkC;IAC/D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAC1C,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,QAAQ,CAAS;gBAEI,IAAI,EAAE,iBAAiB;IAKpD,+FAA+F;IAC/F,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAmC9B,8FAA8F;IACxF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwE5B,qFAAqF;IACrF,KAAK,CAAC,UAAU,SAA4B,GAAG,IAAI;IAUnD,IAAI,IAAI,IAAI;IAKZ,sFAAsF;YACxE,WAAW;IAezB;;;;OAIG;YACW,eAAe;IAmC7B,2FAA2F;YAC7E,QAAQ;IA6HtB;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;CAKzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Worker stall watchdog (crew#287 detection + crew#341 escalation): platform-native liveness
|
|
2
|
-
// for executing runs, and —
|
|
2
|
+
// for executing runs, and — armed by default since perf#4 — recovery when liveness is gone.
|
|
3
3
|
//
|
|
4
4
|
// A wedged worker emits nothing — no unitOutputDelta, no gate frames — and its run sits in
|
|
5
5
|
// `executing` until an operator notices by absence (run 8aa1cd42: a design unit burned 3+ hours
|
|
@@ -15,20 +15,31 @@
|
|
|
15
15
|
// - once per quiet period: after the frame fires, the run stays alerted until a NEW event for
|
|
16
16
|
// it arrives; a second quiet period then emits a second frame.
|
|
17
17
|
//
|
|
18
|
-
// THE ESCALATION LADDER (crew#341) — detection
|
|
18
|
+
// THE ESCALATION LADDER (crew#341, armed by default since perf#4) — detection drives action:
|
|
19
19
|
//
|
|
20
|
-
// notify (always) → act (
|
|
20
|
+
// notify (always) → act (default-ON, `workerStallEscalateMinutes`, 0 disarms) → fail loud
|
|
21
21
|
//
|
|
22
|
-
// -
|
|
23
|
-
//
|
|
24
|
-
//
|
|
22
|
+
// - ON BY DEFAULT (perf#4). crew#341 shipped the ladder OFF, and run 616c8661 then burned the
|
|
23
|
+
// full 2h turn ceiling (106 min of output silence) while the watchdog fired once and watched.
|
|
24
|
+
// `reassignUnit` is safe on a merely-slow run — the superseded turn is not folded as a
|
|
25
|
+
// failure, its late output drops on the attempt guard, queued injects survive — so acting at
|
|
26
|
+
// `DEFAULT_WORKER_STALL_ESCALATE_MINUTES` (30 — ~55% headroom over the recon's slowest
|
|
27
|
+
// legitimate first output of ~19.4 min, still ~4x faster than the 2h ceiling) of TOTAL
|
|
28
|
+
// silence is strictly better than watching. An explicit `workerStallEscalateMinutes: 0`
|
|
29
|
+
// restores detection-only.
|
|
25
30
|
// - When armed, a run still silent past the escalation threshold (never before the detection
|
|
26
31
|
// threshold — the ladder notifies before it acts) gets ONE escalation per quiet period:
|
|
27
|
-
// - action `reassign` (default): recycle the wedged cursor unit
|
|
32
|
+
// - action `reassign` (default): recycle the wedged cursor unit via the engine's
|
|
28
33
|
// `reassignUnit` — the stale turn is superseded (not folded as a failure), the worker
|
|
29
|
-
// session closed, the attempt bumped, the unit re-dispatched
|
|
30
|
-
//
|
|
31
|
-
//
|
|
34
|
+
// session closed, the attempt bumped, the unit re-dispatched; queued operator injects
|
|
35
|
+
// survive into the fresh turn. The re-dispatch is routed to a DIFFERENT seat from the
|
|
36
|
+
// run's own pool when one is available (perf#4): a seat that just sat silent past the
|
|
37
|
+
// escalation threshold is the last seat to hand the retry to. Seats already stall-reassigned away from
|
|
38
|
+
// on this run are skipped too; a single-seat pool falls back to the in-place recycle.
|
|
39
|
+
// NOTE the seat memory is WATCHDOG-LOCAL and per-run: a stalled seat is NOT an errored
|
|
40
|
+
// seat. It is never written to the engine's `worker_failed_clis` (which the resume path
|
|
41
|
+
// reads to permanently exclude seats) and never folded into the SeatHealthTracker — a
|
|
42
|
+
// seat that stalled once under load stays fully eligible for other runs and for resume.
|
|
32
43
|
// - action `notify`: the fail-loud rung — surface a `needsYou` frame + an audit entry and
|
|
33
44
|
// leave the run alone.
|
|
34
45
|
// - A per-run budget (`workerStallMaxEscalations`, default 2) caps AUTOMATIC reassigns: a
|
|
@@ -62,6 +73,14 @@ export class WorkerStallWatchdog {
|
|
|
62
73
|
escalated = new Set();
|
|
63
74
|
/** run id → automatic reassigns consumed (the crew#341 budget). Pruned with the run. */
|
|
64
75
|
escalationCount = new Map();
|
|
76
|
+
/**
|
|
77
|
+
* run id → seats already stall-reassigned AWAY from on this run, so consecutive escalations
|
|
78
|
+
* rotate through the pool instead of bouncing back to a seat that already wedged (perf#4).
|
|
79
|
+
* WATCHDOG-LOCAL BY DESIGN: a stalled seat is not an errored seat — this memory must never
|
|
80
|
+
* reach the engine's `worker_failed_clis` (resume-path exclusion) or the SeatHealthTracker.
|
|
81
|
+
* Pruned with the run, like the budget.
|
|
82
|
+
*/
|
|
83
|
+
stalledSeats = new Map();
|
|
65
84
|
now;
|
|
66
85
|
log;
|
|
67
86
|
handle = null;
|
|
@@ -81,6 +100,28 @@ export class WorkerStallWatchdog {
|
|
|
81
100
|
this.lastOrd.set(session, event.ord);
|
|
82
101
|
this.alerted.delete(session);
|
|
83
102
|
this.escalated.delete(session);
|
|
103
|
+
// The engine's own turn ceiling fired (perf#4: `stepStatus: "timed_out"` — a NEW value; the
|
|
104
|
+
// old shared "cancelled" spelling deliberately triggers nothing, because on an old engine it
|
|
105
|
+
// is indistinguishable from an operator's Ctrl-C). Surface it as what it is: the last-resort
|
|
106
|
+
// backstop this ladder exists to preempt.
|
|
107
|
+
if (event.type === 'unitOutputCaptured' &&
|
|
108
|
+
event.stepStatus === 'timed_out') {
|
|
109
|
+
const ord = typeof event.ord === 'number' ? event.ord : undefined;
|
|
110
|
+
const attempt = typeof event.attempt === 'number' ? event.attempt : undefined;
|
|
111
|
+
this.log(`[stall-watchdog] run ${session}${ord !== undefined ? ` (unit ${ord})` : ''} hit the ` +
|
|
112
|
+
`engine's turn ceiling (stepStatus timed_out) — this was the platform's own timeout, ` +
|
|
113
|
+
`NOT an operator cancel; the run is terminating`);
|
|
114
|
+
try {
|
|
115
|
+
this.deps.onTurnTimeout?.({
|
|
116
|
+
session,
|
|
117
|
+
...(ord !== undefined ? { ord } : {}),
|
|
118
|
+
...(attempt !== undefined ? { attempt } : {}),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
this.log(`[stall-watchdog] turn-timeout sink failed: ${String(err)}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
84
125
|
}
|
|
85
126
|
/** One detection pass. Public so tests drive it directly; the armed interval calls it too. */
|
|
86
127
|
async sweep() {
|
|
@@ -107,6 +148,7 @@ export class WorkerStallWatchdog {
|
|
|
107
148
|
this.alerted.delete(key);
|
|
108
149
|
this.escalated.delete(key);
|
|
109
150
|
this.escalationCount.delete(key);
|
|
151
|
+
this.stalledSeats.delete(key);
|
|
110
152
|
}
|
|
111
153
|
}
|
|
112
154
|
const thresholdMs = await this.thresholdMs();
|
|
@@ -139,7 +181,7 @@ export class WorkerStallWatchdog {
|
|
|
139
181
|
? ` (detection only: the run was NOT touched; the operator decides)`
|
|
140
182
|
: ` (escalation armed at ${(escalation.thresholdMs / 60_000).toFixed(1)} min)`));
|
|
141
183
|
}
|
|
142
|
-
// ── stage 2: act (crew#341,
|
|
184
|
+
// ── stage 2: act (crew#341, default-ON since perf#4) — never before stage 1 ─────
|
|
143
185
|
if (escalation !== undefined &&
|
|
144
186
|
quietForMs >= escalation.thresholdMs &&
|
|
145
187
|
!this.escalated.has(run.id)) {
|
|
@@ -257,15 +299,34 @@ export class WorkerStallWatchdog {
|
|
|
257
299
|
// Budget is consumed by the ATTEMPT, success or not — a rejecting engine call must not
|
|
258
300
|
// be retried indefinitely on the platform's own initiative.
|
|
259
301
|
this.escalationCount.set(run.id, used + 1);
|
|
302
|
+
// Route the re-dispatch to a DIFFERENT seat when the run's pool offers one (perf#4):
|
|
303
|
+
// the current seat just sat silent past the escalation threshold, and seats this run
|
|
304
|
+
// already stall-reassigned away from are skipped too. No distinct candidate (single-seat
|
|
305
|
+
// pool, or the pool is exhausted) falls back to the in-place recycle — still safe, the
|
|
306
|
+
// engine supersedes the stale turn either way. `run.cli` unknown keeps today's shape:
|
|
307
|
+
// pass nothing and let the engine's council pick.
|
|
308
|
+
const target = this.pickFailoverSeat(run);
|
|
309
|
+
if (run.cli !== undefined) {
|
|
310
|
+
// Remember the stalled seat — watchdog-local, per-run; NEVER an error record (a
|
|
311
|
+
// stalled seat must not be conflated with an errored one for resume exclusion).
|
|
312
|
+
let stalled = this.stalledSeats.get(run.id);
|
|
313
|
+
if (stalled === undefined) {
|
|
314
|
+
stalled = new Set();
|
|
315
|
+
this.stalledSeats.set(run.id, stalled);
|
|
316
|
+
}
|
|
317
|
+
stalled.add(run.cli);
|
|
318
|
+
}
|
|
319
|
+
const seat = target ?? run.cli;
|
|
260
320
|
try {
|
|
261
|
-
await this.deps.escalation?.reassign(run.id, ord,
|
|
321
|
+
await this.deps.escalation?.reassign(run.id, ord, seat);
|
|
262
322
|
frame = {
|
|
263
323
|
...base,
|
|
264
324
|
action: 'reassign',
|
|
265
325
|
outcome: 'ok',
|
|
266
326
|
needsYou: false,
|
|
267
327
|
escalations: used + 1,
|
|
268
|
-
...(
|
|
328
|
+
...(seat !== undefined ? { cli: seat } : {}),
|
|
329
|
+
...(run.cli !== undefined ? { previousCli: run.cli } : {}),
|
|
269
330
|
};
|
|
270
331
|
}
|
|
271
332
|
catch (err) {
|
|
@@ -294,8 +355,12 @@ export class WorkerStallWatchdog {
|
|
|
294
355
|
`needs-you frame broadcast, the run was NOT touched`);
|
|
295
356
|
}
|
|
296
357
|
else if (frame.outcome === 'ok') {
|
|
297
|
-
|
|
298
|
-
|
|
358
|
+
const routing = frame.cli !== undefined && frame.previousCli !== undefined && frame.cli !== frame.previousCli
|
|
359
|
+
? `failed over ${frame.previousCli} → ${frame.cli}`
|
|
360
|
+
: frame.cli !== undefined
|
|
361
|
+
? `reassigned in place (seat ${frame.cli})`
|
|
362
|
+
: `reassigned (council re-picks the seat)`;
|
|
363
|
+
this.log(`[stall-watchdog] ESCALATED ${where}: ${quiet} — ${routing} ` +
|
|
299
364
|
`(automatic recovery ${frame.escalations}/${escalation.maxPerRun}; the stale turn is ` +
|
|
300
365
|
`superseded and the unit re-dispatched)`);
|
|
301
366
|
}
|
|
@@ -308,5 +373,19 @@ export class WorkerStallWatchdog {
|
|
|
308
373
|
`happen (${frame.error ?? 'unknown error'}); needs-you frame broadcast`);
|
|
309
374
|
}
|
|
310
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* The failover TARGET for a stall reassign (perf#4): the first seat of the run's own pool
|
|
378
|
+
* that is neither the currently-stalled seat nor one this run already stall-reassigned away
|
|
379
|
+
* from. `undefined` = no distinct candidate (no pool known, a single-seat pool, or every
|
|
380
|
+
* other seat already stalled here) — the caller then recycles in place, which is today's
|
|
381
|
+
* (still safe) behaviour. Pool order is `session.clis` order: deterministic, no health
|
|
382
|
+
* heuristics — the per-run budget bounds how far the rotation can walk.
|
|
383
|
+
*/
|
|
384
|
+
pickFailoverSeat(run) {
|
|
385
|
+
if (run.cli === undefined)
|
|
386
|
+
return undefined; // unknown current seat → council re-pick
|
|
387
|
+
const stalled = this.stalledSeats.get(run.id);
|
|
388
|
+
return (run.seats ?? []).find((s) => s !== run.cli && !(stalled?.has(s) ?? false));
|
|
389
|
+
}
|
|
311
390
|
}
|
|
312
391
|
//# sourceMappingURL=stall-watchdog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stall-watchdog.js","sourceRoot":"","sources":["../../src/api/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AM,OAAO,GAAG;gBAC3D,uBAAuB,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,SAAS,sBAAsB;gBACtF,wCAAwC,CAC3C,CAAC;QACJ,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YACzC,IAAI,CAAC,GAAG,CACN,6CAA6C,KAAK,KAAK,KAAK,0BAA0B;gBACpF,IAAI,UAAU,CAAC,SAAS,gEAAgE,CAC3F,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CACN,0CAA0C,KAAK,KAAK,KAAK,0BAA0B;gBACjF,WAAW,KAAK,CAAC,KAAK,IAAI,eAAe,8BAA8B,CAC1E,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACK,gBAAgB,CAAC,GAAiB;QACxC,IAAI,GAAG,CAAC,GAAG,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC,CAAC,yCAAyC;QACtF,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -24,6 +24,9 @@ export interface RollupDeps {
|
|
|
24
24
|
deliveryUrlFor: (runId: string) => string | undefined;
|
|
25
25
|
/** The shared TTL-memoized probes behind `'stranded'`/`'vacuous'`. */
|
|
26
26
|
vacuity: VacuityProbes;
|
|
27
|
+
/** ERROR-level channel — only a NON-probe derivation throw (a defect) is reported here; the
|
|
28
|
+
* expected probe-unavailable degrade stays quiet (the probe layer already said it). */
|
|
29
|
+
logDefect?: (msg: string) => void;
|
|
27
30
|
}
|
|
28
31
|
/** Index a session list by run id — built once per request from ONE `sessionsDetail()` read. */
|
|
29
32
|
export declare function sessionsById(views: SessionView[]): Map<string, SessionView>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/campaigns/rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,QAAQ,EAER,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/campaigns/rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,QAAQ,EAER,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,sFAAsF;AACtF,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,qEAAqE;IACrE,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACtD,sEAAsE;IACtE,OAAO,EAAE,aAAa,CAAC;IACvB;4FACwF;IACxF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAE3E;AA+CD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAC9B,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,QAAQ,CAAC,CAwBnB;AAED,6FAA6F;AAC7F,wBAAsB,WAAW,CAC/B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAC9B,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,QAAQ,EAAE,CAAC,CAarB"}
|
package/dist/campaigns/rollup.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* list would silently lose archived siblings. This join reads the full session set, so an
|
|
15
15
|
* archived node still reports its delivery honestly.
|
|
16
16
|
*/
|
|
17
|
-
import { deliveryStateWithVacuity, isDeliverConflictStranded, } from '../api/delivery-index.js';
|
|
17
|
+
import { VacuityProbeUnavailable, deliveryStateOf, deliveryStateWithVacuity, isDeliverConflictStranded, } from '../api/delivery-index.js';
|
|
18
18
|
/** Index a session list by run id — built once per request from ONE `sessionsDetail()` read. */
|
|
19
19
|
export function sessionsById(views) {
|
|
20
20
|
return new Map(views.map((v) => [v.session.id, v]));
|
|
@@ -31,7 +31,22 @@ async function deliveryOf(view, deps) {
|
|
|
31
31
|
return { delivery: 'delivered', deliverUrl: url };
|
|
32
32
|
if (isDeliverConflictStranded(view))
|
|
33
33
|
return { delivery: 'stranded' };
|
|
34
|
-
|
|
34
|
+
let state;
|
|
35
|
+
try {
|
|
36
|
+
state = await deliveryStateWithVacuity(view.session, undefined, deps.vacuity);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
// The production probes throw `VacuityProbeUnavailable` when git could not answer — the
|
|
40
|
+
// absence of an answer, not a verdict (PR #435 review). Serve THIS request the stat-only
|
|
41
|
+
// tri-state — the same degrade the run DTOs' cache miss answers — rather than 500 a whole
|
|
42
|
+
// campaign scoreboard over one raced worktree; the next request re-probes past the short
|
|
43
|
+
// failure memo. Any OTHER throw is a DEFECT (a bug, not weather): still degrade — a read
|
|
44
|
+
// endpoint should answer — but say so loudly and distinguishably, never swallow it.
|
|
45
|
+
if (!(err instanceof VacuityProbeUnavailable)) {
|
|
46
|
+
deps.logDefect?.(`[campaigns] DEFECT: delivery derivation for ${view.session.id} threw a non-probe error (served the stat-only label): ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`);
|
|
47
|
+
}
|
|
48
|
+
state = deliveryStateOf(view.session, undefined, deps.vacuity.worktreeExists);
|
|
49
|
+
}
|
|
35
50
|
return {
|
|
36
51
|
delivery: state.delivery,
|
|
37
52
|
...(state.deliverUrl !== undefined ? { deliverUrl: state.deliverUrl } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/campaigns/rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EACL,wBAAwB,EACxB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/campaigns/rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,GAG1B,MAAM,0BAA0B,CAAC;AAelC,gGAAgG;AAChG,MAAM,UAAU,YAAY,CAAC,KAAoB;IAC/C,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAiB,EAAE,IAAgB;IAC3D,8FAA8F;IAC9F,gGAAgG;IAChG,6FAA6F;IAC7F,+FAA+F;IAC/F,8FAA8F;IAC9F,oFAAoF;IACpF,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IACzE,IAAI,yBAAyB,CAAC,IAAI,CAAC;QAAE,OAAO,EA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C,CAAC,CACJ,CAAC;IACF,OAAO,EAAE,GAAG,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AACvD,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA8B,EAC9B,IAAgB;IAEhB,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;QAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAsB,MAAM,OAAO,CAAC,GAAG,CAC/C,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK;YACL,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAgB,EAAE,IAAI,CAAC,CAAC;SAC1D,CAAC,CAAC,CACJ,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -59,10 +59,10 @@ export declare const LaunchCampaignSchema: z.ZodObject<{
|
|
|
59
59
|
tool?: {
|
|
60
60
|
cmd: string[];
|
|
61
61
|
} | undefined;
|
|
62
|
+
repoRef?: string | undefined;
|
|
62
63
|
deps?: string[] | undefined;
|
|
63
64
|
title?: string | undefined;
|
|
64
65
|
depsCondition?: "on_success" | "on_terminal" | undefined;
|
|
65
|
-
repoRef?: string | undefined;
|
|
66
66
|
}, {
|
|
67
67
|
id: string;
|
|
68
68
|
agent?: {
|
|
@@ -72,10 +72,10 @@ export declare const LaunchCampaignSchema: z.ZodObject<{
|
|
|
72
72
|
tool?: {
|
|
73
73
|
cmd: string[];
|
|
74
74
|
} | undefined;
|
|
75
|
+
repoRef?: string | undefined;
|
|
75
76
|
deps?: string[] | undefined;
|
|
76
77
|
title?: string | undefined;
|
|
77
78
|
depsCondition?: "on_success" | "on_terminal" | undefined;
|
|
78
|
-
repoRef?: string | undefined;
|
|
79
79
|
}>, "many">;
|
|
80
80
|
policy: z.ZodOptional<z.ZodEnum<["fail_fast", "continue_independent", "human_gate_on_failure"]>>;
|
|
81
81
|
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
@@ -92,10 +92,10 @@ export declare const LaunchCampaignSchema: z.ZodObject<{
|
|
|
92
92
|
tool?: {
|
|
93
93
|
cmd: string[];
|
|
94
94
|
} | undefined;
|
|
95
|
+
repoRef?: string | undefined;
|
|
95
96
|
deps?: string[] | undefined;
|
|
96
97
|
title?: string | undefined;
|
|
97
98
|
depsCondition?: "on_success" | "on_terminal" | undefined;
|
|
98
|
-
repoRef?: string | undefined;
|
|
99
99
|
}[];
|
|
100
100
|
id?: string | undefined;
|
|
101
101
|
name?: string | undefined;
|
|
@@ -114,10 +114,10 @@ export declare const LaunchCampaignSchema: z.ZodObject<{
|
|
|
114
114
|
tool?: {
|
|
115
115
|
cmd: string[];
|
|
116
116
|
} | undefined;
|
|
117
|
+
repoRef?: string | undefined;
|
|
117
118
|
deps?: string[] | undefined;
|
|
118
119
|
title?: string | undefined;
|
|
119
120
|
depsCondition?: "on_success" | "on_terminal" | undefined;
|
|
120
|
-
repoRef?: string | undefined;
|
|
121
121
|
}[];
|
|
122
122
|
id?: string | undefined;
|
|
123
123
|
name?: string | undefined;
|
package/dist/core/deliver.d.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* to just deliver; ANY other conflict aborts the rebase (pushing nothing) and exits carrying
|
|
18
18
|
* {@link DELIVER_LIFT_CONFLICT_MARKER}, which crew reads as a recoverable STRAND, never a
|
|
19
19
|
* pushed conflicted tree;
|
|
20
|
-
* (d) `git push -u origin <branch>` —
|
|
21
|
-
*
|
|
20
|
+
* (d) `git push -u origin <branch>` — every rejected push carries the recovery marker. The run
|
|
21
|
+
* work is already committed locally, so an operator can repair auth/transport and retry;
|
|
22
22
|
* (e) `gh pr create --head <branch> --fill`, with gh's output and exit status captured
|
|
23
23
|
* SEPARATELY so a gh failure fails the phase carrying gh's own message;
|
|
24
24
|
* (f) the PR URL is the last line of the phase output.
|
|
@@ -62,9 +62,9 @@ import type { PhaseDef, WorkflowDef } from './types.js';
|
|
|
62
62
|
/** The id of the appended phase — also the collision probe when a def already delivers. */
|
|
63
63
|
export declare const DELIVER_PHASE_ID = "deliver";
|
|
64
64
|
/**
|
|
65
|
-
* The sentinel the deliver script prints when
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* The sentinel the deliver script prints when the RUN'S WORK has been committed but its LIFT did
|
|
66
|
+
* not complete (crew#418/#432): a rebase conflict or any failed push. The work is safe on its
|
|
67
|
+
* `wicked/<id>` branch; an operator can fix the remote condition and retry delivery.
|
|
68
68
|
*
|
|
69
69
|
* crew keys the "stranded, recoverable" reinterpretation on this EXACT substring appearing in
|
|
70
70
|
* the deliver unit's `denial_reason` (which carries the head+TAIL excerpt of the script's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver.d.ts","sourceRoot":"","sources":["../../src/core/deliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AA0BrE;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"deliver.d.ts","sourceRoot":"","sources":["../../src/core/deliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AA0BrE;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAyMvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,SAAS,GAAE,MAAM,EAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAgBlF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,GACd,WAAW,CAmBb"}
|
package/dist/core/deliver.js
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* to just deliver; ANY other conflict aborts the rebase (pushing nothing) and exits carrying
|
|
18
18
|
* {@link DELIVER_LIFT_CONFLICT_MARKER}, which crew reads as a recoverable STRAND, never a
|
|
19
19
|
* pushed conflicted tree;
|
|
20
|
-
* (d) `git push -u origin <branch>` —
|
|
21
|
-
*
|
|
20
|
+
* (d) `git push -u origin <branch>` — every rejected push carries the recovery marker. The run
|
|
21
|
+
* work is already committed locally, so an operator can repair auth/transport and retry;
|
|
22
22
|
* (e) `gh pr create --head <branch> --fill`, with gh's output and exit status captured
|
|
23
23
|
* SEPARATELY so a gh failure fails the phase carrying gh's own message;
|
|
24
24
|
* (f) the PR URL is the last line of the phase output.
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
/** The id of the appended phase — also the collision probe when a def already delivers. */
|
|
62
62
|
export const DELIVER_PHASE_ID = 'deliver';
|
|
63
63
|
/**
|
|
64
|
-
* The sentinel the deliver script prints when
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* The sentinel the deliver script prints when the RUN'S WORK has been committed but its LIFT did
|
|
65
|
+
* not complete (crew#418/#432): a rebase conflict or any failed push. The work is safe on its
|
|
66
|
+
* `wicked/<id>` branch; an operator can fix the remote condition and retry delivery.
|
|
67
67
|
*
|
|
68
68
|
* crew keys the "stranded, recoverable" reinterpretation on this EXACT substring appearing in
|
|
69
69
|
* the deliver unit's `denial_reason` (which carries the head+TAIL excerpt of the script's
|
|
@@ -136,11 +136,18 @@ export function deliverPrScript(intent) {
|
|
|
136
136
|
// would put one branch's work on another and push a branch that never saw it. Refuse instead.
|
|
137
137
|
'C=$(git branch --show-current)',
|
|
138
138
|
'[ "$C" = "$B" ] || { echo "deliver: the worktree is on \'$C\' but the run branch is \'$B\' — refusing to commit one branch\'s work onto another; nothing was pushed"; exit 1; }',
|
|
139
|
+
// A failed PUSH happens after the product was committed. Keep its worktree from being reaped
|
|
140
|
+
// by leaving this reserved, untracked recovery sentinel; it is removed HERE (before staging)
|
|
141
|
+
// so a normal delivery never sees it, and a retry removes it before another attempt (crew#432).
|
|
142
|
+
'S=.wicked-crew-delivery-stranded',
|
|
143
|
+
'rm -f -- "$S"',
|
|
139
144
|
// (c1) COMMIT THE RUN'S WORK (crew#317). Agents write files; they do not commit — which is
|
|
140
145
|
// the premise of core#291 and the reason `d1bc72c2` pushed a branch identical to origin/main.
|
|
141
146
|
// Author identity is deliberately NOT set here: the run worktree belongs to the operator's
|
|
142
147
|
// own clone, so `git commit` uses the repo/user config that already exists (and fails loudly,
|
|
143
|
-
// pushing nothing, if that config is missing).
|
|
148
|
+
// pushing nothing, if that config is missing). Staging is two passes (see below): tracked
|
|
149
|
+
// changes always ride; untracked paths ride UNLESS a scratch/key-material classifier excludes
|
|
150
|
+
// them — and every exclusion is reported loudly (crew#434).
|
|
144
151
|
`I='${commitSubjectIntent(intent)}'`,
|
|
145
152
|
'if [ -n "$I" ]; then M="wicked-crew run $R: $I"; else M="wicked-crew run $R"; fi',
|
|
146
153
|
// (c0) DELIVER PREFLIGHT (crew#426) — a governed run that bumps an internal WORKSPACE package's
|
|
@@ -152,7 +159,7 @@ export function deliverPrScript(intent) {
|
|
|
152
159
|
// api-types to the worktree's bumped version and the committed manifest disagrees, and the
|
|
153
160
|
// lockfile↔package.json drift is a latent install hazard (a repo that pins the dep instead of `*`
|
|
154
161
|
// would fail `npm ci` outright). This blocks EVERY governed run that changes an API field. Re-sync
|
|
155
|
-
// BOTH here, BEFORE the commit, so the
|
|
162
|
+
// BOTH here, BEFORE the commit, so the tracked-only staging below stages the regenerated
|
|
156
163
|
// endpoint-manifest.json, the generated api-sample test, and the re-synced package-lock.json.
|
|
157
164
|
//
|
|
158
165
|
// Scoped to the CREW WORKSPACE — the whole preflight (lockfile re-sync AND codegen) runs only
|
|
@@ -174,7 +181,45 @@ export function deliverPrScript(intent) {
|
|
|
174
181
|
' npm run manifest:endpoints -w packages/crew',
|
|
175
182
|
' npm run generate:api-tests -w packages/crew',
|
|
176
183
|
'fi',
|
|
177
|
-
|
|
184
|
+
// (c1a) TRACKED CHANGES ALWAYS RIDE. `git add -u` stages every modification/deletion to an
|
|
185
|
+
// already-tracked path (the run's product for that class), including the crew#426 preflight's
|
|
186
|
+
// regenerated, already-tracked lockfile/manifest/codegen above.
|
|
187
|
+
'git add -u',
|
|
188
|
+
// (c1b) UNTRACKED PATHS — the crew#434 classifier. `git add -A` swept EVERY non-ignored
|
|
189
|
+
// untracked path into the governed PR, so a repo whose `.gitignore` missed its own test
|
|
190
|
+
// scratch (a `bus.db`, a `socket.path` with a username, `.webm`/`.gif` recordings) leaked ~31
|
|
191
|
+
// files into a run's PR. The fix cannot lean on the target repo's `.gitignore` being right, so
|
|
192
|
+
// each untracked candidate (`git ls-files --others --exclude-standard` — gitignore honored
|
|
193
|
+
// first, NUL-delimited so odd names survive) is classified per-file: it is staged (it is the
|
|
194
|
+
// run's deliberately-produced product) UNLESS it looks like scratch or key material —
|
|
195
|
+
// • denylisted name/extension: databases (.db/.sqlite*), sockets (.sock), pids (.pid),
|
|
196
|
+
// dotenv (.env*), recordings (.gif/.webm/.mp4/.mov), key material
|
|
197
|
+
// (*.pem/*.key/*.p12/*.pfx/id_rsa*/*credentials*);
|
|
198
|
+
// • a basename containing `socket` (covers `socket.path`, which has no fixed extension);
|
|
199
|
+
// • a path under an obvious scratch/cache dir (tmp/ .tmp/ scratch/ .cache/ coverage/) or
|
|
200
|
+
// a `.DS_Store`;
|
|
201
|
+
// • any otherwise-unrecognised file larger than 1 MiB (a generic net for future scratch).
|
|
202
|
+
// EVERYTHING ELSE RIDES — the floor's job is hygiene, not taste; an allowlist would silently
|
|
203
|
+
// drop a legitimate new asset. This is a GUARD, NOT A SILENT DROP (the issue's own words):
|
|
204
|
+
// every excluded path is printed with its reason, so a clean delivery that skipped files is
|
|
205
|
+
// still fully auditable in the phase output (retained + served on the run wire), never
|
|
206
|
+
// laundered. `git add` here never touches the untracked recovery sentinel: it was removed
|
|
207
|
+
// above, before this pass.
|
|
208
|
+
'while IFS= read -r -d "" F; do',
|
|
209
|
+
' [ -n "$F" ] || continue',
|
|
210
|
+
' BN=${F##*/}; RN=""',
|
|
211
|
+
// Classify on a LOWERCASED basename so DEPLOY.KEY / .ENV / SOCKET.PATH cannot bypass the
|
|
212
|
+
// denylist by case (review, #439).
|
|
213
|
+
' LBN=$(printf "%s" "$BN" | tr "[:upper:]" "[:lower:]")',
|
|
214
|
+
' case "$LBN" in',
|
|
215
|
+
' *.db|*.db-wal|*.db-shm|*.sqlite|*.sqlite2|*.sqlite3|*.sqlite-wal|*.sqlite-shm|*.sock|*.pid|*.env|*.env.*|.envrc|*.gif|*.webm|*.mp4|*.mov|*.pem|*.key|*.p12|*.pfx|id_rsa*|*credentials*) RN="denylisted-name";;',
|
|
216
|
+
' esac',
|
|
217
|
+
' case "$LBN" in *socket*) [ -n "$RN" ] || RN="socket-name";; esac',
|
|
218
|
+
' [ "$BN" = ".DS_Store" ] && [ -z "$RN" ] && RN="ds-store"',
|
|
219
|
+
' case "/$F" in */tmp/*|*/.tmp/*|*/scratch/*|*/.cache/*|*/coverage/*) [ -n "$RN" ] || RN="scratch-dir";; esac',
|
|
220
|
+
' if [ -z "$RN" ]; then SZ=$(wc -c < "$F" 2>/dev/null || echo 0); [ "${SZ:-0}" -gt 1048576 ] && RN="oversize-1mib"; fi',
|
|
221
|
+
' if [ -n "$RN" ]; then echo "deliver: EXCLUDED ($RN): $F"; else git add -- "$F"; fi',
|
|
222
|
+
'done < <(git ls-files --others --exclude-standard -z)',
|
|
178
223
|
// Only commit when something is staged — a run that committed incrementally (core#280's
|
|
179
224
|
// liveness contract) leaves a clean tree and must not gain an empty commit here.
|
|
180
225
|
'git diff --cached --quiet || git commit -q -m "$M"',
|
|
@@ -237,15 +282,15 @@ export function deliverPrScript(intent) {
|
|
|
237
282
|
// that WAS ahead can come out of a rebase carrying nothing of its own.
|
|
238
283
|
'A=$(git rev-list --count "$D..$B")',
|
|
239
284
|
'[ "$A" -ge 1 ] || { echo "deliver: nothing to deliver — the run produced no committed change (after rebasing onto $D, $B carries no commit of its own); nothing was pushed"; exit 1; }',
|
|
240
|
-
// (d) Push.
|
|
241
|
-
//
|
|
242
|
-
//
|
|
243
|
-
//
|
|
285
|
+
// (d) Push. Any push failure happens AFTER the work was committed and its branch was proven
|
|
286
|
+
// ahead. It is therefore a recoverable lift failure, whether the remote branch moved, auth
|
|
287
|
+
// returned 403, the transport is down, or a hook rejected it. Preserve git's own output AND
|
|
288
|
+
// print the marker last, so crew strands the run and POST /runs/:id/deliver can retry it.
|
|
244
289
|
'if PUSHOUT=$(git push -u origin "$B" 2>&1); then echo "$PUSHOUT"; else',
|
|
245
290
|
' echo "$PUSHOUT"',
|
|
246
291
|
' case "$PUSHOUT" in',
|
|
247
|
-
` *non-fast-forward*|*"fetch first"*|*"[rejected]"*|*"Updates were rejected"*) echo "${DELIVER_LIFT_CONFLICT_MARKER} — push of $B was rejected because the remote branch moved (non-fast-forward); rebase and re-run; nothing was pushed"; exit 1;;`,
|
|
248
|
-
|
|
292
|
+
` *non-fast-forward*|*"fetch first"*|*"[rejected]"*|*"Updates were rejected"*) : > "$S"; echo "${DELIVER_LIFT_CONFLICT_MARKER} — push of $B was rejected because the remote branch moved (non-fast-forward); rebase and re-run; nothing was pushed"; exit 1;;`,
|
|
293
|
+
` *) : > "$S"; PUSHERR="\${PUSHOUT:0:96} ... \${PUSHOUT: -128}"; PUSHERR=\${PUSHERR//$'\\n'/ }; echo "deliver: git push of $B failed after commit: $PUSHERR; retry POST /runs/:id/deliver; nothing was pushed; ${DELIVER_LIFT_CONFLICT_MARKER}"; exit 1;;`,
|
|
249
294
|
' esac',
|
|
250
295
|
'fi',
|
|
251
296
|
// (e) Open the PR with gh's OUTPUT and EXIT STATUS captured separately (crew#317). The old
|