@marimo-team/islands 0.26.1-dev18 → 0.26.1-dev20
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/{ErrorBoundary-BO3Zpp5H.js → ErrorBoundary-Cx-CwafE.js} +1 -1
- package/dist/{chat-ui-b1ERxzeA.js → chat-ui-qZdDDrzU.js} +3 -3
- package/dist/{code-visibility-CMM88JXK.js → code-visibility-CVfXV6fG.js} +2 -2
- package/dist/{common-DPQs9PgT.js → common-BXRJCkJO.js} +3 -3
- package/dist/{data-grid-overlay-editor-ByuVzPXI.js → data-grid-overlay-editor-Mbtx3F9C.js} +1 -1
- package/dist/{error-entries-Bl8fzLQc.js → error-entries-DhI0hGvj.js} +448 -450
- package/dist/{feedback-button-BT4k2_Yi.js → feedback-button-zx4NcNDn.js} +3 -3
- package/dist/{glide-data-editor-xhiVBVLv.js → glide-data-editor-CvezoJKg.js} +3 -3
- package/dist/{globals-Rngj0Xbq.js → globals-CQuPaxzy.js} +1 -1
- package/dist/{html-to-image-D6A1lg0A.js → html-to-image-B803aaWE.js} +1 -1
- package/dist/main.js +3211 -3201
- package/dist/{number-overlay-editor-wXnPSQsq.js → number-overlay-editor-DxM7vsCk.js} +1 -1
- package/dist/{process-output-w5omHedc.js → process-output-CnCLfvnL.js} +2 -2
- package/dist/{reveal-component-f1JkdeUt.js → reveal-component-BefmhjJF.js} +2 -2
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +19 -18
- package/src/__mocks__/notebook.ts +1 -1
- package/src/components/editor/actions/__tests__/name-cell-input.test.tsx +1 -1
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +3 -3
- package/src/components/editor/chrome/wrapper/__tests__/document-sync-status.test.tsx +5 -2
- package/src/core/ai/context/providers/__tests__/error.test.ts +6 -3
- package/src/core/cells/__tests__/actions.test.ts +2 -2
- package/src/core/cells/__tests__/arrange.test.ts +1 -1
- package/src/core/cells/__tests__/harness.ts +9 -7
- package/src/core/cells/__tests__/layout.test.ts +1 -1
- package/src/core/cells/__tests__/runs.test.ts +3 -3
- package/src/core/cells/__tests__/utils.test.ts +3 -2
- package/src/core/cells/actions.ts +6 -6
- package/src/core/cells/cells.ts +1 -1
- package/src/core/cells/document.ts +1 -2
- package/src/core/cells/execution-console.ts +3 -3
- package/src/core/cells/ids.ts +2 -4
- package/src/core/cells/runs.ts +2 -2
- package/src/core/cells/session.ts +4 -4
- package/src/core/executions/__tests__/atoms.test.ts +5 -2
- package/src/core/executions/__tests__/freshness.test.ts +56 -52
- package/src/core/executions/__tests__/interrupt.test.ts +2 -2
- package/src/core/executions/__tests__/output.test.ts +3 -1
- package/src/core/executions/__tests__/run.test.ts +2 -2
- package/src/core/executions/__tests__/select.test.ts +70 -62
- package/src/core/executions/atoms.ts +1 -1
- package/src/core/executions/freshness.ts +5 -5
- package/src/core/executions/output.ts +15 -21
- package/src/core/executions/select.ts +17 -9
- package/src/core/export/__tests__/hooks.test.ts +1 -1
- package/src/core/meta/__tests__/code-visibility.test.tsx +3 -2
- package/src/core/notebook/document/__tests__/codemirror.test.ts +8 -6
- package/src/core/notebook/document/__tests__/draft.test.ts +56 -58
- package/src/core/notebook/document/__tests__/fixtures.ts +8 -7
- package/src/core/notebook/document/__tests__/hooks.test.tsx +39 -35
- package/src/core/notebook/document/__tests__/lifecycle-scenarios.test.ts +8 -5
- package/src/core/notebook/document/__tests__/model.test.ts +8 -5
- package/src/core/notebook/document/__tests__/protocol-fixtures.ts +2 -2
- package/src/core/notebook/document/__tests__/recovery-scenarios.test.ts +37 -32
- package/src/core/notebook/document/__tests__/scenarios.test.ts +49 -45
- package/src/core/notebook/document/__tests__/state.test.ts +59 -56
- package/src/core/notebook/document/__tests__/submission.test.ts +15 -12
- package/src/core/notebook/document/__tests__/test-host.ts +3 -2
- package/src/core/notebook/document/__tests__/user.ts +7 -3
- package/src/core/notebook/document/draft.ts +29 -11
- package/src/core/notebook/document/state.ts +7 -6
- package/src/core/notebook/replica/__tests__/document.test.ts +9 -5
- package/src/core/notebook/replica/__tests__/executions.test.ts +8 -5
- package/src/core/notebook/replica/__tests__/fixtures.ts +6 -2
- package/src/core/notebook/replica/__tests__/results.test.ts +23 -19
- package/src/core/notebook/replica/execution-state.ts +2 -2
- package/src/core/notebook/replica/replica.ts +2 -2
- package/src/core/notebook/replica/resources/analysis.ts +1 -1
- package/src/core/notebook/replica/resources/document.ts +9 -8
- package/src/core/notebook/replica/resources/executions.ts +2 -2
- package/src/core/notebook/replica/resources/results.ts +2 -2
- package/src/core/saving/__tests__/document.test.tsx +1 -1
- package/src/core/saving/__tests__/state.test.ts +2 -2
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +9 -4
- package/src/core/session/useNotebookReplica.ts +1 -1
- package/src/core/session/useNotebookSession.tsx +1 -1
- package/src/core/transports/__tests__/static.test.ts +1 -1
- package/src/core/transports/static.ts +2 -2
|
@@ -4,6 +4,10 @@ import type * as Protocol from "@marimo-team/client/protocol";
|
|
|
4
4
|
import { describe, expect, it } from "vitest";
|
|
5
5
|
import type { Execution, Executions, Result } from "@/core/notebook/replica";
|
|
6
6
|
import { type CellFreshnessInputs, freshnessOf } from "../freshness";
|
|
7
|
+
import { cellId } from "@/__tests__/branded";
|
|
8
|
+
|
|
9
|
+
const C3 = cellId("c3");
|
|
10
|
+
const FIXTURE_CELL = cellId("k7f2");
|
|
7
11
|
|
|
8
12
|
const T0 = "2026-10-01T09:20:11Z";
|
|
9
13
|
const T1 = "2026-10-01T09:20:12.500Z";
|
|
@@ -15,10 +19,10 @@ const K7F2_FINGERPRINT = "db2b1c9e4a7f0d36";
|
|
|
15
19
|
function cell(
|
|
16
20
|
id: string,
|
|
17
21
|
fingerprint: string,
|
|
18
|
-
overrides: Partial<Protocol.
|
|
19
|
-
): Protocol.
|
|
22
|
+
overrides: Partial<Protocol.CellOutput> = {},
|
|
23
|
+
): Protocol.CellOutput {
|
|
20
24
|
return {
|
|
21
|
-
id,
|
|
25
|
+
id: cellId(id),
|
|
22
26
|
notebook_id: "n1",
|
|
23
27
|
code: null,
|
|
24
28
|
name: "_",
|
|
@@ -35,13 +39,13 @@ function cell(
|
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
const SUCCEEDED: Protocol.
|
|
42
|
+
const SUCCEEDED: Protocol.ExecutionOutcomeOutput = { kind: "succeeded" };
|
|
39
43
|
|
|
40
44
|
/** A completed state that read `depends_on`. */
|
|
41
45
|
function completed(
|
|
42
|
-
depends_on: Protocol.
|
|
43
|
-
outcome: Protocol.
|
|
44
|
-
): Protocol.
|
|
46
|
+
depends_on: Protocol.ExecutionCompletedOutput["depends_on"] = {},
|
|
47
|
+
outcome: Protocol.ExecutionOutcomeOutput = SUCCEEDED,
|
|
48
|
+
): Protocol.ExecutionCompletedOutput {
|
|
45
49
|
return {
|
|
46
50
|
status: "completed",
|
|
47
51
|
started_at: T0,
|
|
@@ -52,12 +56,12 @@ function completed(
|
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
function record(
|
|
55
|
-
fields: Partial<Protocol.
|
|
59
|
+
fields: Partial<Protocol.ExecutionOutput> & {
|
|
56
60
|
id: string;
|
|
57
|
-
cell_id:
|
|
61
|
+
cell_id: Protocol.CellId;
|
|
58
62
|
code_fingerprint: string;
|
|
59
63
|
},
|
|
60
|
-
): Protocol.
|
|
64
|
+
): Protocol.ExecutionOutput {
|
|
61
65
|
return {
|
|
62
66
|
run_id: "run-1",
|
|
63
67
|
runtime_id: "r1",
|
|
@@ -84,7 +88,7 @@ function variable(
|
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
function execution(
|
|
87
|
-
rec: Protocol.
|
|
91
|
+
rec: Protocol.ExecutionOutput,
|
|
88
92
|
variables: Protocol.Variable[] = [],
|
|
89
93
|
): Execution {
|
|
90
94
|
return {
|
|
@@ -101,10 +105,10 @@ function inputs({
|
|
|
101
105
|
executions,
|
|
102
106
|
results = executions.map((e) => e.record),
|
|
103
107
|
}: {
|
|
104
|
-
cells: Protocol.
|
|
108
|
+
cells: Protocol.CellOutput[];
|
|
105
109
|
executions: Execution[];
|
|
106
110
|
/** Defaults to the executions on the stream. */
|
|
107
|
-
results?: Protocol.
|
|
111
|
+
results?: Protocol.ExecutionOutput[];
|
|
108
112
|
}): CellFreshnessInputs {
|
|
109
113
|
const stream: Executions = {
|
|
110
114
|
results: new Map(),
|
|
@@ -140,12 +144,12 @@ const c3 = cell("c3", C3_FINGERPRINT);
|
|
|
140
144
|
const k7f2 = cell("k7f2", K7F2_FINGERPRINT);
|
|
141
145
|
const e12 = record({
|
|
142
146
|
id: "e12",
|
|
143
|
-
cell_id:
|
|
147
|
+
cell_id: C3,
|
|
144
148
|
code_fingerprint: C3_FINGERPRINT,
|
|
145
149
|
});
|
|
146
150
|
const e13 = record({
|
|
147
151
|
id: "e13",
|
|
148
|
-
cell_id:
|
|
152
|
+
cell_id: FIXTURE_CELL,
|
|
149
153
|
code_fingerprint: K7F2_FINGERPRINT,
|
|
150
154
|
state: completed({ x: { execution_id: "e12", update: 0 } }),
|
|
151
155
|
});
|
|
@@ -153,11 +157,11 @@ const e13 = record({
|
|
|
153
157
|
describe("cellFreshness", () => {
|
|
154
158
|
it("is current for a cell that never completed, having nothing to compare", () => {
|
|
155
159
|
const state = inputs({ cells: [c3], executions: [] });
|
|
156
|
-
expect(freshnessOf(state)(
|
|
160
|
+
expect(freshnessOf(state)(C3)).toEqual({
|
|
157
161
|
sourceChanged: false,
|
|
158
162
|
inputsChanged: false,
|
|
159
163
|
});
|
|
160
|
-
expect(freshnessOf(state)("missing")).toEqual({
|
|
164
|
+
expect(freshnessOf(state)(cellId("missing"))).toEqual({
|
|
161
165
|
sourceChanged: false,
|
|
162
166
|
inputsChanged: false,
|
|
163
167
|
});
|
|
@@ -169,11 +173,11 @@ describe("cellFreshness", () => {
|
|
|
169
173
|
executions: [execution(e12, [variable("x", "e12")]), execution(e13)],
|
|
170
174
|
});
|
|
171
175
|
const freshness = freshnessOf(state);
|
|
172
|
-
expect(freshness(
|
|
176
|
+
expect(freshness(C3)).toEqual({
|
|
173
177
|
sourceChanged: false,
|
|
174
178
|
inputsChanged: false,
|
|
175
179
|
});
|
|
176
|
-
expect(freshness(
|
|
180
|
+
expect(freshness(FIXTURE_CELL)).toEqual({
|
|
177
181
|
sourceChanged: false,
|
|
178
182
|
inputsChanged: false,
|
|
179
183
|
});
|
|
@@ -185,11 +189,11 @@ describe("cellFreshness", () => {
|
|
|
185
189
|
executions: [execution(e12, [variable("x", "e12", 1)]), execution(e13)],
|
|
186
190
|
});
|
|
187
191
|
const freshness = freshnessOf(state);
|
|
188
|
-
expect(freshness(
|
|
192
|
+
expect(freshness(C3)).toEqual({
|
|
189
193
|
sourceChanged: false,
|
|
190
194
|
inputsChanged: false,
|
|
191
195
|
});
|
|
192
|
-
expect(freshness(
|
|
196
|
+
expect(freshness(FIXTURE_CELL)).toEqual({
|
|
193
197
|
sourceChanged: false,
|
|
194
198
|
inputsChanged: true,
|
|
195
199
|
});
|
|
@@ -201,12 +205,12 @@ describe("cellFreshness", () => {
|
|
|
201
205
|
executions: [execution(e12, [variable("x", "e12")]), execution(e13)],
|
|
202
206
|
});
|
|
203
207
|
const freshness = freshnessOf(state);
|
|
204
|
-
expect(freshness(
|
|
208
|
+
expect(freshness(C3)).toEqual({
|
|
205
209
|
sourceChanged: true,
|
|
206
210
|
inputsChanged: false,
|
|
207
211
|
});
|
|
208
212
|
// The dependent's own source and the values it read are as they were.
|
|
209
|
-
expect(freshness(
|
|
213
|
+
expect(freshness(FIXTURE_CELL)).toEqual({
|
|
210
214
|
sourceChanged: false,
|
|
211
215
|
inputsChanged: false,
|
|
212
216
|
});
|
|
@@ -216,12 +220,12 @@ describe("cellFreshness", () => {
|
|
|
216
220
|
const m = cell("m", "aaaa111122223333");
|
|
217
221
|
const e14 = record({
|
|
218
222
|
id: "e14",
|
|
219
|
-
cell_id:
|
|
223
|
+
cell_id: C3,
|
|
220
224
|
code_fingerprint: C3_FINGERPRINT,
|
|
221
225
|
});
|
|
222
226
|
const e15 = record({
|
|
223
227
|
id: "e15",
|
|
224
|
-
cell_id: "m",
|
|
228
|
+
cell_id: cellId("m"),
|
|
225
229
|
code_fingerprint: "aaaa111122223333",
|
|
226
230
|
state: completed({ y: { execution_id: "e13", update: 0 } }),
|
|
227
231
|
});
|
|
@@ -234,11 +238,11 @@ describe("cellFreshness", () => {
|
|
|
234
238
|
],
|
|
235
239
|
});
|
|
236
240
|
const freshness = freshnessOf(state);
|
|
237
|
-
expect(freshness(
|
|
241
|
+
expect(freshness(FIXTURE_CELL)).toEqual({
|
|
238
242
|
sourceChanged: false,
|
|
239
243
|
inputsChanged: true,
|
|
240
244
|
});
|
|
241
|
-
expect(freshness("m")).toEqual({
|
|
245
|
+
expect(freshness(cellId("m"))).toEqual({
|
|
242
246
|
sourceChanged: false,
|
|
243
247
|
inputsChanged: true,
|
|
244
248
|
});
|
|
@@ -247,14 +251,14 @@ describe("cellFreshness", () => {
|
|
|
247
251
|
it("is outdated as replaced once the binding execution runs again", () => {
|
|
248
252
|
const e14 = record({
|
|
249
253
|
id: "e14",
|
|
250
|
-
cell_id:
|
|
254
|
+
cell_id: C3,
|
|
251
255
|
code_fingerprint: C3_FINGERPRINT,
|
|
252
256
|
});
|
|
253
257
|
const state = inputs({
|
|
254
258
|
cells: [c3, k7f2],
|
|
255
259
|
executions: [execution(e14, [variable("x", "e14")]), execution(e13)],
|
|
256
260
|
});
|
|
257
|
-
expect(freshnessOf(state)(
|
|
261
|
+
expect(freshnessOf(state)(FIXTURE_CELL)).toEqual({
|
|
258
262
|
sourceChanged: false,
|
|
259
263
|
inputsChanged: true,
|
|
260
264
|
});
|
|
@@ -263,7 +267,7 @@ describe("cellFreshness", () => {
|
|
|
263
267
|
it("is outdated as replaced while the binding cell runs again and the name is unbound", () => {
|
|
264
268
|
const queued = record({
|
|
265
269
|
id: "e14",
|
|
266
|
-
cell_id:
|
|
270
|
+
cell_id: C3,
|
|
267
271
|
code_fingerprint: C3_FINGERPRINT,
|
|
268
272
|
state: { status: "queued" },
|
|
269
273
|
});
|
|
@@ -273,12 +277,12 @@ describe("cellFreshness", () => {
|
|
|
273
277
|
results: [e12, e13],
|
|
274
278
|
});
|
|
275
279
|
const freshness = freshnessOf(state);
|
|
276
|
-
expect(freshness(
|
|
280
|
+
expect(freshness(FIXTURE_CELL)).toEqual({
|
|
277
281
|
sourceChanged: false,
|
|
278
282
|
inputsChanged: true,
|
|
279
283
|
});
|
|
280
284
|
// The retained result for c3 still compares by its own fingerprint.
|
|
281
|
-
expect(freshness(
|
|
285
|
+
expect(freshness(C3)).toEqual({
|
|
282
286
|
sourceChanged: false,
|
|
283
287
|
inputsChanged: false,
|
|
284
288
|
});
|
|
@@ -287,7 +291,7 @@ describe("cellFreshness", () => {
|
|
|
287
291
|
it("is outdated as replaced once a name it read as unbound is bound", () => {
|
|
288
292
|
const reader = record({
|
|
289
293
|
id: "e20",
|
|
290
|
-
cell_id:
|
|
294
|
+
cell_id: FIXTURE_CELL,
|
|
291
295
|
code_fingerprint: K7F2_FINGERPRINT,
|
|
292
296
|
state: completed({ y: null }),
|
|
293
297
|
});
|
|
@@ -295,7 +299,7 @@ describe("cellFreshness", () => {
|
|
|
295
299
|
cells: [c3, k7f2],
|
|
296
300
|
executions: [execution(reader)],
|
|
297
301
|
});
|
|
298
|
-
expect(freshnessOf(unbound)(
|
|
302
|
+
expect(freshnessOf(unbound)(FIXTURE_CELL)).toEqual({
|
|
299
303
|
sourceChanged: false,
|
|
300
304
|
inputsChanged: false,
|
|
301
305
|
});
|
|
@@ -304,7 +308,7 @@ describe("cellFreshness", () => {
|
|
|
304
308
|
cells: [c3, k7f2],
|
|
305
309
|
executions: [execution(e12, [variable("y", "e12")]), execution(reader)],
|
|
306
310
|
});
|
|
307
|
-
expect(freshnessOf(bound)(
|
|
311
|
+
expect(freshnessOf(bound)(FIXTURE_CELL)).toEqual({
|
|
308
312
|
sourceChanged: false,
|
|
309
313
|
inputsChanged: true,
|
|
310
314
|
});
|
|
@@ -313,7 +317,7 @@ describe("cellFreshness", () => {
|
|
|
313
317
|
it("reports both facts when the source and a value it read changed", () => {
|
|
314
318
|
const reader = record({
|
|
315
319
|
id: "e21",
|
|
316
|
-
cell_id:
|
|
320
|
+
cell_id: FIXTURE_CELL,
|
|
317
321
|
code_fingerprint: "stale",
|
|
318
322
|
state: completed({
|
|
319
323
|
x: { execution_id: "e12", update: 0 },
|
|
@@ -327,7 +331,7 @@ describe("cellFreshness", () => {
|
|
|
327
331
|
execution(reader),
|
|
328
332
|
],
|
|
329
333
|
});
|
|
330
|
-
expect(freshnessOf(state)(
|
|
334
|
+
expect(freshnessOf(state)(FIXTURE_CELL)).toEqual({
|
|
331
335
|
sourceChanged: true,
|
|
332
336
|
inputsChanged: true,
|
|
333
337
|
});
|
|
@@ -336,7 +340,7 @@ describe("cellFreshness", () => {
|
|
|
336
340
|
it("compares a skipped execution by the dependencies it would have read", () => {
|
|
337
341
|
const skipped = record({
|
|
338
342
|
id: "e22",
|
|
339
|
-
cell_id:
|
|
343
|
+
cell_id: FIXTURE_CELL,
|
|
340
344
|
code_fingerprint: K7F2_FINGERPRINT,
|
|
341
345
|
state: completed(
|
|
342
346
|
{ x: { execution_id: "e12", update: 0 } },
|
|
@@ -355,7 +359,7 @@ describe("cellFreshness", () => {
|
|
|
355
359
|
execution(skipped),
|
|
356
360
|
],
|
|
357
361
|
});
|
|
358
|
-
expect(freshnessOf(state)(
|
|
362
|
+
expect(freshnessOf(state)(FIXTURE_CELL)).toEqual({
|
|
359
363
|
sourceChanged: false,
|
|
360
364
|
inputsChanged: true,
|
|
361
365
|
});
|
|
@@ -367,7 +371,7 @@ describe("cellFreshness", () => {
|
|
|
367
371
|
executions: [execution(e12, [variable("x", "e12")]), execution(e13)],
|
|
368
372
|
results: [e12, e13],
|
|
369
373
|
});
|
|
370
|
-
expect(freshnessOf(state)(
|
|
374
|
+
expect(freshnessOf(state)(C3)).toEqual({
|
|
371
375
|
sourceChanged: true,
|
|
372
376
|
inputsChanged: false,
|
|
373
377
|
});
|
|
@@ -378,7 +382,7 @@ describe("cellFreshness", () => {
|
|
|
378
382
|
(status) => {
|
|
379
383
|
const reader = record({
|
|
380
384
|
id: "reader-r2",
|
|
381
|
-
cell_id:
|
|
385
|
+
cell_id: FIXTURE_CELL,
|
|
382
386
|
runtime_id: "r2",
|
|
383
387
|
code_fingerprint: K7F2_FINGERPRINT,
|
|
384
388
|
state: {
|
|
@@ -389,7 +393,7 @@ describe("cellFreshness", () => {
|
|
|
389
393
|
});
|
|
390
394
|
const binder = record({
|
|
391
395
|
id: "binder-r3",
|
|
392
|
-
cell_id:
|
|
396
|
+
cell_id: C3,
|
|
393
397
|
runtime_id: "r3",
|
|
394
398
|
code_fingerprint: C3_FINGERPRINT,
|
|
395
399
|
state:
|
|
@@ -410,7 +414,7 @@ describe("cellFreshness", () => {
|
|
|
410
414
|
results: [e12, reader],
|
|
411
415
|
});
|
|
412
416
|
|
|
413
|
-
expect(freshnessOf(state)(
|
|
417
|
+
expect(freshnessOf(state)(FIXTURE_CELL)).toEqual({
|
|
414
418
|
sourceChanged: false,
|
|
415
419
|
inputsChanged: true,
|
|
416
420
|
});
|
|
@@ -420,7 +424,7 @@ describe("cellFreshness", () => {
|
|
|
420
424
|
it("treats a name bound only by an earlier runtime as unbound", () => {
|
|
421
425
|
const reader = record({
|
|
422
426
|
id: "e20",
|
|
423
|
-
cell_id:
|
|
427
|
+
cell_id: FIXTURE_CELL,
|
|
424
428
|
runtime_id: "r2",
|
|
425
429
|
code_fingerprint: K7F2_FINGERPRINT,
|
|
426
430
|
state: completed({ x: null }),
|
|
@@ -429,14 +433,14 @@ describe("cellFreshness", () => {
|
|
|
429
433
|
cells: [c3, k7f2],
|
|
430
434
|
executions: [execution(e12, [variable("x", "e12")]), execution(reader)],
|
|
431
435
|
});
|
|
432
|
-
expect(freshnessOf(retained)(
|
|
436
|
+
expect(freshnessOf(retained)(FIXTURE_CELL)).toEqual({
|
|
433
437
|
sourceChanged: false,
|
|
434
438
|
inputsChanged: false,
|
|
435
439
|
});
|
|
436
440
|
|
|
437
441
|
const rebound = record({
|
|
438
442
|
id: "e14",
|
|
439
|
-
cell_id:
|
|
443
|
+
cell_id: C3,
|
|
440
444
|
runtime_id: "r2",
|
|
441
445
|
code_fingerprint: C3_FINGERPRINT,
|
|
442
446
|
});
|
|
@@ -447,7 +451,7 @@ describe("cellFreshness", () => {
|
|
|
447
451
|
execution(reader),
|
|
448
452
|
],
|
|
449
453
|
});
|
|
450
|
-
expect(freshnessOf(bound)(
|
|
454
|
+
expect(freshnessOf(bound)(FIXTURE_CELL)).toEqual({
|
|
451
455
|
sourceChanged: false,
|
|
452
456
|
inputsChanged: true,
|
|
453
457
|
});
|
|
@@ -458,7 +462,7 @@ describe("cellFreshness", () => {
|
|
|
458
462
|
(status) => {
|
|
459
463
|
const pending = record({
|
|
460
464
|
id: "e14",
|
|
461
|
-
cell_id:
|
|
465
|
+
cell_id: C3,
|
|
462
466
|
code_fingerprint: "ffff000011112222",
|
|
463
467
|
state: status === "running" ? { status, started_at: T0 } : { status },
|
|
464
468
|
});
|
|
@@ -468,7 +472,7 @@ describe("cellFreshness", () => {
|
|
|
468
472
|
results: [e12],
|
|
469
473
|
});
|
|
470
474
|
|
|
471
|
-
expect(freshnessOf(state)(
|
|
475
|
+
expect(freshnessOf(state)(C3)).toEqual({
|
|
472
476
|
sourceChanged: true,
|
|
473
477
|
inputsChanged: false,
|
|
474
478
|
});
|
|
@@ -479,7 +483,7 @@ describe("cellFreshness", () => {
|
|
|
479
483
|
const edited = cell("c3", "ffff000011112222");
|
|
480
484
|
const running = record({
|
|
481
485
|
id: "e14",
|
|
482
|
-
cell_id:
|
|
486
|
+
cell_id: C3,
|
|
483
487
|
code_fingerprint: "ffff000011112222",
|
|
484
488
|
state: { status: "running", started_at: T0 },
|
|
485
489
|
});
|
|
@@ -488,7 +492,7 @@ describe("cellFreshness", () => {
|
|
|
488
492
|
executions: [execution(running), execution(e13)],
|
|
489
493
|
results: [e12, e13],
|
|
490
494
|
});
|
|
491
|
-
expect(freshnessOf(covered)(
|
|
495
|
+
expect(freshnessOf(covered)(C3).sourceChanged).toBe(false);
|
|
492
496
|
|
|
493
497
|
const stale = inputs({
|
|
494
498
|
cells: [edited, k7f2],
|
|
@@ -498,6 +502,6 @@ describe("cellFreshness", () => {
|
|
|
498
502
|
],
|
|
499
503
|
results: [e12, e13],
|
|
500
504
|
});
|
|
501
|
-
expect(freshnessOf(stale)(
|
|
505
|
+
expect(freshnessOf(stale)(C3).sourceChanged).toBe(true);
|
|
502
506
|
});
|
|
503
507
|
});
|
|
@@ -23,7 +23,7 @@ function run(
|
|
|
23
23
|
id: string,
|
|
24
24
|
status: Protocol.RunState["status"] = "running",
|
|
25
25
|
runtimeId = "r1",
|
|
26
|
-
): Protocol.
|
|
26
|
+
): Protocol.RunOutput {
|
|
27
27
|
return {
|
|
28
28
|
id,
|
|
29
29
|
notebook_id: "n1",
|
|
@@ -44,7 +44,7 @@ function run(
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
function setup(runs: Protocol.
|
|
47
|
+
function setup(runs: Protocol.RunOutput[]) {
|
|
48
48
|
const store = createStore();
|
|
49
49
|
const replica = MockExecutions.seed(store, [], MockExecutions.runtime());
|
|
50
50
|
const interrupt = vi.fn<FakeInterrupt>(async () => ({
|
|
@@ -19,7 +19,9 @@ const HTML: Protocol.Media = { mimetype: "text/html", data: "<b>1</b>" };
|
|
|
19
19
|
/** After every time the execution mocks use. */
|
|
20
20
|
const LATER = "2026-10-01T09:30:00Z";
|
|
21
21
|
|
|
22
|
-
function hostError(
|
|
22
|
+
function hostError(
|
|
23
|
+
overrides: Partial<Protocol.ErrorOutput>,
|
|
24
|
+
): Protocol.ErrorOutput {
|
|
23
25
|
return {
|
|
24
26
|
kind: "exception",
|
|
25
27
|
message: "boom",
|
|
@@ -34,12 +34,12 @@ vi.mock("@/components/ui/use-toast", () => ({
|
|
|
34
34
|
const C1 = cellId("c1");
|
|
35
35
|
const C2 = cellId("c2");
|
|
36
36
|
|
|
37
|
-
function accepted(cells:
|
|
37
|
+
function accepted(cells: string[]): Protocol.RunOutput {
|
|
38
38
|
return {
|
|
39
39
|
id: "run-1",
|
|
40
40
|
notebook_id: "n1",
|
|
41
41
|
runtime_id: "r1",
|
|
42
|
-
origin: { kind: "cells", cell_ids: cells },
|
|
42
|
+
origin: { kind: "cells", cell_ids: cells.map(cellId) },
|
|
43
43
|
created_at: "2026-10-01T09:20:00Z",
|
|
44
44
|
state: { status: "queued" },
|
|
45
45
|
};
|