@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
|
@@ -632,11 +632,29 @@ function canRequeuePipelineRunAfterEnqueueFailure2(existing, input) {
|
|
|
632
632
|
return existing.status === "failed" && existing.error?.code === "queue.enqueue_failed" && existing.error.retryable && existing.executionId === input.executionId && existing.pipelineId === input.pipelineId;
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
+
// src/storage/pipeline-runs/transitions.ts
|
|
636
|
+
function canFinishPipelineRun2(status, input) {
|
|
637
|
+
if (input.status !== "failed")
|
|
638
|
+
return status === "running";
|
|
639
|
+
if (input.error.code === "queue.enqueue_failed")
|
|
640
|
+
return status === "queued";
|
|
641
|
+
return status === "queued" || status === "running";
|
|
642
|
+
}
|
|
643
|
+
|
|
635
644
|
// src/storage/sync-runs/idempotency.ts
|
|
636
645
|
function canRequeueSyncRunAfterEnqueueFailure2(existing, input) {
|
|
637
646
|
return existing.status === "failed" && existing.error?.code === "queue.enqueue_failed" && existing.error.retryable && existing.executionId === input.executionId && existing.syncId === input.syncId && existing.datasetId === input.datasetId && existing.mode === input.mode && existing.expectedLatestVersionId === input.expectedLatestVersionId && existing.commitMessage === input.commitMessage;
|
|
638
647
|
}
|
|
639
648
|
|
|
649
|
+
// src/storage/sync-runs/transitions.ts
|
|
650
|
+
function canFinishSyncRun2(status, input) {
|
|
651
|
+
if (input.status !== "failed")
|
|
652
|
+
return status === "running";
|
|
653
|
+
if (input.error.code === "queue.enqueue_failed")
|
|
654
|
+
return status === "queued";
|
|
655
|
+
return status === "queued" || status === "running";
|
|
656
|
+
}
|
|
657
|
+
|
|
640
658
|
// src/storage/transaction.ts
|
|
641
659
|
function createTransactionStorageProxy2(target, isActive) {
|
|
642
660
|
const proxies = new WeakMap;
|
|
@@ -683,6 +701,6 @@ function throwNestedStorageTransaction2() {
|
|
|
683
701
|
});
|
|
684
702
|
}
|
|
685
703
|
|
|
686
|
-
export { actionSubjectsEqual, actionRunRequestsEqual, normalizeRecordActionRunInput2, resolveActionRunEffects2, ObjectNotFoundError2, ObjectStorageError2, StorageTransactionError2, isStorageSerializationFailure2, ACTIVITY_BATCH_LIMIT2, ACTIVITY_EVENT_ID_PATTERN2, ACTIVITY_VISIT_ID_PATTERN2, ACTIVITY_HOSTNAME_PATTERN2, ACTIVITY_LABEL_PATTERN2, ACTIVITY_LABEL_MAX_LENGTH2, ACTIVITY_REFERRER_MAX_LENGTH2, ACTIVITY_ROUTE_MAX_LENGTH2, ACTIVITY_ID_MAX_LENGTH2, ACTIVITY_INTERACTION_NAME_PATTERN2, ACTIVITY_INTERACTION_NAME_MAX_LENGTH2, ACTIVITY_MAX_PERIOD_MS2, ACTIVITY_MAX_PAGE_SIZE2, ACTIVITY_MIN_IDLE_TIMEOUT_MS, ACTIVITY_MAX_VISIT_MS2, validateActivityEvents, validateActivityAppend2, planActivityAppend2, activityCalendarDays2, activityDay, activityActor2, serializeActivityAttribution2, parseActivityAttribution2, isActivityRoutePattern2, ArtifactStorageError, parseArtifactRow2, parseArtifactVersionRow2, parseArtifactFrameGrantRow2, parseArtifactStateRow2, artifactStateBytes2, checkArtifactStateWrite2, artifactStorageErrors2, parseFileDownloadGrantRow2, cloneFileDownloadGrantRecord, canRequeuePipelineRunAfterEnqueueFailure2, canRequeueSyncRunAfterEnqueueFailure2, createTransactionStorageProxy2, assertTransactionActive2, throwNestedStorageTransaction2 };
|
|
704
|
+
export { actionSubjectsEqual, actionRunRequestsEqual, normalizeRecordActionRunInput2, resolveActionRunEffects2, ObjectNotFoundError2, ObjectStorageError2, StorageTransactionError2, isStorageSerializationFailure2, ACTIVITY_BATCH_LIMIT2, ACTIVITY_EVENT_ID_PATTERN2, ACTIVITY_VISIT_ID_PATTERN2, ACTIVITY_HOSTNAME_PATTERN2, ACTIVITY_LABEL_PATTERN2, ACTIVITY_LABEL_MAX_LENGTH2, ACTIVITY_REFERRER_MAX_LENGTH2, ACTIVITY_ROUTE_MAX_LENGTH2, ACTIVITY_ID_MAX_LENGTH2, ACTIVITY_INTERACTION_NAME_PATTERN2, ACTIVITY_INTERACTION_NAME_MAX_LENGTH2, ACTIVITY_MAX_PERIOD_MS2, ACTIVITY_MAX_PAGE_SIZE2, ACTIVITY_MIN_IDLE_TIMEOUT_MS, ACTIVITY_MAX_VISIT_MS2, validateActivityEvents, validateActivityAppend2, planActivityAppend2, activityCalendarDays2, activityDay, activityActor2, serializeActivityAttribution2, parseActivityAttribution2, isActivityRoutePattern2, ArtifactStorageError, parseArtifactRow2, parseArtifactVersionRow2, parseArtifactFrameGrantRow2, parseArtifactStateRow2, artifactStateBytes2, checkArtifactStateWrite2, artifactStorageErrors2, parseFileDownloadGrantRow2, cloneFileDownloadGrantRecord, canRequeuePipelineRunAfterEnqueueFailure2, canFinishPipelineRun2, canRequeueSyncRunAfterEnqueueFailure2, canFinishSyncRun2, createTransactionStorageProxy2, assertTransactionActive2, throwNestedStorageTransaction2 };
|
|
687
705
|
|
|
688
|
-
//# debugId=
|
|
706
|
+
//# debugId=A9C9A63BD409A5EF64756E2164756E21
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/storage/action-runs/idempotency.ts", "../src/storage/action-runs/record.ts", "../src/storage/errors.ts", "../src/storage/activity/policy.ts", "../src/storage/artifacts/errors.ts", "../src/storage/artifacts/record.ts", "../src/storage/file-download-grants/record.ts", "../src/storage/pipeline-runs/idempotency.ts", "../src/storage/sync-runs/idempotency.ts", "../src/storage/transaction.ts"],
|
|
3
|
+
"sources": ["../src/storage/action-runs/idempotency.ts", "../src/storage/action-runs/record.ts", "../src/storage/errors.ts", "../src/storage/activity/policy.ts", "../src/storage/artifacts/errors.ts", "../src/storage/artifacts/record.ts", "../src/storage/file-download-grants/record.ts", "../src/storage/pipeline-runs/idempotency.ts", "../src/storage/pipeline-runs/transitions.ts", "../src/storage/sync-runs/idempotency.ts", "../src/storage/sync-runs/transitions.ts", "../src/storage/transaction.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { ActionSubject } from \"../../actions\"\nimport { stableJsonStringify } from \"../../json\"\nimport type { ActionRunEffectsRecord, ActionRunRecord, ActionRunWritebackRecord } from \"./types\"\n\nexport function actionSubjectsEqual(left: ActionSubject, right: ActionSubject): boolean {\n if (left.kind !== right.kind) return false\n if (left.kind === \"none\") return true\n if (right.kind === \"none\") return false\n return left.objectTypeId === right.objectTypeId && left.primaryId === right.primaryId\n}\n\nexport function actionRunParamsEqual(left: unknown, right: unknown): boolean {\n return stableJsonStringify(left) === stableJsonStringify(right)\n}\n\n/** Whether two runs carry the same request: the same Action, subject, and params. */\nexport function actionRunRequestsEqual(\n left: Pick<ActionRunRecord, \"actionId\" | \"subject\" | \"params\">,\n right: Pick<ActionRunRecord, \"actionId\" | \"subject\" | \"params\">\n): boolean {\n return (\n left.actionId === right.actionId &&\n actionSubjectsEqual(left.subject, right.subject) &&\n actionRunParamsEqual(left.params, right.params)\n )\n}\n\nexport type ActionRunPhaseRecord = ActionRunWritebackRecord | ActionRunEffectsRecord\n\nexport function actionRunPhaseRecordsEqual(\n left: ActionRunPhaseRecord,\n right: ActionRunPhaseRecord\n): boolean {\n return actionRunParamsEqual(stripPhaseRecordCompletedAt(left), stripPhaseRecordCompletedAt(right))\n}\n\nfunction stripPhaseRecordCompletedAt(\n record: ActionRunPhaseRecord\n): Omit<ActionRunPhaseRecord, \"completedAt\"> {\n const { completedAt: _completedAt, ...stableRecord } = record\n return stableRecord\n}\n",
|
|
6
6
|
"import { assertJsonValue, cloneJsonValue } from \"../../json\"\nimport { ActionRunError } from \"./errors\"\nimport { parseActionRunFailure } from \"./failure\"\nimport { actionRunPhaseRecordsEqual } from \"./idempotency\"\nimport type {\n ActionRunEffectsRecord,\n ActionRunRecord,\n ActionRunWritebackRecord,\n RecordActionEffectsInput,\n RecordActionRunInput,\n} from \"./types\"\nimport { ACTION_RUN_PHASES } from \"./types\"\n\n/**\n * Validate a terminal run record before a provider inserts it, and detach it from the caller.\n *\n * Every provider records through this, so a stored run always reads back as the record that was\n * written: a failed run carries the failure of the phase it ended in, and a succeeded one none. A\n * run is recorded before its effects run, so no record starts in the `effects` phase.\n */\nexport function normalizeRecordActionRunInput(input: RecordActionRunInput): RecordActionRunInput {\n const label = `[Sixb] Action run '${input.id}'`\n for (const field of [\"id\", \"projectId\", \"executionId\", \"actionId\", \"idempotencyKey\"] as const) {\n if (typeof input[field] !== \"string\" || input[field].trim().length === 0) {\n throw new ActionRunError(`${label} must have a nonblank ${field}.`)\n }\n }\n const status: string = input.status\n if (status !== \"succeeded\" && status !== \"failed\") {\n throw new ActionRunError(`${label} has unknown status '${status}'.`)\n }\n if (!(ACTION_RUN_PHASES as readonly string[]).includes(input.phase)) {\n throw new ActionRunError(`${label} has unknown phase '${input.phase}'.`)\n }\n if (input.phase === \"effects\") {\n throw new ActionRunError(`${label} is recorded before its effects run.`)\n }\n const startedAt = requireDate(input.startedAt, `${label} startedAt`)\n const finishedAt = requireDate(input.finishedAt, `${label} finishedAt`)\n if (finishedAt < startedAt) {\n throw new ActionRunError(`${label} cannot finish before it started.`)\n }\n assertJsonValue(input.params, `${label} params`)\n\n const fields = {\n id: input.id,\n projectId: input.projectId,\n executionId: input.executionId,\n actionId: input.actionId,\n subject: structuredClone(input.subject),\n phase: input.phase,\n startedAt,\n finishedAt,\n params: structuredClone(input.params),\n idempotencyKey: input.idempotencyKey,\n ...(input.writeback === undefined\n ? {}\n : { writeback: normalizeWriteback(input.writeback, label) }),\n }\n\n if (input.status === \"succeeded\") {\n if (input.error !== undefined) {\n throw new ActionRunError(`${label} succeeded, so it cannot record a failure.`)\n }\n return { ...fields, status: \"succeeded\" }\n }\n const error = parseActionRunFailure(input.error, input.phase)\n if (error.details.runId !== input.id || error.details.actionId !== input.actionId) {\n throw new ActionRunError(`${label} records the failure of another run.`)\n }\n return { ...fields, status: \"failed\", error }\n}\n\n/**\n * Resolve what recording effects does to the stored run: write `effects`, or nothing (`null`) when\n * an equal outcome is already recorded.\n *\n * Effects run only after a succeeded run committed its edits, and their outcome is recorded once.\n */\nexport function resolveActionRunEffects(\n existing: ActionRunRecord | null,\n input: RecordActionEffectsInput\n): { readonly run: ActionRunRecord; readonly effects: ActionRunEffectsRecord | null } {\n const label = `[Sixb] Action run '${input.id}'`\n if (!existing) {\n throw new ActionRunError(`${label} not found for project '${input.projectId}'.`)\n }\n const completedAt = requireDate(input.completedAt ?? new Date(), `${label} effects`)\n const effects: ActionRunEffectsRecord =\n input.status === \"succeeded\"\n ? { status: \"succeeded\", completedAt }\n : { status: \"failed\", completedAt, error: parseActionRunFailure(input.error, \"effects\") }\n\n if (existing.effects) {\n if (actionRunPhaseRecordsEqual(existing.effects, effects))\n return { run: existing, effects: null }\n throw new ActionRunError(`${label} already has a different effects record.`)\n }\n if (existing.status !== \"succeeded\" || existing.phase !== \"commit\") {\n throw new ActionRunError(\n `${label} cannot record effects: it ended '${existing.status}' in phase '${existing.phase}'.`\n )\n }\n return { run: existing, effects }\n}\n\nfunction normalizeWriteback(\n writeback: ActionRunWritebackRecord,\n label: string\n): ActionRunWritebackRecord {\n const completedAt = requireDate(writeback.completedAt, `${label} writeback`)\n if (writeback.status === \"succeeded\") {\n assertJsonValue(writeback.result, `${label} writeback result`)\n return { status: \"succeeded\", completedAt, result: cloneJsonValue(writeback.result) }\n }\n return {\n status: \"failed\",\n completedAt,\n error: parseActionRunFailure(writeback.error, \"writeback\"),\n }\n}\n\n/** A detached copy of `value`, which must be a valid date. */\nfunction requireDate(value: Date, label: string): Date {\n const date = value instanceof Date ? new Date(value) : new Date(Number.NaN)\n if (!Number.isFinite(date.getTime())) {\n throw new ActionRunError(`${label} must be a valid date.`)\n }\n return date\n}\n",
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
"import { isArtifactKind } from \"../../artifacts/kinds\"\nimport { ARTIFACT_STATE_LIMITS } from \"../../artifacts/limits\"\nimport type { ArtifactOutline } from \"../../artifacts/outline\"\nimport type { ArtifactReference } from \"../../artifacts/references\"\nimport type { Principal } from \"../../auth\"\nimport { isFileRef } from \"../../blob-storage\"\nimport { type ArtifactLatestVersion, ArtifactStorageError } from \"./errors\"\nimport type {\n ArtifactFile,\n ArtifactFrameGrantRecord,\n ArtifactFrameTarget,\n ArtifactKind,\n ArtifactRecord,\n ArtifactStateEntry,\n ArtifactVersionRecord,\n} from \"./types\"\n\n// Rows arrive from providers with camelCase keys. JSON columns may arrive parsed (jsonb) or as text\n// (SQLite), and timestamps as `Date` or ISO text. A row that does not read back as a valid record\n// fails closed rather than rendering something the store never held.\n\ntype Row = { readonly [column: string]: unknown }\n\nexport function parseArtifactRow(row: Row): ArtifactRecord {\n const id = text(row.id, \"id\", \"artifact\")\n const where = `artifact '${id}'`\n const kind = row.kind\n if (!isArtifactKind(kind)) throw corrupt(where, \"kind is not an artifact kind\")\n return {\n projectId: text(row.projectId, \"projectId\", where),\n id,\n kind,\n title: text(row.title, \"title\", where),\n owner: principal(row.ownerPrincipalType, row.ownerPrincipalId, \"owner\", where),\n latestVersion: positiveInteger(row.latestVersion, \"latestVersion\", where),\n createdAt: date(row.createdAt, \"createdAt\", where),\n updatedAt: date(row.updatedAt, \"updatedAt\", where),\n }\n}\n\nexport function parseArtifactVersionRow(row: Row): ArtifactVersionRecord {\n const artifactId = text(row.artifactId, \"artifactId\", \"artifact version\")\n const version = positiveInteger(row.version, \"version\", `artifact '${artifactId}'`)\n const where = `artifact '${artifactId}' version ${version}`\n const originThreadId = row.originThreadId\n const originRunId = row.originRunId\n if ((originThreadId == null) !== (originRunId == null)) {\n throw corrupt(where, \"origin needs both a thread and a run\")\n }\n return {\n projectId: text(row.projectId, \"projectId\", where),\n artifactId,\n version,\n title: text(row.title, \"title\", where),\n entry: text(row.entry, \"entry\", where),\n files: files(json(row.files, \"files\", where), where),\n outline: outline(json(row.outline, \"outline\", where), where),\n references: references(json(row.refs, \"refs\", where), where),\n author: principal(row.authorPrincipalType, row.authorPrincipalId, \"author\", where),\n ...(originThreadId == null\n ? {}\n : {\n origin: {\n threadId: text(originThreadId, \"originThreadId\", where),\n runId: text(originRunId, \"originRunId\", where),\n },\n }),\n createdAt: date(row.createdAt, \"createdAt\", where),\n }\n}\n\n/** Targets are checked one by one: they decide what a frame may show from other artifacts. */\nexport function parseArtifactFrameGrantRow(row: Row): ArtifactFrameGrantRecord {\n const artifactId = text(row.artifactId, \"artifactId\", \"artifact frame grant\")\n const where = `frame grant for artifact '${artifactId}'`\n return {\n projectId: text(row.projectId, \"projectId\", where),\n tokenHash: text(row.tokenHash, \"tokenHash\", where),\n artifactId,\n version: positiveInteger(row.version, \"version\", where),\n targets: frameTargets(json(row.targets, \"targets\", where), where),\n createdAt: date(row.createdAt, \"createdAt\", where),\n expiresAt: date(row.expiresAt, \"expiresAt\", where),\n }\n}\n\nexport function parseArtifactStateRow(row: Row): ArtifactStateEntry {\n const key = text(row.key, \"key\", \"artifact state\")\n const where = `artifact state '${key}'`\n const sizeBytes = Number(row.sizeBytes)\n if (!Number.isSafeInteger(sizeBytes) || sizeBytes < 0) {\n throw corrupt(where, \"sizeBytes is not a byte count\")\n }\n return {\n key,\n value: text(row.value, \"value\", where),\n sizeBytes,\n updatedAt: date(row.updatedAt, \"updatedAt\", where),\n }\n}\n\n/** A value's UTF-8 bytes, which a reader's state limits count. */\nexport function artifactStateBytes(value: string): number {\n return new TextEncoder().encode(value).byteLength\n}\n\n/**\n * Throws `artifact_state_full` when a value would take a reader past `ARTIFACT_STATE_LIMITS`.\n * `others` is what the reader keeps under every other key, so replacing a value counts once.\n */\nexport function checkArtifactStateWrite(input: {\n readonly key: string\n readonly valueBytes: number\n readonly others: { readonly keys: number; readonly bytes: number }\n}): void {\n const limits = ARTIFACT_STATE_LIMITS\n if (input.valueBytes > limits.maxValueBytes) {\n throw artifactStorageErrors.stateFull(\n `[Sixb] '${input.key}' is ${kilobytes(input.valueBytes)}; a page keeps at most ${kilobytes(limits.maxValueBytes)} under one key.`\n )\n }\n if (input.others.keys + 1 > limits.maxKeys) {\n throw artifactStorageErrors.stateFull(\n `[Sixb] A page keeps at most ${limits.maxKeys} keys for each reader: delete one before keeping '${input.key}'.`\n )\n }\n if (input.others.bytes + input.valueBytes > limits.maxBytes) {\n throw artifactStorageErrors.stateFull(\n `[Sixb] A page keeps at most ${kilobytes(limits.maxBytes)} for each reader; '${input.key}' would take it to ${kilobytes(input.others.bytes + input.valueBytes)}.`\n )\n }\n}\n\nfunction kilobytes(bytes: number): string {\n return `${Math.ceil(bytes / 1024).toLocaleString(\"en-US\")} KB`\n}\n\n/** The errors every provider raises, with one wording. */\nexport const artifactStorageErrors = {\n exists: (id: string) =>\n new ArtifactStorageError(\"artifact_exists\", `[Sixb] Artifact '${id}' already exists.`),\n notFound: (id: string) =>\n new ArtifactStorageError(\"artifact_not_found\", `[Sixb] Artifact '${id}' was not found.`),\n kindMismatch: (id: string, kind: ArtifactKind, requested: ArtifactKind) =>\n new ArtifactStorageError(\n \"artifact_kind_mismatch\",\n `[Sixb] Artifact '${id}' is a ${kind}; it cannot take a ${requested} version.`\n ),\n moved: (id: string, baseVersion: number, latest: ArtifactLatestVersion) =>\n new ArtifactStorageError(\n \"artifact_moved\",\n `[Sixb] Artifact '${id}' is at version ${latest.version}, not version ${baseVersion}, which this publish was based on.`,\n latest\n ),\n stateFull: (message: string) => new ArtifactStorageError(\"artifact_state_full\", message),\n}\n\nfunction files(value: unknown, where: string): ArtifactFile[] {\n if (!Array.isArray(value)) throw corrupt(where, \"files is not a list\")\n return value.map((entry) => {\n if (!isObject(entry) || typeof entry.path !== \"string\" || !isFileRef(entry.file)) {\n throw corrupt(where, \"a file entry is not a path and a file reference\")\n }\n return { path: entry.path, file: entry.file }\n })\n}\n\nfunction outline(value: unknown, where: string): ArtifactOutline {\n if (!isObject(value) || !isArtifactKind(value.kind)) {\n throw corrupt(where, \"outline does not name an artifact kind\")\n }\n return value as unknown as ArtifactOutline\n}\n\nfunction references(value: unknown, where: string): ArtifactReference[] {\n if (!Array.isArray(value)) throw corrupt(where, \"references is not a list\")\n return value.map((entry) => {\n if (\n !isObject(entry) ||\n typeof entry.address !== \"string\" ||\n (entry.as !== \"embed\" && entry.as !== \"link\") ||\n typeof entry.at !== \"string\" ||\n !Number.isSafeInteger(entry.resolvedVersion) ||\n (entry.resolvedVersion as number) < 1\n ) {\n throw corrupt(where, \"a reference is not an address, a verb, a place, and a version\")\n }\n return {\n address: entry.address,\n as: entry.as,\n at: entry.at,\n resolvedVersion: entry.resolvedVersion as number,\n }\n })\n}\n\nfunction frameTargets(value: unknown, where: string): ArtifactFrameTarget[] {\n if (!Array.isArray(value)) throw corrupt(where, \"targets is not a list\")\n return value.map((entry) => {\n if (\n !isObject(entry) ||\n typeof entry.address !== \"string\" ||\n typeof entry.artifactId !== \"string\" ||\n !Number.isSafeInteger(entry.version) ||\n (entry.version as number) < 1\n ) {\n throw corrupt(where, \"a target is not an address, an artifact, and a version\")\n }\n return {\n address: entry.address,\n artifactId: entry.artifactId,\n version: entry.version as number,\n }\n })\n}\n\nconst PRINCIPAL_TYPES: ReadonlySet<string> = new Set([\"user\", \"serviceAccount\", \"system\"])\n\nfunction principal(type: unknown, id: unknown, column: string, where: string): Principal {\n if (typeof type !== \"string\" || !PRINCIPAL_TYPES.has(type)) {\n throw corrupt(where, `${column} is not a principal`)\n }\n return { type: type as Principal[\"type\"], id: text(id, column, where) }\n}\n\nfunction json(value: unknown, column: string, where: string): unknown {\n if (typeof value !== \"string\") return value\n try {\n return JSON.parse(value)\n } catch {\n throw corrupt(where, `${column} is not JSON`)\n }\n}\n\nfunction text(value: unknown, column: string, where: string): string {\n if (typeof value !== \"string\" || value.length === 0) throw corrupt(where, `${column} is not text`)\n return value\n}\n\nfunction positiveInteger(value: unknown, column: string, where: string): number {\n const number = typeof value === \"bigint\" ? Number(value) : value\n if (typeof number !== \"number\" || !Number.isSafeInteger(number) || number < 1) {\n throw corrupt(where, `${column} is not a positive integer`)\n }\n return number\n}\n\nfunction date(value: unknown, column: string, where: string): Date {\n const parsed = value instanceof Date || typeof value === \"string\" ? new Date(value) : null\n if (!parsed || !Number.isFinite(parsed.getTime())) throw corrupt(where, `${column} is not a date`)\n return parsed\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\nfunction corrupt(where: string, reason: string): Error {\n return new Error(`[Sixb] Stored ${where} is invalid: ${reason}.`)\n}\n",
|
|
11
11
|
"import { isFileRef } from \"../../blob-storage\"\nimport type { FileDownloadGrantRecord } from \"./types\"\n\n/**\n * Rebuilds a grant from a provider row with camelCase keys. `file` may arrive parsed (jsonb) or\n * as text (SQLite), and timestamps as `Date` or ISO text. Fails closed on corruption: a grant that\n * cannot be read must not serve a file.\n */\nexport function parseFileDownloadGrantRow(row: {\n readonly [column: string]: unknown\n}): FileDownloadGrantRecord {\n const id = text(row.id, \"id\", String(row.id))\n const file = typeof row.file === \"string\" ? JSON.parse(row.file) : row.file\n if (!isFileRef(file)) throw corrupt(id, \"file is not a file reference\")\n\n return {\n id,\n projectId: text(row.projectId, \"projectId\", id),\n tokenHash: text(row.tokenHash, \"tokenHash\", id),\n file,\n executionId: text(row.executionId, \"executionId\", id),\n createdAt: date(row.createdAt, \"createdAt\", id),\n expiresAt: date(row.expiresAt, \"expiresAt\", id),\n ...(row.revokedAt == null ? {} : { revokedAt: date(row.revokedAt, \"revokedAt\", id) }),\n }\n}\n\nexport function cloneFileDownloadGrantRecord(\n record: FileDownloadGrantRecord\n): FileDownloadGrantRecord {\n return structuredClone(record)\n}\n\nfunction text(value: unknown, column: string, id: string): string {\n if (typeof value !== \"string\" || value.length === 0) throw corrupt(id, `${column} is not text`)\n return value\n}\n\nfunction date(value: unknown, column: string, id: string): Date {\n const parsed = value instanceof Date || typeof value === \"string\" ? new Date(value) : null\n if (!parsed || !Number.isFinite(parsed.getTime())) throw corrupt(id, `${column} is not a date`)\n return parsed\n}\n\nfunction corrupt(id: string, reason: string): Error {\n return new Error(`[Sixb] Stored file download grant '${id}' is invalid: ${reason}.`)\n}\n",
|
|
12
12
|
"import type { PipelineRunRecord, QueuePipelineRunInput } from \"./types\"\n\nexport function canRequeuePipelineRunAfterEnqueueFailure(\n existing: PipelineRunRecord,\n input: QueuePipelineRunInput\n): boolean {\n return (\n existing.status === \"failed\" &&\n existing.error?.code === \"queue.enqueue_failed\" &&\n existing.error.retryable &&\n existing.executionId === input.executionId &&\n existing.pipelineId === input.pipelineId\n )\n}\n",
|
|
13
|
+
"import type { FinishPipelineRunInput, PipelineRunStatus } from \"./types\"\n\n/**\n * A run finishes from `running`. One that never started can only fail: its job could not be\n * published (`queue.enqueue_failed`), or the job ended before starting it.\n */\nexport function canFinishPipelineRun(\n status: PipelineRunStatus,\n input: FinishPipelineRunInput\n): boolean {\n if (input.status !== \"failed\") return status === \"running\"\n if (input.error.code === \"queue.enqueue_failed\") return status === \"queued\"\n return status === \"queued\" || status === \"running\"\n}\n",
|
|
13
14
|
"import type { QueueSyncRunInput, SyncRunRecord } from \"./types\"\n\nexport function canRequeueSyncRunAfterEnqueueFailure(\n existing: SyncRunRecord,\n input: QueueSyncRunInput\n): boolean {\n return (\n existing.status === \"failed\" &&\n existing.error?.code === \"queue.enqueue_failed\" &&\n existing.error.retryable &&\n existing.executionId === input.executionId &&\n existing.syncId === input.syncId &&\n existing.datasetId === input.datasetId &&\n existing.mode === input.mode &&\n existing.expectedLatestVersionId === input.expectedLatestVersionId &&\n existing.commitMessage === input.commitMessage\n )\n}\n",
|
|
15
|
+
"import type { FinishSyncRunInput, SyncRunStatus } from \"./types\"\n\n/**\n * A run finishes from `running`. One that never started can only fail: its job could not be\n * published (`queue.enqueue_failed`), or the job ended before starting it.\n */\nexport function canFinishSyncRun(status: SyncRunStatus, input: FinishSyncRunInput): boolean {\n if (input.status !== \"failed\") return status === \"running\"\n if (input.error.code === \"queue.enqueue_failed\") return status === \"queued\"\n return status === \"queued\" || status === \"running\"\n}\n",
|
|
14
16
|
"import { StorageTransactionError } from \"./errors\"\nimport { createObjectOperationScope } from \"./operation-scope\"\nimport type { Storage } from \"./types\"\n\ntype ObjectLike = Record<PropertyKey, unknown>\n\nexport function createTransactionStorageProxy<T extends Storage>(\n target: T,\n isActive: () => boolean\n): T {\n const proxies = new WeakMap<object, object>()\n const objectStorage = createObjectOperationScope(target.objects, {\n assertAvailable: () => assertTransactionActive(isActive),\n run: async <TResult>(operation: () => Promise<TResult> | TResult): Promise<TResult> => {\n assertTransactionActive(isActive)\n return operation()\n },\n })\n\n const wrap = <TValue extends object>(value: TValue): TValue => {\n const existing = proxies.get(value)\n if (existing) return existing as TValue\n\n const proxy = new Proxy(value as ObjectLike, {\n // The guard runs on property access and on call. Its purpose is to fail fast when a\n // transaction handle (`tx`) leaks past the transaction's lifetime — using it afterward is a\n // bug, not a recoverable state. Overhead is bounded: only the storage namespaces reachable\n // from `tx` are wrapped (a handful), not the row/link data graph, and never per-record.\n get(current, property, receiver) {\n assertTransactionActive(isActive)\n const result =\n current === target && property === \"objects\"\n ? objectStorage\n : Reflect.get(current, property, receiver)\n if (typeof result === \"function\") {\n return (...args: unknown[]) => {\n assertTransactionActive(isActive)\n return result.apply(current, args)\n }\n }\n if (result && typeof result === \"object\") {\n return wrap(result)\n }\n return result\n },\n })\n\n proxies.set(value, proxy)\n return proxy as TValue\n }\n\n return wrap(target)\n}\n\nexport function assertTransactionActive(isActive: () => boolean): void {\n if (!isActive()) {\n throw new StorageTransactionError(\n \"[Sixb] Transaction storage cannot be used after transaction completion.\",\n { code: \"transaction_inactive\" }\n )\n }\n}\n\nexport function throwNestedStorageTransaction(): never {\n throw new StorageTransactionError(\"[Sixb] Nested storage transactions are not supported yet.\", {\n code: \"nested_transaction\",\n })\n}\n"
|
|
15
17
|
],
|
|
16
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,mBAAmB,CAAC,MAAqB,OAA+B;AAAA,EACtF,IAAI,KAAK,SAAS,MAAM;AAAA,IAAM,OAAO;AAAA,EACrC,IAAI,KAAK,SAAS;AAAA,IAAQ,OAAO;AAAA,EACjC,IAAI,MAAM,SAAS;AAAA,IAAQ,OAAO;AAAA,EAClC,OAAO,KAAK,iBAAiB,MAAM,gBAAgB,KAAK,cAAc,MAAM;AAAA;AAGvE,SAAS,oBAAoB,CAAC,MAAe,OAAyB;AAAA,EAC3E,OAAO,qBAAoB,IAAI,MAAM,qBAAoB,KAAK;AAAA;AAIzD,SAAS,sBAAsB,CACpC,MACA,OACS;AAAA,EACT,OACE,KAAK,aAAa,MAA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,IAAI,SAAS,UAAU,QAAQ;AAAA,QAC7C,IAAI,OAAO,WAAW,YAAY;AAAA,UAChC,OAAO,IAAI,SAAoB;AAAA,YAC7B,yBAAwB,QAAQ;AAAA,YAChC,OAAO,OAAO,MAAM,SAAS,IAAI;AAAA;AAAA,QAErC;AAAA,QACA,IAAI,UAAU,OAAO,WAAW,UAAU;AAAA,UACxC,OAAO,KAAK,MAAM;AAAA,QACpB;AAAA,QACA,OAAO;AAAA;AAAA,IAEX,CAAC;AAAA,IAED,QAAQ,IAAI,OAAO,KAAK;AAAA,IACxB,OAAO;AAAA;AAAA,EAGT,OAAO,KAAK,MAAM;AAAA;AAGb,SAAS,wBAAuB,CAAC,UAA+B;AAAA,EACrE,IAAI,CAAC,SAAS,GAAG;AAAA,IACf,MAAM,IAAI,yBACR,2EACA,EAAE,MAAM,uBAAuB,CACjC;AAAA,EACF;AAAA;AAGK,SAAS,8BAA6B,GAAU;AAAA,EACrD,MAAM,IAAI,yBAAwB,6DAA6D;AAAA,IAC7F,MAAM;AAAA,EACR,CAAC;AAAA;",
|
|
19
|
+
"debugId": "A9C9A63BD409A5EF64756E2164756E21",
|
|
18
20
|
"names": []
|
|
19
21
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-w976a4me.js";
|
|
13
13
|
import {
|
|
14
14
|
PIPELINE_RUN_FAILURE_CODES2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-cb21tx14.js";
|
|
16
16
|
import {
|
|
17
17
|
PipelineRunError2
|
|
18
18
|
} from "./chunk-mmagke4x.js";
|
|
@@ -46,6 +46,7 @@ class PipelineRunDispatcher2 {
|
|
|
46
46
|
runId: input.runId,
|
|
47
47
|
metadata: input.metadata,
|
|
48
48
|
validateExistingRun: (run, storage) => assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),
|
|
49
|
+
joinQueuedRun: true,
|
|
49
50
|
createExecution: async (executionId, runId) => createPrimitiveExecutionRecord({
|
|
50
51
|
id: executionId,
|
|
51
52
|
primitive: { kind: "pipeline", id: pipeline.id, runId },
|
|
@@ -85,6 +86,18 @@ async function persistPipelineRun(input, runId) {
|
|
|
85
86
|
await input.validateExistingRun?.(raced, tx);
|
|
86
87
|
return { publish: false, run: raced };
|
|
87
88
|
}
|
|
89
|
+
if (input.joinQueuedRun) {
|
|
90
|
+
const waiting = await findQueuedPipelineRun(transactionalRuns, input);
|
|
91
|
+
if (waiting) {
|
|
92
|
+
return {
|
|
93
|
+
publish: true,
|
|
94
|
+
run: waiting,
|
|
95
|
+
queuedAt: waiting.queuedAt,
|
|
96
|
+
created: false,
|
|
97
|
+
jobId: joinJobId(waiting, runId)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
88
101
|
await tx.executions.create(execution);
|
|
89
102
|
const run = await transactionalRuns.queue({
|
|
90
103
|
projectId: input.projectId,
|
|
@@ -93,7 +106,7 @@ async function persistPipelineRun(input, runId) {
|
|
|
93
106
|
pipelineId: input.pipeline.id,
|
|
94
107
|
queuedAt
|
|
95
108
|
});
|
|
96
|
-
return { publish: true, run,
|
|
109
|
+
return { publish: true, run, queuedAt, created: true };
|
|
97
110
|
}, { isolation: "serializable" });
|
|
98
111
|
} catch (error) {
|
|
99
112
|
if (!(error instanceof PipelineRunError2))
|
|
@@ -106,6 +119,19 @@ async function persistPipelineRun(input, runId) {
|
|
|
106
119
|
return { publish: false, run: raced };
|
|
107
120
|
}
|
|
108
121
|
}
|
|
122
|
+
async function findQueuedPipelineRun(pipelineRuns, input) {
|
|
123
|
+
const { runs } = await pipelineRuns.list({
|
|
124
|
+
projectId: input.projectId,
|
|
125
|
+
pipelineId: input.pipeline.id,
|
|
126
|
+
statuses: ["queued"],
|
|
127
|
+
order: "asc",
|
|
128
|
+
limit: 1
|
|
129
|
+
});
|
|
130
|
+
return runs[0];
|
|
131
|
+
}
|
|
132
|
+
function joinJobId(waiting, triggerRunId) {
|
|
133
|
+
return `${waiting.id}:join:${triggerRunId}`;
|
|
134
|
+
}
|
|
109
135
|
async function reusePipelineRun(input, existing) {
|
|
110
136
|
assertExistingRunMatchesRequest(existing, input);
|
|
111
137
|
await input.validateExistingRun?.(existing, input.storage);
|
|
@@ -116,7 +142,7 @@ async function reusePipelineRun(input, existing) {
|
|
|
116
142
|
});
|
|
117
143
|
if (!execution)
|
|
118
144
|
throw new PipelineRunError2(`[Sixb] Execution '${existing.executionId}' was not found.`);
|
|
119
|
-
return { publish: true, run: existing,
|
|
145
|
+
return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false };
|
|
120
146
|
}
|
|
121
147
|
if (existing.status !== "failed" || existing.error?.code !== "queue.enqueue_failed" || !existing.error.retryable) {
|
|
122
148
|
return { publish: false, run: existing };
|
|
@@ -136,22 +162,23 @@ async function reusePipelineRun(input, existing) {
|
|
|
136
162
|
pipelineId: existing.pipelineId,
|
|
137
163
|
queuedAt
|
|
138
164
|
});
|
|
139
|
-
return { publish: true, run,
|
|
165
|
+
return { publish: true, run, queuedAt, created: false };
|
|
140
166
|
}
|
|
141
167
|
async function publishPipelineRun(input, persisted) {
|
|
168
|
+
const jobId = persisted.jobId ?? persisted.run.id;
|
|
142
169
|
try {
|
|
143
170
|
const [job] = await input.queue.enqueue({
|
|
144
171
|
projectId: input.projectId,
|
|
145
172
|
jobs: [
|
|
146
173
|
{
|
|
147
|
-
id:
|
|
174
|
+
id: jobId,
|
|
148
175
|
type: "pipeline.run.requested",
|
|
149
176
|
payload: { runId: persisted.run.id },
|
|
150
177
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
151
178
|
}
|
|
152
179
|
]
|
|
153
180
|
});
|
|
154
|
-
if (!job || job.id !==
|
|
181
|
+
if (!job || job.id !== jobId) {
|
|
155
182
|
throw new PipelineRunError2(`[Sixb] Queue did not acknowledge Pipeline run '${persisted.run.id}'.`);
|
|
156
183
|
}
|
|
157
184
|
return {
|
|
@@ -269,4 +296,4 @@ async function requestPipelineRun2(runtime, execution, pipeline, options = {}) {
|
|
|
269
296
|
|
|
270
297
|
export { PipelineRunDispatcher2, requestPipelineRun2 };
|
|
271
298
|
|
|
272
|
-
//# debugId=
|
|
299
|
+
//# debugId=846D768D7A6424AA64756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/pipelines/run-dispatch.ts", "../src/pipelines/request.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { randomUUID } from \"node:crypto\"\nimport { reportRunFailure } from \"../error-reporting/capability\"\nimport { createSixbError, toSixbFailure } from \"../errors/internal\"\nimport type { SixbFailure } from \"../errors/types\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type {\n CreateExecutionInput,\n PipelineRunFailureCode,\n PipelineRunRecord,\n Storage,\n} from \"../storage\"\nimport { PIPELINE_RUN_FAILURE_CODES, PipelineRunError } from \"../storage\"\nimport { PipelineError } from \"./errors\"\nimport type { PipelineRunRequestOptions, PipelineRunRequestResult } from \"./request\"\nimport type { PipelineDefinition } from \"./types\"\n\nexport type AutomaticPipelineExecutionSource =\n | { readonly type: \"schedule\"; readonly eventId: string }\n | { readonly type: \"event\"; readonly eventId: string }\n\nexport interface AutomaticPipelineRunDispatchInput extends PipelineRunRequestOptions {\n readonly pipelineId: string\n readonly runId: string\n readonly source: AutomaticPipelineExecutionSource\n readonly correlationId: string\n readonly metadata?: Readonly<Record<string, string>>\n}\n\nexport type PipelineRunDispatchPort = RunDispatcher<\n AutomaticPipelineRunDispatchInput,\n PipelineRunRequestResult\n>\n\nexport interface PipelineRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"pipelines\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"pipelines\">\n}\n\ninterface DispatchPipelineRunInput extends PipelineRunRequestOptions {\n readonly errorReporterHost: object\n readonly projectId: string\n readonly pipeline: PipelineDefinition\n readonly storage: Storage\n readonly queue: Queues[\"pipelines\"]\n readonly metadata?: Readonly<Record<string, string>>\n readonly createExecution: (executionId: string, runId: string) => Promise<CreateExecutionInput>\n readonly validateExistingRun?: (run: PipelineRunRecord, storage: Storage) => Promise<void>\n /** Return a run of this Pipeline that has not started yet instead of queueing another one. */\n readonly joinQueuedRun?: boolean\n}\n\ntype PersistedPipelineRun =\n | { readonly publish: false; readonly run: PipelineRunRecord }\n | {\n readonly publish: true\n readonly run: PipelineRunRecord\n readonly queuedAt: Date\n readonly created: boolean\n /** Defaults to the run id. A trigger that joins a run publishes its own job for it. */\n readonly jobId?: string\n }\n\n/** Core-owned durable dispatch boundary used by automatic Pipeline triggers. */\nexport class PipelineRunDispatcher implements PipelineRunDispatchPort {\n constructor(private readonly dependencies: PipelineRunDispatcherDependencies) {}\n\n async dispatch(input: AutomaticPipelineRunDispatchInput): Promise<PipelineRunRequestResult> {\n assertAutomaticDispatchInput(input)\n const pipeline = this.dependencies.definitions.pipelines.getById(input.pipelineId)\n if (!pipeline) throw new PipelineError(`[Sixb] Unknown pipeline '${input.pipelineId}'`)\n\n return dispatchPipelineRun({\n errorReporterHost: this.dependencies,\n projectId: this.dependencies.id,\n pipeline,\n storage: this.dependencies.storage,\n queue: this.dependencies.queues.pipelines,\n runId: input.runId,\n metadata: input.metadata,\n validateExistingRun: (run, storage) =>\n assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),\n joinQueuedRun: true,\n createExecution: async (executionId, runId) =>\n createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"pipeline\", id: pipeline.id, runId },\n origin: {\n type: \"automatic\",\n projectId: this.dependencies.id,\n source: input.source,\n correlationId: input.correlationId,\n },\n }),\n })\n }\n}\n\n/** Persist a Pipeline execution and queued run before publishing its queue job. */\nexport async function dispatchPipelineRun(\n input: DispatchPipelineRunInput\n): Promise<PipelineRunRequestResult> {\n const runId = createPipelineRunId(input.runId)\n let persisted = await persistPipelineRun(input, runId)\n if (!persisted.publish && input.validateExistingRun && persisted.run.status === \"queued\") {\n persisted = await reusePipelineRun(input, persisted.run)\n }\n if (!persisted.publish) return existingPipelineRunResult(persisted.run)\n return publishPipelineRun(input, persisted)\n}\n\nasync function persistPipelineRun(\n input: DispatchPipelineRunInput,\n runId: string\n): Promise<PersistedPipelineRun> {\n const pipelineRuns = requirePipelineRunStorage(input.storage)\n const existing = await pipelineRuns.getById({ projectId: input.projectId, id: runId })\n if (existing) return reusePipelineRun(input, existing)\n\n const execution = await input.createExecution(`exec_${randomUUID()}`, runId)\n const queuedAt = new Date()\n try {\n return await input.storage.transaction(\n async (tx): Promise<PersistedPipelineRun> => {\n const transactionalRuns = requirePipelineRunStorage(tx)\n const raced = await transactionalRuns.getById({ projectId: input.projectId, id: runId })\n if (raced) {\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, tx)\n return { publish: false, run: raced }\n }\n\n if (input.joinQueuedRun) {\n const waiting = await findQueuedPipelineRun(transactionalRuns, input)\n if (waiting) {\n return {\n publish: true,\n run: waiting,\n queuedAt: waiting.queuedAt,\n created: false,\n jobId: joinJobId(waiting, runId),\n }\n }\n }\n\n await tx.executions.create(execution)\n const run = await transactionalRuns.queue({\n projectId: input.projectId,\n id: runId,\n executionId: execution.id,\n pipelineId: input.pipeline.id,\n queuedAt,\n })\n return { publish: true, run, queuedAt, created: true }\n },\n { isolation: \"serializable\" }\n )\n } catch (error) {\n if (!(error instanceof PipelineRunError)) throw error\n const raced = await pipelineRuns.getById({ projectId: input.projectId, id: runId })\n if (!raced) throw error\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, input.storage)\n return { publish: false, run: raced }\n }\n}\n\n/**\n * A run that has not started reads each input's latest version when its steps start, so it already\n * covers a trigger that arrives now. The oldest one starts first.\n */\nasync function findQueuedPipelineRun(\n pipelineRuns: NonNullable<Storage[\"pipelineRuns\"]>,\n input: Pick<DispatchPipelineRunInput, \"projectId\" | \"pipeline\">\n): Promise<PipelineRunRecord | undefined> {\n const { runs } = await pipelineRuns.list({\n projectId: input.projectId,\n pipelineId: input.pipeline.id,\n statuses: [\"queued\"],\n order: \"asc\",\n limit: 1,\n })\n return runs[0]\n}\n\n/**\n * The job a trigger publishes for the run it joins. The run's own job may be gone (a provider\n * keeps a settled job id, and ignores a new job under it), so each joining trigger brings a job\n * that can start the run; once it has started, the others complete without doing anything. The id\n * derives from the trigger's run id, so a redelivered trigger publishes the same job.\n */\nfunction joinJobId(waiting: PipelineRunRecord, triggerRunId: string): string {\n return `${waiting.id}:join:${triggerRunId}`\n}\n\nasync function reusePipelineRun(\n input: DispatchPipelineRunInput,\n existing: PipelineRunRecord\n): Promise<PersistedPipelineRun> {\n assertExistingRunMatchesRequest(existing, input)\n await input.validateExistingRun?.(existing, input.storage)\n if (input.validateExistingRun && existing.status === \"queued\") {\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution)\n throw new PipelineRunError(`[Sixb] Execution '${existing.executionId}' was not found.`)\n return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false }\n }\n if (\n existing.status !== \"failed\" ||\n existing.error?.code !== \"queue.enqueue_failed\" ||\n !existing.error.retryable\n ) {\n return { publish: false, run: existing }\n }\n\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution) {\n throw new PipelineRunError(\n `[Sixb] Execution '${existing.executionId}' for Pipeline run '${existing.id}' was not found.`\n )\n }\n\n const queuedAt = new Date()\n const run = await requirePipelineRunStorage(input.storage).queue({\n projectId: input.projectId,\n id: existing.id,\n executionId: existing.executionId,\n pipelineId: existing.pipelineId,\n queuedAt,\n })\n return { publish: true, run, queuedAt, created: false }\n}\n\nasync function publishPipelineRun(\n input: DispatchPipelineRunInput,\n persisted: Extract<PersistedPipelineRun, { readonly publish: true }>\n): Promise<PipelineRunRequestResult> {\n const jobId = persisted.jobId ?? persisted.run.id\n\n try {\n const [job] = await input.queue.enqueue({\n projectId: input.projectId,\n jobs: [\n {\n id: jobId,\n type: \"pipeline.run.requested\",\n payload: { runId: persisted.run.id },\n ...(input.metadata === undefined ? {} : { metadata: input.metadata }),\n },\n ],\n })\n if (!job || job.id !== jobId) {\n throw new PipelineRunError(\n `[Sixb] Queue did not acknowledge Pipeline run '${persisted.run.id}'.`\n )\n }\n return {\n pipelineId: persisted.run.pipelineId,\n runId: persisted.run.id,\n queuedAt: persisted.queuedAt.toISOString(),\n ...(job?.id ? { jobId: job.id } : {}),\n created: persisted.created,\n }\n } catch (error) {\n // Automatic consumers retain the batch and retry. Keep uncertain delivery queued:\n // a lost reply does not prove that the queue rejected the job.\n if (input.validateExistingRun) throw error\n const failedAt = new Date()\n const failure = toEnqueueFailure(error, persisted.run, failedAt)\n const failed = await requirePipelineRunStorage(input.storage).finish({\n projectId: input.projectId,\n id: persisted.run.id,\n status: \"failed\",\n finishedAt: failedAt,\n error: failure,\n })\n reportRunFailure(input.errorReporterHost, error, {\n projectId: input.projectId,\n runKind: \"pipeline\",\n run: { runId: failed.id, pipelineId: failed.pipelineId },\n failure,\n })\n throw error\n }\n}\n\nfunction assertExistingRunMatchesRequest(\n existing: PipelineRunRecord,\n input: Pick<DispatchPipelineRunInput, \"pipeline\">\n): void {\n if (existing.pipelineId !== input.pipeline.id) {\n throw new PipelineRunError(\n `[Sixb] Pipeline run '${existing.id}' already exists with a different request payload.`\n )\n }\n}\n\nfunction existingPipelineRunResult(existing: PipelineRunRecord): PipelineRunRequestResult {\n return {\n pipelineId: existing.pipelineId,\n runId: existing.id,\n queuedAt: existing.queuedAt.toISOString(),\n created: false,\n }\n}\n\nfunction requirePipelineRunStorage(storage: Storage): NonNullable<Storage[\"pipelineRuns\"]> {\n if (!storage.pipelineRuns) {\n throw new PipelineError(\"[Sixb] Pipeline run storage is not configured.\")\n }\n return storage.pipelineRuns\n}\n\nfunction createPipelineRunId(runId: string | undefined): string {\n if (runId === undefined) return `run_${randomUUID()}`\n if (!runId.trim()) throw new PipelineError(\"[Sixb] Pipeline run id must not be empty\")\n return runId\n}\n\nfunction assertAutomaticDispatchInput(input: AutomaticPipelineRunDispatchInput): void {\n assertNonBlank(input.pipelineId, \"Pipeline id\")\n assertNonBlank(input.runId, \"Pipeline run id\")\n assertNonBlank(input.source.eventId, \"Pipeline source event id\")\n assertNonBlank(input.correlationId, \"Pipeline correlation id\")\n}\n\nasync function assertAutomaticExecutionIdentity(\n storage: Storage,\n projectId: string,\n input: AutomaticPipelineRunDispatchInput,\n run: PipelineRunRecord\n): Promise<void> {\n const execution = await storage.executions.getById({ projectId, id: run.executionId })\n if (\n !execution ||\n execution.source.type !== input.source.type ||\n execution.source.eventId !== input.source.eventId ||\n execution.correlationId !== input.correlationId ||\n execution.requestedBy !== undefined\n ) {\n throw new PipelineError(\n `[Sixb] Pipeline run '${run.id}' already exists with different automatic provenance.`\n )\n }\n}\n\nfunction toEnqueueFailure(\n error: unknown,\n run: PipelineRunRecord,\n at: Date\n): SixbFailure<PipelineRunFailureCode> {\n const enqueueError = createSixbError(\n \"queue.enqueue_failed\",\n `[Sixb] Could not enqueue Pipeline run '${run.id}'.`,\n {\n cause: error,\n details: { pipelineId: run.pipelineId, runId: run.id, phase: \"enqueue\" },\n }\n )\n return toSixbFailure(enqueueError, { allowedCodes: PIPELINE_RUN_FAILURE_CODES, at })\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (!value.trim()) throw new PipelineError(`[Sixb] ${label} must not be empty.`)\n}\n",
|
|
6
|
+
"import { assertAuthorized } from \"../authorization\"\nimport { resolveExecutionScopeAuthorization } from \"../execution/authorization\"\nimport {\n createPrimitiveExecutionRecord,\n ensureExecutionRecord,\n executionRecordInputFromRuntime,\n} from \"../execution/durable\"\nimport type { ExecutionContext } from \"../execution/types\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport { PipelineError } from \"./errors\"\nimport { dispatchPipelineRun } from \"./run-dispatch\"\nimport type { PipelineDefinition } from \"./types\"\n\nexport interface PipelineRunRequestOptions {\n /** Stable identity used to make dispatch idempotent. */\n readonly runId?: string\n}\n\nexport interface RequestPipelineRunInput extends PipelineRunRequestOptions {\n readonly pipelineId: string\n}\n\nexport interface PipelineRunRequestResult {\n readonly pipelineId: string\n readonly runId: string\n /** Durable time at which the run entered the queue. */\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\n/**\n * Authorize and queue a pipeline run request.\n *\n * Operates on an already-resolved definition and the shared runtime context, so the HTTP route and\n * the runtime verb cannot drift apart.\n *\n * The immutable child execution and queued run are persisted before queue publication.\n */\nexport async function requestPipelineRun(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n pipeline: PipelineDefinition,\n options: PipelineRunRequestOptions = {}\n): Promise<PipelineRunRequestResult> {\n resolveExecutionScopeAuthorization(runtime.projectId, {\n execution,\n authorization: runtime.runtimeAuthorization,\n })\n assertAuthorized(runtime, { kind: \"pipeline.run\", pipelineId: pipeline.id })\n if (!runtime.storage.pipelineRuns) {\n throw new PipelineError(\"[Sixb] Pipeline run storage is not configured.\")\n }\n\n const queue = runtime.queues.pipelines\n if (!queue) {\n throw new PipelineError(\"[Sixb] Pipeline run queue is not configured.\")\n }\n\n return dispatchPipelineRun({\n errorReporterHost: runtime,\n projectId: runtime.projectId,\n pipeline,\n storage: runtime.storage,\n queue,\n ...options,\n createExecution: async (executionId, runId) => {\n const caller = await ensureExecutionRecord(\n runtime.storage.executions,\n executionRecordInputFromRuntime({\n execution,\n runtimeAuthorization: runtime.runtimeAuthorization,\n })\n )\n return createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"pipeline\", id: pipeline.id, runId },\n origin: { type: \"execution\", parent: caller },\n })\n },\n })\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAoEO,MAAM,uBAAyD;AAAA,EACvC;AAAA,EAA7B,WAAW,CAA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G,CAAC;AAAA,EAC3E,IAAI,CAAC,QAAQ,QAAQ,cAAc;AAAA,IACjC,MAAM,IAAI,eAAc,gDAAgD;AAAA,EAC1E;AAAA,EAEA,MAAM,QAAQ,QAAQ,OAAO;AAAA,EAC7B,IAAI,CAAC,OAAO;AAAA,IACV,MAAM,IAAI,eAAc,8CAA8C;AAAA,EACxE;AAAA,EAEA,OAAO,oBAAoB;AAAA,IACzB,mBAAmB;AAAA,IACnB,WAAW,QAAQ;AAAA,IACnB;AAAA,IACA,SAAS,QAAQ;AAAA,IACjB;AAAA,OACG;AAAA,IACH,iBAAiB,OAAO,aAAa,UAAU;AAAA,MAC7C,MAAM,SAAS,MAAM,uBACnB,QAAQ,QAAQ,YAChB,gCAAgC;AAAA,QAC9B;AAAA,QACA,sBAAsB,QAAQ;AAAA,MAChC,CAAC,CACH;AAAA,MACA,OAAO,+BAA+B;AAAA,QACpC,IAAI;AAAA,QACJ,WAAW,EAAE,MAAM,YAAY,IAAI,SAAS,IAAI,MAAM;AAAA,QACtD,QAAQ,EAAE,MAAM,aAAa,QAAQ,OAAO;AAAA,MAC9C,CAAC;AAAA;AAAA,EAEL,CAAC;AAAA;",
|
|
9
|
+
"debugId": "846D768D7A6424AA64756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-w976a4me.js";
|
|
13
13
|
import {
|
|
14
14
|
SYNC_RUN_FAILURE_CODES2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-cb21tx14.js";
|
|
16
16
|
import {
|
|
17
17
|
SyncRunError2
|
|
18
18
|
} from "./chunk-jmfet9r4.js";
|
|
@@ -50,6 +50,7 @@ class SyncRunDispatcher2 {
|
|
|
50
50
|
commitMessage: input.commitMessage,
|
|
51
51
|
metadata: input.metadata,
|
|
52
52
|
validateExistingRun: (run, storage) => assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),
|
|
53
|
+
joinQueuedRun: true,
|
|
53
54
|
createExecution: async (executionId, runId) => createPrimitiveExecutionRecord({
|
|
54
55
|
id: executionId,
|
|
55
56
|
primitive: { kind: "sync", id: sync.id, runId },
|
|
@@ -89,6 +90,18 @@ async function persistSyncRun(input, runId) {
|
|
|
89
90
|
await input.validateExistingRun?.(raced, tx);
|
|
90
91
|
return { publish: false, run: raced };
|
|
91
92
|
}
|
|
93
|
+
if (input.joinQueuedRun) {
|
|
94
|
+
const waiting = await findQueuedSyncRun(transactionalRuns, input);
|
|
95
|
+
if (waiting) {
|
|
96
|
+
return {
|
|
97
|
+
publish: true,
|
|
98
|
+
run: waiting,
|
|
99
|
+
queuedAt: waiting.queuedAt,
|
|
100
|
+
created: false,
|
|
101
|
+
jobId: joinJobId(waiting, runId)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
92
105
|
await tx.executions.create(execution);
|
|
93
106
|
const run = await transactionalRuns.queue({
|
|
94
107
|
projectId: input.projectId,
|
|
@@ -101,7 +114,7 @@ async function persistSyncRun(input, runId) {
|
|
|
101
114
|
expectedLatestVersionId: input.expectedLatestVersionId,
|
|
102
115
|
commitMessage: input.commitMessage
|
|
103
116
|
});
|
|
104
|
-
return { publish: true, run,
|
|
117
|
+
return { publish: true, run, queuedAt, created: true };
|
|
105
118
|
}, { isolation: "serializable" });
|
|
106
119
|
} catch (error) {
|
|
107
120
|
if (!(error instanceof SyncRunError2))
|
|
@@ -114,6 +127,20 @@ async function persistSyncRun(input, runId) {
|
|
|
114
127
|
return { publish: false, run: raced };
|
|
115
128
|
}
|
|
116
129
|
}
|
|
130
|
+
async function findQueuedSyncRun(syncRuns, input) {
|
|
131
|
+
const { runs } = await syncRuns.list({
|
|
132
|
+
projectId: input.projectId,
|
|
133
|
+
syncId: input.sync.id,
|
|
134
|
+
statuses: ["queued"],
|
|
135
|
+
order: "asc",
|
|
136
|
+
limit: 1
|
|
137
|
+
});
|
|
138
|
+
const [waiting] = runs;
|
|
139
|
+
return waiting && runMatchesRequest(waiting, input) ? waiting : undefined;
|
|
140
|
+
}
|
|
141
|
+
function joinJobId(waiting, triggerRunId) {
|
|
142
|
+
return `${waiting.id}:join:${triggerRunId}`;
|
|
143
|
+
}
|
|
117
144
|
async function reuseSyncRun(input, existing) {
|
|
118
145
|
assertExistingRunMatchesRequest(existing, input);
|
|
119
146
|
await input.validateExistingRun?.(existing, input.storage);
|
|
@@ -124,7 +151,7 @@ async function reuseSyncRun(input, existing) {
|
|
|
124
151
|
});
|
|
125
152
|
if (!execution)
|
|
126
153
|
throw new SyncRunError2(`[Sixb] Execution '${existing.executionId}' was not found.`);
|
|
127
|
-
return { publish: true, run: existing,
|
|
154
|
+
return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false };
|
|
128
155
|
}
|
|
129
156
|
if (existing.status !== "failed" || existing.error?.code !== "queue.enqueue_failed" || !existing.error.retryable) {
|
|
130
157
|
return { publish: false, run: existing };
|
|
@@ -148,22 +175,23 @@ async function reuseSyncRun(input, existing) {
|
|
|
148
175
|
expectedLatestVersionId: existing.expectedLatestVersionId,
|
|
149
176
|
commitMessage: existing.commitMessage
|
|
150
177
|
});
|
|
151
|
-
return { publish: true, run,
|
|
178
|
+
return { publish: true, run, queuedAt, created: false };
|
|
152
179
|
}
|
|
153
180
|
async function publishSyncRun(input, persisted) {
|
|
181
|
+
const jobId = persisted.jobId ?? persisted.run.id;
|
|
154
182
|
try {
|
|
155
183
|
const [job] = await input.queue.enqueue({
|
|
156
184
|
projectId: input.projectId,
|
|
157
185
|
jobs: [
|
|
158
186
|
{
|
|
159
|
-
id:
|
|
187
|
+
id: jobId,
|
|
160
188
|
type: "sync.run.requested",
|
|
161
189
|
payload: { runId: persisted.run.id },
|
|
162
190
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
163
191
|
}
|
|
164
192
|
]
|
|
165
193
|
});
|
|
166
|
-
if (!job || job.id !==
|
|
194
|
+
if (!job || job.id !== jobId) {
|
|
167
195
|
throw new SyncRunError2(`[Sixb] Queue did not acknowledge Sync run '${persisted.run.id}'.`);
|
|
168
196
|
}
|
|
169
197
|
return {
|
|
@@ -195,10 +223,13 @@ async function publishSyncRun(input, persisted) {
|
|
|
195
223
|
}
|
|
196
224
|
}
|
|
197
225
|
function assertExistingRunMatchesRequest(existing, input) {
|
|
198
|
-
if (existing
|
|
226
|
+
if (!runMatchesRequest(existing, input)) {
|
|
199
227
|
throw new SyncRunError2(`[Sixb] Sync run '${existing.id}' already exists with a different request payload.`);
|
|
200
228
|
}
|
|
201
229
|
}
|
|
230
|
+
function runMatchesRequest(existing, input) {
|
|
231
|
+
return existing.syncId === input.sync.id && existing.datasetId === input.sync.target.dataset.id && existing.mode === input.sync.config.mode && existing.expectedLatestVersionId === input.expectedLatestVersionId && existing.commitMessage === input.commitMessage;
|
|
232
|
+
}
|
|
202
233
|
function existingSyncRunResult(existing) {
|
|
203
234
|
return {
|
|
204
235
|
syncId: existing.syncId,
|
|
@@ -280,4 +311,4 @@ async function requestSyncRun2(runtime, execution, sync, options = {}) {
|
|
|
280
311
|
|
|
281
312
|
export { SyncValidationError2, SyncRunDispatcher2, requestSyncRun2 };
|
|
282
313
|
|
|
283
|
-
//# debugId=
|
|
314
|
+
//# debugId=A81F31D2E247449664756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/syncs/errors.ts", "../src/syncs/run-dispatch.ts", "../src/syncs/request.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export class SyncValidationError extends Error {\n readonly name = \"SyncValidationError\"\n}\n",
|
|
6
|
+
"import { randomUUID } from \"node:crypto\"\nimport { reportRunFailure } from \"../error-reporting/capability\"\nimport { createSixbError, toSixbFailure } from \"../errors/internal\"\nimport type { SixbFailure } from \"../errors/types\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type { CreateExecutionInput, Storage, SyncRunFailureCode, SyncRunRecord } from \"../storage\"\nimport { SYNC_RUN_FAILURE_CODES, SyncRunError } from \"../storage\"\nimport { SyncValidationError } from \"./errors\"\nimport type { SyncRunRequestOptions, SyncRunRequestResult } from \"./request\"\nimport type { SyncDefinition } from \"./types\"\n\nexport type AutomaticSyncExecutionSource =\n | { readonly type: \"schedule\"; readonly eventId: string }\n | { readonly type: \"event\"; readonly eventId: string }\n\nexport interface AutomaticSyncRunDispatchInput extends SyncRunRequestOptions {\n readonly syncId: string\n readonly runId: string\n readonly source: AutomaticSyncExecutionSource\n readonly correlationId: string\n readonly metadata?: Readonly<Record<string, string>>\n}\n\nexport type SyncRunDispatchPort = RunDispatcher<AutomaticSyncRunDispatchInput, SyncRunRequestResult>\n\nexport interface SyncRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"syncs\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"syncRuns\">\n}\n\ninterface DispatchSyncRunInput extends SyncRunRequestOptions {\n readonly errorReporterHost: object\n readonly projectId: string\n readonly sync: SyncDefinition\n readonly storage: Storage\n readonly queue: Queues[\"syncRuns\"]\n readonly metadata?: Readonly<Record<string, string>>\n readonly createExecution: (executionId: string, runId: string) => Promise<CreateExecutionInput>\n readonly validateExistingRun?: (run: SyncRunRecord, storage: Storage) => Promise<void>\n /** Return a matching run of this Sync that has not started yet instead of queueing another one. */\n readonly joinQueuedRun?: boolean\n}\n\ntype PersistedSyncRun =\n | { readonly publish: false; readonly run: SyncRunRecord }\n | {\n readonly publish: true\n readonly run: SyncRunRecord\n readonly queuedAt: Date\n readonly created: boolean\n /** Defaults to the run id. A trigger that joins a run publishes its own job for it. */\n readonly jobId?: string\n }\n\n/** Core-owned durable dispatch boundary used by automatic Sync triggers. */\nexport class SyncRunDispatcher implements SyncRunDispatchPort {\n constructor(private readonly dependencies: SyncRunDispatcherDependencies) {}\n\n async dispatch(input: AutomaticSyncRunDispatchInput): Promise<SyncRunRequestResult> {\n assertAutomaticDispatchInput(input)\n const sync = this.dependencies.definitions.syncs.getById(input.syncId)\n if (!sync) throw new SyncValidationError(`[Sixb] Unknown sync '${input.syncId}'`)\n\n return dispatchSyncRun({\n errorReporterHost: this.dependencies,\n projectId: this.dependencies.id,\n sync,\n storage: this.dependencies.storage,\n queue: this.dependencies.queues.syncRuns,\n runId: input.runId,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n metadata: input.metadata,\n validateExistingRun: (run, storage) =>\n assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),\n joinQueuedRun: true,\n createExecution: async (executionId, runId) =>\n createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId },\n origin: {\n type: \"automatic\",\n projectId: this.dependencies.id,\n source: input.source,\n correlationId: input.correlationId,\n },\n }),\n })\n }\n}\n\n/** Persist a Sync execution and queued run before publishing its queue job. */\nexport async function dispatchSyncRun(input: DispatchSyncRunInput): Promise<SyncRunRequestResult> {\n const runId = createSyncRunId(input.runId)\n let persisted = await persistSyncRun(input, runId)\n if (!persisted.publish && input.validateExistingRun && persisted.run.status === \"queued\") {\n persisted = await reuseSyncRun(input, persisted.run)\n }\n if (!persisted.publish) return existingSyncRunResult(persisted.run)\n return publishSyncRun(input, persisted)\n}\n\nasync function persistSyncRun(\n input: DispatchSyncRunInput,\n runId: string\n): Promise<PersistedSyncRun> {\n const syncRuns = requireSyncRunStorage(input.storage)\n const existing = await syncRuns.getById({ projectId: input.projectId, id: runId })\n if (existing) return reuseSyncRun(input, existing)\n\n const execution = await input.createExecution(`exec_${randomUUID()}`, runId)\n const queuedAt = new Date()\n try {\n return await input.storage.transaction(\n async (tx): Promise<PersistedSyncRun> => {\n const transactionalRuns = requireSyncRunStorage(tx)\n const raced = await transactionalRuns.getById({ projectId: input.projectId, id: runId })\n if (raced) {\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, tx)\n return { publish: false, run: raced }\n }\n\n if (input.joinQueuedRun) {\n const waiting = await findQueuedSyncRun(transactionalRuns, input)\n if (waiting) {\n return {\n publish: true,\n run: waiting,\n queuedAt: waiting.queuedAt,\n created: false,\n jobId: joinJobId(waiting, runId),\n }\n }\n }\n\n await tx.executions.create(execution)\n const run = await transactionalRuns.queue({\n projectId: input.projectId,\n id: runId,\n executionId: execution.id,\n syncId: input.sync.id,\n datasetId: input.sync.target.dataset.id,\n mode: input.sync.config.mode,\n queuedAt,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n })\n return { publish: true, run, queuedAt, created: true }\n },\n { isolation: \"serializable\" }\n )\n } catch (error) {\n if (!(error instanceof SyncRunError)) throw error\n const raced = await syncRuns.getById({ projectId: input.projectId, id: runId })\n if (!raced) throw error\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, input.storage)\n return { publish: false, run: raced }\n }\n}\n\n/**\n * A run that has not started reads its source when it starts, so it already covers a trigger that\n * arrives now. The oldest one starts first; one queued with another request payload is not joined.\n */\nasync function findQueuedSyncRun(\n syncRuns: NonNullable<Storage[\"syncRuns\"]>,\n input: DispatchSyncRunInput\n): Promise<SyncRunRecord | undefined> {\n const { runs } = await syncRuns.list({\n projectId: input.projectId,\n syncId: input.sync.id,\n statuses: [\"queued\"],\n order: \"asc\",\n limit: 1,\n })\n const [waiting] = runs\n return waiting && runMatchesRequest(waiting, input) ? waiting : undefined\n}\n\n/**\n * The job a trigger publishes for the run it joins. The run's own job may be gone (a provider\n * keeps a settled job id, and ignores a new job under it), so each joining trigger brings a job\n * that can start the run; once it has started, the others complete without doing anything. The id\n * derives from the trigger's run id, so a redelivered trigger publishes the same job.\n */\nfunction joinJobId(waiting: SyncRunRecord, triggerRunId: string): string {\n return `${waiting.id}:join:${triggerRunId}`\n}\n\nasync function reuseSyncRun(\n input: DispatchSyncRunInput,\n existing: SyncRunRecord\n): Promise<PersistedSyncRun> {\n assertExistingRunMatchesRequest(existing, input)\n await input.validateExistingRun?.(existing, input.storage)\n if (input.validateExistingRun && existing.status === \"queued\") {\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution)\n throw new SyncRunError(`[Sixb] Execution '${existing.executionId}' was not found.`)\n return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false }\n }\n if (\n existing.status !== \"failed\" ||\n existing.error?.code !== \"queue.enqueue_failed\" ||\n !existing.error.retryable\n ) {\n return { publish: false, run: existing }\n }\n\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution) {\n throw new SyncRunError(\n `[Sixb] Execution '${existing.executionId}' for Sync run '${existing.id}' was not found.`\n )\n }\n\n const queuedAt = new Date()\n const run = await requireSyncRunStorage(input.storage).queue({\n projectId: input.projectId,\n id: existing.id,\n executionId: existing.executionId,\n syncId: existing.syncId,\n datasetId: existing.datasetId,\n mode: existing.mode,\n queuedAt,\n expectedLatestVersionId: existing.expectedLatestVersionId,\n commitMessage: existing.commitMessage,\n })\n return { publish: true, run, queuedAt, created: false }\n}\n\nasync function publishSyncRun(\n input: DispatchSyncRunInput,\n persisted: Extract<PersistedSyncRun, { readonly publish: true }>\n): Promise<SyncRunRequestResult> {\n const jobId = persisted.jobId ?? persisted.run.id\n\n try {\n const [job] = await input.queue.enqueue({\n projectId: input.projectId,\n jobs: [\n {\n id: jobId,\n type: \"sync.run.requested\",\n payload: { runId: persisted.run.id },\n ...(input.metadata === undefined ? {} : { metadata: input.metadata }),\n },\n ],\n })\n if (!job || job.id !== jobId) {\n throw new SyncRunError(`[Sixb] Queue did not acknowledge Sync run '${persisted.run.id}'.`)\n }\n return {\n syncId: persisted.run.syncId,\n runId: persisted.run.id,\n queuedAt: persisted.queuedAt.toISOString(),\n ...(job?.id ? { jobId: job.id } : {}),\n created: persisted.created,\n }\n } catch (error) {\n // Automatic consumers retain the batch and retry. Keep uncertain delivery queued:\n // a lost reply does not prove that the queue rejected the job.\n if (input.validateExistingRun) throw error\n const failedAt = new Date()\n const failure = toEnqueueFailure(error, persisted.run, failedAt)\n const failed = await requireSyncRunStorage(input.storage).finish({\n projectId: input.projectId,\n id: persisted.run.id,\n status: \"failed\",\n finishedAt: failedAt,\n error: failure,\n })\n reportRunFailure(input.errorReporterHost, error, {\n projectId: input.projectId,\n runKind: \"sync\",\n run: { runId: failed.id, syncId: failed.syncId },\n failure,\n })\n throw error\n }\n}\n\nfunction assertExistingRunMatchesRequest(\n existing: SyncRunRecord,\n input: Pick<DispatchSyncRunInput, \"sync\" | \"expectedLatestVersionId\" | \"commitMessage\">\n): void {\n if (!runMatchesRequest(existing, input)) {\n throw new SyncRunError(\n `[Sixb] Sync run '${existing.id}' already exists with a different request payload.`\n )\n }\n}\n\nfunction runMatchesRequest(\n existing: SyncRunRecord,\n input: Pick<DispatchSyncRunInput, \"sync\" | \"expectedLatestVersionId\" | \"commitMessage\">\n): boolean {\n return (\n existing.syncId === input.sync.id &&\n existing.datasetId === input.sync.target.dataset.id &&\n existing.mode === input.sync.config.mode &&\n existing.expectedLatestVersionId === input.expectedLatestVersionId &&\n existing.commitMessage === input.commitMessage\n )\n}\n\nfunction existingSyncRunResult(existing: SyncRunRecord): SyncRunRequestResult {\n return {\n syncId: existing.syncId,\n runId: existing.id,\n queuedAt: existing.queuedAt.toISOString(),\n created: false,\n }\n}\n\nfunction requireSyncRunStorage(storage: Storage): NonNullable<Storage[\"syncRuns\"]> {\n if (!storage.syncRuns) throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n return storage.syncRuns\n}\n\nfunction createSyncRunId(runId: string | undefined): string {\n if (runId === undefined) return `run_${randomUUID()}`\n if (!runId.trim()) throw new SyncValidationError(\"[Sixb] Sync run id must not be empty\")\n return runId\n}\n\nfunction assertAutomaticDispatchInput(input: AutomaticSyncRunDispatchInput): void {\n assertNonBlank(input.syncId, \"Sync id\")\n assertNonBlank(input.runId, \"Sync run id\")\n assertNonBlank(input.source.eventId, \"Sync source event id\")\n assertNonBlank(input.correlationId, \"Sync correlation id\")\n}\n\nasync function assertAutomaticExecutionIdentity(\n storage: Storage,\n projectId: string,\n input: AutomaticSyncRunDispatchInput,\n run: SyncRunRecord\n): Promise<void> {\n const execution = await storage.executions.getById({ projectId, id: run.executionId })\n if (\n !execution ||\n execution.source.type !== input.source.type ||\n execution.source.eventId !== input.source.eventId ||\n execution.correlationId !== input.correlationId ||\n execution.requestedBy !== undefined\n ) {\n throw new SyncValidationError(\n `[Sixb] Sync run '${run.id}' already exists with different automatic provenance.`\n )\n }\n}\n\nfunction toEnqueueFailure(\n error: unknown,\n run: SyncRunRecord,\n at: Date\n): SixbFailure<SyncRunFailureCode> {\n const enqueueError = createSixbError(\n \"queue.enqueue_failed\",\n `[Sixb] Could not enqueue Sync run '${run.id}'.`,\n {\n cause: error,\n details: { syncId: run.syncId, runId: run.id, phase: \"enqueue\" },\n }\n )\n return toSixbFailure(enqueueError, { allowedCodes: SYNC_RUN_FAILURE_CODES, at })\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (!value.trim()) throw new SyncValidationError(`[Sixb] ${label} must not be empty.`)\n}\n",
|
|
7
|
+
"import { assertAuthorized } from \"../authorization\"\nimport { resolveExecutionScopeAuthorization } from \"../execution/authorization\"\nimport {\n createPrimitiveExecutionRecord,\n ensureExecutionRecord,\n executionRecordInputFromRuntime,\n} from \"../execution/durable\"\nimport type { ExecutionContext } from \"../execution/types\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport { SyncValidationError } from \"./errors\"\nimport { dispatchSyncRun } from \"./run-dispatch\"\nimport type { SyncDefinition } from \"./types\"\n\nexport interface SyncRunRequestOptions {\n /** Stable identity used to make dispatch idempotent. */\n readonly runId?: string\n /** Optimistic concurrency guard: fail the run if the dataset moved past this version. */\n readonly expectedLatestVersionId?: string\n readonly commitMessage?: string\n}\n\nexport interface RequestSyncRunInput extends SyncRunRequestOptions {\n readonly syncId: string\n}\n\nexport interface SyncRunRequestResult {\n readonly syncId: string\n readonly runId: string\n /** Durable time at which the run entered the queue. */\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\n/**\n * Authorize and queue a sync run request.\n *\n * Operates on an already-resolved definition and the shared runtime context, so the HTTP route and\n * the runtime verb cannot drift apart.\n *\n * The immutable child execution and queued run are persisted before queue publication.\n */\nexport async function requestSyncRun(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n sync: SyncDefinition,\n options: SyncRunRequestOptions = {}\n): Promise<SyncRunRequestResult> {\n resolveExecutionScopeAuthorization(runtime.projectId, {\n execution,\n authorization: runtime.runtimeAuthorization,\n })\n assertAuthorized(runtime, { kind: \"sync.run\", syncId: sync.id })\n if (!runtime.storage.syncRuns) {\n throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n }\n\n const queue = runtime.queues.syncRuns\n if (!queue) {\n throw new SyncValidationError(\"[Sixb] Sync run queue is not configured.\")\n }\n\n return dispatchSyncRun({\n errorReporterHost: runtime,\n projectId: runtime.projectId,\n sync,\n storage: runtime.storage,\n queue,\n ...options,\n createExecution: async (executionId, runId) => {\n const caller = await ensureExecutionRecord(\n runtime.storage.executions,\n executionRecordInputFromRuntime({\n execution,\n runtimeAuthorization: runtime.runtimeAuthorization,\n })\n )\n return createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId },\n origin: { type: \"execution\", parent: caller },\n })\n },\n })\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,6BAA4B,MAAM;AAAA,EACpC,OAAO;AAClB;;;ACFA;AA4DO,MAAM,mBAAiD;AAAA,EAC/B;AAAA,EAA7B,WAAW,CAAkB,cAA6C;AAAA,IAA7C;AAAA;AAAA,QAEvB,QAAQ,CAAC,OAAqE;AAAA,IAClF,6BAA6B,KAAK;AAAA,IAClC,MAAM,OAAO,KAAK,aAAa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