@sixb/core 0.2.0 → 0.2.1
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/actions/index.js +11 -11
- package/dist/agents/index.js +12 -12
- package/dist/artifacts/publish/index.js +5 -5
- package/dist/bootstrap/index.js +18 -18
- package/dist/{chunk-fntqb7qy.js → chunk-57g0215c.js} +1 -1
- package/dist/{chunk-fb3m4sa1.js → chunk-8yzhjawq.js} +1 -1
- package/dist/{chunk-xj97s5js.js → chunk-aqyjb86c.js} +2 -2
- package/dist/{chunk-f2w6328x.js → chunk-ax10ft8d.js} +4 -4
- package/dist/{chunk-c78jjzhy.js → chunk-b7a97n8b.js} +1 -1
- package/dist/{chunk-e99kp9jh.js → chunk-cb21tx14.js} +6 -6
- package/dist/{chunk-e99kp9jh.js.map → chunk-cb21tx14.js.map} +4 -4
- package/dist/{chunk-peggaard.js → chunk-e6xgz4h4.js} +20 -2
- package/dist/{chunk-peggaard.js.map → chunk-e6xgz4h4.js.map} +5 -3
- package/dist/{chunk-ekkpzcka.js → chunk-epyfm23v.js} +34 -7
- package/dist/chunk-epyfm23v.js.map +11 -0
- package/dist/{chunk-ztf5vtmp.js → chunk-h05rg3bx.js} +39 -8
- package/dist/chunk-h05rg3bx.js.map +12 -0
- package/dist/{chunk-d3t26vah.js → chunk-j1ny5fwh.js} +35 -11
- package/dist/chunk-j1ny5fwh.js.map +15 -0
- package/dist/{chunk-855n80en.js → chunk-jjmggm9a.js} +1 -1
- package/dist/{chunk-semf1yqn.js → chunk-ks87m383.js} +11 -11
- package/dist/{chunk-vkweppkw.js → chunk-nqnfz3jg.js} +2 -2
- package/dist/{chunk-hjy3dsws.js → chunk-ratj7t3t.js} +3 -3
- package/dist/{chunk-fdkpkkpw.js → chunk-rjeeyssy.js} +2 -2
- package/dist/{chunk-9mab3dvg.js → chunk-s038wa5v.js} +9 -1
- package/dist/{chunk-9mab3dvg.js.map → chunk-s038wa5v.js.map} +3 -3
- package/dist/{chunk-n54k068r.js → chunk-t5daew4g.js} +3 -3
- package/dist/{chunk-8hvfs0fr.js → chunk-t9xyr7y9.js} +2 -2
- package/dist/{chunk-8dcfj58k.js → chunk-tvbmh7tj.js} +1 -1
- package/dist/{chunk-he7g39e5.js → chunk-w53trr0c.js} +4 -4
- package/dist/{chunk-qya541bk.js → chunk-z3evap21.js} +14 -12
- package/dist/{chunk-qya541bk.js.map → chunk-z3evap21.js.map} +3 -3
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/selectors/index.js +1 -1
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/types/datasets.d.ts +6 -0
- package/dist/events/types/datasets.d.ts.map +1 -1
- package/dist/execution/agent.js +11 -11
- package/dist/execution/primitive.js +11 -11
- package/dist/execution/request.js +11 -11
- package/dist/index.js +21 -21
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +2 -2
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +6 -2
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +7 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +18 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +11 -3
- package/dist/lake-storage/version-inputs.d.ts.map +1 -1
- package/dist/materializer/index.js +3 -3
- package/dist/models/execution/index.js +3 -3
- package/dist/objects/index.js +11 -11
- package/dist/objects/query/index.js +3 -3
- package/dist/pipelines/index.js +6 -6
- package/dist/pipelines/run-dispatch.d.ts +2 -0
- package/dist/pipelines/run-dispatch.d.ts.map +1 -1
- package/dist/projections/internal.js +2 -2
- package/dist/runtime/internal.js +7 -7
- package/dist/schedules/index.js +2 -2
- package/dist/shares/internal.js +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/storage/internal.d.ts +2 -0
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +6 -2
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/transitions.d.ts +7 -0
- package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -0
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/transitions.d.ts +7 -0
- package/dist/storage/sync-runs/transitions.d.ts.map +1 -0
- package/dist/syncs/index.js +6 -6
- package/dist/syncs/run-dispatch.d.ts +2 -0
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
- package/dist/testing/index.js +170 -33
- package/dist/testing/index.js.map +5 -5
- package/dist/testing/lake-changes-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +2 -2
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +12 -2
- package/dist/workers/index.js.map +5 -4
- package/dist/workers/unstarted-run.d.ts +10 -0
- package/dist/workers/unstarted-run.d.ts.map +1 -0
- package/dist/workflows/index.js +15 -15
- package/package.json +1 -1
- package/src/datasets/execution.ts +2 -0
- package/src/events/selectors/predicate.ts +15 -0
- package/src/events/types/datasets.ts +6 -0
- package/src/lake-storage/in-memory.ts +30 -20
- package/src/lake-storage/index.ts +2 -1
- package/src/lake-storage/source-ordering.ts +31 -4
- package/src/lake-storage/types.ts +18 -0
- package/src/lake-storage/version-inputs.ts +21 -5
- package/src/pipelines/run-dispatch.ts +53 -6
- package/src/storage/internal.ts +2 -0
- package/src/storage/pipeline-runs/in-memory.ts +2 -5
- package/src/storage/pipeline-runs/transitions.ts +14 -0
- package/src/storage/sync-runs/in-memory.ts +2 -5
- package/src/storage/sync-runs/transitions.ts +11 -0
- package/src/syncs/run-dispatch.ts +68 -13
- package/src/testing/dataset-sequence-contract.ts +81 -0
- package/src/testing/lake-changes-contract.ts +2 -1
- package/src/testing/lake-storage-contract.ts +112 -0
- package/src/workers/index.ts +1 -0
- package/src/workers/unstarted-run.ts +18 -0
- package/dist/chunk-d3t26vah.js.map +0 -15
- package/dist/chunk-ekkpzcka.js.map +0 -11
- package/dist/chunk-ztf5vtmp.js.map +0 -12
- /package/dist/{chunk-fntqb7qy.js.map → chunk-57g0215c.js.map} +0 -0
- /package/dist/{chunk-fb3m4sa1.js.map → chunk-8yzhjawq.js.map} +0 -0
- /package/dist/{chunk-xj97s5js.js.map → chunk-aqyjb86c.js.map} +0 -0
- /package/dist/{chunk-f2w6328x.js.map → chunk-ax10ft8d.js.map} +0 -0
- /package/dist/{chunk-c78jjzhy.js.map → chunk-b7a97n8b.js.map} +0 -0
- /package/dist/{chunk-855n80en.js.map → chunk-jjmggm9a.js.map} +0 -0
- /package/dist/{chunk-semf1yqn.js.map → chunk-ks87m383.js.map} +0 -0
- /package/dist/{chunk-vkweppkw.js.map → chunk-nqnfz3jg.js.map} +0 -0
- /package/dist/{chunk-hjy3dsws.js.map → chunk-ratj7t3t.js.map} +0 -0
- /package/dist/{chunk-fdkpkkpw.js.map → chunk-rjeeyssy.js.map} +0 -0
- /package/dist/{chunk-n54k068r.js.map → chunk-t5daew4g.js.map} +0 -0
- /package/dist/{chunk-8hvfs0fr.js.map → chunk-t9xyr7y9.js.map} +0 -0
- /package/dist/{chunk-8dcfj58k.js.map → chunk-tvbmh7tj.js.map} +0 -0
- /package/dist/{chunk-he7g39e5.js.map → chunk-w53trr0c.js.map} +0 -0
package/dist/testing/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
import"../chunk-23s66j86.js";
|
|
59
59
|
import {
|
|
60
60
|
ArtifactStorageError
|
|
61
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-e6xgz4h4.js";
|
|
62
62
|
import {
|
|
63
63
|
ARTIFACT_STATE_LIMITS2
|
|
64
64
|
} from "../chunk-hz5d43gn.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
WorkflowInterventionError2,
|
|
83
83
|
InMemoryStorage2,
|
|
84
84
|
migrateStorage2
|
|
85
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-cb21tx14.js";
|
|
86
86
|
import"../chunk-nz7815t3.js";
|
|
87
87
|
import"../chunk-s7xqfxs9.js";
|
|
88
88
|
import"../chunk-mmagke4x.js";
|
|
@@ -96,13 +96,13 @@ import {
|
|
|
96
96
|
ProjectionRegistry2,
|
|
97
97
|
createLinkScopeFingerprint2,
|
|
98
98
|
createOntologyMaterializer2
|
|
99
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-rjeeyssy.js";
|
|
100
100
|
import {
|
|
101
101
|
bindModelExecutionAttempt,
|
|
102
102
|
isBoundSixb
|
|
103
|
-
} from "../chunk-
|
|
103
|
+
} from "../chunk-z3evap21.js";
|
|
104
104
|
import"../chunk-w976a4me.js";
|
|
105
|
-
import"../chunk-
|
|
105
|
+
import"../chunk-ax10ft8d.js";
|
|
106
106
|
import {
|
|
107
107
|
planObjectQuery2,
|
|
108
108
|
executeObjectQuery2,
|
|
@@ -110,13 +110,13 @@ import {
|
|
|
110
110
|
existsObjects2,
|
|
111
111
|
facetObjects2,
|
|
112
112
|
executeObjectQueryLinks2
|
|
113
|
-
} from "../chunk-
|
|
114
|
-
import"../chunk-
|
|
113
|
+
} from "../chunk-tvbmh7tj.js";
|
|
114
|
+
import"../chunk-8yzhjawq.js";
|
|
115
115
|
import"../chunk-fg1db9xx.js";
|
|
116
116
|
import"../chunk-3fqxbn31.js";
|
|
117
117
|
import"../chunk-waqk73p1.js";
|
|
118
118
|
import"../chunk-kwfhd1g0.js";
|
|
119
|
-
import"../chunk-
|
|
119
|
+
import"../chunk-t9xyr7y9.js";
|
|
120
120
|
import"../chunk-qsg8rw04.js";
|
|
121
121
|
import"../chunk-sgx82nnt.js";
|
|
122
122
|
import"../chunk-8ncg20rd.js";
|
|
@@ -130,31 +130,31 @@ import {
|
|
|
130
130
|
import {
|
|
131
131
|
writeDataset2
|
|
132
132
|
} from "../chunk-jbw70d6t.js";
|
|
133
|
-
import"../chunk-
|
|
133
|
+
import"../chunk-b7a97n8b.js";
|
|
134
134
|
import"../chunk-jhbk10wf.js";
|
|
135
135
|
import"../chunk-1vg43g9q.js";
|
|
136
136
|
import"../chunk-m427qgq0.js";
|
|
137
137
|
import {
|
|
138
138
|
SixbHost2
|
|
139
|
-
} from "../chunk-
|
|
139
|
+
} from "../chunk-ks87m383.js";
|
|
140
140
|
import"../chunk-w122ymx4.js";
|
|
141
141
|
import"../chunk-t5608tkq.js";
|
|
142
|
-
import"../chunk-
|
|
143
|
-
import"../chunk-
|
|
142
|
+
import"../chunk-s038wa5v.js";
|
|
143
|
+
import"../chunk-aqyjb86c.js";
|
|
144
144
|
import"../chunk-y2x2935j.js";
|
|
145
145
|
import"../chunk-fb3feg1e.js";
|
|
146
146
|
import"../chunk-yw9pyg66.js";
|
|
147
147
|
import"../chunk-ytzcxtpt.js";
|
|
148
148
|
import {
|
|
149
149
|
projectAgentThreadModelContext2
|
|
150
|
-
} from "../chunk-
|
|
151
|
-
import"../chunk-
|
|
150
|
+
} from "../chunk-ratj7t3t.js";
|
|
151
|
+
import"../chunk-57g0215c.js";
|
|
152
152
|
import"../chunk-de5sfbc3.js";
|
|
153
153
|
import"../chunk-5taem5aw.js";
|
|
154
154
|
import"../chunk-jftd33rc.js";
|
|
155
155
|
import {
|
|
156
156
|
workflowAgentStepActorId2
|
|
157
|
-
} from "../chunk-
|
|
157
|
+
} from "../chunk-t5daew4g.js";
|
|
158
158
|
import {
|
|
159
159
|
BrokerError2,
|
|
160
160
|
InMemoryBroker2
|
|
@@ -163,22 +163,22 @@ import {
|
|
|
163
163
|
QueueError2,
|
|
164
164
|
InMemoryQueues2
|
|
165
165
|
} from "../chunk-s3we74h8.js";
|
|
166
|
-
import"../chunk-
|
|
166
|
+
import"../chunk-j1ny5fwh.js";
|
|
167
167
|
import"../chunk-4zm1k3xj.js";
|
|
168
|
-
import"../chunk-
|
|
169
|
-
import"../chunk-
|
|
168
|
+
import"../chunk-nqnfz3jg.js";
|
|
169
|
+
import"../chunk-jjmggm9a.js";
|
|
170
170
|
import"../chunk-c69nj7se.js";
|
|
171
|
-
import"../chunk-
|
|
171
|
+
import"../chunk-w53trr0c.js";
|
|
172
172
|
import {
|
|
173
173
|
createTestingScope
|
|
174
174
|
} from "../chunk-m3qe54bb.js";
|
|
175
175
|
import"../chunk-8wsjr52f.js";
|
|
176
|
-
import"../chunk-
|
|
176
|
+
import"../chunk-h05rg3bx.js";
|
|
177
177
|
import {
|
|
178
178
|
SandboxNotRunningError2
|
|
179
179
|
} from "../chunk-r1cxq7vv.js";
|
|
180
180
|
import"../chunk-cgznz22f.js";
|
|
181
|
-
import"../chunk-
|
|
181
|
+
import"../chunk-epyfm23v.js";
|
|
182
182
|
import {
|
|
183
183
|
restoreTrustedPrimitiveExecutionScope
|
|
184
184
|
} from "../chunk-qbrmpgvv.js";
|
|
@@ -13334,7 +13334,8 @@ function runLakeChangesContractSuite(name, harness) {
|
|
|
13334
13334
|
});
|
|
13335
13335
|
test20("refuses blank identities and invalid column requests", async () => {
|
|
13336
13336
|
const first = await write([row(" ", "one")]);
|
|
13337
|
-
|
|
13337
|
+
const second = await write([row(" ", "two")]);
|
|
13338
|
+
expect20(await read(first, second)).toBeNull();
|
|
13338
13339
|
await expect20(read(first, first, [])).rejects.toThrow("distinct columns");
|
|
13339
13340
|
await expect20(read(first, first, ["missing"])).rejects.toThrow("distinct columns");
|
|
13340
13341
|
});
|
|
@@ -13648,6 +13649,62 @@ function runDatasetSequenceContract(options) {
|
|
|
13648
13649
|
await merge(storage, [change2.delete({ id: "42" }, { sequence: 11 })]);
|
|
13649
13650
|
expect21(await rows(storage)).toEqual([]);
|
|
13650
13651
|
}));
|
|
13652
|
+
test21("records a merge that only advances source ordering as changing no rows", () => withStorage(async (storage) => {
|
|
13653
|
+
const changed = (result) => ({
|
|
13654
|
+
outcome: result.outcome,
|
|
13655
|
+
rowsChanged: result.version?.rowsChanged,
|
|
13656
|
+
lineageChanged: result.version?.lineageChanged
|
|
13657
|
+
});
|
|
13658
|
+
expect21(changed(await merge(storage, [upsert(1)]))).toEqual({
|
|
13659
|
+
outcome: "created",
|
|
13660
|
+
rowsChanged: true,
|
|
13661
|
+
lineageChanged: true
|
|
13662
|
+
});
|
|
13663
|
+
const orderingOnly = await merge(storage, [change2.delete({ id: "7" }, { sequence: 3 })]);
|
|
13664
|
+
expect21(changed(orderingOnly)).toEqual({
|
|
13665
|
+
outcome: "created",
|
|
13666
|
+
rowsChanged: false,
|
|
13667
|
+
lineageChanged: false
|
|
13668
|
+
});
|
|
13669
|
+
expect21((await storage.getVersion(dataset.id, orderingOnly.version.versionId))?.rowsChanged).toBe(false);
|
|
13670
|
+
expect21(changed(await merge(storage, [upsert(2, "Ada")]))).toEqual({
|
|
13671
|
+
outcome: "created",
|
|
13672
|
+
rowsChanged: true,
|
|
13673
|
+
lineageChanged: false
|
|
13674
|
+
});
|
|
13675
|
+
}));
|
|
13676
|
+
test21("keeps a stored row that a newer delivery repeats with only its sequence changed", () => withStorage(async (storage) => {
|
|
13677
|
+
const stored = async () => (await rows(storage)).map((row) => ({ id: row.id, revision: String(row.revision), name: row.name })).sort((left, right) => String(left.id).localeCompare(String(right.id)));
|
|
13678
|
+
const changed = (result) => ({
|
|
13679
|
+
outcome: result.outcome,
|
|
13680
|
+
rowsChanged: result.version?.rowsChanged
|
|
13681
|
+
});
|
|
13682
|
+
await merge(storage, [upsert(10), upsert(1, "Lin", "7")]);
|
|
13683
|
+
expect21(changed(await merge(storage, [upsert(12)]))).toEqual({
|
|
13684
|
+
outcome: "created",
|
|
13685
|
+
rowsChanged: false
|
|
13686
|
+
});
|
|
13687
|
+
expect21(await stored()).toEqual([
|
|
13688
|
+
{ id: "42", revision: "10", name: "Sam" },
|
|
13689
|
+
{ id: "7", revision: "1", name: "Lin" }
|
|
13690
|
+
]);
|
|
13691
|
+
expect21((await merge(storage, [upsert(11, "Late")])).outcome).toBe("unchanged");
|
|
13692
|
+
expect21((await merge(storage, [upsert(12)])).outcome).toBe("unchanged");
|
|
13693
|
+
await expect21(merge(storage, [upsert(12, "Tie")])).rejects.toThrow("conflicting content");
|
|
13694
|
+
expect21(changed(await merge(storage, [upsert(13), upsert(2, "Grace", "7")]))).toEqual({
|
|
13695
|
+
outcome: "created",
|
|
13696
|
+
rowsChanged: true
|
|
13697
|
+
});
|
|
13698
|
+
expect21(await stored()).toEqual([
|
|
13699
|
+
{ id: "42", revision: "10", name: "Sam" },
|
|
13700
|
+
{ id: "7", revision: "2", name: "Grace" }
|
|
13701
|
+
]);
|
|
13702
|
+
expect21(changed(await merge(storage, [upsert(14, "Ada")]))).toEqual({
|
|
13703
|
+
outcome: "created",
|
|
13704
|
+
rowsChanged: true
|
|
13705
|
+
});
|
|
13706
|
+
expect21((await stored())[0]).toEqual({ id: "42", revision: "14", name: "Ada" });
|
|
13707
|
+
}));
|
|
13651
13708
|
test21("compares canonical content across JSON order and nullable representations", () => withStorage(async (storage) => {
|
|
13652
13709
|
await merge(storage, [
|
|
13653
13710
|
change2.upsert({ id: "42", revision: 1, name: "Sam", details: { a: 1, b: 2 } })
|
|
@@ -14002,6 +14059,7 @@ async function collectRows(rows) {
|
|
|
14002
14059
|
}
|
|
14003
14060
|
// src/testing/lake-storage-contract.ts
|
|
14004
14061
|
import { describe as describe23, expect as expect23, test as test23 } from "bun:test";
|
|
14062
|
+
import { randomUUID } from "crypto";
|
|
14005
14063
|
var definitionDataset = defineDataset2("contract.definitions.orders", {
|
|
14006
14064
|
schema: [col2("orderId", "string"), col2("customerName", "string")],
|
|
14007
14065
|
description: "Contract orders"
|
|
@@ -14828,6 +14886,85 @@ function runLakeStorageContractSuite(label, options) {
|
|
|
14828
14886
|
});
|
|
14829
14887
|
}));
|
|
14830
14888
|
});
|
|
14889
|
+
describe23("what a version changed", () => {
|
|
14890
|
+
const changed = (version) => ({
|
|
14891
|
+
rowsChanged: version?.rowsChanged,
|
|
14892
|
+
lineageChanged: version?.lineageChanged
|
|
14893
|
+
});
|
|
14894
|
+
test23("records whether a version changed rows or lineage, across reopening", async () => {
|
|
14895
|
+
let storage = await options.createStorage();
|
|
14896
|
+
try {
|
|
14897
|
+
await storage.createDataset(writeDataset);
|
|
14898
|
+
await storage.createDataset(definitionDataset);
|
|
14899
|
+
const inputVersion = async () => {
|
|
14900
|
+
const session = await storage.beginWrite({ dataset: definitionDataset });
|
|
14901
|
+
await session.writeRows([{ orderId: randomUUID(), customerName: "Input" }]);
|
|
14902
|
+
const version = await session.commit();
|
|
14903
|
+
return { datasetId: definitionDataset.id, versionId: version.versionId };
|
|
14904
|
+
};
|
|
14905
|
+
const rows = [{ orderId: "ord_1", customerName: "Ada" }];
|
|
14906
|
+
const commit = async (input, written = rows) => {
|
|
14907
|
+
const session = await storage.beginWrite({ dataset: writeDataset, ...input });
|
|
14908
|
+
await session.writeRows(written);
|
|
14909
|
+
const version = await session.commit();
|
|
14910
|
+
expect23(version.outcome).toBe("created");
|
|
14911
|
+
return version;
|
|
14912
|
+
};
|
|
14913
|
+
const first = await commit({ inputs: [await inputVersion()] });
|
|
14914
|
+
expect23(changed(first)).toEqual({ rowsChanged: true, lineageChanged: true });
|
|
14915
|
+
const provenanceOnly = await commit({ inputs: [await inputVersion()] });
|
|
14916
|
+
expect23(changed(provenanceOnly)).toEqual({ rowsChanged: false, lineageChanged: false });
|
|
14917
|
+
const lineageOnly = await commit({ producer: pipeline, lineage: copied });
|
|
14918
|
+
expect23(changed(lineageOnly)).toEqual({ rowsChanged: false, lineageChanged: true });
|
|
14919
|
+
const rowsOnly = await commit({ producer: pipeline, lineage: copied }, [
|
|
14920
|
+
{ orderId: "ord_2", customerName: "Grace" }
|
|
14921
|
+
]);
|
|
14922
|
+
expect23(changed(rowsOnly)).toEqual({ rowsChanged: true, lineageChanged: false });
|
|
14923
|
+
const emptyAppend = await commit({ producer: pipeline, lineage: copied, mode: "append", inputs: [await inputVersion()] }, []);
|
|
14924
|
+
expect23(changed(emptyAppend)).toEqual({ rowsChanged: false, lineageChanged: false });
|
|
14925
|
+
const append = await commit({ producer: pipeline, lineage: copied, mode: "append" }, [
|
|
14926
|
+
{ orderId: "ord_3", customerName: "Lin" }
|
|
14927
|
+
]);
|
|
14928
|
+
expect23(changed(append)).toEqual({ rowsChanged: true, lineageChanged: false });
|
|
14929
|
+
if (options.reopen)
|
|
14930
|
+
storage = await options.reopen(storage);
|
|
14931
|
+
const committed = [first, provenanceOnly, lineageOnly, rowsOnly, emptyAppend, append];
|
|
14932
|
+
const expected = Object.fromEntries(committed.map((v) => [v.versionId, changed(v)]));
|
|
14933
|
+
const listed = await storage.listVersions(writeDataset.id);
|
|
14934
|
+
expect23(Object.fromEntries(listed.map((v) => [v.versionId, changed(v)]))).toEqual(expected);
|
|
14935
|
+
for (const version of committed) {
|
|
14936
|
+
expect23(changed(await storage.getVersion(writeDataset.id, version.versionId))).toEqual(changed(version));
|
|
14937
|
+
}
|
|
14938
|
+
expect23(changed(await storage.getLatestVersion(writeDataset.id))).toEqual(changed(append));
|
|
14939
|
+
} finally {
|
|
14940
|
+
await options.teardown?.(storage);
|
|
14941
|
+
}
|
|
14942
|
+
});
|
|
14943
|
+
test23("a dataset's first version changes rows, even empty", () => withStorage(async (storage) => {
|
|
14944
|
+
await storage.createDataset(writeDataset);
|
|
14945
|
+
const session = await storage.beginWrite({ dataset: writeDataset });
|
|
14946
|
+
const first = await session.commit();
|
|
14947
|
+
expect23(changed(first)).toEqual({ rowsChanged: true, lineageChanged: true });
|
|
14948
|
+
}));
|
|
14949
|
+
test23("a schema change changes rows", () => withStorage(async (storage) => {
|
|
14950
|
+
if (schemaEvolution === "strict")
|
|
14951
|
+
return;
|
|
14952
|
+
const initial = defineDataset2("contract.changes.schema_evolution", {
|
|
14953
|
+
schema: [col2("invoiceId", "string")]
|
|
14954
|
+
});
|
|
14955
|
+
const widened = defineDataset2("contract.changes.schema_evolution", {
|
|
14956
|
+
schema: [col2("invoiceId", "string"), col2("currency", "string", { nullable: true })]
|
|
14957
|
+
});
|
|
14958
|
+
await storage.createDataset(initial);
|
|
14959
|
+
const session = await storage.beginWrite({ dataset: initial });
|
|
14960
|
+
await session.writeRows([{ invoiceId: "inv_1" }]);
|
|
14961
|
+
await session.commit();
|
|
14962
|
+
await storage.createDataset(widened);
|
|
14963
|
+
const [schemaVersion] = await storage.listVersions(initial.id, 1);
|
|
14964
|
+
expect23(schemaVersion?.mode).toBe("schema");
|
|
14965
|
+
expect23(changed(schemaVersion)).toEqual({ rowsChanged: true, lineageChanged: true });
|
|
14966
|
+
}));
|
|
14967
|
+
});
|
|
14831
14968
|
});
|
|
14832
14969
|
}
|
|
14833
14970
|
async function collectRows2(rows) {
|
|
@@ -22149,7 +22286,7 @@ function runQueueContractSuite(label, options) {
|
|
|
22149
22286
|
}
|
|
22150
22287
|
// src/testing/sandbox-credentials-contract.ts
|
|
22151
22288
|
import { afterAll, beforeAll, describe as describe31, expect as expect32, test as test32 } from "bun:test";
|
|
22152
|
-
import { randomUUID } from "crypto";
|
|
22289
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
22153
22290
|
function runSandboxCredentialsContractSuite(label, options) {
|
|
22154
22291
|
describe31(label, () => {
|
|
22155
22292
|
let server;
|
|
@@ -22208,7 +22345,7 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22208
22345
|
}
|
|
22209
22346
|
}
|
|
22210
22347
|
test32("a command reaches the origin with the credential added", async () => {
|
|
22211
|
-
const secret = `suite-${
|
|
22348
|
+
const secret = `suite-${randomUUID2()}`;
|
|
22212
22349
|
await withSandbox([credential(secret)], async (sandbox) => {
|
|
22213
22350
|
const seen = await request(sandbox, origin, "/api/whoami");
|
|
22214
22351
|
expect32(seen).toEqual({
|
|
@@ -22219,7 +22356,7 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22219
22356
|
});
|
|
22220
22357
|
});
|
|
22221
22358
|
test32("only a request the credential matches gets it, replacing the command's own", async () => {
|
|
22222
|
-
const secret = `suite-${
|
|
22359
|
+
const secret = `suite-${randomUUID2()}`;
|
|
22223
22360
|
await withSandbox([credential(secret)], async (sandbox) => {
|
|
22224
22361
|
expect32((await request(sandbox, origin, "/health")).authorization).toBeNull();
|
|
22225
22362
|
expect32((await request(sandbox, origin, "/api/x", { method: "DELETE" })).authorization).toBeNull();
|
|
@@ -22228,8 +22365,8 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22228
22365
|
});
|
|
22229
22366
|
});
|
|
22230
22367
|
test32("a credential reaches its own origin alone, whatever the paths it shares", async () => {
|
|
22231
|
-
const secret = `suite-${
|
|
22232
|
-
const otherSecret = `suite-${
|
|
22368
|
+
const secret = `suite-${randomUUID2()}`;
|
|
22369
|
+
const otherSecret = `suite-${randomUUID2()}`;
|
|
22233
22370
|
const credentials = [
|
|
22234
22371
|
credential(secret),
|
|
22235
22372
|
credential(otherSecret, { origin: otherOrigin, path: { prefix: "/api/v2/" } })
|
|
@@ -22242,8 +22379,8 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22242
22379
|
});
|
|
22243
22380
|
});
|
|
22244
22381
|
test32("setRequestCredentials replaces the credentials, and an empty list removes them", async () => {
|
|
22245
|
-
const first = `suite-${
|
|
22246
|
-
const second = `suite-${
|
|
22382
|
+
const first = `suite-${randomUUID2()}`;
|
|
22383
|
+
const second = `suite-${randomUUID2()}`;
|
|
22247
22384
|
await withSandbox([credential(first)], async (sandbox) => {
|
|
22248
22385
|
if (!sandbox.setRequestCredentials)
|
|
22249
22386
|
throw new Error("setRequestCredentials is missing");
|
|
@@ -22254,8 +22391,8 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22254
22391
|
});
|
|
22255
22392
|
});
|
|
22256
22393
|
test32.skipIf(options.separatesSandboxes === false)("a sandbox's commands can't use another sandbox's credentials", async () => {
|
|
22257
|
-
const secretA = `suite-${
|
|
22258
|
-
const secretB = `suite-${
|
|
22394
|
+
const secretA = `suite-${randomUUID2()}`;
|
|
22395
|
+
const secretB = `suite-${randomUUID2()}`;
|
|
22259
22396
|
await withSandbox([credential(secretA)], async (a) => {
|
|
22260
22397
|
if (!a.credentialedUrl)
|
|
22261
22398
|
throw new Error("credentialedUrl is missing");
|
|
@@ -22269,7 +22406,7 @@ function runSandboxCredentialsContractSuite(label, options) {
|
|
|
22269
22406
|
expect32(received).not.toContain(`Bearer ${secretA}`);
|
|
22270
22407
|
});
|
|
22271
22408
|
test32("nothing a command can read holds the credential", async () => {
|
|
22272
|
-
const secret = `suite-${
|
|
22409
|
+
const secret = `suite-${randomUUID2()}`;
|
|
22273
22410
|
await withSandbox([credential(secret)], async (sandbox) => {
|
|
22274
22411
|
const looked = await sandbox.runCommand("bash", [
|
|
22275
22412
|
"-c",
|
|
@@ -24272,4 +24409,4 @@ export {
|
|
|
24272
24409
|
startTestWebhookRun
|
|
24273
24410
|
};
|
|
24274
24411
|
|
|
24275
|
-
//# debugId=
|
|
24412
|
+
//# debugId=41EE842525691F8864756E2164756E21
|