niceeval 0.16.3-canary.99 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/bootstrap.cjs +7 -1
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/project-configuration.cjs +8 -11
- package/dist/cli/project-configuration.cjs.map +1 -1
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +1 -0
- package/dist/expect/index.d.mts +1 -0
- package/dist/expect/index.d.ts +1 -0
- package/dist/experiment/host/cli/contribution.cjs +6 -11
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +0 -16
- package/dist/experiment/host/cli/contribution.d.mts +0 -16
- package/dist/experiment/host/cli/contribution.d.ts +0 -16
- package/dist/experiment/host/operations.cjs +3 -3
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +0 -4
- package/dist/experiment/host/types.d.mts +0 -4
- package/dist/experiment/host/types.d.ts +0 -4
- package/dist/fresh-import.cjs +2 -2
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/fresh-import.d.cts +3 -3
- package/dist/fresh-import.d.mts +3 -3
- package/dist/fresh-import.d.ts +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/inspection/codec.cjs.map +1 -1
- package/dist/inspection/codec.d.cts +1 -1
- package/dist/inspection/codec.d.mts +1 -1
- package/dist/inspection/codec.d.ts +1 -1
- package/dist/inspection/facts.cjs +66 -9
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/facts.d.cts +4 -0
- package/dist/inspection/facts.d.mts +4 -0
- package/dist/inspection/facts.d.ts +4 -0
- package/dist/inspection/facts.js +4 -2
- package/dist/inspection/index.cjs +1 -3
- package/dist/inspection/index.cjs.map +1 -1
- package/dist/inspection/index.d.cts +1 -1
- package/dist/inspection/index.d.mts +1 -1
- package/dist/inspection/index.d.ts +1 -1
- package/dist/inspection/index.js +44 -48
- package/dist/inspection/limits.cjs +3 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +2 -0
- package/dist/inspection/limits.d.mts +2 -0
- package/dist/inspection/limits.d.ts +2 -0
- package/dist/inspection/limits.js +6 -4
- package/dist/inspection/project-source.cjs +4 -1
- package/dist/inspection/project-source.cjs.map +1 -1
- package/dist/inspection/protocol.cjs +10 -18
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +111 -173
- package/dist/inspection/protocol.d.mts +111 -173
- package/dist/inspection/protocol.d.ts +111 -173
- package/dist/inspection/public.mjs +73 -109
- package/dist/inspection/results.cjs +12 -48
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +124 -122
- package/dist/inspection/results.d.mts +124 -122
- package/dist/inspection/results.d.ts +124 -122
- package/dist/inspection/results.js +16 -20
- package/dist/inspection/select.cjs +80 -117
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +14 -15
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/source.d.cts +6 -3
- package/dist/inspection/source.d.mts +6 -3
- package/dist/inspection/source.d.ts +6 -3
- package/dist/inspection/trace.cjs +1 -1
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/load-config.cjs +17 -11
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +3 -2
- package/dist/load-config.d.mts +3 -2
- package/dist/load-config.d.ts +3 -2
- package/dist/o11y/adapter-usage-projection.cjs +5 -1
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
- package/dist/o11y/adapter-usage-projection.d.cts +109 -1
- package/dist/o11y/adapter-usage-projection.d.mts +109 -1
- package/dist/o11y/adapter-usage-projection.d.ts +109 -1
- package/dist/o11y/cache-read.cjs +113 -0
- package/dist/o11y/cache-read.cjs.map +1 -0
- package/dist/o11y/cache-read.d.cts +80 -0
- package/dist/o11y/cache-read.d.mts +80 -0
- package/dist/o11y/cache-read.d.ts +80 -0
- package/dist/o11y/cache-read.js +8 -0
- package/dist/o11y/cache-read.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +4 -1
- package/dist/o11y/eval-usage.cjs.map +1 -1
- package/dist/o11y/eval-usage.d.cts +4 -1
- package/dist/o11y/eval-usage.d.mts +4 -1
- package/dist/o11y/eval-usage.d.ts +4 -1
- package/dist/record/host/sqlite-host.cjs +188 -53
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/sqlite-host.d.cts +37 -1
- package/dist/record/host/sqlite-host.d.mts +37 -1
- package/dist/record/host/sqlite-host.d.ts +37 -1
- package/dist/record/host/sqlite-host.js +16 -8
- package/dist/record/maintenance/runtime.cjs +3 -3
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/sqlite/admission-repository.cjs +18 -18
- package/dist/record/sqlite/admission-repository.cjs.map +1 -1
- package/dist/record/sqlite/case-repository.cjs +6 -6
- package/dist/record/sqlite/case-repository.cjs.map +1 -1
- package/dist/record/sqlite/coordination-repository.cjs +25 -25
- package/dist/record/sqlite/coordination-repository.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.cjs +115 -111
- package/dist/record/sqlite/current-schema.cjs.map +1 -1
- package/dist/record/sqlite/current-schema.d.cts +3 -3
- package/dist/record/sqlite/current-schema.d.mts +3 -3
- package/dist/record/sqlite/current-schema.d.ts +3 -3
- package/dist/record/sqlite/database.cjs +56 -53
- package/dist/record/sqlite/database.cjs.map +1 -1
- package/dist/record/sqlite/index.cjs +3 -1
- package/dist/record/sqlite/index.cjs.map +1 -1
- package/dist/record/sqlite/index.d.cts +5 -2
- package/dist/record/sqlite/index.d.mts +5 -2
- package/dist/record/sqlite/index.d.ts +5 -2
- package/dist/record/sqlite/legacy-schema-018.cjs +443 -0
- package/dist/record/sqlite/legacy-schema-018.cjs.map +1 -0
- package/dist/record/sqlite/legacy-schema-018.d.cts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.mts +6 -0
- package/dist/record/sqlite/legacy-schema-018.d.ts +6 -0
- package/dist/record/sqlite/legacy-schema-018.js +6 -0
- package/dist/record/sqlite/legacy-schema-018.js.map +1 -0
- package/dist/record/sqlite/migration.cjs +105 -46
- package/dist/record/sqlite/migration.cjs.map +1 -1
- package/dist/record/sqlite/migration.d.cts +2 -1
- package/dist/record/sqlite/migration.d.mts +2 -1
- package/dist/record/sqlite/migration.d.ts +2 -1
- package/dist/record/sqlite/portable-capture.cjs +13 -13
- package/dist/record/sqlite/portable-capture.cjs.map +1 -1
- package/dist/record/sqlite/registry-repository.cjs +22 -22
- package/dist/record/sqlite/registry-repository.cjs.map +1 -1
- package/dist/record/sqlite/schema.cjs +10 -2
- package/dist/record/sqlite/schema.cjs.map +1 -1
- package/dist/record/sqlite/schema.d.cts +4 -1
- package/dist/record/sqlite/schema.d.mts +4 -1
- package/dist/record/sqlite/schema.d.ts +4 -1
- package/dist/record/sqlite/schema.js +20 -14
- package/dist/record/sqlite/storage-worker.cjs +1 -1
- package/dist/record/sqlite/storage-worker.cjs.map +1 -1
- package/dist/record/sqlite/storage.cjs +316 -232
- package/dist/record/sqlite/storage.cjs.map +1 -1
- package/dist/record/sqlite/storage.d.cts +10 -2
- package/dist/record/sqlite/storage.d.mts +10 -2
- package/dist/record/sqlite/storage.d.ts +10 -2
- package/dist/record/sqlite/storage.js +54 -50
- package/dist/record/sqlite/types.cjs +1 -1
- package/dist/record/sqlite/types.cjs.map +1 -1
- package/dist/record/sqlite/types.d.cts +13 -1
- package/dist/record/sqlite/types.d.mts +13 -1
- package/dist/record/sqlite/types.d.ts +13 -1
- package/dist/run/cli/contribution.cjs +17 -12
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/lifecycle-adapter.cjs +1 -1
- package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
- package/dist/run/storage/owner-identity.cjs +78 -16
- package/dist/run/storage/owner-identity.cjs.map +1 -1
- package/dist/run/storage/owner-identity.d.cts +2 -1
- package/dist/run/storage/owner-identity.d.mts +2 -1
- package/dist/run/storage/owner-identity.d.ts +2 -1
- package/dist/run/storage/sqlite.cjs +55 -55
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/accept.cjs +12 -42
- package/dist/runner/accept.cjs.map +1 -1
- package/dist/runner/accept.d.cts +2 -3
- package/dist/runner/accept.d.mts +2 -3
- package/dist/runner/accept.d.ts +2 -3
- package/dist/runner/adapter-usage.cjs +2 -2
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adoption.cjs +14 -26
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/adoption.d.cts +5 -13
- package/dist/runner/adoption.d.mts +5 -13
- package/dist/runner/adoption.d.ts +5 -13
- package/dist/runner/adoption.js +2 -4
- package/dist/runner/record.cjs +24 -18
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/rename-experiment.cjs +5 -7
- package/dist/runner/rename-experiment.cjs.map +1 -1
- package/dist/runner/reuse-plan.cjs +37 -18
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +4 -1
- package/dist/runner/reuse-plan.d.mts +4 -1
- package/dist/runner/reuse-plan.d.ts +4 -1
- package/dist/runner/setup-prefix-plan.cjs +17 -12
- package/dist/runner/setup-prefix-plan.cjs.map +1 -1
- package/dist/runner/setup-prefix-plan.d.cts +0 -2
- package/dist/runner/setup-prefix-plan.d.mts +0 -2
- package/dist/runner/setup-prefix-plan.d.ts +0 -2
- package/dist/runner/setup-prefix-plan.js +8 -12
- package/dist/sandbox/backend.cjs +10 -1
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +16 -8
- package/dist/sandbox/backend.d.mts +16 -8
- package/dist/sandbox/backend.d.ts +16 -8
- package/dist/sandbox/backend.js +28 -26
- package/dist/sandbox/docker.cjs +7 -1
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.cjs +13 -3
- package/dist/sandbox/e2b-cache-repository.cjs.map +1 -1
- package/dist/sandbox/e2b-cache-repository.d.cts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.mts +3 -0
- package/dist/sandbox/e2b-cache-repository.d.ts +3 -0
- package/dist/sandbox/e2b-cache-repository.js +16 -12
- package/dist/sandbox/e2b.cjs +2 -2
- package/dist/sandbox/e2b.cjs.map +1 -1
- package/dist/sandbox/incus/materialize.cjs +1 -1
- package/dist/sandbox/incus/materialize.cjs.map +1 -1
- package/dist/show/contribution.cjs +3 -3
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/model.cjs +14 -13
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +7 -7
- package/dist/show/model.d.mts +7 -7
- package/dist/show/model.d.ts +7 -7
- package/dist/show/render.cjs +14 -0
- package/dist/show/render.cjs.map +1 -1
- package/dist/user-database/storage-worker.cjs +13 -3
- package/dist/user-database/storage-worker.cjs.map +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-CmVoXbwG.js → index-B3ijZRph.js} +17 -17
- package/dist/view/app-dist/assets/{quality-cost-scatter-BuLISaH4.js → quality-cost-scatter-B--DfJ9s.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/application-runtime.cjs +8 -0
- package/dist/view/application-runtime.cjs.map +1 -0
- package/dist/view/application-runtime.d.cts +9 -0
- package/dist/view/application-runtime.d.mts +9 -0
- package/dist/view/application-runtime.d.ts +9 -0
- package/dist/view/application-runtime.js +6 -0
- package/dist/view/application-runtime.js.map +1 -0
- package/dist/view/cli/contribution.cjs +5 -2
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +1019 -456
- package/dist/view/http-protocol.d.cts +1 -9
- package/dist/view/http-protocol.d.mts +1 -9
- package/dist/view/http-protocol.d.ts +1 -9
- package/dist/view/inspection-host.cjs +39 -30
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/inspection-host.d.cts +7545 -2
- package/dist/view/inspection-host.d.mts +7545 -2
- package/dist/view/inspection-host.d.ts +7545 -2
- package/dist/view/server.cjs +8 -5
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +4 -2
- package/dist/view/server.d.mts +4 -2
- package/dist/view/server.d.ts +4 -2
- package/docs-site/zh/reference/cli.mdx +1 -2
- package/docs-site/zh/tutorials/control-run-cost.mdx +22 -0
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +21 -0
- package/package.json +1 -1
|
@@ -98,13 +98,13 @@ function requireClosure(bytes, digest) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
function metadataGeneration(connection) {
|
|
101
|
-
const row = (0, database_ts_1.recordStatement)(connection, "SELECT storage_generation FROM
|
|
101
|
+
const row = (0, database_ts_1.recordStatement)(connection, "SELECT storage_generation FROM ne19_record_metadata WHERE singleton=1").get();
|
|
102
102
|
if (row === undefined)
|
|
103
103
|
throw invalid("ProjectDatabase storage generation is missing");
|
|
104
104
|
return text(row, "storage_generation");
|
|
105
105
|
}
|
|
106
106
|
function currentRevision(connection) {
|
|
107
|
-
const row = (0, database_ts_1.recordStatement)(connection, "SELECT revision FROM
|
|
107
|
+
const row = (0, database_ts_1.recordStatement)(connection, "SELECT revision FROM ne19_run_publication_clock WHERE singleton=1").get();
|
|
108
108
|
if (row === undefined)
|
|
109
109
|
throw invalid("Run publication clock is missing");
|
|
110
110
|
return integer(row, "revision");
|
|
@@ -113,7 +113,7 @@ function cutoffAt(connection, revision) {
|
|
|
113
113
|
return Object.freeze({ storeGeneration: metadataGeneration(connection), revision });
|
|
114
114
|
}
|
|
115
115
|
function nextRevision(connection) {
|
|
116
|
-
const changed = (0, database_ts_1.recordStatement)(connection, "UPDATE
|
|
116
|
+
const changed = (0, database_ts_1.recordStatement)(connection, "UPDATE ne19_run_publication_clock SET revision=revision+1 WHERE singleton=1").run();
|
|
117
117
|
if (Number(changed.changes) !== 1)
|
|
118
118
|
throw invalid("Run publication clock could not advance");
|
|
119
119
|
return currentRevision(connection);
|
|
@@ -130,7 +130,7 @@ function requireCutoff(connection, requested) {
|
|
|
130
130
|
}
|
|
131
131
|
function runHeader(connection, runId) {
|
|
132
132
|
const row = (0, database_ts_1.recordStatement)(connection, `SELECT run_id,current_writer_generation,terminal_state,created_revision,close_revision
|
|
133
|
-
FROM
|
|
133
|
+
FROM ne19_run_resources WHERE run_id=?`).get(runId);
|
|
134
134
|
if (row === undefined)
|
|
135
135
|
return undefined;
|
|
136
136
|
const terminalState = optionalText(row, "terminal_state");
|
|
@@ -145,7 +145,7 @@ function runHeader(connection, runId) {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
function requireActiveWriter(connection, runId, writerGeneration) {
|
|
148
|
-
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM
|
|
148
|
+
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM ne19_record_metadata WHERE singleton=1").get();
|
|
149
149
|
if (barrier === undefined || text(barrier, "barrier_state") !== "open") {
|
|
150
150
|
throw new errors_ts_2.RunStorageError("run-not-active", "ProjectDatabase writer barrier is not open");
|
|
151
151
|
}
|
|
@@ -160,15 +160,15 @@ function requireActiveWriter(connection, runId, writerGeneration) {
|
|
|
160
160
|
return run;
|
|
161
161
|
}
|
|
162
162
|
function slotExists(connection, runId, slotId) {
|
|
163
|
-
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM
|
|
163
|
+
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM ne19_run_expected_slots WHERE run_id=? AND slot_id=?")
|
|
164
164
|
.get(runId, slotId) !== undefined;
|
|
165
165
|
}
|
|
166
166
|
function slotBound(connection, runId, slotId) {
|
|
167
|
-
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM
|
|
167
|
+
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM ne19_run_slot_bindings WHERE target_run_id=? AND slot_id=?")
|
|
168
168
|
.get(runId, slotId) !== undefined;
|
|
169
169
|
}
|
|
170
170
|
function sourceDeleted(connection, runId) {
|
|
171
|
-
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM
|
|
171
|
+
return (0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM ne19_run_deletion_tombstones WHERE run_id=?").get(runId) !== undefined;
|
|
172
172
|
}
|
|
173
173
|
function validateExpectedSlots(slots) {
|
|
174
174
|
if (slots.length > types_ts_1.RECORD_SQLITE_MAX_ROW_BYTES / 256) {
|
|
@@ -201,7 +201,7 @@ function createRunResourceOnConnection(connection, input) {
|
|
|
201
201
|
requireIsoInstant(input.startedAt, "startedAt");
|
|
202
202
|
validateExpectedSlots(input.expectedSlots);
|
|
203
203
|
return (0, transaction_ts_1.withImmediateTransaction)(connection, input.deadlineEpochMs, "create-run-resource", () => {
|
|
204
|
-
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM
|
|
204
|
+
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM ne19_record_metadata WHERE singleton=1").get();
|
|
205
205
|
if (barrier === undefined || text(barrier, "barrier_state") !== "open") {
|
|
206
206
|
throw new errors_ts_2.RunStorageError("run-not-active", "ProjectDatabase writer barrier is not open");
|
|
207
207
|
}
|
|
@@ -209,10 +209,10 @@ function createRunResourceOnConnection(connection, input) {
|
|
|
209
209
|
throw new errors_ts_2.RunStorageError("run-storage-invalid", `Run ${input.runId} already exists`);
|
|
210
210
|
}
|
|
211
211
|
const revision = nextRevision(connection);
|
|
212
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
212
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_resources(run_id,invocation_id,experiment_id,started_at,
|
|
213
213
|
initial_writer_generation,current_writer_generation,terminal_state,completed_at,created_revision,close_revision)
|
|
214
214
|
VALUES (?,?,?,?,?,?,NULL,NULL,?,NULL)`).run(input.runId, input.invocationId, input.experimentId, input.startedAt, input.writerGeneration, input.writerGeneration, revision);
|
|
215
|
-
const insertSlot = (0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
215
|
+
const insertSlot = (0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_expected_slots(run_id,slot_id,ordinal,eval_id,
|
|
216
216
|
attempt_ordinal,execution_identity_digest) VALUES (?,?,?,?,?,?)`);
|
|
217
217
|
input.expectedSlots.forEach((slot, ordinal) => insertSlot.run(input.runId, slot.slotId, ordinal, slot.evalId, slot.attemptOrdinal, slot.executionIdentityDigest));
|
|
218
218
|
return Object.freeze({ runId: input.runId, cutoff: cutoffAt(connection, revision) });
|
|
@@ -237,13 +237,13 @@ function publishOriginAttemptOnConnection(connection, input) {
|
|
|
237
237
|
if (slotBound(connection, input.runId, input.slotId)) {
|
|
238
238
|
throw new errors_ts_2.RunStorageError("slot-already-bound", `Run ${input.runId} slot ${input.slotId} is already bound`);
|
|
239
239
|
}
|
|
240
|
-
if ((0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM
|
|
240
|
+
if ((0, database_ts_1.recordStatement)(connection, "SELECT 1 AS present FROM ne19_attempt_publications WHERE attempt_id=?").get(input.attemptId) !== undefined) {
|
|
241
241
|
throw new errors_ts_2.RunStorageError("attempt-already-published", `Attempt ${input.attemptId} is already published`);
|
|
242
242
|
}
|
|
243
243
|
const aggregate = (0, database_ts_1.recordStatement)(connection, `SELECT r.status,r.writer_generation,a.attempt_locator,a.publication_state,a.core_payload,a.core_digest,
|
|
244
|
-
m.slot_id AS member_slot FROM
|
|
245
|
-
JOIN
|
|
246
|
-
JOIN
|
|
244
|
+
m.slot_id AS member_slot FROM ne19_runs r
|
|
245
|
+
JOIN ne19_attempts a ON a.origin_run_id=r.run_id AND a.attempt_id=?
|
|
246
|
+
JOIN ne19_members m ON m.target_run_id=r.run_id AND m.slot_id=? AND m.origin_run_id=r.run_id AND m.attempt_id=a.attempt_id
|
|
247
247
|
WHERE r.run_id=?`).get(input.attemptId, input.slotId, input.runId);
|
|
248
248
|
if (aggregate === undefined || text(aggregate, "writer_generation") !== input.writerGeneration ||
|
|
249
249
|
(text(aggregate, "status") !== "open" && text(aggregate, "status") !== "sealing") ||
|
|
@@ -252,8 +252,8 @@ function publishOriginAttemptOnConnection(connection, input) {
|
|
|
252
252
|
typeof aggregate.core_digest !== "string") {
|
|
253
253
|
throw new errors_ts_2.RunStorageError("run-storage-invalid", "Attempt aggregate is not complete at its publication fence");
|
|
254
254
|
}
|
|
255
|
-
const incomplete = (0, database_ts_1.recordStatement)(connection, `SELECT count(*) AS count FROM
|
|
256
|
-
LEFT JOIN
|
|
255
|
+
const incomplete = (0, database_ts_1.recordStatement)(connection, `SELECT count(*) AS count FROM ne19_attachments a
|
|
256
|
+
LEFT JOIN ne19_contents c ON c.attachment_id=a.attachment_id
|
|
257
257
|
WHERE a.owner_run_id=? AND a.owner_attempt_id=? AND
|
|
258
258
|
(a.logical_identity IS NULL OR a.canonical_payload IS NULL OR a.canonical_digest IS NULL OR
|
|
259
259
|
a.logical_inventory IS NULL OR a.inventory_digest IS NULL OR
|
|
@@ -262,17 +262,17 @@ function publishOriginAttemptOnConnection(connection, input) {
|
|
|
262
262
|
if (integer(incomplete, "count") !== 0) {
|
|
263
263
|
throw new errors_ts_2.RunStorageError("run-storage-invalid", "Attempt attachment closure is incomplete at its publication fence");
|
|
264
264
|
}
|
|
265
|
-
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM
|
|
265
|
+
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM ne19_record_metadata WHERE singleton=1").get();
|
|
266
266
|
if (barrier === undefined || text(barrier, "barrier_state") !== "open") {
|
|
267
267
|
throw new errors_ts_2.RunStorageError("run-not-active", "ProjectDatabase portable barrier is not open");
|
|
268
268
|
}
|
|
269
269
|
const revision = nextRevision(connection);
|
|
270
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
270
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_attempt_publications(attempt_id,attempt_locator,origin_run_id,origin_slot_id,
|
|
271
271
|
closure_payload,closure_digest,published_revision) VALUES (?,?,?,?,?,?,?)`).run(input.attemptId, input.attemptLocator, input.runId, input.slotId, input.closureBytes, input.closureDigest, revision);
|
|
272
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
272
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_slot_bindings(target_run_id,slot_id,attempt_id,origin_run_id,
|
|
273
273
|
origin_slot_id,attempt_publication_revision,action,binding_revision) VALUES (?,?,?,?,?,?,'executed',?)`).run(input.runId, input.slotId, input.attemptId, input.runId, input.slotId, revision, revision);
|
|
274
274
|
const publicationIdentity = Object.freeze({ originRunId: input.runId, attemptId: input.attemptId, revision });
|
|
275
|
-
const frozen = (0, database_ts_1.recordStatement)(connection, `UPDATE
|
|
275
|
+
const frozen = (0, database_ts_1.recordStatement)(connection, `UPDATE ne19_attempts SET publication_state='published'
|
|
276
276
|
WHERE origin_run_id=? AND attempt_id=? AND publication_state='sealing'`).run(input.runId, input.attemptId);
|
|
277
277
|
if (Number(frozen.changes) !== 1) {
|
|
278
278
|
throw new errors_ts_2.RunStorageError("run-storage-invalid", "Attempt publication fence changed before freeze");
|
|
@@ -304,7 +304,7 @@ function bindAttemptReferenceOnConnection(connection, input) {
|
|
|
304
304
|
if (slotBound(connection, input.runId, input.slotId)) {
|
|
305
305
|
throw new errors_ts_2.RunStorageError("slot-already-bound", `Run ${input.runId} slot ${input.slotId} is already bound`);
|
|
306
306
|
}
|
|
307
|
-
const source = (0, database_ts_1.recordStatement)(connection, `SELECT origin_run_id,origin_slot_id,published_revision FROM
|
|
307
|
+
const source = (0, database_ts_1.recordStatement)(connection, `SELECT origin_run_id,origin_slot_id,published_revision FROM ne19_attempt_publications
|
|
308
308
|
WHERE attempt_id=?`).get(input.publicationIdentity.attemptId);
|
|
309
309
|
if (source === undefined || text(source, "origin_run_id") !== input.publicationIdentity.originRunId ||
|
|
310
310
|
integer(source, "published_revision") !== input.publicationIdentity.revision) {
|
|
@@ -314,7 +314,7 @@ function bindAttemptReferenceOnConnection(connection, input) {
|
|
|
314
314
|
throw new errors_ts_2.RunStorageError("source-run-deleted", `Origin Run ${input.publicationIdentity.originRunId} is deleted`);
|
|
315
315
|
}
|
|
316
316
|
const revision = nextRevision(connection);
|
|
317
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
317
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_slot_bindings(target_run_id,slot_id,attempt_id,origin_run_id,
|
|
318
318
|
origin_slot_id,attempt_publication_revision,action,binding_revision) VALUES (?,?,?,?,?,?,?,?)`).run(input.runId, input.slotId, input.publicationIdentity.attemptId, input.publicationIdentity.originRunId, text(source, "origin_slot_id"), input.publicationIdentity.revision, input.action, revision);
|
|
319
319
|
return Object.freeze({
|
|
320
320
|
runId: input.runId,
|
|
@@ -325,8 +325,8 @@ function bindAttemptReferenceOnConnection(connection, input) {
|
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
function pendingSlotIds(connection, runId) {
|
|
328
|
-
const rows = (0, database_ts_1.recordStatement)(connection, `SELECT s.slot_id FROM
|
|
329
|
-
LEFT JOIN
|
|
328
|
+
const rows = (0, database_ts_1.recordStatement)(connection, `SELECT s.slot_id FROM ne19_run_expected_slots s
|
|
329
|
+
LEFT JOIN ne19_run_slot_bindings b ON b.target_run_id=s.run_id AND b.slot_id=s.slot_id
|
|
330
330
|
WHERE s.run_id=? AND b.slot_id IS NULL ORDER BY s.ordinal`).all(runId);
|
|
331
331
|
return Object.freeze(rows.map((row) => text(row, "slot_id")));
|
|
332
332
|
}
|
|
@@ -346,7 +346,7 @@ function validateAbsenceClosure(connection, runId, absences) {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
function insertAbsences(connection, runId, revision, absences) {
|
|
349
|
-
const insert = (0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
349
|
+
const insert = (0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_slot_absences(run_id,slot_id,reason,absence_revision)
|
|
350
350
|
VALUES (?,?,?,?)`);
|
|
351
351
|
for (const absence of absences)
|
|
352
352
|
insert.run(runId, absence.slotId, absence.reason, revision);
|
|
@@ -360,19 +360,19 @@ function closeRunResourceOnConnection(connection, input) {
|
|
|
360
360
|
return (0, transaction_ts_1.withImmediateTransaction)(connection, input.deadlineEpochMs, "close-run-resource", () => {
|
|
361
361
|
requireActiveWriter(connection, input.runId, input.writerGeneration);
|
|
362
362
|
validateAbsenceClosure(connection, input.runId, input.absences);
|
|
363
|
-
const aggregate = (0, database_ts_1.recordStatement)(connection, "SELECT status,writer_generation FROM
|
|
363
|
+
const aggregate = (0, database_ts_1.recordStatement)(connection, "SELECT status,writer_generation FROM ne19_runs WHERE run_id=?")
|
|
364
364
|
.get(input.runId);
|
|
365
365
|
if (aggregate === undefined || text(aggregate, "status") !== "sealed" ||
|
|
366
366
|
text(aggregate, "writer_generation") !== input.writerGeneration) {
|
|
367
367
|
throw new errors_ts_2.RunStorageError("run-storage-invalid", `Run ${input.runId} aggregate is not sealed at close`);
|
|
368
368
|
}
|
|
369
|
-
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM
|
|
369
|
+
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM ne19_record_metadata WHERE singleton=1").get();
|
|
370
370
|
if (barrier === undefined || text(barrier, "barrier_state") !== "open") {
|
|
371
371
|
throw new errors_ts_2.RunStorageError("run-not-active", "ProjectDatabase portable barrier is not open");
|
|
372
372
|
}
|
|
373
373
|
const revision = nextRevision(connection);
|
|
374
374
|
insertAbsences(connection, input.runId, revision, input.absences);
|
|
375
|
-
const changed = (0, database_ts_1.recordStatement)(connection, `UPDATE
|
|
375
|
+
const changed = (0, database_ts_1.recordStatement)(connection, `UPDATE ne19_run_resources SET terminal_state=?,completed_at=?,close_revision=?
|
|
376
376
|
WHERE run_id=? AND terminal_state IS NULL AND current_writer_generation=?`).run(input.state, input.completedAt, revision, input.runId, input.writerGeneration);
|
|
377
377
|
if (Number(changed.changes) !== 1)
|
|
378
378
|
throw new errors_ts_2.RunStorageError("run-not-active", `Run ${input.runId} changed before close`);
|
|
@@ -400,20 +400,20 @@ function recoverRunResourceOnConnection(connection, input) {
|
|
|
400
400
|
}));
|
|
401
401
|
const revision = nextRevision(connection);
|
|
402
402
|
insertAbsences(connection, input.runId, revision, absences);
|
|
403
|
-
const changed = (0, database_ts_1.recordStatement)(connection, `UPDATE
|
|
403
|
+
const changed = (0, database_ts_1.recordStatement)(connection, `UPDATE ne19_run_resources SET current_writer_generation=?,terminal_state='interrupted',
|
|
404
404
|
completed_at=?,close_revision=? WHERE run_id=? AND terminal_state IS NULL AND current_writer_generation=?`).run(input.recoveryWriterGeneration, input.completedAt, revision, input.runId, input.expectedWriterGeneration);
|
|
405
405
|
if (Number(changed.changes) !== 1) {
|
|
406
406
|
throw new errors_ts_2.RunStorageError("writer-generation-mismatch", `Run ${input.runId} changed before recovery fence`);
|
|
407
407
|
}
|
|
408
|
-
(0, database_ts_1.recordStatement)(connection, `DELETE FROM
|
|
409
|
-
(owner_kind='run' OR owner_attempt_id NOT IN (SELECT attempt_id FROM
|
|
408
|
+
(0, database_ts_1.recordStatement)(connection, `DELETE FROM ne19_attachments WHERE owner_run_id=? AND
|
|
409
|
+
(owner_kind='run' OR owner_attempt_id NOT IN (SELECT attempt_id FROM ne19_attempt_publications WHERE origin_run_id=?))`)
|
|
410
410
|
.run(input.runId, input.runId);
|
|
411
|
-
(0, database_ts_1.recordStatement)(connection, `DELETE FROM
|
|
412
|
-
(attempt_id IS NULL OR attempt_id NOT IN (SELECT attempt_id FROM
|
|
411
|
+
(0, database_ts_1.recordStatement)(connection, `DELETE FROM ne19_members WHERE target_run_id=? AND
|
|
412
|
+
(attempt_id IS NULL OR attempt_id NOT IN (SELECT attempt_id FROM ne19_attempt_publications WHERE origin_run_id=?))`)
|
|
413
413
|
.run(input.runId, input.runId);
|
|
414
|
-
(0, database_ts_1.recordStatement)(connection, `DELETE FROM
|
|
415
|
-
attempt_id NOT IN (SELECT attempt_id FROM
|
|
416
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
414
|
+
(0, database_ts_1.recordStatement)(connection, `DELETE FROM ne19_attempts WHERE origin_run_id=? AND
|
|
415
|
+
attempt_id NOT IN (SELECT attempt_id FROM ne19_attempt_publications WHERE origin_run_id=?)`).run(input.runId, input.runId);
|
|
416
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_recoveries(run_id,previous_writer_generation,recovery_writer_generation,
|
|
417
417
|
evidence_kind,evidence_identity,evidence_observed_at,recovery_revision) VALUES (?,?,?,?,?,?,?)`).run(input.runId, input.expectedWriterGeneration, input.recoveryWriterGeneration, input.evidence.kind, input.evidence.identity, input.evidence.observedAt, revision);
|
|
418
418
|
return Object.freeze({
|
|
419
419
|
runId: input.runId,
|
|
@@ -426,8 +426,8 @@ function recoverRunResourceOnConnection(connection, input) {
|
|
|
426
426
|
}
|
|
427
427
|
function incomingReferences(connection, originRunId) {
|
|
428
428
|
const rows = (0, database_ts_1.recordStatement)(connection, `SELECT b.target_run_id,b.slot_id,b.attempt_id,a.attempt_locator
|
|
429
|
-
FROM
|
|
430
|
-
LEFT JOIN
|
|
429
|
+
FROM ne19_run_slot_bindings b JOIN ne19_attempt_publications a ON a.attempt_id=b.attempt_id
|
|
430
|
+
LEFT JOIN ne19_run_deletion_tombstones d ON d.run_id=b.target_run_id
|
|
431
431
|
WHERE b.origin_run_id=? AND b.target_run_id<>? AND d.run_id IS NULL
|
|
432
432
|
ORDER BY b.target_run_id,b.slot_id,b.attempt_id LIMIT ?`).all(originRunId, originRunId, Math.trunc(types_ts_1.RECORD_SQLITE_MAX_ROW_BYTES / 256) + 1);
|
|
433
433
|
if (rows.length > types_ts_1.RECORD_SQLITE_MAX_ROW_BYTES / 256) {
|
|
@@ -448,15 +448,15 @@ function deleteRunResourceOnConnection(connection, input) {
|
|
|
448
448
|
requireTerminalState(input.expectedState);
|
|
449
449
|
requireIsoInstant(input.deletedAt, "deletedAt");
|
|
450
450
|
return (0, transaction_ts_1.withImmediateTransaction)(connection, input.deadlineEpochMs, "delete-run-resource", () => {
|
|
451
|
-
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM
|
|
451
|
+
const barrier = (0, database_ts_1.recordStatement)(connection, "SELECT barrier_state FROM ne19_record_metadata WHERE singleton=1").get();
|
|
452
452
|
if (barrier === undefined || text(barrier, "barrier_state") === "draining") {
|
|
453
453
|
throw new errors_ts_2.RunStorageError("run-not-active", "ProjectDatabase writer barrier is not open");
|
|
454
454
|
}
|
|
455
455
|
if (text(barrier, "barrier_state") === "portable") {
|
|
456
456
|
const generation = (0, node_crypto_1.randomUUID)();
|
|
457
|
-
(0, database_ts_1.recordStatement)(connection, `UPDATE
|
|
457
|
+
(0, database_ts_1.recordStatement)(connection, `UPDATE ne19_record_metadata SET barrier_state='open',storage_generation=?,portable_generation=NULL,
|
|
458
458
|
portable_revision=NULL,portable_gate_id=NULL WHERE singleton=1 AND barrier_state='portable'`).run(generation);
|
|
459
|
-
(0, database_ts_1.recordStatement)(connection, "UPDATE
|
|
459
|
+
(0, database_ts_1.recordStatement)(connection, "UPDATE ne19_coordination_state SET operational_generation=?,revision=revision+1 WHERE singleton=1")
|
|
460
460
|
.run(generation);
|
|
461
461
|
}
|
|
462
462
|
const run = runHeader(connection, input.runId);
|
|
@@ -465,7 +465,7 @@ function deleteRunResourceOnConnection(connection, input) {
|
|
|
465
465
|
if (run.terminalState !== input.expectedState) {
|
|
466
466
|
throw new errors_ts_2.RunStorageError("run-state-mismatch", `Run ${input.runId} is ${run.terminalState ?? "active"}, not ${input.expectedState}`);
|
|
467
467
|
}
|
|
468
|
-
const tombstone = (0, database_ts_1.recordStatement)(connection, "SELECT deletion_revision FROM
|
|
468
|
+
const tombstone = (0, database_ts_1.recordStatement)(connection, "SELECT deletion_revision FROM ne19_run_deletion_tombstones WHERE run_id=?")
|
|
469
469
|
.get(input.runId);
|
|
470
470
|
if (tombstone !== undefined) {
|
|
471
471
|
const revision = integer(tombstone, "deletion_revision");
|
|
@@ -476,7 +476,7 @@ function deleteRunResourceOnConnection(connection, input) {
|
|
|
476
476
|
throw new errors_ts_2.RunStorageError("run-delete-reference-conflict", `Run ${input.runId} has incoming Attempt references`, dependencies);
|
|
477
477
|
}
|
|
478
478
|
const revision = nextRevision(connection);
|
|
479
|
-
(0, database_ts_1.recordStatement)(connection, `INSERT INTO
|
|
479
|
+
(0, database_ts_1.recordStatement)(connection, `INSERT INTO ne19_run_deletion_tombstones(run_id,terminal_state,deleted_at,deletion_revision)
|
|
480
480
|
VALUES (?,?,?,?)`).run(input.runId, input.expectedState, input.deletedAt, revision);
|
|
481
481
|
return Object.freeze({ runId: input.runId, state: input.expectedState, cutoff: cutoffAt(connection, revision) });
|
|
482
482
|
});
|
|
@@ -490,8 +490,8 @@ function publicationIdentity(row) {
|
|
|
490
490
|
}
|
|
491
491
|
function readSlotPublication(connection, runId, slotId, cutoff) {
|
|
492
492
|
const binding = (0, database_ts_1.recordStatement)(connection, `SELECT b.action,b.binding_revision,b.attempt_id,b.origin_run_id,b.origin_slot_id,
|
|
493
|
-
b.attempt_publication_revision,a.attempt_locator FROM
|
|
494
|
-
JOIN
|
|
493
|
+
b.attempt_publication_revision,a.attempt_locator FROM ne19_run_slot_bindings b
|
|
494
|
+
JOIN ne19_attempt_publications a ON a.attempt_id=b.attempt_id
|
|
495
495
|
WHERE b.target_run_id=? AND b.slot_id=? AND b.binding_revision<=?`).get(runId, slotId, cutoff.revision);
|
|
496
496
|
if (binding !== undefined) {
|
|
497
497
|
const action = text(binding, "action");
|
|
@@ -509,7 +509,7 @@ function readSlotPublication(connection, runId, slotId, cutoff) {
|
|
|
509
509
|
bindingRevision: integer(binding, "binding_revision"),
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
const absence = (0, database_ts_1.recordStatement)(connection, `SELECT reason,absence_revision FROM
|
|
512
|
+
const absence = (0, database_ts_1.recordStatement)(connection, `SELECT reason,absence_revision FROM ne19_run_slot_absences
|
|
513
513
|
WHERE run_id=? AND slot_id=? AND absence_revision<=?`).get(runId, slotId, cutoff.revision);
|
|
514
514
|
if (absence !== undefined) {
|
|
515
515
|
const reason = text(absence, "reason");
|
|
@@ -521,7 +521,7 @@ function readSlotPublication(connection, runId, slotId, cutoff) {
|
|
|
521
521
|
function readRunAtCutoff(connection, runId, cutoff) {
|
|
522
522
|
const row = (0, database_ts_1.recordStatement)(connection, `SELECT r.run_id,r.invocation_id,r.experiment_id,r.started_at,r.initial_writer_generation,r.current_writer_generation,
|
|
523
523
|
r.terminal_state,r.completed_at,r.created_revision,r.close_revision,d.deletion_revision
|
|
524
|
-
FROM
|
|
524
|
+
FROM ne19_run_resources r LEFT JOIN ne19_run_deletion_tombstones d ON d.run_id=r.run_id WHERE r.run_id=?`).get(runId);
|
|
525
525
|
if (row === undefined || integer(row, "created_revision") > cutoff.revision ||
|
|
526
526
|
row.deletion_revision !== null && row.deletion_revision !== undefined && integer(row, "deletion_revision") <= cutoff.revision) {
|
|
527
527
|
return undefined;
|
|
@@ -535,7 +535,7 @@ function readRunAtCutoff(connection, runId, cutoff) {
|
|
|
535
535
|
? terminalState ?? (() => { throw invalid(`Run ${runId} close revision lacks terminal state`); })()
|
|
536
536
|
: "active";
|
|
537
537
|
const slotRows = (0, database_ts_1.recordStatement)(connection, `SELECT slot_id,eval_id,attempt_ordinal,execution_identity_digest
|
|
538
|
-
FROM
|
|
538
|
+
FROM ne19_run_expected_slots WHERE run_id=? ORDER BY ordinal LIMIT ?`).all(runId, Math.trunc(types_ts_1.RECORD_SQLITE_MAX_ROW_BYTES / 256) + 1);
|
|
539
539
|
if (slotRows.length > types_ts_1.RECORD_SQLITE_MAX_ROW_BYTES / 256) {
|
|
540
540
|
throw invalid(`Run ${runId} expected slot inventory exceeds its bounded read`);
|
|
541
541
|
}
|
|
@@ -576,12 +576,12 @@ function listRunResourcesOnConnection(connection, input = {}) {
|
|
|
576
576
|
if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 256)
|
|
577
577
|
throw invalid("Run page size must be between 1 and 256");
|
|
578
578
|
const rows = (input.invocationId === undefined
|
|
579
|
-
? (0, database_ts_1.recordStatement)(connection, `SELECT r.run_id FROM
|
|
580
|
-
LEFT JOIN
|
|
579
|
+
? (0, database_ts_1.recordStatement)(connection, `SELECT r.run_id FROM ne19_run_resources r
|
|
580
|
+
LEFT JOIN ne19_run_deletion_tombstones d ON d.run_id=r.run_id
|
|
581
581
|
WHERE r.created_revision<=? AND (d.deletion_revision IS NULL OR d.deletion_revision>?) AND r.run_id>?
|
|
582
582
|
ORDER BY r.run_id LIMIT ?`).all(cutoff.revision, cutoff.revision, afterRunId, pageSize + 1)
|
|
583
|
-
: (0, database_ts_1.recordStatement)(connection, `SELECT r.run_id FROM
|
|
584
|
-
LEFT JOIN
|
|
583
|
+
: (0, database_ts_1.recordStatement)(connection, `SELECT r.run_id FROM ne19_run_resources r
|
|
584
|
+
LEFT JOIN ne19_run_deletion_tombstones d ON d.run_id=r.run_id
|
|
585
585
|
WHERE r.created_revision<=? AND (d.deletion_revision IS NULL OR d.deletion_revision>?) AND r.invocation_id=? AND r.run_id>?
|
|
586
586
|
ORDER BY r.run_id LIMIT ?`).all(cutoff.revision, cutoff.revision, input.invocationId, afterRunId, pageSize + 1));
|
|
587
587
|
const selected = rows.slice(0, pageSize);
|
|
@@ -596,8 +596,8 @@ function readPublishedAttemptOnConnection(connection, attemptId, requestedCutoff
|
|
|
596
596
|
requireIdentity(attemptId, "attemptId");
|
|
597
597
|
const cutoff = requireCutoff(connection, requestedCutoff);
|
|
598
598
|
const row = (0, database_ts_1.recordStatement)(connection, `SELECT a.attempt_id,a.attempt_locator,a.origin_run_id,a.origin_slot_id,a.closure_payload,
|
|
599
|
-
a.closure_digest,a.published_revision,d.deletion_revision FROM
|
|
600
|
-
LEFT JOIN
|
|
599
|
+
a.closure_digest,a.published_revision,d.deletion_revision FROM ne19_attempt_publications a
|
|
600
|
+
LEFT JOIN ne19_run_deletion_tombstones d ON d.run_id=a.origin_run_id WHERE a.attempt_id=?`).get(attemptId);
|
|
601
601
|
if (row === undefined || integer(row, "published_revision") > cutoff.revision ||
|
|
602
602
|
row.deletion_revision !== null && row.deletion_revision !== undefined && integer(row, "deletion_revision") <= cutoff.revision) {
|
|
603
603
|
return undefined;
|