@kici-dev/orchestrator 0.20.0 → 0.21.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/api-client.d.ts +2 -0
- package/dist/cli/commands/runs.d.ts +3 -1
- package/dist/cli/commands/shared/run-ref.d.ts +4 -0
- package/dist/cli/commands/source.d.ts +1 -1
- package/dist/cli.js +834 -687
- package/dist/db/migrations/160_execution_jobs_workflow_name.d.ts +16 -0
- package/dist/db/types.d.ts +6 -0
- package/dist/index.js +1 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +9 -1
- package/dist/pipeline/invoke-gate.d.ts +1 -1
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +3 -1
- package/dist/pipeline/test-pipeline.d.ts +23 -1
- package/dist/provenance/backfill-run.d.ts +2 -0
- package/dist/reporting/check-run-reporter.d.ts +2 -0
- package/dist/reporting/check-run-summary.d.ts +12 -0
- package/dist/reporting/execution-tracker.d.ts +30 -2
- package/dist/reporting/run-aggregator.d.ts +8 -0
- package/dist/reporting/run-workflow-names.d.ts +30 -0
- package/dist/reporting/step-display-order.d.ts +9 -5
- package/dist/server.js +51833 -51469
- package/dist/standalone.js +8612 -8289
- package/dist/ws/job-status-forward-frame.d.ts +2 -0
- package/dist/ws/test-relay-handlers.d.ts +8 -0
- package/installer-image-digests.json +3 -3
- package/package.json +4 -4
- package/sbom.spdx.json +53 -53
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import fs, { chmodSync, closeSync, constants, createReadStream, createWriteStrea
|
|
|
8
8
|
import { Command, Option } from "commander";
|
|
9
9
|
import { AGENT_DEFAULT_PORT, LOGGER_ENV_VARS, ORCHESTRATOR_DEFAULT_PORT, defineEnv, validateUnknownKiciVars } from "@kici-dev/shared/env";
|
|
10
10
|
import { AgentPlatform, BaseColdStore, ChunkLru, PgTableAdapterBase, ReadinessStatus, addLogsToArchive, clearDispatchQueueDirect, computeMigrationsHash, createColdStoreAdminOps, createContextTemplateDirect, createDb, createDbRole, createLogger, createPool, createReadOnlyDbUser, createS3Client, decrypt, deleteContextDirect, deriveKey, diagnoseExitCode, diffFingerprints, dropAndCreateDatabase, emitKiciEventDirect, encrypt, ensureDatabase, fingerprintSchema, formatBytes, formatDiffEntry, formatUptime, isSchemaCurrent, kiciMkdtemp, listCheckRunTrackingDirect, listContextsDirect, listExecutionRunsDirect, listQueueDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, prunePeerCredentialsDirect, purgeContextsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, registerWorkflowManualDirect, resetRaftStateDirect, seedContextBindingDirect, seedContextDirect, serializeError, setContextPolicyDirect, setContextSecretDirect, sha256, showContextDirect, showExecutionRunDirect, showQueueEntryDirect, showRegistrationDirect, splitAgentPlatform, storeMigrationContentHash, toCommandError, toErrorMessage } from "@kici-dev/shared";
|
|
11
|
-
import { AccessLogSource, ApprovalDecision, CiTrustLevel, ContextType, ExecutionJobStatus, FleetHostWriteRefusal, ForkPolicy, HoldType, JOIN_PROTOCOL_UNSUPPORTED_MESSAGE, JOIN_PROTOCOL_VERSION, JoinErrorCode, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, MinimumTrustSchema, OrchRole, OrchestratorMode, PLATFORM_CONNECTED_MODES, PRIVILEGED_ROOT_LABEL, PROTOCOL_VERSION, PeerForgetOutcome, RuntimeFact, ScalerBackendType, ScalerEventType, ScalerReloadOutcome, ScalerVmStatus, ScalerVmStopOutcome, ScalerVmTracker, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, WS_MAX_PAYLOAD_BYTES, accessLogWarmSqlCase, agentLabelOf, assertValidSecretKey, attestationVerifyStatusSchema, canonicalizeLabel, canonicalizeLabels, canonicalizeMatcher, flattenActor, formatExpiryDuration, getAccessLogColdDays, getSecretAuditLogColdDays, joinResponseSchema, matcherSatisfiedBy, minAccessLogWarmDays, minSecretAuditLogWarmDays, parseExpiryDuration, parseHostPropertyAssignments, platformToTaints, resolveHeldRunId, resolveRoleLabels, resourceRequestNestedSchema, runtimeLabel, scalerAgentLabels, scalerPlatformSchema, secretAuditLogWarmSqlCase, shouldRecordAccess, sleep, toIsoString } from "@kici-dev/engine";
|
|
11
|
+
import { AccessLogSource, ApprovalDecision, CiTrustLevel, ContextType, ExecutionJobStatus, FleetHostWriteRefusal, ForkPolicy, HoldType, JOIN_PROTOCOL_UNSUPPORTED_MESSAGE, JOIN_PROTOCOL_VERSION, JoinErrorCode, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, MinimumTrustSchema, OrchRole, OrchestratorMode, PLATFORM_CONNECTED_MODES, PRIVILEGED_ROOT_LABEL, PROTOCOL_VERSION, PeerForgetOutcome, RuntimeFact, ScalerBackendType, ScalerEventType, ScalerReloadOutcome, ScalerVmStatus, ScalerVmStopOutcome, ScalerVmTracker, StepPhase, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, WS_MAX_PAYLOAD_BYTES, accessLogWarmSqlCase, agentLabelOf, assertValidSecretKey, attestationVerifyStatusSchema, canonicalizeLabel, canonicalizeLabels, canonicalizeMatcher, compareStepsByPhase, flattenActor, formatExpiryDuration, getAccessLogColdDays, getSecretAuditLogColdDays, initStepIndex, initStepLabel, initStepType, invalidRunIdMessage, joinResponseSchema, matcherSatisfiedBy, minAccessLogWarmDays, minSecretAuditLogWarmDays, parseExpiryDuration, parseHostPropertyAssignments, parseInitStepRef, parseRunIdRef, pickRunIdMatch, platformToTaints, resolveHeldRunId, resolveRoleLabels, resourceRequestNestedSchema, runIdHasPrefix, runtimeLabel, scalerAgentLabels, scalerPlatformSchema, secretAuditLogWarmSqlCase, shouldRecordAccess, sleep, stepPhase, toIsoString } from "@kici-dev/engine";
|
|
12
12
|
import crypto$1, { createDecipheriv, createHash, createHmac, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
13
13
|
import { createInterface } from "node:readline";
|
|
14
14
|
import { access, chmod, constants as constants$1, copyFile, link, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -521,6 +521,7 @@ var AdminApiClient = class {
|
|
|
521
521
|
workflowName: opts?.workflowName,
|
|
522
522
|
repo: opts?.repo,
|
|
523
523
|
since: opts?.since,
|
|
524
|
+
runIdPrefix: opts?.runIdPrefix,
|
|
524
525
|
limit: opts?.limit || void 0,
|
|
525
526
|
offset: opts?.offset || void 0
|
|
526
527
|
});
|
|
@@ -1874,8 +1875,8 @@ var init_client = __esmMin((() => {
|
|
|
1874
1875
|
//#region src/db/migrations/001_initial.ts
|
|
1875
1876
|
init_client();
|
|
1876
1877
|
var _001_initial_exports = /* @__PURE__ */ __exportAll({
|
|
1877
|
-
down: () => down$
|
|
1878
|
-
up: () => up$
|
|
1878
|
+
down: () => down$159,
|
|
1879
|
+
up: () => up$159
|
|
1879
1880
|
});
|
|
1880
1881
|
/**
|
|
1881
1882
|
* Squashed initial migration: the complete Orchestrator baseline schema, replacing the original
|
|
@@ -2559,7 +2560,7 @@ const DDL_STATEMENTS = [
|
|
|
2559
2560
|
`ALTER TABLE ONLY public.held_runs
|
|
2560
2561
|
ADD CONSTRAINT held_runs_environment_id_fkey FOREIGN KEY (environment_id) REFERENCES public.environments(id);`
|
|
2561
2562
|
];
|
|
2562
|
-
async function up$
|
|
2563
|
+
async function up$159(db) {
|
|
2563
2564
|
for (const stmt of DDL_STATEMENTS) await sql.raw(stmt).execute(db);
|
|
2564
2565
|
await sql`
|
|
2565
2566
|
INSERT INTO cluster_meta (key, value)
|
|
@@ -2578,7 +2579,7 @@ async function up$158(db) {
|
|
|
2578
2579
|
`.execute(db);
|
|
2579
2580
|
}
|
|
2580
2581
|
/** Drops everything `up` created; CASCADE cuts the FK graph without a topological order. */
|
|
2581
|
-
async function down$
|
|
2582
|
+
async function down$159(db) {
|
|
2582
2583
|
for (const [trig, tbl] of [["source_secrets_change_trigger", "scoped_secrets"], ["sources_change_trigger", "sources"]]) await sql.raw(`DROP TRIGGER IF EXISTS ${trig} ON public.${tbl}`).execute(db);
|
|
2583
2584
|
for (const table of [
|
|
2584
2585
|
"workflow_registrations",
|
|
@@ -2625,8 +2626,8 @@ async function down$158(db) {
|
|
|
2625
2626
|
//#endregion
|
|
2626
2627
|
//#region src/db/migrations/002_config_versions_key_version.ts
|
|
2627
2628
|
var _002_config_versions_key_version_exports = /* @__PURE__ */ __exportAll({
|
|
2628
|
-
down: () => down$
|
|
2629
|
-
up: () => up$
|
|
2629
|
+
down: () => down$158,
|
|
2630
|
+
up: () => up$158
|
|
2630
2631
|
});
|
|
2631
2632
|
/**
|
|
2632
2633
|
* `config_versions.key_version`, so `kici-admin rotate-key` can rotate sensitive-field encryption.
|
|
@@ -2637,13 +2638,13 @@ var _002_config_versions_key_version_exports = /* @__PURE__ */ __exportAll({
|
|
|
2637
2638
|
*
|
|
2638
2639
|
* No index: rotation full-scans; reads go by the `version` primary key.
|
|
2639
2640
|
*/
|
|
2640
|
-
async function up$
|
|
2641
|
+
async function up$158(db) {
|
|
2641
2642
|
await sql`
|
|
2642
2643
|
ALTER TABLE public.config_versions
|
|
2643
2644
|
ADD COLUMN key_version integer NOT NULL DEFAULT 1
|
|
2644
2645
|
`.execute(db);
|
|
2645
2646
|
}
|
|
2646
|
-
async function down$
|
|
2647
|
+
async function down$158(db) {
|
|
2647
2648
|
await sql`
|
|
2648
2649
|
ALTER TABLE public.config_versions
|
|
2649
2650
|
DROP COLUMN key_version
|
|
@@ -2652,8 +2653,8 @@ async function down$157(db) {
|
|
|
2652
2653
|
//#endregion
|
|
2653
2654
|
//#region src/db/migrations/003_access_log.ts
|
|
2654
2655
|
var _003_access_log_exports = /* @__PURE__ */ __exportAll({
|
|
2655
|
-
down: () => down$
|
|
2656
|
-
up: () => up$
|
|
2656
|
+
down: () => down$157,
|
|
2657
|
+
up: () => up$157
|
|
2657
2658
|
});
|
|
2658
2659
|
/**
|
|
2659
2660
|
* Access log: one row per read or orchestrator-admin mutation attributable
|
|
@@ -2672,7 +2673,7 @@ var _003_access_log_exports = /* @__PURE__ */ __exportAll({
|
|
|
2672
2673
|
*
|
|
2673
2674
|
* Retention is TTL-based via expires_at; queue/cleanup.ts prunes.
|
|
2674
2675
|
*/
|
|
2675
|
-
async function up$
|
|
2676
|
+
async function up$157(db) {
|
|
2676
2677
|
await sql`
|
|
2677
2678
|
CREATE TABLE public.access_log (
|
|
2678
2679
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
@@ -2710,28 +2711,28 @@ async function up$156(db) {
|
|
|
2710
2711
|
ON public.access_log (actor_type, actor_id, created_at DESC)
|
|
2711
2712
|
`.execute(db);
|
|
2712
2713
|
}
|
|
2713
|
-
async function down$
|
|
2714
|
+
async function down$157(db) {
|
|
2714
2715
|
await sql`DROP TABLE IF EXISTS public.access_log`.execute(db);
|
|
2715
2716
|
}
|
|
2716
2717
|
//#endregion
|
|
2717
2718
|
//#region src/db/migrations/004_rename_bundle_to_source.ts
|
|
2718
2719
|
var _004_rename_bundle_to_source_exports = /* @__PURE__ */ __exportAll({
|
|
2719
|
-
down: () => down$
|
|
2720
|
-
up: () => up$
|
|
2720
|
+
down: () => down$156,
|
|
2721
|
+
up: () => up$156
|
|
2721
2722
|
});
|
|
2722
|
-
async function up$
|
|
2723
|
+
async function up$156(db) {
|
|
2723
2724
|
await db.schema.alterTable("dispatch_queue").renameColumn("bundle_url", "source_tar_url").execute();
|
|
2724
2725
|
await db.schema.alterTable("dispatch_queue").renameColumn("bundle_hash", "source_tar_hash").execute();
|
|
2725
2726
|
}
|
|
2726
|
-
async function down$
|
|
2727
|
+
async function down$156(db) {
|
|
2727
2728
|
await db.schema.alterTable("dispatch_queue").renameColumn("source_tar_url", "bundle_url").execute();
|
|
2728
2729
|
await db.schema.alterTable("dispatch_queue").renameColumn("source_tar_hash", "bundle_hash").execute();
|
|
2729
2730
|
}
|
|
2730
2731
|
//#endregion
|
|
2731
2732
|
//#region src/db/migrations/005_cold_store_chunk_counter.ts
|
|
2732
2733
|
var _005_cold_store_chunk_counter_exports = /* @__PURE__ */ __exportAll({
|
|
2733
|
-
down: () => down$
|
|
2734
|
-
up: () => up$
|
|
2734
|
+
down: () => down$155,
|
|
2735
|
+
up: () => up$155
|
|
2735
2736
|
});
|
|
2736
2737
|
/**
|
|
2737
2738
|
* Per-(db, table, tenant) archived-chunk totals, so the `cold_store_chunks_total` gauge and
|
|
@@ -2740,7 +2741,7 @@ var _005_cold_store_chunk_counter_exports = /* @__PURE__ */ __exportAll({
|
|
|
2740
2741
|
* Starts empty; the archiver upserts it in the same transaction as every successful chunk
|
|
2741
2742
|
* write (`INSERT ... ON CONFLICT (db, table_name, tenant_id) DO UPDATE ...`).
|
|
2742
2743
|
*/
|
|
2743
|
-
async function up$
|
|
2744
|
+
async function up$155(db) {
|
|
2744
2745
|
await sql`
|
|
2745
2746
|
CREATE TABLE public.cold_store_chunk_counts (
|
|
2746
2747
|
db TEXT NOT NULL,
|
|
@@ -2758,14 +2759,14 @@ async function up$154(db) {
|
|
|
2758
2759
|
ON public.cold_store_chunk_counts (db, table_name)
|
|
2759
2760
|
`.execute(db);
|
|
2760
2761
|
}
|
|
2761
|
-
async function down$
|
|
2762
|
+
async function down$155(db) {
|
|
2762
2763
|
await sql`DROP TABLE IF EXISTS public.cold_store_chunk_counts`.execute(db);
|
|
2763
2764
|
}
|
|
2764
2765
|
//#endregion
|
|
2765
2766
|
//#region src/db/migrations/006_runs_jobs_steps_archived_at.ts
|
|
2766
2767
|
var _006_runs_jobs_steps_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
2767
|
-
down: () => down$
|
|
2768
|
-
up: () => up$
|
|
2768
|
+
down: () => down$154,
|
|
2769
|
+
up: () => up$154
|
|
2769
2770
|
});
|
|
2770
2771
|
/**
|
|
2771
2772
|
* Cold-store columns for `execution_runs` / `execution_jobs` / `execution_steps`.
|
|
@@ -2781,7 +2782,7 @@ var _006_runs_jobs_steps_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
|
2781
2782
|
* The `(routing_key, created_at)` indexes serve the archiver's `listEligiblePartitions` query
|
|
2782
2783
|
* (`GROUP BY routing_key, DATE(created_at)`).
|
|
2783
2784
|
*/
|
|
2784
|
-
async function up$
|
|
2785
|
+
async function up$154(db) {
|
|
2785
2786
|
await sql`
|
|
2786
2787
|
ALTER TABLE public.execution_runs
|
|
2787
2788
|
ADD COLUMN archived_at TIMESTAMPTZ NULL,
|
|
@@ -2826,7 +2827,7 @@ async function up$153(db) {
|
|
|
2826
2827
|
ON public.execution_steps (routing_key, created_at)
|
|
2827
2828
|
`.execute(db);
|
|
2828
2829
|
}
|
|
2829
|
-
async function down$
|
|
2830
|
+
async function down$154(db) {
|
|
2830
2831
|
await sql`DROP INDEX IF EXISTS public.idx_execution_steps_routing_key_created`.execute(db);
|
|
2831
2832
|
await sql`
|
|
2832
2833
|
ALTER TABLE public.execution_steps
|
|
@@ -2851,8 +2852,8 @@ async function down$153(db) {
|
|
|
2851
2852
|
//#endregion
|
|
2852
2853
|
//#region src/db/migrations/007_audit_logs_archived_at.ts
|
|
2853
2854
|
var _007_audit_logs_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
2854
|
-
down: () => down$
|
|
2855
|
-
up: () => up$
|
|
2855
|
+
down: () => down$153,
|
|
2856
|
+
up: () => up$153
|
|
2856
2857
|
});
|
|
2857
2858
|
/**
|
|
2858
2859
|
* Cold-store columns for `secret_audit_log` and `access_log`, and removal of `access_log`'s
|
|
@@ -2870,7 +2871,7 @@ var _007_audit_logs_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
|
2870
2871
|
* contract. `down()` recreates it with a `now() + 90 days` default, best effort: rows inserted
|
|
2871
2872
|
* after `up()` get no meaningful retention bound.
|
|
2872
2873
|
*/
|
|
2873
|
-
async function up$
|
|
2874
|
+
async function up$153(db) {
|
|
2874
2875
|
await sql`
|
|
2875
2876
|
ALTER TABLE public.secret_audit_log
|
|
2876
2877
|
ADD COLUMN archived_at TIMESTAMPTZ NULL,
|
|
@@ -2891,7 +2892,7 @@ async function up$152(db) {
|
|
|
2891
2892
|
DROP COLUMN IF EXISTS expires_at
|
|
2892
2893
|
`.execute(db);
|
|
2893
2894
|
}
|
|
2894
|
-
async function down$
|
|
2895
|
+
async function down$153(db) {
|
|
2895
2896
|
await sql`
|
|
2896
2897
|
ALTER TABLE public.access_log
|
|
2897
2898
|
ADD COLUMN expires_at TIMESTAMPTZ NOT NULL DEFAULT (now() + INTERVAL '90 days')
|
|
@@ -2919,8 +2920,8 @@ async function down$152(db) {
|
|
|
2919
2920
|
//#endregion
|
|
2920
2921
|
//#region src/db/migrations/008_event_log_archived_at.ts
|
|
2921
2922
|
var _008_event_log_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
2922
|
-
down: () => down$
|
|
2923
|
-
up: () => up$
|
|
2923
|
+
down: () => down$152,
|
|
2924
|
+
up: () => up$152
|
|
2924
2925
|
});
|
|
2925
2926
|
/**
|
|
2926
2927
|
* `event_log` cold-store schema: adds the `archived_at` /
|
|
@@ -2941,7 +2942,7 @@ var _008_event_log_archived_at_exports = /* @__PURE__ */ __exportAll({
|
|
|
2941
2942
|
* effort; rows inserted between `up()` and `down()` get no meaningful
|
|
2942
2943
|
* retention bound.
|
|
2943
2944
|
*/
|
|
2944
|
-
async function up$
|
|
2945
|
+
async function up$152(db) {
|
|
2945
2946
|
await sql`
|
|
2946
2947
|
ALTER TABLE public.event_log
|
|
2947
2948
|
ADD COLUMN archived_at TIMESTAMPTZ NULL,
|
|
@@ -2957,7 +2958,7 @@ async function up$151(db) {
|
|
|
2957
2958
|
DROP COLUMN IF EXISTS expires_at
|
|
2958
2959
|
`.execute(db);
|
|
2959
2960
|
}
|
|
2960
|
-
async function down$
|
|
2961
|
+
async function down$152(db) {
|
|
2961
2962
|
await sql`
|
|
2962
2963
|
ALTER TABLE public.event_log
|
|
2963
2964
|
ADD COLUMN expires_at TIMESTAMPTZ NOT NULL DEFAULT (now() + INTERVAL '30 days')
|
|
@@ -2976,8 +2977,8 @@ async function down$151(db) {
|
|
|
2976
2977
|
//#endregion
|
|
2977
2978
|
//#region src/db/migrations/009_access_log_trigram.ts
|
|
2978
2979
|
var _009_access_log_trigram_exports = /* @__PURE__ */ __exportAll({
|
|
2979
|
-
down: () => down$
|
|
2980
|
-
up: () => up$
|
|
2980
|
+
down: () => down$151,
|
|
2981
|
+
up: () => up$151
|
|
2981
2982
|
});
|
|
2982
2983
|
/**
|
|
2983
2984
|
* pg_trgm index on access_log.error_message for the Activity page's `q` search; matches the
|
|
@@ -2986,7 +2987,7 @@ var _009_access_log_trigram_exports = /* @__PURE__ */ __exportAll({
|
|
|
2986
2987
|
* Idempotent. No CONCURRENTLY because Kysely runs migrations inside a transaction; the lock is
|
|
2987
2988
|
* brief on a sampled table.
|
|
2988
2989
|
*/
|
|
2989
|
-
async function up$
|
|
2990
|
+
async function up$151(db) {
|
|
2990
2991
|
await sql`CREATE EXTENSION IF NOT EXISTS pg_trgm`.execute(db);
|
|
2991
2992
|
await sql`
|
|
2992
2993
|
CREATE INDEX IF NOT EXISTS access_log_error_message_trgm_idx
|
|
@@ -2995,14 +2996,14 @@ async function up$150(db) {
|
|
|
2995
2996
|
WHERE error_message IS NOT NULL
|
|
2996
2997
|
`.execute(db);
|
|
2997
2998
|
}
|
|
2998
|
-
async function down$
|
|
2999
|
+
async function down$151(db) {
|
|
2999
3000
|
await sql`DROP INDEX IF EXISTS public.access_log_error_message_trgm_idx`.execute(db);
|
|
3000
3001
|
}
|
|
3001
3002
|
//#endregion
|
|
3002
3003
|
//#region src/db/migrations/010_cold_store_chunks.ts
|
|
3003
3004
|
var _010_cold_store_chunks_exports = /* @__PURE__ */ __exportAll({
|
|
3004
|
-
down: () => down$
|
|
3005
|
-
up: () => up$
|
|
3005
|
+
down: () => down$150,
|
|
3006
|
+
up: () => up$150
|
|
3006
3007
|
});
|
|
3007
3008
|
/**
|
|
3008
3009
|
* Cold-store chunk index: one row per archived chunk the GC sweep can later
|
|
@@ -3024,7 +3025,7 @@ var _010_cold_store_chunks_exports = /* @__PURE__ */ __exportAll({
|
|
|
3024
3025
|
* V1-manifest chunks are NOT here — they live forever — nor are chunks from
|
|
3025
3026
|
* adapters that do not opt into per-bucket archival via `coldTtlDays`.
|
|
3026
3027
|
*/
|
|
3027
|
-
async function up$
|
|
3028
|
+
async function up$150(db) {
|
|
3028
3029
|
await sql`
|
|
3029
3030
|
CREATE TABLE public.cold_store_chunks (
|
|
3030
3031
|
db TEXT NOT NULL,
|
|
@@ -3051,14 +3052,14 @@ async function up$149(db) {
|
|
|
3051
3052
|
ON public.cold_store_chunks (db, table_name, tenant_id, archived_at DESC)
|
|
3052
3053
|
`.execute(db);
|
|
3053
3054
|
}
|
|
3054
|
-
async function down$
|
|
3055
|
+
async function down$150(db) {
|
|
3055
3056
|
await sql`DROP TABLE IF EXISTS public.cold_store_chunks`.execute(db);
|
|
3056
3057
|
}
|
|
3057
3058
|
//#endregion
|
|
3058
3059
|
//#region src/db/migrations/011_drop_source_secrets_notify.ts
|
|
3059
3060
|
var _011_drop_source_secrets_notify_exports = /* @__PURE__ */ __exportAll({
|
|
3060
|
-
down: () => down$
|
|
3061
|
-
up: () => up$
|
|
3061
|
+
down: () => down$149,
|
|
3062
|
+
up: () => up$149
|
|
3062
3063
|
});
|
|
3063
3064
|
/**
|
|
3064
3065
|
* Drops `source_secrets_change_trigger` and `notify_source_secrets_change()`. Their only
|
|
@@ -3069,11 +3070,11 @@ var _011_drop_source_secrets_notify_exports = /* @__PURE__ */ __exportAll({
|
|
|
3069
3070
|
* `down` re-creates both as defined in `001_initial.ts`; they wake no consumer, so the
|
|
3070
3071
|
* rollback is safe.
|
|
3071
3072
|
*/
|
|
3072
|
-
async function up$
|
|
3073
|
+
async function up$149(db) {
|
|
3073
3074
|
await sql`DROP TRIGGER IF EXISTS source_secrets_change_trigger ON public.scoped_secrets`.execute(db);
|
|
3074
3075
|
await sql`DROP FUNCTION IF EXISTS public.notify_source_secrets_change() CASCADE`.execute(db);
|
|
3075
3076
|
}
|
|
3076
|
-
async function down$
|
|
3077
|
+
async function down$149(db) {
|
|
3077
3078
|
await sql`
|
|
3078
3079
|
CREATE OR REPLACE FUNCTION public.notify_source_secrets_change() RETURNS trigger
|
|
3079
3080
|
LANGUAGE plpgsql
|
|
@@ -3112,8 +3113,8 @@ async function down$148(db) {
|
|
|
3112
3113
|
//#endregion
|
|
3113
3114
|
//#region src/db/migrations/012_peer_credentials_active_uniq.ts
|
|
3114
3115
|
var _012_peer_credentials_active_uniq_exports = /* @__PURE__ */ __exportAll({
|
|
3115
|
-
down: () => down$
|
|
3116
|
-
up: () => up$
|
|
3116
|
+
down: () => down$148,
|
|
3117
|
+
up: () => up$148
|
|
3117
3118
|
});
|
|
3118
3119
|
/**
|
|
3119
3120
|
* Add a partial unique index on `peer_credentials (instance_id) WHERE
|
|
@@ -3132,7 +3133,7 @@ var _012_peer_credentials_active_uniq_exports = /* @__PURE__ */ __exportAll({
|
|
|
3132
3133
|
* `down()` only drops the index; it does NOT undo the dedupe (revoked rows
|
|
3133
3134
|
* cannot be safely recreated, and the dedupe is monotonic).
|
|
3134
3135
|
*/
|
|
3135
|
-
async function up$
|
|
3136
|
+
async function up$148(db) {
|
|
3136
3137
|
await sql`
|
|
3137
3138
|
UPDATE public.peer_credentials
|
|
3138
3139
|
SET revoked_at = NOW()
|
|
@@ -3150,14 +3151,14 @@ async function up$147(db) {
|
|
|
3150
3151
|
WHERE revoked_at IS NULL
|
|
3151
3152
|
`.execute(db);
|
|
3152
3153
|
}
|
|
3153
|
-
async function down$
|
|
3154
|
+
async function down$148(db) {
|
|
3154
3155
|
await sql`DROP INDEX IF EXISTS public.peer_credentials_active_uniq`.execute(db);
|
|
3155
3156
|
}
|
|
3156
3157
|
//#endregion
|
|
3157
3158
|
//#region src/db/migrations/013_execution_log_bytes.ts
|
|
3158
3159
|
var _013_execution_log_bytes_exports = /* @__PURE__ */ __exportAll({
|
|
3159
|
-
down: () => down$
|
|
3160
|
-
up: () => up$
|
|
3160
|
+
down: () => down$147,
|
|
3161
|
+
up: () => up$147
|
|
3161
3162
|
});
|
|
3162
3163
|
/**
|
|
3163
3164
|
* Per-run and per-job raw log byte totals, reported by agents on terminal `step.status`.
|
|
@@ -3168,7 +3169,7 @@ var _013_execution_log_bytes_exports = /* @__PURE__ */ __exportAll({
|
|
|
3168
3169
|
* Default 0 needs no backfill: older runs never had the agent telemetry, so zero is correct.
|
|
3169
3170
|
* Idempotent.
|
|
3170
3171
|
*/
|
|
3171
|
-
async function up$
|
|
3172
|
+
async function up$147(db) {
|
|
3172
3173
|
await sql`
|
|
3173
3174
|
ALTER TABLE public.execution_runs
|
|
3174
3175
|
ADD COLUMN IF NOT EXISTS log_bytes BIGINT NOT NULL DEFAULT 0
|
|
@@ -3178,15 +3179,15 @@ async function up$146(db) {
|
|
|
3178
3179
|
ADD COLUMN IF NOT EXISTS log_bytes BIGINT NOT NULL DEFAULT 0
|
|
3179
3180
|
`.execute(db);
|
|
3180
3181
|
}
|
|
3181
|
-
async function down$
|
|
3182
|
+
async function down$147(db) {
|
|
3182
3183
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS log_bytes`.execute(db);
|
|
3183
3184
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS log_bytes`.execute(db);
|
|
3184
3185
|
}
|
|
3185
3186
|
//#endregion
|
|
3186
3187
|
//#region src/db/migrations/014_kici_events_lease_retry.ts
|
|
3187
3188
|
var _014_kici_events_lease_retry_exports = /* @__PURE__ */ __exportAll({
|
|
3188
|
-
down: () => down$
|
|
3189
|
-
up: () => up$
|
|
3189
|
+
down: () => down$146,
|
|
3190
|
+
up: () => up$146
|
|
3190
3191
|
});
|
|
3191
3192
|
/**
|
|
3192
3193
|
* Lease + retry + DLQ columns on `kici_events`, so the EventRouter delivers
|
|
@@ -3207,7 +3208,7 @@ var _014_kici_events_lease_retry_exports = /* @__PURE__ */ __exportAll({
|
|
|
3207
3208
|
*
|
|
3208
3209
|
* Partial indexes skip the hot-path processed=true rows. Idempotent.
|
|
3209
3210
|
*/
|
|
3210
|
-
async function up$
|
|
3211
|
+
async function up$146(db) {
|
|
3211
3212
|
await sql`
|
|
3212
3213
|
ALTER TABLE public.kici_events
|
|
3213
3214
|
ADD COLUMN IF NOT EXISTS claimed_at TIMESTAMPTZ,
|
|
@@ -3238,7 +3239,7 @@ async function up$145(db) {
|
|
|
3238
3239
|
WHERE dlq_at IS NOT NULL
|
|
3239
3240
|
`.execute(db);
|
|
3240
3241
|
}
|
|
3241
|
-
async function down$
|
|
3242
|
+
async function down$146(db) {
|
|
3242
3243
|
await sql`DROP INDEX IF EXISTS public.idx_kici_events_dlq`.execute(db);
|
|
3243
3244
|
await sql`DROP INDEX IF EXISTS public.idx_kici_events_lease_expired`.execute(db);
|
|
3244
3245
|
await sql`DROP INDEX IF EXISTS public.idx_kici_events_retry_due`.execute(db);
|
|
@@ -3256,8 +3257,8 @@ async function down$145(db) {
|
|
|
3256
3257
|
//#endregion
|
|
3257
3258
|
//#region src/db/migrations/015_org_settings_customer_scoped.ts
|
|
3258
3259
|
var _015_org_settings_customer_scoped_exports = /* @__PURE__ */ __exportAll({
|
|
3259
|
-
down: () => down$
|
|
3260
|
-
up: () => up$
|
|
3260
|
+
down: () => down$145,
|
|
3261
|
+
up: () => up$145
|
|
3261
3262
|
});
|
|
3262
3263
|
/**
|
|
3263
3264
|
* Org-scope `org_settings` and qualify each glob entry by source.
|
|
@@ -3280,7 +3281,7 @@ var _015_org_settings_customer_scoped_exports = /* @__PURE__ */ __exportAll({
|
|
|
3280
3281
|
*
|
|
3281
3282
|
* Idempotent: an existing `customer_id` column makes a re-run a no-op.
|
|
3282
3283
|
*/
|
|
3283
|
-
async function up$
|
|
3284
|
+
async function up$145(db) {
|
|
3284
3285
|
if ((await sql`
|
|
3285
3286
|
SELECT EXISTS (
|
|
3286
3287
|
SELECT 1 FROM information_schema.columns
|
|
@@ -3405,7 +3406,7 @@ async function up$144(db) {
|
|
|
3405
3406
|
await sql`DROP TABLE _org_settings_merged`.execute(db);
|
|
3406
3407
|
await sql`DROP TABLE _org_settings_stage`.execute(db);
|
|
3407
3408
|
}
|
|
3408
|
-
async function down$
|
|
3409
|
+
async function down$145(db) {
|
|
3409
3410
|
if (!(await sql`
|
|
3410
3411
|
SELECT EXISTS (
|
|
3411
3412
|
SELECT 1 FROM information_schema.columns
|
|
@@ -3430,8 +3431,8 @@ async function down$144(db) {
|
|
|
3430
3431
|
//#endregion
|
|
3431
3432
|
//#region src/db/migrations/016_org_settings_allow_http_npm.ts
|
|
3432
3433
|
var _016_org_settings_allow_http_npm_exports = /* @__PURE__ */ __exportAll({
|
|
3433
|
-
down: () => down$
|
|
3434
|
-
up: () => up$
|
|
3434
|
+
down: () => down$144,
|
|
3435
|
+
up: () => up$144
|
|
3435
3436
|
});
|
|
3436
3437
|
/**
|
|
3437
3438
|
* Add `org_settings.allow_http_npm_registries boolean NOT NULL DEFAULT false`.
|
|
@@ -3442,7 +3443,7 @@ var _016_org_settings_allow_http_npm_exports = /* @__PURE__ */ __exportAll({
|
|
|
3442
3443
|
*
|
|
3443
3444
|
* Idempotent.
|
|
3444
3445
|
*/
|
|
3445
|
-
async function up$
|
|
3446
|
+
async function up$144(db) {
|
|
3446
3447
|
if ((await sql`
|
|
3447
3448
|
SELECT EXISTS (
|
|
3448
3449
|
SELECT 1 FROM information_schema.columns
|
|
@@ -3456,7 +3457,7 @@ async function up$143(db) {
|
|
|
3456
3457
|
ADD COLUMN allow_http_npm_registries boolean NOT NULL DEFAULT false
|
|
3457
3458
|
`.execute(db);
|
|
3458
3459
|
}
|
|
3459
|
-
async function down$
|
|
3460
|
+
async function down$144(db) {
|
|
3460
3461
|
await sql`
|
|
3461
3462
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS allow_http_npm_registries
|
|
3462
3463
|
`.execute(db);
|
|
@@ -3464,8 +3465,8 @@ async function down$143(db) {
|
|
|
3464
3465
|
//#endregion
|
|
3465
3466
|
//#region src/db/migrations/017_org_id_widen.ts
|
|
3466
3467
|
var _017_org_id_widen_exports = /* @__PURE__ */ __exportAll({
|
|
3467
|
-
down: () => down$
|
|
3468
|
-
up: () => up$
|
|
3468
|
+
down: () => down$143,
|
|
3469
|
+
up: () => up$143
|
|
3469
3470
|
});
|
|
3470
3471
|
/**
|
|
3471
3472
|
* Widen orchestrator `org_id varchar(12)` columns to `varchar(16)` for the Platform's prefixed
|
|
@@ -3488,17 +3489,17 @@ const ORG_ID_TABLES$3 = [
|
|
|
3488
3489
|
"held_runs",
|
|
3489
3490
|
"scoped_secrets"
|
|
3490
3491
|
];
|
|
3491
|
-
async function up$
|
|
3492
|
+
async function up$143(db) {
|
|
3492
3493
|
for (const table of ORG_ID_TABLES$3) await sql.raw(`ALTER TABLE public.${table} ALTER COLUMN org_id TYPE varchar(16)`).execute(db);
|
|
3493
3494
|
}
|
|
3494
|
-
async function down$
|
|
3495
|
+
async function down$143(db) {
|
|
3495
3496
|
for (const table of ORG_ID_TABLES$3) await sql.raw(`ALTER TABLE public.${table} ALTER COLUMN org_id TYPE varchar(12)`).execute(db);
|
|
3496
3497
|
}
|
|
3497
3498
|
//#endregion
|
|
3498
3499
|
//#region src/db/migrations/018_org_id_prefix_backfill.ts
|
|
3499
3500
|
var _018_org_id_prefix_backfill_exports = /* @__PURE__ */ __exportAll({
|
|
3500
|
-
down: () => down$
|
|
3501
|
-
up: () => up$
|
|
3501
|
+
down: () => down$142,
|
|
3502
|
+
up: () => up$142
|
|
3502
3503
|
});
|
|
3503
3504
|
/**
|
|
3504
3505
|
* Prefix every orchestrator-side tenant string with `org_` to align
|
|
@@ -3534,19 +3535,19 @@ const CUSTOMER_ID_TABLES = [
|
|
|
3534
3535
|
"workflow_registrations",
|
|
3535
3536
|
"org_settings"
|
|
3536
3537
|
];
|
|
3537
|
-
async function up$
|
|
3538
|
+
async function up$142(db) {
|
|
3538
3539
|
for (const table of ORG_ID_TABLES$2) await sql.raw(`UPDATE public.${table} SET org_id = 'org_' || org_id WHERE org_id <> 'kici-admin' AND org_id NOT LIKE 'org\\_%' ESCAPE '\\'`).execute(db);
|
|
3539
3540
|
for (const table of CUSTOMER_ID_TABLES) await sql.raw(`UPDATE public.${table} SET customer_id = 'org_' || customer_id WHERE customer_id <> 'kici-admin' AND customer_id NOT LIKE 'org\\_%' ESCAPE '\\'`).execute(db);
|
|
3540
3541
|
}
|
|
3541
|
-
async function down$
|
|
3542
|
+
async function down$142(db) {
|
|
3542
3543
|
for (const table of CUSTOMER_ID_TABLES) await sql.raw(`UPDATE public.${table} SET customer_id = substring(customer_id from 5) WHERE customer_id LIKE 'org\\_%' ESCAPE '\\'`).execute(db);
|
|
3543
3544
|
for (const table of ORG_ID_TABLES$2) await sql.raw(`UPDATE public.${table} SET org_id = substring(org_id from 5) WHERE org_id LIKE 'org\\_%' ESCAPE '\\'`).execute(db);
|
|
3544
3545
|
}
|
|
3545
3546
|
//#endregion
|
|
3546
3547
|
//#region src/db/migrations/019_generic_sources_change_notify.ts
|
|
3547
3548
|
var _019_generic_sources_change_notify_exports = /* @__PURE__ */ __exportAll({
|
|
3548
|
-
down: () => down$
|
|
3549
|
-
up: () => up$
|
|
3549
|
+
down: () => down$141,
|
|
3550
|
+
up: () => up$141
|
|
3550
3551
|
});
|
|
3551
3552
|
/**
|
|
3552
3553
|
* Add a trigger on `generic_webhook_sources` that emits
|
|
@@ -3565,7 +3566,7 @@ var _019_generic_sources_change_notify_exports = /* @__PURE__ */ __exportAll({
|
|
|
3565
3566
|
* Mirrors the GitHub-app `sources` trigger (`notify_sources_change()` +
|
|
3566
3567
|
* `sources_change_trigger` in `001_initial.ts`).
|
|
3567
3568
|
*/
|
|
3568
|
-
async function up$
|
|
3569
|
+
async function up$141(db) {
|
|
3569
3570
|
await sql`
|
|
3570
3571
|
CREATE FUNCTION public.notify_generic_sources_change() RETURNS trigger
|
|
3571
3572
|
LANGUAGE plpgsql
|
|
@@ -3586,15 +3587,15 @@ async function up$140(db) {
|
|
|
3586
3587
|
FOR EACH ROW EXECUTE FUNCTION public.notify_generic_sources_change()
|
|
3587
3588
|
`.execute(db);
|
|
3588
3589
|
}
|
|
3589
|
-
async function down$
|
|
3590
|
+
async function down$141(db) {
|
|
3590
3591
|
await sql`DROP TRIGGER IF EXISTS generic_sources_change_trigger ON public.generic_webhook_sources`.execute(db);
|
|
3591
3592
|
await sql`DROP FUNCTION IF EXISTS public.notify_generic_sources_change()`.execute(db);
|
|
3592
3593
|
}
|
|
3593
3594
|
//#endregion
|
|
3594
3595
|
//#region src/db/migrations/020_org_settings_dashboard_write_policy.ts
|
|
3595
3596
|
var _020_org_settings_dashboard_write_policy_exports = /* @__PURE__ */ __exportAll({
|
|
3596
|
-
down: () => down$
|
|
3597
|
-
up: () => up$
|
|
3597
|
+
down: () => down$140,
|
|
3598
|
+
up: () => up$140
|
|
3598
3599
|
});
|
|
3599
3600
|
/**
|
|
3600
3601
|
* Add `org_settings.dashboard_write_policy jsonb NOT NULL DEFAULT '{}'`.
|
|
@@ -3606,7 +3607,7 @@ var _020_org_settings_dashboard_write_policy_exports = /* @__PURE__ */ __exportA
|
|
|
3606
3607
|
*
|
|
3607
3608
|
* Idempotent.
|
|
3608
3609
|
*/
|
|
3609
|
-
async function up$
|
|
3610
|
+
async function up$140(db) {
|
|
3610
3611
|
if ((await sql`
|
|
3611
3612
|
SELECT EXISTS (
|
|
3612
3613
|
SELECT 1 FROM information_schema.columns
|
|
@@ -3620,7 +3621,7 @@ async function up$139(db) {
|
|
|
3620
3621
|
ADD COLUMN dashboard_write_policy jsonb NOT NULL DEFAULT '{}'::jsonb
|
|
3621
3622
|
`.execute(db);
|
|
3622
3623
|
}
|
|
3623
|
-
async function down$
|
|
3624
|
+
async function down$140(db) {
|
|
3624
3625
|
await sql`
|
|
3625
3626
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS dashboard_write_policy
|
|
3626
3627
|
`.execute(db);
|
|
@@ -3628,8 +3629,8 @@ async function down$139(db) {
|
|
|
3628
3629
|
//#endregion
|
|
3629
3630
|
//#region src/db/migrations/021_check_run_tracking.ts
|
|
3630
3631
|
var _021_check_run_tracking_exports = /* @__PURE__ */ __exportAll({
|
|
3631
|
-
down: () => down$
|
|
3632
|
-
up: () => up$
|
|
3632
|
+
down: () => down$139,
|
|
3633
|
+
up: () => up$139
|
|
3633
3634
|
});
|
|
3634
3635
|
/**
|
|
3635
3636
|
* `check_run_tracking`: `CheckRunReporter` state keyed per (provider, owner, repo, sha,
|
|
@@ -3641,7 +3642,7 @@ var _021_check_run_tracking_exports = /* @__PURE__ */ __exportAll({
|
|
|
3641
3642
|
*
|
|
3642
3643
|
* Idempotent: a re-run on a DB that already has the table is a no-op.
|
|
3643
3644
|
*/
|
|
3644
|
-
async function up$
|
|
3645
|
+
async function up$139(db) {
|
|
3645
3646
|
if ((await sql`
|
|
3646
3647
|
SELECT EXISTS (
|
|
3647
3648
|
SELECT 1 FROM information_schema.tables
|
|
@@ -3672,14 +3673,14 @@ async function up$138(db) {
|
|
|
3672
3673
|
WHERE run_id IS NOT NULL
|
|
3673
3674
|
`.execute(db);
|
|
3674
3675
|
}
|
|
3675
|
-
async function down$
|
|
3676
|
+
async function down$139(db) {
|
|
3676
3677
|
await sql`DROP TABLE IF EXISTS public.check_run_tracking`.execute(db);
|
|
3677
3678
|
}
|
|
3678
3679
|
//#endregion
|
|
3679
3680
|
//#region src/db/migrations/022_scaler_manager_state.ts
|
|
3680
3681
|
var _022_scaler_manager_state_exports = /* @__PURE__ */ __exportAll({
|
|
3681
|
-
down: () => down$
|
|
3682
|
-
up: () => up$
|
|
3682
|
+
down: () => down$138,
|
|
3683
|
+
up: () => up$138
|
|
3683
3684
|
});
|
|
3684
3685
|
/**
|
|
3685
3686
|
* Persists `ScalerManager` per-coord state:
|
|
@@ -3696,7 +3697,7 @@ var _022_scaler_manager_state_exports = /* @__PURE__ */ __exportAll({
|
|
|
3696
3697
|
*
|
|
3697
3698
|
* Idempotent: an existing table is left alone.
|
|
3698
3699
|
*/
|
|
3699
|
-
async function up$
|
|
3700
|
+
async function up$138(db) {
|
|
3700
3701
|
const tableExists = async (name) => {
|
|
3701
3702
|
return (await sql`
|
|
3702
3703
|
SELECT EXISTS (
|
|
@@ -3746,7 +3747,7 @@ async function up$137(db) {
|
|
|
3746
3747
|
`.execute(db);
|
|
3747
3748
|
}
|
|
3748
3749
|
}
|
|
3749
|
-
async function down$
|
|
3750
|
+
async function down$138(db) {
|
|
3750
3751
|
await sql`DROP TABLE IF EXISTS public.scaler_reservations`.execute(db);
|
|
3751
3752
|
await sql`DROP TABLE IF EXISTS public.scaler_agent_jobs`.execute(db);
|
|
3752
3753
|
await sql`DROP TABLE IF EXISTS public.scaler_spawning_agents`.execute(db);
|
|
@@ -3754,8 +3755,8 @@ async function down$137(db) {
|
|
|
3754
3755
|
//#endregion
|
|
3755
3756
|
//#region src/db/migrations/023_dispatch_queue_recovery_deadline.ts
|
|
3756
3757
|
var _023_dispatch_queue_recovery_deadline_exports = /* @__PURE__ */ __exportAll({
|
|
3757
|
-
down: () => down$
|
|
3758
|
-
up: () => up$
|
|
3758
|
+
down: () => down$137,
|
|
3759
|
+
up: () => up$137
|
|
3759
3760
|
});
|
|
3760
3761
|
/**
|
|
3761
3762
|
* Persists per-job agent-disconnect recovery state, so a coord crash between starting the
|
|
@@ -3768,7 +3769,7 @@ var _023_dispatch_queue_recovery_deadline_exports = /* @__PURE__ */ __exportAll(
|
|
|
3768
3769
|
*
|
|
3769
3770
|
* Idempotent: an existing column is a no-op.
|
|
3770
3771
|
*/
|
|
3771
|
-
async function up$
|
|
3772
|
+
async function up$137(db) {
|
|
3772
3773
|
const colExists = async (name) => {
|
|
3773
3774
|
return (await sql`
|
|
3774
3775
|
SELECT EXISTS (
|
|
@@ -3793,7 +3794,7 @@ async function up$136(db) {
|
|
|
3793
3794
|
WHERE recovery_deadline IS NOT NULL
|
|
3794
3795
|
`.execute(db);
|
|
3795
3796
|
}
|
|
3796
|
-
async function down$
|
|
3797
|
+
async function down$137(db) {
|
|
3797
3798
|
await sql`DROP INDEX IF EXISTS public.idx_dispatch_queue_recovery_deadline`.execute(db);
|
|
3798
3799
|
await sql`
|
|
3799
3800
|
ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS recovery_agent_id
|
|
@@ -3805,8 +3806,8 @@ async function down$136(db) {
|
|
|
3805
3806
|
//#endregion
|
|
3806
3807
|
//#region src/db/migrations/024_dispatch_queue_provisioning_error.ts
|
|
3807
3808
|
var _024_dispatch_queue_provisioning_error_exports = /* @__PURE__ */ __exportAll({
|
|
3808
|
-
down: () => down$
|
|
3809
|
-
up: () => up$
|
|
3809
|
+
down: () => down$136,
|
|
3810
|
+
up: () => up$136
|
|
3810
3811
|
});
|
|
3811
3812
|
/**
|
|
3812
3813
|
* `dispatch_queue.last_provisioning_error`: the latest scaler spawn-failure detail for a queued
|
|
@@ -3816,7 +3817,7 @@ var _024_dispatch_queue_provisioning_error_exports = /* @__PURE__ */ __exportAll
|
|
|
3816
3817
|
*
|
|
3817
3818
|
* Idempotent: an existing column is a no-op.
|
|
3818
3819
|
*/
|
|
3819
|
-
async function up$
|
|
3820
|
+
async function up$136(db) {
|
|
3820
3821
|
const colExists = async (name) => {
|
|
3821
3822
|
return (await sql`
|
|
3822
3823
|
SELECT EXISTS (
|
|
@@ -3832,7 +3833,7 @@ async function up$135(db) {
|
|
|
3832
3833
|
ADD COLUMN last_provisioning_error TEXT
|
|
3833
3834
|
`.execute(db);
|
|
3834
3835
|
}
|
|
3835
|
-
async function down$
|
|
3836
|
+
async function down$136(db) {
|
|
3836
3837
|
await sql`
|
|
3837
3838
|
ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS last_provisioning_error
|
|
3838
3839
|
`.execute(db);
|
|
@@ -3840,8 +3841,8 @@ async function down$135(db) {
|
|
|
3840
3841
|
//#endregion
|
|
3841
3842
|
//#region src/db/migrations/025_init_failure.ts
|
|
3842
3843
|
var _025_init_failure_exports = /* @__PURE__ */ __exportAll({
|
|
3843
|
-
down: () => down$
|
|
3844
|
-
up: () => up$
|
|
3844
|
+
down: () => down$135,
|
|
3845
|
+
up: () => up$135
|
|
3845
3846
|
});
|
|
3846
3847
|
/**
|
|
3847
3848
|
* `init_failure` on `execution_runs` / `execution_jobs`: non-NULL means the run/job never
|
|
@@ -3851,7 +3852,7 @@ var _025_init_failure_exports = /* @__PURE__ */ __exportAll({
|
|
|
3851
3852
|
*
|
|
3852
3853
|
* Idempotent per column.
|
|
3853
3854
|
*/
|
|
3854
|
-
async function up$
|
|
3855
|
+
async function up$135(db) {
|
|
3855
3856
|
const colExists = async (table, name) => {
|
|
3856
3857
|
return (await sql`
|
|
3857
3858
|
SELECT EXISTS (
|
|
@@ -3871,7 +3872,7 @@ async function up$134(db) {
|
|
|
3871
3872
|
ADD COLUMN init_failure JSONB DEFAULT NULL
|
|
3872
3873
|
`.execute(db);
|
|
3873
3874
|
}
|
|
3874
|
-
async function down$
|
|
3875
|
+
async function down$135(db) {
|
|
3875
3876
|
await sql`
|
|
3876
3877
|
ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS init_failure
|
|
3877
3878
|
`.execute(db);
|
|
@@ -3882,8 +3883,8 @@ async function down$134(db) {
|
|
|
3882
3883
|
//#endregion
|
|
3883
3884
|
//#region src/db/migrations/026_event_log_lockfile_corrupt.ts
|
|
3884
3885
|
var _026_event_log_lockfile_corrupt_exports = /* @__PURE__ */ __exportAll({
|
|
3885
|
-
down: () => down$
|
|
3886
|
-
up: () => up$
|
|
3886
|
+
down: () => down$134,
|
|
3887
|
+
up: () => up$134
|
|
3887
3888
|
});
|
|
3888
3889
|
/**
|
|
3889
3890
|
* Extend the event_log.status CHECK constraint with 'lockfile_corrupt' so the
|
|
@@ -3892,7 +3893,7 @@ var _026_event_log_lockfile_corrupt_exports = /* @__PURE__ */ __exportAll({
|
|
|
3892
3893
|
*
|
|
3893
3894
|
* Idempotent: the DROP ... IF EXISTS / re-ADD pair re-runs cleanly.
|
|
3894
3895
|
*/
|
|
3895
|
-
async function up$
|
|
3896
|
+
async function up$134(db) {
|
|
3896
3897
|
await sql`ALTER TABLE event_log DROP CONSTRAINT IF EXISTS event_log_status_check`.execute(db);
|
|
3897
3898
|
await sql`
|
|
3898
3899
|
ALTER TABLE event_log ADD CONSTRAINT event_log_status_check
|
|
@@ -3902,7 +3903,7 @@ async function up$133(db) {
|
|
|
3902
3903
|
])))
|
|
3903
3904
|
`.execute(db);
|
|
3904
3905
|
}
|
|
3905
|
-
async function down$
|
|
3906
|
+
async function down$134(db) {
|
|
3906
3907
|
await sql`ALTER TABLE event_log DROP CONSTRAINT IF EXISTS event_log_status_check`.execute(db);
|
|
3907
3908
|
await sql`
|
|
3908
3909
|
ALTER TABLE event_log ADD CONSTRAINT event_log_status_check
|
|
@@ -3915,8 +3916,8 @@ async function down$133(db) {
|
|
|
3915
3916
|
//#endregion
|
|
3916
3917
|
//#region src/db/migrations/027_workflow_timeout.ts
|
|
3917
3918
|
var _027_workflow_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
3918
|
-
down: () => down$
|
|
3919
|
-
up: () => up$
|
|
3919
|
+
down: () => down$133,
|
|
3920
|
+
up: () => up$133
|
|
3920
3921
|
});
|
|
3921
3922
|
/**
|
|
3922
3923
|
* Add `execution_runs.workflow_timeout_ms`: the lock workflow's wall-clock timeout (ms), read at
|
|
@@ -3926,13 +3927,13 @@ var _027_workflow_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
|
3926
3927
|
* INTEGER like the other `*_ms` columns, so pg reads a plain number rather than a BIGINT string;
|
|
3927
3928
|
* it caps the timeout at ~24.8 days. Idempotent.
|
|
3928
3929
|
*/
|
|
3929
|
-
async function up$
|
|
3930
|
+
async function up$133(db) {
|
|
3930
3931
|
await sql`
|
|
3931
3932
|
ALTER TABLE public.execution_runs
|
|
3932
3933
|
ADD COLUMN IF NOT EXISTS workflow_timeout_ms INTEGER DEFAULT NULL
|
|
3933
3934
|
`.execute(db);
|
|
3934
3935
|
}
|
|
3935
|
-
async function down$
|
|
3936
|
+
async function down$133(db) {
|
|
3936
3937
|
await sql`
|
|
3937
3938
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS workflow_timeout_ms
|
|
3938
3939
|
`.execute(db);
|
|
@@ -3940,8 +3941,8 @@ async function down$132(db) {
|
|
|
3940
3941
|
//#endregion
|
|
3941
3942
|
//#region src/db/migrations/028_org_settings_user_cache.ts
|
|
3942
3943
|
var _028_org_settings_user_cache_exports = /* @__PURE__ */ __exportAll({
|
|
3943
|
-
down: () => down$
|
|
3944
|
-
up: () => up$
|
|
3944
|
+
down: () => down$132,
|
|
3945
|
+
up: () => up$132
|
|
3945
3946
|
});
|
|
3946
3947
|
/**
|
|
3947
3948
|
* Add `org_settings.user_cache_quota_bytes bigint` and
|
|
@@ -3967,7 +3968,7 @@ async function columnExists$16(db, column) {
|
|
|
3967
3968
|
) AS exists
|
|
3968
3969
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
3969
3970
|
}
|
|
3970
|
-
async function up$
|
|
3971
|
+
async function up$132(db) {
|
|
3971
3972
|
if (!await columnExists$16(db, "user_cache_quota_bytes")) await sql`
|
|
3972
3973
|
ALTER TABLE public.org_settings
|
|
3973
3974
|
ADD COLUMN user_cache_quota_bytes bigint
|
|
@@ -3977,7 +3978,7 @@ async function up$131(db) {
|
|
|
3977
3978
|
ADD COLUMN user_cache_ttl_ms bigint
|
|
3978
3979
|
`.execute(db);
|
|
3979
3980
|
}
|
|
3980
|
-
async function down$
|
|
3981
|
+
async function down$132(db) {
|
|
3981
3982
|
await sql`
|
|
3982
3983
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS user_cache_quota_bytes
|
|
3983
3984
|
`.execute(db);
|
|
@@ -3988,8 +3989,8 @@ async function down$131(db) {
|
|
|
3988
3989
|
//#endregion
|
|
3989
3990
|
//#region src/db/migrations/029_dispatch_queue_attempts.ts
|
|
3990
3991
|
var _029_dispatch_queue_attempts_exports = /* @__PURE__ */ __exportAll({
|
|
3991
|
-
down: () => down$
|
|
3992
|
-
up: () => up$
|
|
3992
|
+
down: () => down$131,
|
|
3993
|
+
up: () => up$131
|
|
3993
3994
|
});
|
|
3994
3995
|
/**
|
|
3995
3996
|
* Add `dispatch_queue.dispatch_attempts`: how often a job returned to `pending` after a failed
|
|
@@ -3997,7 +3998,7 @@ var _029_dispatch_queue_attempts_exports = /* @__PURE__ */ __exportAll({
|
|
|
3997
3998
|
* fails the job at MAX_DISPATCH_ATTEMPTS, bounding requeue loops; `expires_at` stays the
|
|
3998
3999
|
* time-based backstop. Idempotent.
|
|
3999
4000
|
*/
|
|
4000
|
-
async function up$
|
|
4001
|
+
async function up$131(db) {
|
|
4001
4002
|
if (!((await sql`
|
|
4002
4003
|
SELECT EXISTS (
|
|
4003
4004
|
SELECT 1 FROM information_schema.columns
|
|
@@ -4010,7 +4011,7 @@ async function up$130(db) {
|
|
|
4010
4011
|
ADD COLUMN dispatch_attempts INT NOT NULL DEFAULT 0
|
|
4011
4012
|
`.execute(db);
|
|
4012
4013
|
}
|
|
4013
|
-
async function down$
|
|
4014
|
+
async function down$131(db) {
|
|
4014
4015
|
await sql`
|
|
4015
4016
|
ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS dispatch_attempts
|
|
4016
4017
|
`.execute(db);
|
|
@@ -4018,8 +4019,8 @@ async function down$130(db) {
|
|
|
4018
4019
|
//#endregion
|
|
4019
4020
|
//#region src/db/migrations/030_held_runs_env_set_null.ts
|
|
4020
4021
|
var _030_held_runs_env_set_null_exports = /* @__PURE__ */ __exportAll({
|
|
4021
|
-
down: () => down$
|
|
4022
|
-
up: () => up$
|
|
4022
|
+
down: () => down$130,
|
|
4023
|
+
up: () => up$130
|
|
4023
4024
|
});
|
|
4024
4025
|
/**
|
|
4025
4026
|
* held_runs.environment_id becomes nullable with ON DELETE SET NULL, so
|
|
@@ -4029,14 +4030,14 @@ var _030_held_runs_env_set_null_exports = /* @__PURE__ */ __exportAll({
|
|
|
4029
4030
|
* Idempotent: both drops are no-ops on a re-run, and the constraint is
|
|
4030
4031
|
* re-created with the SET NULL action.
|
|
4031
4032
|
*/
|
|
4032
|
-
async function up$
|
|
4033
|
+
async function up$130(db) {
|
|
4033
4034
|
await sql`ALTER TABLE public.held_runs ALTER COLUMN environment_id DROP NOT NULL`.execute(db);
|
|
4034
4035
|
await sql`ALTER TABLE public.held_runs DROP CONSTRAINT IF EXISTS held_runs_environment_id_fkey`.execute(db);
|
|
4035
4036
|
await sql`ALTER TABLE public.held_runs
|
|
4036
4037
|
ADD CONSTRAINT held_runs_environment_id_fkey
|
|
4037
4038
|
FOREIGN KEY (environment_id) REFERENCES public.environments(id) ON DELETE SET NULL`.execute(db);
|
|
4038
4039
|
}
|
|
4039
|
-
async function down$
|
|
4040
|
+
async function down$130(db) {
|
|
4040
4041
|
await sql`ALTER TABLE public.held_runs DROP CONSTRAINT IF EXISTS held_runs_environment_id_fkey`.execute(db);
|
|
4041
4042
|
await sql`ALTER TABLE public.held_runs
|
|
4042
4043
|
ADD CONSTRAINT held_runs_environment_id_fkey
|
|
@@ -4046,8 +4047,8 @@ async function down$129(db) {
|
|
|
4046
4047
|
//#endregion
|
|
4047
4048
|
//#region src/db/migrations/031_dispatch_queue_ack_deadline.ts
|
|
4048
4049
|
var _031_dispatch_queue_ack_deadline_exports = /* @__PURE__ */ __exportAll({
|
|
4049
|
-
down: () => down$
|
|
4050
|
-
up: () => up$
|
|
4050
|
+
down: () => down$129,
|
|
4051
|
+
up: () => up$129
|
|
4051
4052
|
});
|
|
4052
4053
|
/**
|
|
4053
4054
|
* Add `dispatch_queue.ack_deadline` / `ack_agent_id`: the persisted per-dispatch ack deadline
|
|
@@ -4058,7 +4059,7 @@ var _031_dispatch_queue_ack_deadline_exports = /* @__PURE__ */ __exportAll({
|
|
|
4058
4059
|
* the leader-gated `Dispatcher.sweepExpiredAckDeadlines` when that coord crashed;
|
|
4059
4060
|
* `Dispatcher.recoverState()` re-arms timers on coord boot. Idempotent.
|
|
4060
4061
|
*/
|
|
4061
|
-
async function up$
|
|
4062
|
+
async function up$129(db) {
|
|
4062
4063
|
const colExists = async (name) => {
|
|
4063
4064
|
return (await sql`
|
|
4064
4065
|
SELECT EXISTS (
|
|
@@ -4083,7 +4084,7 @@ async function up$128(db) {
|
|
|
4083
4084
|
WHERE ack_deadline IS NOT NULL
|
|
4084
4085
|
`.execute(db);
|
|
4085
4086
|
}
|
|
4086
|
-
async function down$
|
|
4087
|
+
async function down$129(db) {
|
|
4087
4088
|
await sql`DROP INDEX IF EXISTS public.idx_dispatch_queue_ack_deadline`.execute(db);
|
|
4088
4089
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS ack_agent_id`.execute(db);
|
|
4089
4090
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS ack_deadline`.execute(db);
|
|
@@ -4091,8 +4092,8 @@ async function down$128(db) {
|
|
|
4091
4092
|
//#endregion
|
|
4092
4093
|
//#region src/db/migrations/032_org_settings_dispatch_ack_timeout.ts
|
|
4093
4094
|
var _032_org_settings_dispatch_ack_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
4094
|
-
down: () => down$
|
|
4095
|
-
up: () => up$
|
|
4095
|
+
down: () => down$128,
|
|
4096
|
+
up: () => up$128
|
|
4096
4097
|
});
|
|
4097
4098
|
/**
|
|
4098
4099
|
* Add `org_settings.dispatch_ack_timeout_ms BIGINT` (nullable).
|
|
@@ -4104,7 +4105,7 @@ var _032_org_settings_dispatch_ack_timeout_exports = /* @__PURE__ */ __exportAll
|
|
|
4104
4105
|
*
|
|
4105
4106
|
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
4106
4107
|
*/
|
|
4107
|
-
async function up$
|
|
4108
|
+
async function up$128(db) {
|
|
4108
4109
|
if ((await sql`
|
|
4109
4110
|
SELECT EXISTS (
|
|
4110
4111
|
SELECT 1 FROM information_schema.columns
|
|
@@ -4118,7 +4119,7 @@ async function up$127(db) {
|
|
|
4118
4119
|
ADD COLUMN dispatch_ack_timeout_ms BIGINT
|
|
4119
4120
|
`.execute(db);
|
|
4120
4121
|
}
|
|
4121
|
-
async function down$
|
|
4122
|
+
async function down$128(db) {
|
|
4122
4123
|
await sql`
|
|
4123
4124
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS dispatch_ack_timeout_ms
|
|
4124
4125
|
`.execute(db);
|
|
@@ -4126,8 +4127,8 @@ async function down$127(db) {
|
|
|
4126
4127
|
//#endregion
|
|
4127
4128
|
//#region src/db/migrations/033_org_settings_approval.ts
|
|
4128
4129
|
var _033_org_settings_approval_exports = /* @__PURE__ */ __exportAll({
|
|
4129
|
-
down: () => down$
|
|
4130
|
-
up: () => up$
|
|
4130
|
+
down: () => down$127,
|
|
4131
|
+
up: () => up$127
|
|
4131
4132
|
});
|
|
4132
4133
|
/**
|
|
4133
4134
|
* Add the approval-policy columns to `org_settings`:
|
|
@@ -4141,7 +4142,7 @@ var _033_org_settings_approval_exports = /* @__PURE__ */ __exportAll({
|
|
|
4141
4142
|
* Set per org via `kici-admin org-settings approval` and the orchestrator admin
|
|
4142
4143
|
* route. Idempotent: each column is guarded independently.
|
|
4143
4144
|
*/
|
|
4144
|
-
async function up$
|
|
4145
|
+
async function up$127(db) {
|
|
4145
4146
|
const colExists = async (column) => {
|
|
4146
4147
|
return (await sql`
|
|
4147
4148
|
SELECT EXISTS (
|
|
@@ -4161,7 +4162,7 @@ async function up$126(db) {
|
|
|
4161
4162
|
ADD COLUMN allow_self_approval BOOLEAN NOT NULL DEFAULT true
|
|
4162
4163
|
`.execute(db);
|
|
4163
4164
|
}
|
|
4164
|
-
async function down$
|
|
4165
|
+
async function down$127(db) {
|
|
4165
4166
|
await sql`
|
|
4166
4167
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS approval_expiry_seconds
|
|
4167
4168
|
`.execute(db);
|
|
@@ -4172,8 +4173,8 @@ async function down$126(db) {
|
|
|
4172
4173
|
//#endregion
|
|
4173
4174
|
//#region src/db/migrations/034_held_runs_generalize.ts
|
|
4174
4175
|
var _034_held_runs_generalize_exports = /* @__PURE__ */ __exportAll({
|
|
4175
|
-
down: () => down$
|
|
4176
|
-
up: () => up$
|
|
4176
|
+
down: () => down$126,
|
|
4177
|
+
up: () => up$126
|
|
4177
4178
|
});
|
|
4178
4179
|
/**
|
|
4179
4180
|
* Generalize `held_runs` from an environment-only hold into the "held element" model behind
|
|
@@ -4187,7 +4188,7 @@ var _034_held_runs_generalize_exports = /* @__PURE__ */ __exportAll({
|
|
|
4187
4188
|
* - `approval_requirement` — the normalized `ApprovalRequirement` (clauses + expiresAt +
|
|
4188
4189
|
* reason); NULL on rows that predate the approval model.
|
|
4189
4190
|
*/
|
|
4190
|
-
async function up$
|
|
4191
|
+
async function up$126(db) {
|
|
4191
4192
|
const colExists = async (column) => {
|
|
4192
4193
|
return (await sql`
|
|
4193
4194
|
SELECT EXISTS (
|
|
@@ -4220,7 +4221,7 @@ async function up$125(db) {
|
|
|
4220
4221
|
ON public.held_run_approvals USING btree (held_run_id)
|
|
4221
4222
|
`.execute(db);
|
|
4222
4223
|
}
|
|
4223
|
-
async function down$
|
|
4224
|
+
async function down$126(db) {
|
|
4224
4225
|
await sql`DROP TABLE IF EXISTS public.held_run_approvals`.execute(db);
|
|
4225
4226
|
await sql`ALTER TABLE public.held_runs DROP COLUMN IF EXISTS approval_requirement`.execute(db);
|
|
4226
4227
|
await sql`ALTER TABLE public.held_runs DROP COLUMN IF EXISTS trigger_source`.execute(db);
|
|
@@ -4230,8 +4231,8 @@ async function down$125(db) {
|
|
|
4230
4231
|
//#endregion
|
|
4231
4232
|
//#region src/db/migrations/035_pending_workflow_contexts.ts
|
|
4232
4233
|
var _035_pending_workflow_contexts_exports = /* @__PURE__ */ __exportAll({
|
|
4233
|
-
down: () => down$
|
|
4234
|
-
up: () => up$
|
|
4234
|
+
down: () => down$125,
|
|
4235
|
+
up: () => up$125
|
|
4235
4236
|
});
|
|
4236
4237
|
/**
|
|
4237
4238
|
* Pending workflow dispatch context, for resuming a workflow whose install gate
|
|
@@ -4239,7 +4240,7 @@ var _035_pending_workflow_contexts_exports = /* @__PURE__ */ __exportAll({
|
|
|
4239
4240
|
* WorkflowDispatchContext when the hold releases (reviewer approve, wait-timer
|
|
4240
4241
|
* expiry, free concurrency slot); it is deleted once the resume dispatch starts.
|
|
4241
4242
|
*/
|
|
4242
|
-
async function up$
|
|
4243
|
+
async function up$125(db) {
|
|
4243
4244
|
await sql`
|
|
4244
4245
|
CREATE TABLE IF NOT EXISTS public.pending_workflow_contexts (
|
|
4245
4246
|
run_id text PRIMARY KEY,
|
|
@@ -4249,14 +4250,14 @@ async function up$124(db) {
|
|
|
4249
4250
|
)
|
|
4250
4251
|
`.execute(db);
|
|
4251
4252
|
}
|
|
4252
|
-
async function down$
|
|
4253
|
+
async function down$125(db) {
|
|
4253
4254
|
await sql`DROP TABLE IF EXISTS public.pending_workflow_contexts`.execute(db);
|
|
4254
4255
|
}
|
|
4255
4256
|
//#endregion
|
|
4256
4257
|
//#region src/db/migrations/036_attestations.ts
|
|
4257
4258
|
var _036_attestations_exports = /* @__PURE__ */ __exportAll({
|
|
4258
|
-
down: () => down$
|
|
4259
|
-
up: () => up$
|
|
4259
|
+
down: () => down$124,
|
|
4260
|
+
up: () => up$124
|
|
4260
4261
|
});
|
|
4261
4262
|
/**
|
|
4262
4263
|
* Add the `attestations` table for build-provenance bundles.
|
|
@@ -4269,7 +4270,7 @@ var _036_attestations_exports = /* @__PURE__ */ __exportAll({
|
|
|
4269
4270
|
*
|
|
4270
4271
|
* Idempotent: a re-run on a DB that already has the table is a no-op.
|
|
4271
4272
|
*/
|
|
4272
|
-
async function up$
|
|
4273
|
+
async function up$124(db) {
|
|
4273
4274
|
if ((await sql`
|
|
4274
4275
|
SELECT EXISTS (
|
|
4275
4276
|
SELECT 1 FROM information_schema.tables
|
|
@@ -4295,14 +4296,14 @@ async function up$123(db) {
|
|
|
4295
4296
|
ON public.attestations (run_id, job_id)
|
|
4296
4297
|
`.execute(db);
|
|
4297
4298
|
}
|
|
4298
|
-
async function down$
|
|
4299
|
+
async function down$124(db) {
|
|
4299
4300
|
await sql`DROP TABLE IF EXISTS public.attestations`.execute(db);
|
|
4300
4301
|
}
|
|
4301
4302
|
//#endregion
|
|
4302
4303
|
//#region src/db/migrations/037_generic_sources_provider_type_local.ts
|
|
4303
4304
|
var _037_generic_sources_provider_type_local_exports = /* @__PURE__ */ __exportAll({
|
|
4304
|
-
down: () => down$
|
|
4305
|
-
up: () => up$
|
|
4305
|
+
down: () => down$123,
|
|
4306
|
+
up: () => up$123
|
|
4306
4307
|
});
|
|
4307
4308
|
/**
|
|
4308
4309
|
* Replace the `generic_webhook_sources.provider_type` CHECK constraint so it
|
|
@@ -4318,7 +4319,7 @@ var _037_generic_sources_provider_type_local_exports = /* @__PURE__ */ __exportA
|
|
|
4318
4319
|
* Idempotent: the constraint is dropped IF EXISTS and recreated; the data
|
|
4319
4320
|
* backfill is a plain UPDATE that is a no-op once no `'internal'` rows remain.
|
|
4320
4321
|
*/
|
|
4321
|
-
async function up$
|
|
4322
|
+
async function up$123(db) {
|
|
4322
4323
|
await sql`
|
|
4323
4324
|
ALTER TABLE public.generic_webhook_sources
|
|
4324
4325
|
DROP CONSTRAINT IF EXISTS generic_webhook_sources_provider_type_check
|
|
@@ -4334,7 +4335,7 @@ async function up$122(db) {
|
|
|
4334
4335
|
CHECK (provider_type = ANY (ARRAY['generic'::text, 'local'::text]))
|
|
4335
4336
|
`.execute(db);
|
|
4336
4337
|
}
|
|
4337
|
-
async function down$
|
|
4338
|
+
async function down$123(db) {
|
|
4338
4339
|
await sql`
|
|
4339
4340
|
ALTER TABLE public.generic_webhook_sources
|
|
4340
4341
|
DROP CONSTRAINT IF EXISTS generic_webhook_sources_provider_type_check
|
|
@@ -4353,8 +4354,8 @@ async function down$122(db) {
|
|
|
4353
4354
|
//#endregion
|
|
4354
4355
|
//#region src/db/migrations/038_remote_sources.ts
|
|
4355
4356
|
var _038_remote_sources_exports = /* @__PURE__ */ __exportAll({
|
|
4356
|
-
down: () => down$
|
|
4357
|
-
up: () => up$
|
|
4357
|
+
down: () => down$122,
|
|
4358
|
+
up: () => up$122
|
|
4358
4359
|
});
|
|
4359
4360
|
/**
|
|
4360
4361
|
* `remote_sources` anchors a Platform-relayed `kici run remote` to its real org: one row per
|
|
@@ -4364,7 +4365,7 @@ var _038_remote_sources_exports = /* @__PURE__ */ __exportAll({
|
|
|
4364
4365
|
*
|
|
4365
4366
|
* Idempotent: an existing table is a no-op.
|
|
4366
4367
|
*/
|
|
4367
|
-
async function up$
|
|
4368
|
+
async function up$122(db) {
|
|
4368
4369
|
if ((await sql`
|
|
4369
4370
|
SELECT EXISTS (
|
|
4370
4371
|
SELECT 1 FROM information_schema.tables
|
|
@@ -4383,14 +4384,14 @@ async function up$121(db) {
|
|
|
4383
4384
|
)
|
|
4384
4385
|
`.execute(db);
|
|
4385
4386
|
}
|
|
4386
|
-
async function down$
|
|
4387
|
+
async function down$122(db) {
|
|
4387
4388
|
await sql`DROP TABLE IF EXISTS public.remote_sources`.execute(db);
|
|
4388
4389
|
}
|
|
4389
4390
|
//#endregion
|
|
4390
4391
|
//#region src/db/migrations/039_host_roster.ts
|
|
4391
4392
|
var _039_host_roster_exports = /* @__PURE__ */ __exportAll({
|
|
4392
|
-
down: () => down$
|
|
4393
|
-
up: () => up$
|
|
4393
|
+
down: () => down$121,
|
|
4394
|
+
up: () => up$121
|
|
4394
4395
|
});
|
|
4395
4396
|
/**
|
|
4396
4397
|
* `host_roster` is KiCI's declared inventory: one durable row per agent the
|
|
@@ -4407,7 +4408,7 @@ var _039_host_roster_exports = /* @__PURE__ */ __exportAll({
|
|
|
4407
4408
|
*
|
|
4408
4409
|
* Idempotent: a re-run on a DB that already has the table is a no-op.
|
|
4409
4410
|
*/
|
|
4410
|
-
async function up$
|
|
4411
|
+
async function up$121(db) {
|
|
4411
4412
|
if ((await sql`
|
|
4412
4413
|
SELECT EXISTS (
|
|
4413
4414
|
SELECT 1 FROM information_schema.tables
|
|
@@ -4437,14 +4438,14 @@ async function up$120(db) {
|
|
|
4437
4438
|
await sql`CREATE INDEX idx_host_roster_reap
|
|
4438
4439
|
ON public.host_roster (lifecycle_class, last_seen)`.execute(db);
|
|
4439
4440
|
}
|
|
4440
|
-
async function down$
|
|
4441
|
+
async function down$121(db) {
|
|
4441
4442
|
await sql`DROP TABLE IF EXISTS public.host_roster`.execute(db);
|
|
4442
4443
|
}
|
|
4443
4444
|
//#endregion
|
|
4444
4445
|
//#region src/db/migrations/040_runsonall_pin.ts
|
|
4445
4446
|
var _040_runsonall_pin_exports = /* @__PURE__ */ __exportAll({
|
|
4446
|
-
down: () => down$
|
|
4447
|
-
up: () => up$
|
|
4447
|
+
down: () => down$120,
|
|
4448
|
+
up: () => up$120
|
|
4448
4449
|
});
|
|
4449
4450
|
/**
|
|
4450
4451
|
* Add the `runsOnAll` host fan-out columns:
|
|
@@ -4468,7 +4469,7 @@ async function colExists$22(db, table, name) {
|
|
|
4468
4469
|
) AS exists
|
|
4469
4470
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4470
4471
|
}
|
|
4471
|
-
async function up$
|
|
4472
|
+
async function up$120(db) {
|
|
4472
4473
|
if (!await colExists$22(db, "dispatch_queue", "pinned_agent_id")) await sql`ALTER TABLE public.dispatch_queue ADD COLUMN pinned_agent_id TEXT`.execute(db);
|
|
4473
4474
|
if (!await colExists$22(db, "execution_jobs", "base_job_name")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN base_job_name TEXT`.execute(db);
|
|
4474
4475
|
if (!await colExists$22(db, "execution_jobs", "variant_kind")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN variant_kind TEXT`.execute(db);
|
|
@@ -4479,7 +4480,7 @@ async function up$119(db) {
|
|
|
4479
4480
|
WHERE pinned_agent_id IS NOT NULL
|
|
4480
4481
|
`.execute(db);
|
|
4481
4482
|
}
|
|
4482
|
-
async function down$
|
|
4483
|
+
async function down$120(db) {
|
|
4483
4484
|
await sql`DROP INDEX IF EXISTS public.idx_dispatch_queue_pinned_agent`.execute(db);
|
|
4484
4485
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS pinned_agent_id`.execute(db);
|
|
4485
4486
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS variant_label`.execute(db);
|
|
@@ -4489,8 +4490,8 @@ async function down$119(db) {
|
|
|
4489
4490
|
//#endregion
|
|
4490
4491
|
//#region src/db/migrations/041_wave_gated.ts
|
|
4491
4492
|
var _041_wave_gated_exports = /* @__PURE__ */ __exportAll({
|
|
4492
|
-
down: () => down$
|
|
4493
|
-
up: () => up$
|
|
4493
|
+
down: () => down$119,
|
|
4494
|
+
up: () => up$119
|
|
4494
4495
|
});
|
|
4495
4496
|
/**
|
|
4496
4497
|
* Add the rolling fan-out wave-gate columns:
|
|
@@ -4519,7 +4520,7 @@ async function colExists$21(db, table, name) {
|
|
|
4519
4520
|
) AS exists
|
|
4520
4521
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4521
4522
|
}
|
|
4522
|
-
async function up$
|
|
4523
|
+
async function up$119(db) {
|
|
4523
4524
|
if (!await colExists$21(db, "execution_jobs", "wave_gated")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN wave_gated boolean NOT NULL DEFAULT false`.execute(db);
|
|
4524
4525
|
if (!await colExists$21(db, "execution_jobs", "wave_max_parallel")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN wave_max_parallel integer`.execute(db);
|
|
4525
4526
|
if (!await colExists$21(db, "execution_jobs", "wave_fail_fast")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN wave_fail_fast boolean`.execute(db);
|
|
@@ -4528,7 +4529,7 @@ async function up$118(db) {
|
|
|
4528
4529
|
ON public.execution_jobs (run_id, base_job_name, wave_gated)
|
|
4529
4530
|
`.execute(db);
|
|
4530
4531
|
}
|
|
4531
|
-
async function down$
|
|
4532
|
+
async function down$119(db) {
|
|
4532
4533
|
await sql`DROP INDEX IF EXISTS public.idx_execution_jobs_wave`.execute(db);
|
|
4533
4534
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS wave_fail_fast`.execute(db);
|
|
4534
4535
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS wave_max_parallel`.execute(db);
|
|
@@ -4537,8 +4538,8 @@ async function down$118(db) {
|
|
|
4537
4538
|
//#endregion
|
|
4538
4539
|
//#region src/db/migrations/042_dispatch_queue_patterns.ts
|
|
4539
4540
|
var _042_dispatch_queue_patterns_exports = /* @__PURE__ */ __exportAll({
|
|
4540
|
-
down: () => down$
|
|
4541
|
-
up: () => up$
|
|
4541
|
+
down: () => down$118,
|
|
4542
|
+
up: () => up$118
|
|
4542
4543
|
});
|
|
4543
4544
|
/**
|
|
4544
4545
|
* Add dispatch_queue `runs_on_patterns` (regex matchers the agent's labels must satisfy) and
|
|
@@ -4557,19 +4558,19 @@ async function colExists$20(db, table, name) {
|
|
|
4557
4558
|
) AS exists
|
|
4558
4559
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4559
4560
|
}
|
|
4560
|
-
async function up$
|
|
4561
|
+
async function up$118(db) {
|
|
4561
4562
|
if (!await colExists$20(db, "dispatch_queue", "runs_on_patterns")) await sql`ALTER TABLE public.dispatch_queue ADD COLUMN runs_on_patterns jsonb NOT NULL DEFAULT '[]'::jsonb`.execute(db);
|
|
4562
4563
|
if (!await colExists$20(db, "dispatch_queue", "exclude_patterns")) await sql`ALTER TABLE public.dispatch_queue ADD COLUMN exclude_patterns jsonb NOT NULL DEFAULT '[]'::jsonb`.execute(db);
|
|
4563
4564
|
}
|
|
4564
|
-
async function down$
|
|
4565
|
+
async function down$118(db) {
|
|
4565
4566
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS exclude_patterns`.execute(db);
|
|
4566
4567
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS runs_on_patterns`.execute(db);
|
|
4567
4568
|
}
|
|
4568
4569
|
//#endregion
|
|
4569
4570
|
//#region src/db/migrations/043_rerouted_to_peer.ts
|
|
4570
4571
|
var _043_rerouted_to_peer_exports = /* @__PURE__ */ __exportAll({
|
|
4571
|
-
down: () => down$
|
|
4572
|
-
up: () => up$
|
|
4572
|
+
down: () => down$117,
|
|
4573
|
+
up: () => up$117
|
|
4573
4574
|
});
|
|
4574
4575
|
/**
|
|
4575
4576
|
* Add a nullable `rerouted_to_peer text` marker to execution_jobs. Non-null
|
|
@@ -4590,17 +4591,17 @@ async function colExists$19(db, table, name) {
|
|
|
4590
4591
|
) AS exists
|
|
4591
4592
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4592
4593
|
}
|
|
4593
|
-
async function up$
|
|
4594
|
+
async function up$117(db) {
|
|
4594
4595
|
if (!await colExists$19(db, "execution_jobs", "rerouted_to_peer")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN rerouted_to_peer text`.execute(db);
|
|
4595
4596
|
}
|
|
4596
|
-
async function down$
|
|
4597
|
+
async function down$117(db) {
|
|
4597
4598
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS rerouted_to_peer`.execute(db);
|
|
4598
4599
|
}
|
|
4599
4600
|
//#endregion
|
|
4600
4601
|
//#region src/db/migrations/044_check_mode.ts
|
|
4601
4602
|
var _044_check_mode_exports = /* @__PURE__ */ __exportAll({
|
|
4602
|
-
down: () => down$
|
|
4603
|
-
up: () => up$
|
|
4603
|
+
down: () => down$116,
|
|
4604
|
+
up: () => up$116
|
|
4604
4605
|
});
|
|
4605
4606
|
/**
|
|
4606
4607
|
* Add the check-mode columns, all nullable. Idempotent.
|
|
@@ -4622,13 +4623,13 @@ async function colExists$18(db, table, name) {
|
|
|
4622
4623
|
) AS exists
|
|
4623
4624
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4624
4625
|
}
|
|
4625
|
-
async function up$
|
|
4626
|
+
async function up$116(db) {
|
|
4626
4627
|
if (!await colExists$18(db, "execution_runs", "check_mode")) await sql`ALTER TABLE public.execution_runs ADD COLUMN check_mode text`.execute(db);
|
|
4627
4628
|
if (!await colExists$18(db, "execution_steps", "check_outcome")) await sql`ALTER TABLE public.execution_steps ADD COLUMN check_outcome text`.execute(db);
|
|
4628
4629
|
if (!await colExists$18(db, "execution_steps", "drift_summary")) await sql`ALTER TABLE public.execution_steps ADD COLUMN drift_summary text`.execute(db);
|
|
4629
4630
|
if (!await colExists$18(db, "execution_steps", "drift")) await sql`ALTER TABLE public.execution_steps ADD COLUMN drift jsonb`.execute(db);
|
|
4630
4631
|
}
|
|
4631
|
-
async function down$
|
|
4632
|
+
async function down$116(db) {
|
|
4632
4633
|
await sql`ALTER TABLE public.execution_steps DROP COLUMN IF EXISTS drift`.execute(db);
|
|
4633
4634
|
await sql`ALTER TABLE public.execution_steps DROP COLUMN IF EXISTS drift_summary`.execute(db);
|
|
4634
4635
|
await sql`ALTER TABLE public.execution_steps DROP COLUMN IF EXISTS check_outcome`.execute(db);
|
|
@@ -4637,8 +4638,8 @@ async function down$115(db) {
|
|
|
4637
4638
|
//#endregion
|
|
4638
4639
|
//#region src/db/migrations/045_host_properties.ts
|
|
4639
4640
|
var _045_host_properties_exports = /* @__PURE__ */ __exportAll({
|
|
4640
|
-
down: () => down$
|
|
4641
|
-
up: () => up$
|
|
4641
|
+
down: () => down$115,
|
|
4642
|
+
up: () => up$115
|
|
4642
4643
|
});
|
|
4643
4644
|
/**
|
|
4644
4645
|
* `host_roster.host_properties jsonb NOT NULL DEFAULT '{}'`: the typed host-vars
|
|
@@ -4648,18 +4649,18 @@ var _045_host_properties_exports = /* @__PURE__ */ __exportAll({
|
|
|
4648
4649
|
*
|
|
4649
4650
|
* Idempotent and additive.
|
|
4650
4651
|
*/
|
|
4651
|
-
async function up$
|
|
4652
|
+
async function up$115(db) {
|
|
4652
4653
|
await sql`ALTER TABLE public.host_roster
|
|
4653
4654
|
ADD COLUMN IF NOT EXISTS host_properties jsonb NOT NULL DEFAULT '{}'::jsonb`.execute(db);
|
|
4654
4655
|
}
|
|
4655
|
-
async function down$
|
|
4656
|
+
async function down$115(db) {
|
|
4656
4657
|
await sql`ALTER TABLE public.host_roster DROP COLUMN IF EXISTS host_properties`.execute(db);
|
|
4657
4658
|
}
|
|
4658
4659
|
//#endregion
|
|
4659
4660
|
//#region src/db/migrations/046_join_token_consumed_by_instance.ts
|
|
4660
4661
|
var _046_join_token_consumed_by_instance_exports = /* @__PURE__ */ __exportAll({
|
|
4661
|
-
down: () => down$
|
|
4662
|
-
up: () => up$
|
|
4662
|
+
down: () => down$114,
|
|
4663
|
+
up: () => up$114
|
|
4663
4664
|
});
|
|
4664
4665
|
/**
|
|
4665
4666
|
* `join_tokens.consumed_by_instance`: the joining peer's `instanceId` at first consumption
|
|
@@ -4669,18 +4670,18 @@ var _046_join_token_consumed_by_instance_exports = /* @__PURE__ */ __exportAll({
|
|
|
4669
4670
|
* credential self-heals by re-presenting the join token in its env, with no operator action.
|
|
4670
4671
|
* Idempotent and additive.
|
|
4671
4672
|
*/
|
|
4672
|
-
async function up$
|
|
4673
|
+
async function up$114(db) {
|
|
4673
4674
|
await sql`ALTER TABLE public.join_tokens
|
|
4674
4675
|
ADD COLUMN IF NOT EXISTS consumed_by_instance text`.execute(db);
|
|
4675
4676
|
}
|
|
4676
|
-
async function down$
|
|
4677
|
+
async function down$114(db) {
|
|
4677
4678
|
await sql`ALTER TABLE public.join_tokens DROP COLUMN IF EXISTS consumed_by_instance`.execute(db);
|
|
4678
4679
|
}
|
|
4679
4680
|
//#endregion
|
|
4680
4681
|
//#region src/db/migrations/047_needs_run_on.ts
|
|
4681
4682
|
var _047_needs_run_on_exports = /* @__PURE__ */ __exportAll({
|
|
4682
|
-
down: () => down$
|
|
4683
|
-
up: () => up$
|
|
4683
|
+
down: () => down$113,
|
|
4684
|
+
up: () => up$113
|
|
4684
4685
|
});
|
|
4685
4686
|
/**
|
|
4686
4687
|
* Migrate `execution_job_needs` from the binary `if_failed` policy to a
|
|
@@ -4714,7 +4715,7 @@ async function colExists$17(db, table, name) {
|
|
|
4714
4715
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4715
4716
|
}
|
|
4716
4717
|
const SUCCESS_ONLY_DEFAULT = `'${SUCCESS_ONLY_JSON}'`;
|
|
4717
|
-
async function up$
|
|
4718
|
+
async function up$113(db) {
|
|
4718
4719
|
if (!await colExists$17(db, "execution_job_needs", "run_on")) await sql`
|
|
4719
4720
|
ALTER TABLE public.execution_job_needs
|
|
4720
4721
|
ADD COLUMN run_on text NOT NULL DEFAULT ${sql.raw(SUCCESS_ONLY_DEFAULT)}
|
|
@@ -4733,7 +4734,7 @@ async function up$112(db) {
|
|
|
4733
4734
|
await sql`ALTER TABLE public.execution_job_needs DROP COLUMN if_failed`.execute(db);
|
|
4734
4735
|
}
|
|
4735
4736
|
}
|
|
4736
|
-
async function down$
|
|
4737
|
+
async function down$113(db) {
|
|
4737
4738
|
if (!await colExists$17(db, "execution_job_needs", "if_failed")) await sql`
|
|
4738
4739
|
ALTER TABLE public.execution_job_needs
|
|
4739
4740
|
ADD COLUMN if_failed text NOT NULL DEFAULT 'skip'
|
|
@@ -4749,8 +4750,8 @@ async function down$112(db) {
|
|
|
4749
4750
|
//#endregion
|
|
4750
4751
|
//#region src/db/migrations/048_host_reboot_pending.ts
|
|
4751
4752
|
var _048_host_reboot_pending_exports = /* @__PURE__ */ __exportAll({
|
|
4752
|
-
down: () => down$
|
|
4753
|
-
up: () => up$
|
|
4753
|
+
down: () => down$112,
|
|
4754
|
+
up: () => up$112
|
|
4754
4755
|
});
|
|
4755
4756
|
/**
|
|
4756
4757
|
* `host_roster.reboot_pending_until`: the persisted reboot-pending flag (NULL = none), set when
|
|
@@ -4761,36 +4762,36 @@ var _048_host_reboot_pending_exports = /* @__PURE__ */ __exportAll({
|
|
|
4761
4762
|
* rebooting box, and (3) clears on the next reconnect, releasing the held job.
|
|
4762
4763
|
* Idempotent and additive.
|
|
4763
4764
|
*/
|
|
4764
|
-
async function up$
|
|
4765
|
+
async function up$112(db) {
|
|
4765
4766
|
await sql`ALTER TABLE public.host_roster
|
|
4766
4767
|
ADD COLUMN IF NOT EXISTS reboot_pending_until timestamptz`.execute(db);
|
|
4767
4768
|
}
|
|
4768
|
-
async function down$
|
|
4769
|
+
async function down$112(db) {
|
|
4769
4770
|
await sql`ALTER TABLE public.host_roster DROP COLUMN IF EXISTS reboot_pending_until`.execute(db);
|
|
4770
4771
|
}
|
|
4771
4772
|
//#endregion
|
|
4772
4773
|
//#region src/db/migrations/049_held_runs_payload.ts
|
|
4773
4774
|
var _049_held_runs_payload_exports = /* @__PURE__ */ __exportAll({
|
|
4774
|
-
down: () => down$
|
|
4775
|
-
up: () => up$
|
|
4775
|
+
down: () => down$111,
|
|
4776
|
+
up: () => up$111
|
|
4776
4777
|
});
|
|
4777
4778
|
/**
|
|
4778
4779
|
* Add `held_runs.payload`: the `{ summaryMarkdown, drift }` captured when a `when: 'drift'`
|
|
4779
4780
|
* step-approval gate fires, so the dashboard approval queue and the CLI render the diff the
|
|
4780
4781
|
* operator approves. NULL for every non-drift hold. Idempotent and additive.
|
|
4781
4782
|
*/
|
|
4782
|
-
async function up$
|
|
4783
|
+
async function up$111(db) {
|
|
4783
4784
|
await sql`ALTER TABLE public.held_runs
|
|
4784
4785
|
ADD COLUMN IF NOT EXISTS payload jsonb`.execute(db);
|
|
4785
4786
|
}
|
|
4786
|
-
async function down$
|
|
4787
|
+
async function down$111(db) {
|
|
4787
4788
|
await sql`ALTER TABLE public.held_runs DROP COLUMN IF EXISTS payload`.execute(db);
|
|
4788
4789
|
}
|
|
4789
4790
|
//#endregion
|
|
4790
4791
|
//#region src/db/migrations/050_sources_slug.ts
|
|
4791
4792
|
var _050_sources_slug_exports = /* @__PURE__ */ __exportAll({
|
|
4792
|
-
down: () => down$
|
|
4793
|
-
up: () => up$
|
|
4793
|
+
down: () => down$110,
|
|
4794
|
+
up: () => up$110
|
|
4794
4795
|
});
|
|
4795
4796
|
/**
|
|
4796
4797
|
* Add `sources.slug TEXT NULL` — the GitHub App slug (the URL-safe identifier
|
|
@@ -4804,18 +4805,18 @@ var _050_sources_slug_exports = /* @__PURE__ */ __exportAll({
|
|
|
4804
4805
|
* Idempotent (`ADD COLUMN IF NOT EXISTS`); additive, so existing data is
|
|
4805
4806
|
* preserved.
|
|
4806
4807
|
*/
|
|
4807
|
-
async function up$
|
|
4808
|
+
async function up$110(db) {
|
|
4808
4809
|
await sql`ALTER TABLE public.sources
|
|
4809
4810
|
ADD COLUMN IF NOT EXISTS slug text`.execute(db);
|
|
4810
4811
|
}
|
|
4811
|
-
async function down$
|
|
4812
|
+
async function down$110(db) {
|
|
4812
4813
|
await sql`ALTER TABLE public.sources DROP COLUMN IF EXISTS slug`.execute(db);
|
|
4813
4814
|
}
|
|
4814
4815
|
//#endregion
|
|
4815
4816
|
//#region src/db/migrations/051_binding_host_pattern.ts
|
|
4816
4817
|
var _051_binding_host_pattern_exports = /* @__PURE__ */ __exportAll({
|
|
4817
|
-
down: () => down$
|
|
4818
|
-
up: () => up$
|
|
4818
|
+
down: () => down$109,
|
|
4819
|
+
up: () => up$109
|
|
4819
4820
|
});
|
|
4820
4821
|
/**
|
|
4821
4822
|
* Per-host environment secret bindings:
|
|
@@ -4828,7 +4829,7 @@ var _051_binding_host_pattern_exports = /* @__PURE__ */ __exportAll({
|
|
|
4828
4829
|
*
|
|
4829
4830
|
* Idempotent and additive.
|
|
4830
4831
|
*/
|
|
4831
|
-
async function up$
|
|
4832
|
+
async function up$109(db) {
|
|
4832
4833
|
await sql`ALTER TABLE public.environment_bindings
|
|
4833
4834
|
ADD COLUMN IF NOT EXISTS host_pattern text NOT NULL DEFAULT '**'`.execute(db);
|
|
4834
4835
|
await sql`ALTER TABLE public.environment_bindings
|
|
@@ -4836,7 +4837,7 @@ async function up$108(db) {
|
|
|
4836
4837
|
await sql`CREATE UNIQUE INDEX IF NOT EXISTS environment_bindings_env_scope_host_uniq
|
|
4837
4838
|
ON public.environment_bindings (environment_id, scope_pattern, host_pattern)`.execute(db);
|
|
4838
4839
|
}
|
|
4839
|
-
async function down$
|
|
4840
|
+
async function down$109(db) {
|
|
4840
4841
|
await sql`DROP INDEX IF EXISTS public.environment_bindings_env_scope_host_uniq`.execute(db);
|
|
4841
4842
|
await sql`ALTER TABLE public.environment_bindings
|
|
4842
4843
|
DROP COLUMN IF EXISTS host_pattern`.execute(db);
|
|
@@ -4846,8 +4847,8 @@ async function down$108(db) {
|
|
|
4846
4847
|
//#endregion
|
|
4847
4848
|
//#region src/db/migrations/052_host_reach_metadata.ts
|
|
4848
4849
|
var _052_host_reach_metadata_exports = /* @__PURE__ */ __exportAll({
|
|
4849
|
-
down: () => down$
|
|
4850
|
-
up: () => up$
|
|
4850
|
+
down: () => down$108,
|
|
4851
|
+
up: () => up$108
|
|
4851
4852
|
});
|
|
4852
4853
|
/**
|
|
4853
4854
|
* Add SSH reach metadata so a declared host with no agent yet can be bootstrapped:
|
|
@@ -4861,14 +4862,14 @@ var _052_host_reach_metadata_exports = /* @__PURE__ */ __exportAll({
|
|
|
4861
4862
|
* All nullable: a host without them cannot be bootstrapped and is otherwise unaffected.
|
|
4862
4863
|
* Idempotent and additive.
|
|
4863
4864
|
*/
|
|
4864
|
-
async function up$
|
|
4865
|
+
async function up$108(db) {
|
|
4865
4866
|
await sql`ALTER TABLE public.host_roster
|
|
4866
4867
|
ADD COLUMN IF NOT EXISTS address text,
|
|
4867
4868
|
ADD COLUMN IF NOT EXISTS ssh_user text,
|
|
4868
4869
|
ADD COLUMN IF NOT EXISTS ssh_port integer,
|
|
4869
4870
|
ADD COLUMN IF NOT EXISTS ssh_key_secret text`.execute(db);
|
|
4870
4871
|
}
|
|
4871
|
-
async function down$
|
|
4872
|
+
async function down$108(db) {
|
|
4872
4873
|
await sql`ALTER TABLE public.host_roster
|
|
4873
4874
|
DROP COLUMN IF EXISTS address,
|
|
4874
4875
|
DROP COLUMN IF EXISTS ssh_user,
|
|
@@ -4878,8 +4879,8 @@ async function down$107(db) {
|
|
|
4878
4879
|
//#endregion
|
|
4879
4880
|
//#region src/db/migrations/053_agent_token_single_use.ts
|
|
4880
4881
|
var _053_agent_token_single_use_exports = /* @__PURE__ */ __exportAll({
|
|
4881
|
-
down: () => down$
|
|
4882
|
-
up: () => up$
|
|
4882
|
+
down: () => down$107,
|
|
4883
|
+
up: () => up$107
|
|
4883
4884
|
});
|
|
4884
4885
|
/**
|
|
4885
4886
|
* `agent_tokens.consumed_at timestamptz NULL`: the single-use marker for the
|
|
@@ -4890,19 +4891,19 @@ var _053_agent_token_single_use_exports = /* @__PURE__ */ __exportAll({
|
|
|
4890
4891
|
*
|
|
4891
4892
|
* Idempotent and additive.
|
|
4892
4893
|
*/
|
|
4893
|
-
async function up$
|
|
4894
|
+
async function up$107(db) {
|
|
4894
4895
|
await sql`ALTER TABLE public.agent_tokens
|
|
4895
4896
|
ADD COLUMN IF NOT EXISTS consumed_at timestamptz`.execute(db);
|
|
4896
4897
|
}
|
|
4897
|
-
async function down$
|
|
4898
|
+
async function down$107(db) {
|
|
4898
4899
|
await sql`ALTER TABLE public.agent_tokens
|
|
4899
4900
|
DROP COLUMN IF EXISTS consumed_at`.execute(db);
|
|
4900
4901
|
}
|
|
4901
4902
|
//#endregion
|
|
4902
4903
|
//#region src/db/migrations/054_local_working_tree.ts
|
|
4903
4904
|
var _054_local_working_tree_exports = /* @__PURE__ */ __exportAll({
|
|
4904
|
-
down: () => down$
|
|
4905
|
-
up: () => up$
|
|
4905
|
+
down: () => down$106,
|
|
4906
|
+
up: () => up$106
|
|
4906
4907
|
});
|
|
4907
4908
|
/**
|
|
4908
4909
|
* Add `execution_runs.local_working_tree boolean NOT NULL DEFAULT false`: true
|
|
@@ -4913,19 +4914,19 @@ var _054_local_working_tree_exports = /* @__PURE__ */ __exportAll({
|
|
|
4913
4914
|
* Idempotent (`ADD COLUMN IF NOT EXISTS`); additive with a default, so existing
|
|
4914
4915
|
* data is preserved.
|
|
4915
4916
|
*/
|
|
4916
|
-
async function up$
|
|
4917
|
+
async function up$106(db) {
|
|
4917
4918
|
await sql`ALTER TABLE public.execution_runs
|
|
4918
4919
|
ADD COLUMN IF NOT EXISTS local_working_tree boolean NOT NULL DEFAULT false`.execute(db);
|
|
4919
4920
|
}
|
|
4920
|
-
async function down$
|
|
4921
|
+
async function down$106(db) {
|
|
4921
4922
|
await sql`ALTER TABLE public.execution_runs
|
|
4922
4923
|
DROP COLUMN IF EXISTS local_working_tree`.execute(db);
|
|
4923
4924
|
}
|
|
4924
4925
|
//#endregion
|
|
4925
4926
|
//#region src/db/migrations/055_agent_token_mandatory_labels.ts
|
|
4926
4927
|
var _055_agent_token_mandatory_labels_exports = /* @__PURE__ */ __exportAll({
|
|
4927
|
-
down: () => down$
|
|
4928
|
-
up: () => up$
|
|
4928
|
+
down: () => down$105,
|
|
4929
|
+
up: () => up$105
|
|
4929
4930
|
});
|
|
4930
4931
|
/**
|
|
4931
4932
|
* `agent_tokens.mandatory_labels text NULL`: a JSON-encoded `string[]` of
|
|
@@ -4936,19 +4937,19 @@ var _055_agent_token_mandatory_labels_exports = /* @__PURE__ */ __exportAll({
|
|
|
4936
4937
|
*
|
|
4937
4938
|
* Idempotent and additive.
|
|
4938
4939
|
*/
|
|
4939
|
-
async function up$
|
|
4940
|
+
async function up$105(db) {
|
|
4940
4941
|
await sql`ALTER TABLE public.agent_tokens
|
|
4941
4942
|
ADD COLUMN IF NOT EXISTS mandatory_labels text`.execute(db);
|
|
4942
4943
|
}
|
|
4943
|
-
async function down$
|
|
4944
|
+
async function down$105(db) {
|
|
4944
4945
|
await sql`ALTER TABLE public.agent_tokens
|
|
4945
4946
|
DROP COLUMN IF EXISTS mandatory_labels`.execute(db);
|
|
4946
4947
|
}
|
|
4947
4948
|
//#endregion
|
|
4948
4949
|
//#region src/db/migrations/056_execution_jobs_environments.ts
|
|
4949
4950
|
var _056_execution_jobs_environments_exports = /* @__PURE__ */ __exportAll({
|
|
4950
|
-
down: () => down$
|
|
4951
|
-
up: () => up$
|
|
4951
|
+
down: () => down$104,
|
|
4952
|
+
up: () => up$104
|
|
4952
4953
|
});
|
|
4953
4954
|
/**
|
|
4954
4955
|
* Add `execution_jobs.environments`: a JSON-encoded `string[]` of the environment names a job
|
|
@@ -4956,19 +4957,19 @@ var _056_execution_jobs_environments_exports = /* @__PURE__ */ __exportAll({
|
|
|
4956
4957
|
* `(dynamic)` placeholder), then overwritten with the full list when a deferred-init agent eval
|
|
4957
4958
|
* resolves them. NULL = no environment. Idempotent and additive.
|
|
4958
4959
|
*/
|
|
4959
|
-
async function up$
|
|
4960
|
+
async function up$104(db) {
|
|
4960
4961
|
await sql`ALTER TABLE public.execution_jobs
|
|
4961
4962
|
ADD COLUMN IF NOT EXISTS environments text`.execute(db);
|
|
4962
4963
|
}
|
|
4963
|
-
async function down$
|
|
4964
|
+
async function down$104(db) {
|
|
4964
4965
|
await sql`ALTER TABLE public.execution_jobs
|
|
4965
4966
|
DROP COLUMN IF EXISTS environments`.execute(db);
|
|
4966
4967
|
}
|
|
4967
4968
|
//#endregion
|
|
4968
4969
|
//#region src/db/migrations/057_step_concurrency.ts
|
|
4969
4970
|
var _057_step_concurrency_exports = /* @__PURE__ */ __exportAll({
|
|
4970
|
-
down: () => down$
|
|
4971
|
-
up: () => up$
|
|
4971
|
+
down: () => down$103,
|
|
4972
|
+
up: () => up$103
|
|
4972
4973
|
});
|
|
4973
4974
|
/**
|
|
4974
4975
|
* Add parallel step-group concurrency columns to `execution_steps`:
|
|
@@ -4991,19 +4992,19 @@ async function colExists$16(db, table, name) {
|
|
|
4991
4992
|
) AS exists
|
|
4992
4993
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
4993
4994
|
}
|
|
4994
|
-
async function up$
|
|
4995
|
+
async function up$103(db) {
|
|
4995
4996
|
if (!await colExists$16(db, "execution_steps", "concurrency_kind")) await sql`ALTER TABLE public.execution_steps ADD COLUMN concurrency_kind text`.execute(db);
|
|
4996
4997
|
if (!await colExists$16(db, "execution_steps", "group_id")) await sql`ALTER TABLE public.execution_steps ADD COLUMN group_id text`.execute(db);
|
|
4997
4998
|
}
|
|
4998
|
-
async function down$
|
|
4999
|
+
async function down$103(db) {
|
|
4999
5000
|
await sql`ALTER TABLE public.execution_steps DROP COLUMN IF EXISTS group_id`.execute(db);
|
|
5000
5001
|
await sql`ALTER TABLE public.execution_steps DROP COLUMN IF EXISTS concurrency_kind`.execute(db);
|
|
5001
5002
|
}
|
|
5002
5003
|
//#endregion
|
|
5003
5004
|
//#region src/db/migrations/058_access_log_agent_label.ts
|
|
5004
5005
|
var _058_access_log_agent_label_exports = /* @__PURE__ */ __exportAll({
|
|
5005
|
-
down: () => down$
|
|
5006
|
-
up: () => up$
|
|
5006
|
+
down: () => down$102,
|
|
5007
|
+
up: () => up$102
|
|
5007
5008
|
});
|
|
5008
5009
|
/**
|
|
5009
5010
|
* Add `access_log.agent_label text` — the human-set name of the agent that
|
|
@@ -5023,17 +5024,17 @@ async function colExists$15(db, table, name) {
|
|
|
5023
5024
|
) AS exists
|
|
5024
5025
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5025
5026
|
}
|
|
5026
|
-
async function up$
|
|
5027
|
+
async function up$102(db) {
|
|
5027
5028
|
if (!await colExists$15(db, "access_log", "agent_label")) await sql`ALTER TABLE public.access_log ADD COLUMN agent_label text`.execute(db);
|
|
5028
5029
|
}
|
|
5029
|
-
async function down$
|
|
5030
|
+
async function down$102(db) {
|
|
5030
5031
|
await sql`ALTER TABLE public.access_log DROP COLUMN IF EXISTS agent_label`.execute(db);
|
|
5031
5032
|
}
|
|
5032
5033
|
//#endregion
|
|
5033
5034
|
//#region src/db/migrations/059_attestation_verdict.ts
|
|
5034
5035
|
var _059_attestation_verdict_exports = /* @__PURE__ */ __exportAll({
|
|
5035
|
-
down: () => down$
|
|
5036
|
-
up: () => up$
|
|
5036
|
+
down: () => down$101,
|
|
5037
|
+
up: () => up$101
|
|
5037
5038
|
});
|
|
5038
5039
|
/**
|
|
5039
5040
|
* Add server-side verification verdict columns to `attestations`, plus the
|
|
@@ -5060,7 +5061,7 @@ async function colExists$14(db, table, name) {
|
|
|
5060
5061
|
) AS exists
|
|
5061
5062
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5062
5063
|
}
|
|
5063
|
-
async function up$
|
|
5064
|
+
async function up$101(db) {
|
|
5064
5065
|
if (await colExists$14(db, "attestations", "verify_status")) return;
|
|
5065
5066
|
await sql`
|
|
5066
5067
|
ALTER TABLE public.attestations
|
|
@@ -5073,7 +5074,7 @@ async function up$100(db) {
|
|
|
5073
5074
|
await sql`CREATE INDEX idx_attestations_verify_status ON public.attestations (verify_status)`.execute(db);
|
|
5074
5075
|
await sql`CREATE INDEX idx_attestations_created_at ON public.attestations (created_at)`.execute(db);
|
|
5075
5076
|
}
|
|
5076
|
-
async function down$
|
|
5077
|
+
async function down$101(db) {
|
|
5077
5078
|
await sql`DROP INDEX IF EXISTS idx_attestations_created_at`.execute(db);
|
|
5078
5079
|
await sql`DROP INDEX IF EXISTS idx_attestations_verify_status`.execute(db);
|
|
5079
5080
|
await sql`DROP INDEX IF EXISTS idx_attestations_subject_name`.execute(db);
|
|
@@ -5088,8 +5089,8 @@ async function down$100(db) {
|
|
|
5088
5089
|
//#endregion
|
|
5089
5090
|
//#region src/db/migrations/060_run_trigger_actor.ts
|
|
5090
5091
|
var _060_run_trigger_actor_exports = /* @__PURE__ */ __exportAll({
|
|
5091
|
-
down: () => down$
|
|
5092
|
-
up: () => up$
|
|
5092
|
+
down: () => down$100,
|
|
5093
|
+
up: () => up$100
|
|
5093
5094
|
});
|
|
5094
5095
|
/**
|
|
5095
5096
|
* Triggering-actor columns on `execution_runs`:
|
|
@@ -5115,12 +5116,12 @@ async function colExists$13(db, table, name) {
|
|
|
5115
5116
|
) AS exists
|
|
5116
5117
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5117
5118
|
}
|
|
5118
|
-
async function up$
|
|
5119
|
+
async function up$100(db) {
|
|
5119
5120
|
if (!await colExists$13(db, "execution_runs", "trigger_actor_provider")) await sql`ALTER TABLE public.execution_runs ADD COLUMN trigger_actor_provider text`.execute(db);
|
|
5120
5121
|
if (!await colExists$13(db, "execution_runs", "trigger_actor_username")) await sql`ALTER TABLE public.execution_runs ADD COLUMN trigger_actor_username text`.execute(db);
|
|
5121
5122
|
if (!await colExists$13(db, "execution_runs", "trigger_actor_user_id")) await sql`ALTER TABLE public.execution_runs ADD COLUMN trigger_actor_user_id text`.execute(db);
|
|
5122
5123
|
}
|
|
5123
|
-
async function down$
|
|
5124
|
+
async function down$100(db) {
|
|
5124
5125
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS trigger_actor_provider`.execute(db);
|
|
5125
5126
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS trigger_actor_username`.execute(db);
|
|
5126
5127
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS trigger_actor_user_id`.execute(db);
|
|
@@ -5128,8 +5129,8 @@ async function down$99(db) {
|
|
|
5128
5129
|
//#endregion
|
|
5129
5130
|
//#region src/db/migrations/061_execution_runs_environment_id.ts
|
|
5130
5131
|
var _061_execution_runs_environment_id_exports = /* @__PURE__ */ __exportAll({
|
|
5131
|
-
down: () => down$
|
|
5132
|
-
up: () => up$
|
|
5132
|
+
down: () => down$99,
|
|
5133
|
+
up: () => up$99
|
|
5133
5134
|
});
|
|
5134
5135
|
/**
|
|
5135
5136
|
* `execution_runs.environment_id`, so environment run-history keys off the matched
|
|
@@ -5157,7 +5158,7 @@ async function colExists$12(db, table, name) {
|
|
|
5157
5158
|
) AS exists
|
|
5158
5159
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5159
5160
|
}
|
|
5160
|
-
async function up$
|
|
5161
|
+
async function up$99(db) {
|
|
5161
5162
|
if (!await colExists$12(db, "execution_runs", "environment_id")) await sql`
|
|
5162
5163
|
ALTER TABLE public.execution_runs
|
|
5163
5164
|
ADD COLUMN environment_id uuid
|
|
@@ -5179,15 +5180,15 @@ async function up$98(db) {
|
|
|
5179
5180
|
WHERE e2.type = 'fixed' AND e2.name = er.environment) = 1
|
|
5180
5181
|
`.execute(db);
|
|
5181
5182
|
}
|
|
5182
|
-
async function down$
|
|
5183
|
+
async function down$99(db) {
|
|
5183
5184
|
await sql`DROP INDEX IF EXISTS idx_execution_runs_environment_id`.execute(db);
|
|
5184
5185
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS environment_id`.execute(db);
|
|
5185
5186
|
}
|
|
5186
5187
|
//#endregion
|
|
5187
5188
|
//#region src/db/migrations/062_execution_runs_agent_label.ts
|
|
5188
5189
|
var _062_execution_runs_agent_label_exports = /* @__PURE__ */ __exportAll({
|
|
5189
|
-
down: () => down$
|
|
5190
|
-
up: () => up$
|
|
5190
|
+
down: () => down$98,
|
|
5191
|
+
up: () => up$98
|
|
5191
5192
|
});
|
|
5192
5193
|
/**
|
|
5193
5194
|
* Agent provenance on `execution_runs`: `triggered_by_agent_label` / `cancelled_by_agent_label`
|
|
@@ -5207,19 +5208,19 @@ async function colExists$11(db, table, name) {
|
|
|
5207
5208
|
) AS exists
|
|
5208
5209
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5209
5210
|
}
|
|
5210
|
-
async function up$
|
|
5211
|
+
async function up$98(db) {
|
|
5211
5212
|
if (!await colExists$11(db, "execution_runs", "triggered_by_agent_label")) await sql`ALTER TABLE public.execution_runs ADD COLUMN triggered_by_agent_label text`.execute(db);
|
|
5212
5213
|
if (!await colExists$11(db, "execution_runs", "cancelled_by_agent_label")) await sql`ALTER TABLE public.execution_runs ADD COLUMN cancelled_by_agent_label text`.execute(db);
|
|
5213
5214
|
}
|
|
5214
|
-
async function down$
|
|
5215
|
+
async function down$98(db) {
|
|
5215
5216
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS triggered_by_agent_label`.execute(db);
|
|
5216
5217
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS cancelled_by_agent_label`.execute(db);
|
|
5217
5218
|
}
|
|
5218
5219
|
//#endregion
|
|
5219
5220
|
//#region src/db/migrations/063_access_log_agent_label_index.ts
|
|
5220
5221
|
var _063_access_log_agent_label_index_exports = /* @__PURE__ */ __exportAll({
|
|
5221
|
-
down: () => down$
|
|
5222
|
-
up: () => up$
|
|
5222
|
+
down: () => down$97,
|
|
5223
|
+
up: () => up$97
|
|
5223
5224
|
});
|
|
5224
5225
|
/**
|
|
5225
5226
|
* Index `access_log.agent_label` (column added by migration 058) so the
|
|
@@ -5227,17 +5228,17 @@ var _063_access_log_agent_label_index_exports = /* @__PURE__ */ __exportAll({
|
|
|
5227
5228
|
* the dashboard "agent name" filter) does an indexed exact-match lookup
|
|
5228
5229
|
* instead of a scan. Idempotent.
|
|
5229
5230
|
*/
|
|
5230
|
-
async function up$
|
|
5231
|
+
async function up$97(db) {
|
|
5231
5232
|
await sql`CREATE INDEX IF NOT EXISTS access_log_agent_label_idx ON public.access_log (agent_label)`.execute(db);
|
|
5232
5233
|
}
|
|
5233
|
-
async function down$
|
|
5234
|
+
async function down$97(db) {
|
|
5234
5235
|
await sql`DROP INDEX IF EXISTS access_log_agent_label_idx`.execute(db);
|
|
5235
5236
|
}
|
|
5236
5237
|
//#endregion
|
|
5237
5238
|
//#region src/db/migrations/064_execution_jobs_skipped_environments.ts
|
|
5238
5239
|
var _064_execution_jobs_skipped_environments_exports = /* @__PURE__ */ __exportAll({
|
|
5239
|
-
down: () => down$
|
|
5240
|
-
up: () => up$
|
|
5240
|
+
down: () => down$96,
|
|
5241
|
+
up: () => up$96
|
|
5241
5242
|
});
|
|
5242
5243
|
/**
|
|
5243
5244
|
* Test-run skipped environments on `execution_jobs`:
|
|
@@ -5249,13 +5250,13 @@ var _064_execution_jobs_skipped_environments_exports = /* @__PURE__ */ __exportA
|
|
|
5249
5250
|
*
|
|
5250
5251
|
* Idempotent and additive.
|
|
5251
5252
|
*/
|
|
5252
|
-
async function up$
|
|
5253
|
+
async function up$96(db) {
|
|
5253
5254
|
await sql`ALTER TABLE public.execution_jobs
|
|
5254
5255
|
ADD COLUMN IF NOT EXISTS skipped_environments text`.execute(db);
|
|
5255
5256
|
await sql`ALTER TABLE public.execution_jobs
|
|
5256
5257
|
ADD COLUMN IF NOT EXISTS env_warning text`.execute(db);
|
|
5257
5258
|
}
|
|
5258
|
-
async function down$
|
|
5259
|
+
async function down$96(db) {
|
|
5259
5260
|
await sql`ALTER TABLE public.execution_jobs
|
|
5260
5261
|
DROP COLUMN IF EXISTS skipped_environments`.execute(db);
|
|
5261
5262
|
await sql`ALTER TABLE public.execution_jobs
|
|
@@ -5264,8 +5265,8 @@ async function down$95(db) {
|
|
|
5264
5265
|
//#endregion
|
|
5265
5266
|
//#region src/db/migrations/065_pending_attestations.ts
|
|
5266
5267
|
var _065_pending_attestations_exports = /* @__PURE__ */ __exportAll({
|
|
5267
|
-
down: () => down$
|
|
5268
|
-
up: () => up$
|
|
5268
|
+
down: () => down$95,
|
|
5269
|
+
up: () => up$95
|
|
5269
5270
|
});
|
|
5270
5271
|
/**
|
|
5271
5272
|
* The `pending_attestations` deferred-attestation outbox, plus an idempotency unique index on
|
|
@@ -5282,7 +5283,7 @@ var _065_pending_attestations_exports = /* @__PURE__ */ __exportAll({
|
|
|
5282
5283
|
*
|
|
5283
5284
|
* Idempotent: guarded on table existence.
|
|
5284
5285
|
*/
|
|
5285
|
-
async function up$
|
|
5286
|
+
async function up$95(db) {
|
|
5286
5287
|
if ((await sql`
|
|
5287
5288
|
SELECT EXISTS (
|
|
5288
5289
|
SELECT 1 FROM information_schema.tables
|
|
@@ -5321,15 +5322,15 @@ async function up$94(db) {
|
|
|
5321
5322
|
ON public.attestations (run_id, job_id, subject_digest)
|
|
5322
5323
|
`.execute(db);
|
|
5323
5324
|
}
|
|
5324
|
-
async function down$
|
|
5325
|
+
async function down$95(db) {
|
|
5325
5326
|
await sql`DROP INDEX IF EXISTS uq_attestations_run_job_subject`.execute(db);
|
|
5326
5327
|
await sql`DROP TABLE IF EXISTS public.pending_attestations`.execute(db);
|
|
5327
5328
|
}
|
|
5328
5329
|
//#endregion
|
|
5329
5330
|
//#region src/db/migrations/066_pending_attestations_rejected.ts
|
|
5330
5331
|
var _066_pending_attestations_rejected_exports = /* @__PURE__ */ __exportAll({
|
|
5331
|
-
down: () => down$
|
|
5332
|
-
up: () => up$
|
|
5332
|
+
down: () => down$94,
|
|
5333
|
+
up: () => up$94
|
|
5333
5334
|
});
|
|
5334
5335
|
/**
|
|
5335
5336
|
* Add `pending_attestations.rejected_at`: marks a deferred attestation the Platform definitively
|
|
@@ -5337,14 +5338,14 @@ var _066_pending_attestations_rejected_exports = /* @__PURE__ */ __exportAll({
|
|
|
5337
5338
|
* pending-attestations gauge; `kici-admin attestations retry --include-rejected` re-arms it.
|
|
5338
5339
|
* Idempotent.
|
|
5339
5340
|
*/
|
|
5340
|
-
async function up$
|
|
5341
|
+
async function up$94(db) {
|
|
5341
5342
|
if (await columnExists$15(db, "pending_attestations", "rejected_at")) return;
|
|
5342
5343
|
await sql`
|
|
5343
5344
|
ALTER TABLE public.pending_attestations
|
|
5344
5345
|
ADD COLUMN rejected_at TIMESTAMPTZ
|
|
5345
5346
|
`.execute(db);
|
|
5346
5347
|
}
|
|
5347
|
-
async function down$
|
|
5348
|
+
async function down$94(db) {
|
|
5348
5349
|
if (!await columnExists$15(db, "pending_attestations", "rejected_at")) return;
|
|
5349
5350
|
await sql`
|
|
5350
5351
|
ALTER TABLE public.pending_attestations
|
|
@@ -5362,8 +5363,8 @@ async function columnExists$15(db, table, column) {
|
|
|
5362
5363
|
//#endregion
|
|
5363
5364
|
//#region src/db/migrations/067_environments_to_contexts.ts
|
|
5364
5365
|
var _067_environments_to_contexts_exports = /* @__PURE__ */ __exportAll({
|
|
5365
|
-
down: () => down$
|
|
5366
|
-
up: () => up$
|
|
5366
|
+
down: () => down$93,
|
|
5367
|
+
up: () => up$93
|
|
5367
5368
|
});
|
|
5368
5369
|
/**
|
|
5369
5370
|
* Rename the named-policy object from "environment" to "context" across the
|
|
@@ -5397,7 +5398,7 @@ var _067_environments_to_contexts_exports = /* @__PURE__ */ __exportAll({
|
|
|
5397
5398
|
* columns automatically (Postgres references them by identity, not name), so
|
|
5398
5399
|
* only the one hand-named index above needs an explicit rename.
|
|
5399
5400
|
*/
|
|
5400
|
-
async function up$
|
|
5401
|
+
async function up$93(db) {
|
|
5401
5402
|
await sql`ALTER TABLE public.environments RENAME TO contexts`.execute(db);
|
|
5402
5403
|
await sql`ALTER TABLE public.environment_bindings RENAME TO context_bindings`.execute(db);
|
|
5403
5404
|
await sql`ALTER TABLE public.environment_variables RENAME TO context_variables`.execute(db);
|
|
@@ -5416,7 +5417,7 @@ async function up$92(db) {
|
|
|
5416
5417
|
await sql`ALTER TABLE public.held_runs ALTER COLUMN queue_type SET DEFAULT 'context'`.execute(db);
|
|
5417
5418
|
await sql`ALTER TABLE public.held_runs ALTER COLUMN trigger_source SET DEFAULT 'context'`.execute(db);
|
|
5418
5419
|
}
|
|
5419
|
-
async function down$
|
|
5420
|
+
async function down$93(db) {
|
|
5420
5421
|
await sql`ALTER TABLE public.held_runs ALTER COLUMN trigger_source SET DEFAULT 'environment'`.execute(db);
|
|
5421
5422
|
await sql`ALTER TABLE public.held_runs ALTER COLUMN queue_type SET DEFAULT 'environment'`.execute(db);
|
|
5422
5423
|
await sql`UPDATE public.held_runs SET trigger_source = 'environment' WHERE trigger_source = 'context'`.execute(db);
|
|
@@ -5438,8 +5439,8 @@ async function down$92(db) {
|
|
|
5438
5439
|
//#endregion
|
|
5439
5440
|
//#region src/db/migrations/068_request_idempotency.ts
|
|
5440
5441
|
var _068_request_idempotency_exports = /* @__PURE__ */ __exportAll({
|
|
5441
|
-
down: () => down$
|
|
5442
|
-
up: () => up$
|
|
5442
|
+
down: () => down$92,
|
|
5443
|
+
up: () => up$92
|
|
5443
5444
|
});
|
|
5444
5445
|
/**
|
|
5445
5446
|
* Add the `request_idempotency` claim table, making run-minting dashboard
|
|
@@ -5452,12 +5453,12 @@ var _068_request_idempotency_exports = /* @__PURE__ */ __exportAll({
|
|
|
5452
5453
|
*
|
|
5453
5454
|
* Idempotent: guarded on table existence.
|
|
5454
5455
|
*/
|
|
5455
|
-
async function up$
|
|
5456
|
+
async function up$92(db) {
|
|
5456
5457
|
if (await tableExists$5(db, "request_idempotency")) return;
|
|
5457
5458
|
await db.schema.createTable("request_idempotency").addColumn("request_id", "text", (c) => c.primaryKey()).addColumn("new_run_id", "text", (c) => c.notNull()).addColumn("created_at", "timestamptz", (c) => c.notNull().defaultTo(sql`now()`)).execute();
|
|
5458
5459
|
await db.schema.createIndex("idx_request_idempotency_created_at").on("request_idempotency").column("created_at").execute();
|
|
5459
5460
|
}
|
|
5460
|
-
async function down$
|
|
5461
|
+
async function down$92(db) {
|
|
5461
5462
|
await db.schema.dropTable("request_idempotency").ifExists().execute();
|
|
5462
5463
|
}
|
|
5463
5464
|
async function tableExists$5(db, table) {
|
|
@@ -5471,8 +5472,8 @@ async function tableExists$5(db, table) {
|
|
|
5471
5472
|
//#endregion
|
|
5472
5473
|
//#region src/db/migrations/069_reroute_tunables.ts
|
|
5473
5474
|
var _069_reroute_tunables_exports = /* @__PURE__ */ __exportAll({
|
|
5474
|
-
down: () => down$
|
|
5475
|
-
up: () => up$
|
|
5475
|
+
down: () => down$91,
|
|
5476
|
+
up: () => up$91
|
|
5476
5477
|
});
|
|
5477
5478
|
/**
|
|
5478
5479
|
* Add the per-org reroute tunables to `org_settings` (nullable; NULL is the cluster default; set
|
|
@@ -5483,12 +5484,12 @@ var _069_reroute_tunables_exports = /* @__PURE__ */ __exportAll({
|
|
|
5483
5484
|
* - `reroute_ack_timeout_ms` — the reroute `sendAndWaitAck` deadline (`rerouteAckTimeoutMs`, 15s).
|
|
5484
5485
|
* - `reroute_max_hops` — max peer hops for a rerouted job (`rerouteMaxHops`, 3).
|
|
5485
5486
|
*/
|
|
5486
|
-
async function up$
|
|
5487
|
+
async function up$91(db) {
|
|
5487
5488
|
await addColumnIfMissing$1(db, "reroute_spawn_window_ms", "BIGINT");
|
|
5488
5489
|
await addColumnIfMissing$1(db, "reroute_ack_timeout_ms", "BIGINT");
|
|
5489
5490
|
await addColumnIfMissing$1(db, "reroute_max_hops", "INTEGER");
|
|
5490
5491
|
}
|
|
5491
|
-
async function down$
|
|
5492
|
+
async function down$91(db) {
|
|
5492
5493
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS reroute_spawn_window_ms`.execute(db);
|
|
5493
5494
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS reroute_ack_timeout_ms`.execute(db);
|
|
5494
5495
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS reroute_max_hops`.execute(db);
|
|
@@ -5507,8 +5508,8 @@ async function addColumnIfMissing$1(db, column, type) {
|
|
|
5507
5508
|
//#endregion
|
|
5508
5509
|
//#region src/db/migrations/070_execution_runs_failure_class.ts
|
|
5509
5510
|
var _070_execution_runs_failure_class_exports = /* @__PURE__ */ __exportAll({
|
|
5510
|
-
down: () => down$
|
|
5511
|
-
up: () => up$
|
|
5511
|
+
down: () => down$90,
|
|
5512
|
+
up: () => up$90
|
|
5512
5513
|
});
|
|
5513
5514
|
/**
|
|
5514
5515
|
* `execution_runs.failure_class` (`RunFailureClass`: never_started / timed_out /
|
|
@@ -5527,17 +5528,17 @@ async function colExists$10(db, table, name) {
|
|
|
5527
5528
|
) AS exists
|
|
5528
5529
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
5529
5530
|
}
|
|
5530
|
-
async function up$
|
|
5531
|
+
async function up$90(db) {
|
|
5531
5532
|
if (!await colExists$10(db, "execution_runs", "failure_class")) await sql`ALTER TABLE public.execution_runs ADD COLUMN failure_class text`.execute(db);
|
|
5532
5533
|
}
|
|
5533
|
-
async function down$
|
|
5534
|
+
async function down$90(db) {
|
|
5534
5535
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS failure_class`.execute(db);
|
|
5535
5536
|
}
|
|
5536
5537
|
//#endregion
|
|
5537
5538
|
//#region src/db/migrations/071_batch_accumulation.ts
|
|
5538
5539
|
var _071_batch_accumulation_exports = /* @__PURE__ */ __exportAll({
|
|
5539
|
-
down: () => down$
|
|
5540
|
-
up: () => up$
|
|
5540
|
+
down: () => down$89,
|
|
5541
|
+
up: () => up$89
|
|
5541
5542
|
});
|
|
5542
5543
|
/**
|
|
5543
5544
|
* Batch-accumulation tables behind the `workflows_failed_batch` trigger.
|
|
@@ -5553,7 +5554,7 @@ var _071_batch_accumulation_exports = /* @__PURE__ */ __exportAll({
|
|
|
5553
5554
|
*
|
|
5554
5555
|
* Idempotent: guarded on table existence.
|
|
5555
5556
|
*/
|
|
5556
|
-
async function up$
|
|
5557
|
+
async function up$89(db) {
|
|
5557
5558
|
if ((await sql`
|
|
5558
5559
|
SELECT EXISTS (
|
|
5559
5560
|
SELECT 1 FROM information_schema.tables
|
|
@@ -5598,35 +5599,35 @@ async function up$88(db) {
|
|
|
5598
5599
|
ON public.batch_accumulation_items (window_id)
|
|
5599
5600
|
`.execute(db);
|
|
5600
5601
|
}
|
|
5601
|
-
async function down$
|
|
5602
|
+
async function down$89(db) {
|
|
5602
5603
|
await sql`DROP TABLE IF EXISTS public.batch_accumulation_items`.execute(db);
|
|
5603
5604
|
await sql`DROP TABLE IF EXISTS public.batch_accumulation_windows`.execute(db);
|
|
5604
5605
|
}
|
|
5605
5606
|
//#endregion
|
|
5606
5607
|
//#region src/db/migrations/072_dispatch_queue_run_id_index.ts
|
|
5607
5608
|
var _072_dispatch_queue_run_id_index_exports = /* @__PURE__ */ __exportAll({
|
|
5608
|
-
down: () => down$
|
|
5609
|
-
up: () => up$
|
|
5609
|
+
down: () => down$88,
|
|
5610
|
+
up: () => up$88
|
|
5610
5611
|
});
|
|
5611
5612
|
/**
|
|
5612
5613
|
* `failByRunId`, `cancelByRunId` and `getDispatchedJobIdsByRunId` filter on `run_id`; without
|
|
5613
5614
|
* this index each run-failure cascade and cancel full-scans the dispatch history while holding
|
|
5614
5615
|
* a pooled connection. `pruneTerminalDispatchRows` also uses it. Idempotent.
|
|
5615
5616
|
*/
|
|
5616
|
-
async function up$
|
|
5617
|
+
async function up$88(db) {
|
|
5617
5618
|
await sql`
|
|
5618
5619
|
CREATE INDEX IF NOT EXISTS idx_dispatch_queue_run_id
|
|
5619
5620
|
ON public.dispatch_queue (run_id)
|
|
5620
5621
|
`.execute(db);
|
|
5621
5622
|
}
|
|
5622
|
-
async function down$
|
|
5623
|
+
async function down$88(db) {
|
|
5623
5624
|
await sql`DROP INDEX IF EXISTS public.idx_dispatch_queue_run_id`.execute(db);
|
|
5624
5625
|
}
|
|
5625
5626
|
//#endregion
|
|
5626
5627
|
//#region src/db/migrations/073_org_settings_ingest_concurrency.ts
|
|
5627
5628
|
var _073_org_settings_ingest_concurrency_exports = /* @__PURE__ */ __exportAll({
|
|
5628
|
-
down: () => down$
|
|
5629
|
-
up: () => up$
|
|
5629
|
+
down: () => down$87,
|
|
5630
|
+
up: () => up$87
|
|
5630
5631
|
});
|
|
5631
5632
|
/**
|
|
5632
5633
|
* Add `org_settings.ingest_max_concurrency BIGINT` (nullable).
|
|
@@ -5637,7 +5638,7 @@ var _073_org_settings_ingest_concurrency_exports = /* @__PURE__ */ __exportAll({
|
|
|
5637
5638
|
*
|
|
5638
5639
|
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
5639
5640
|
*/
|
|
5640
|
-
async function up$
|
|
5641
|
+
async function up$87(db) {
|
|
5641
5642
|
if ((await sql`
|
|
5642
5643
|
SELECT EXISTS (
|
|
5643
5644
|
SELECT 1 FROM information_schema.columns
|
|
@@ -5651,7 +5652,7 @@ async function up$86(db) {
|
|
|
5651
5652
|
ADD COLUMN ingest_max_concurrency BIGINT
|
|
5652
5653
|
`.execute(db);
|
|
5653
5654
|
}
|
|
5654
|
-
async function down$
|
|
5655
|
+
async function down$87(db) {
|
|
5655
5656
|
await sql`
|
|
5656
5657
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS ingest_max_concurrency
|
|
5657
5658
|
`.execute(db);
|
|
@@ -5659,8 +5660,8 @@ async function down$86(db) {
|
|
|
5659
5660
|
//#endregion
|
|
5660
5661
|
//#region src/db/migrations/074_normalize_zero_concurrency_limit.ts
|
|
5661
5662
|
var _074_normalize_zero_concurrency_limit_exports = /* @__PURE__ */ __exportAll({
|
|
5662
|
-
down: () => down$
|
|
5663
|
-
up: () => up$
|
|
5663
|
+
down: () => down$86,
|
|
5664
|
+
up: () => up$86
|
|
5664
5665
|
});
|
|
5665
5666
|
/**
|
|
5666
5667
|
* Normalize non-positive `concurrency_limit` values, which wedge the workflow-install gate in
|
|
@@ -5668,15 +5669,15 @@ var _074_normalize_zero_concurrency_limit_exports = /* @__PURE__ */ __exportAll(
|
|
|
5668
5669
|
* integer. The write boundary rejects them and the gate treats them as unlimited.
|
|
5669
5670
|
* Idempotent; down() is a no-op.
|
|
5670
5671
|
*/
|
|
5671
|
-
async function up$
|
|
5672
|
+
async function up$86(db) {
|
|
5672
5673
|
await sql`UPDATE public.contexts SET concurrency_limit = NULL WHERE concurrency_limit <= 0`.execute(db);
|
|
5673
5674
|
}
|
|
5674
|
-
async function down$
|
|
5675
|
+
async function down$86(_db) {}
|
|
5675
5676
|
//#endregion
|
|
5676
5677
|
//#region src/db/migrations/075_ingest_overflow_buffer.ts
|
|
5677
5678
|
var _075_ingest_overflow_buffer_exports = /* @__PURE__ */ __exportAll({
|
|
5678
|
-
down: () => down$
|
|
5679
|
-
up: () => up$
|
|
5679
|
+
down: () => down$85,
|
|
5680
|
+
up: () => up$85
|
|
5680
5681
|
});
|
|
5681
5682
|
/**
|
|
5682
5683
|
* Durable overflow buffer for shed webhook-ingest deliveries.
|
|
@@ -5690,7 +5691,7 @@ var _075_ingest_overflow_buffer_exports = /* @__PURE__ */ __exportAll({
|
|
|
5690
5691
|
*
|
|
5691
5692
|
* Idempotent: a re-run on a DB that already has the table is a no-op.
|
|
5692
5693
|
*/
|
|
5693
|
-
async function up$
|
|
5694
|
+
async function up$85(db) {
|
|
5694
5695
|
if ((await sql`
|
|
5695
5696
|
SELECT EXISTS (
|
|
5696
5697
|
SELECT 1 FROM information_schema.tables
|
|
@@ -5723,14 +5724,14 @@ async function up$84(db) {
|
|
|
5723
5724
|
ON public.ingest_overflow_buffer (delivery_id)
|
|
5724
5725
|
`.execute(db);
|
|
5725
5726
|
}
|
|
5726
|
-
async function down$
|
|
5727
|
+
async function down$85(db) {
|
|
5727
5728
|
await sql`DROP TABLE IF EXISTS public.ingest_overflow_buffer`.execute(db);
|
|
5728
5729
|
}
|
|
5729
5730
|
//#endregion
|
|
5730
5731
|
//#region src/db/migrations/076_artifacts.ts
|
|
5731
5732
|
var _076_artifacts_exports = /* @__PURE__ */ __exportAll({
|
|
5732
|
-
down: () => down$
|
|
5733
|
-
up: () => up$
|
|
5733
|
+
down: () => down$84,
|
|
5734
|
+
up: () => up$84
|
|
5734
5735
|
});
|
|
5735
5736
|
/**
|
|
5736
5737
|
* Add the `artifacts` table for user-facing build artifacts and the per-org
|
|
@@ -5746,7 +5747,7 @@ var _076_artifacts_exports = /* @__PURE__ */ __exportAll({
|
|
|
5746
5747
|
*
|
|
5747
5748
|
* Idempotent.
|
|
5748
5749
|
*/
|
|
5749
|
-
async function up$
|
|
5750
|
+
async function up$84(db) {
|
|
5750
5751
|
if (!(await sql`
|
|
5751
5752
|
SELECT EXISTS (
|
|
5752
5753
|
SELECT 1 FROM information_schema.tables
|
|
@@ -5782,7 +5783,7 @@ async function up$83(db) {
|
|
|
5782
5783
|
ADD COLUMN IF NOT EXISTS artifact_ttl_ms BIGINT
|
|
5783
5784
|
`.execute(db);
|
|
5784
5785
|
}
|
|
5785
|
-
async function down$
|
|
5786
|
+
async function down$84(db) {
|
|
5786
5787
|
await sql`DROP TABLE IF EXISTS public.artifacts`.execute(db);
|
|
5787
5788
|
await sql`
|
|
5788
5789
|
ALTER TABLE public.org_settings
|
|
@@ -5793,8 +5794,8 @@ async function down$83(db) {
|
|
|
5793
5794
|
//#endregion
|
|
5794
5795
|
//#region src/db/migrations/077_backup_runs.ts
|
|
5795
5796
|
var _077_backup_runs_exports = /* @__PURE__ */ __exportAll({
|
|
5796
|
-
down: () => down$
|
|
5797
|
-
up: () => up$
|
|
5797
|
+
down: () => down$83,
|
|
5798
|
+
up: () => up$83
|
|
5798
5799
|
});
|
|
5799
5800
|
/**
|
|
5800
5801
|
* Add the `backup_runs` table: one row per successful `kici-admin db backup`,
|
|
@@ -5805,12 +5806,12 @@ var _077_backup_runs_exports = /* @__PURE__ */ __exportAll({
|
|
|
5805
5806
|
*
|
|
5806
5807
|
* Idempotent: guarded on table existence.
|
|
5807
5808
|
*/
|
|
5808
|
-
async function up$
|
|
5809
|
+
async function up$83(db) {
|
|
5809
5810
|
if (await tableExists$4(db, "backup_runs")) return;
|
|
5810
5811
|
await db.schema.createTable("backup_runs").addColumn("id", "bigserial", (c) => c.primaryKey()).addColumn("created_at", "timestamptz", (c) => c.notNull().defaultTo(sql`now()`)).addColumn("dump_path", "text", (c) => c.notNull()).addColumn("byte_size", "bigint", (c) => c.notNull()).addColumn("secret_key_version", "integer").addColumn("pg_server_version", "text", (c) => c.notNull()).addColumn("migrations_hash", "text", (c) => c.notNull()).addColumn("hostname", "text", (c) => c.notNull()).execute();
|
|
5811
5812
|
await db.schema.createIndex("idx_backup_runs_created_at").on("backup_runs").column("created_at").execute();
|
|
5812
5813
|
}
|
|
5813
|
-
async function down$
|
|
5814
|
+
async function down$83(db) {
|
|
5814
5815
|
await db.schema.dropTable("backup_runs").ifExists().execute();
|
|
5815
5816
|
}
|
|
5816
5817
|
async function tableExists$4(db, table) {
|
|
@@ -5824,15 +5825,15 @@ async function tableExists$4(db, table) {
|
|
|
5824
5825
|
//#endregion
|
|
5825
5826
|
//#region src/db/migrations/078_org_settings_backup_staleness.ts
|
|
5826
5827
|
var _078_org_settings_backup_staleness_exports = /* @__PURE__ */ __exportAll({
|
|
5827
|
-
down: () => down$
|
|
5828
|
-
up: () => up$
|
|
5828
|
+
down: () => down$82,
|
|
5829
|
+
up: () => up$82
|
|
5829
5830
|
});
|
|
5830
5831
|
/**
|
|
5831
5832
|
* Add `org_settings.backup_staleness_warn_hours`: the per-org WARN threshold for the DB-backup
|
|
5832
5833
|
* freshness diagnostic, set via `kici-admin org-settings backup-freshness`. NULL is the cluster
|
|
5833
5834
|
* default (`config.backupStalenessWarnHours`, 24h). Idempotent.
|
|
5834
5835
|
*/
|
|
5835
|
-
async function up$
|
|
5836
|
+
async function up$82(db) {
|
|
5836
5837
|
if ((await sql`
|
|
5837
5838
|
SELECT EXISTS (
|
|
5838
5839
|
SELECT 1 FROM information_schema.columns
|
|
@@ -5846,7 +5847,7 @@ async function up$81(db) {
|
|
|
5846
5847
|
ADD COLUMN backup_staleness_warn_hours INTEGER
|
|
5847
5848
|
`.execute(db);
|
|
5848
5849
|
}
|
|
5849
|
-
async function down$
|
|
5850
|
+
async function down$82(db) {
|
|
5850
5851
|
await sql`
|
|
5851
5852
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS backup_staleness_warn_hours
|
|
5852
5853
|
`.execute(db);
|
|
@@ -5854,8 +5855,8 @@ async function down$81(db) {
|
|
|
5854
5855
|
//#endregion
|
|
5855
5856
|
//#region src/db/migrations/079_org_settings_scaler_spawn_timeout.ts
|
|
5856
5857
|
var _079_org_settings_scaler_spawn_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
5857
|
-
down: () => down$
|
|
5858
|
-
up: () => up$
|
|
5858
|
+
down: () => down$81,
|
|
5859
|
+
up: () => up$81
|
|
5859
5860
|
});
|
|
5860
5861
|
/**
|
|
5861
5862
|
* `org_settings.scaler_spawn_timeout_ms BIGINT` (nullable): per-org deadline
|
|
@@ -5863,7 +5864,7 @@ var _079_org_settings_scaler_spawn_timeout_exports = /* @__PURE__ */ __exportAll
|
|
|
5863
5864
|
* falls back to `KICI_SCALER_SPAWN_TIMEOUT_MS` (default 300s). Tuned per tenant
|
|
5864
5865
|
* via `kici-admin org-settings scaler-spawn-timeout`. Idempotent.
|
|
5865
5866
|
*/
|
|
5866
|
-
async function up$
|
|
5867
|
+
async function up$81(db) {
|
|
5867
5868
|
if ((await sql`
|
|
5868
5869
|
SELECT EXISTS (
|
|
5869
5870
|
SELECT 1 FROM information_schema.columns
|
|
@@ -5877,7 +5878,7 @@ async function up$80(db) {
|
|
|
5877
5878
|
ADD COLUMN scaler_spawn_timeout_ms BIGINT
|
|
5878
5879
|
`.execute(db);
|
|
5879
5880
|
}
|
|
5880
|
-
async function down$
|
|
5881
|
+
async function down$81(db) {
|
|
5881
5882
|
await sql`
|
|
5882
5883
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS scaler_spawn_timeout_ms
|
|
5883
5884
|
`.execute(db);
|
|
@@ -5885,8 +5886,8 @@ async function down$80(db) {
|
|
|
5885
5886
|
//#endregion
|
|
5886
5887
|
//#region src/db/migrations/080_cluster_settings.ts
|
|
5887
5888
|
var _080_cluster_settings_exports = /* @__PURE__ */ __exportAll({
|
|
5888
|
-
down: () => down$
|
|
5889
|
-
up: () => up$
|
|
5889
|
+
down: () => down$80,
|
|
5890
|
+
up: () => up$80
|
|
5890
5891
|
});
|
|
5891
5892
|
/**
|
|
5892
5893
|
* Create `cluster_settings`: a single-row (id='default') table of fleet-wide operator tunables;
|
|
@@ -5897,7 +5898,7 @@ var _080_cluster_settings_exports = /* @__PURE__ */ __exportAll({
|
|
|
5897
5898
|
* Read via ClusterSettingsReader (whole-row, short-TTL cache); written via
|
|
5898
5899
|
* `/api/v1/admin/cluster-settings` and `kici-admin cluster-settings`. Idempotent.
|
|
5899
5900
|
*/
|
|
5900
|
-
async function up$
|
|
5901
|
+
async function up$80(db) {
|
|
5901
5902
|
if ((await sql`
|
|
5902
5903
|
SELECT EXISTS (
|
|
5903
5904
|
SELECT 1 FROM information_schema.tables
|
|
@@ -5921,14 +5922,14 @@ async function up$79(db) {
|
|
|
5921
5922
|
)
|
|
5922
5923
|
`.execute(db);
|
|
5923
5924
|
}
|
|
5924
|
-
async function down$
|
|
5925
|
+
async function down$80(db) {
|
|
5925
5926
|
await sql`DROP TABLE IF EXISTS public.cluster_settings`.execute(db);
|
|
5926
5927
|
}
|
|
5927
5928
|
//#endregion
|
|
5928
5929
|
//#region src/db/migrations/081_org_settings_queue_timeout.ts
|
|
5929
5930
|
var _081_org_settings_queue_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
5930
|
-
down: () => down$
|
|
5931
|
-
up: () => up$
|
|
5931
|
+
down: () => down$79,
|
|
5932
|
+
up: () => up$79
|
|
5932
5933
|
});
|
|
5933
5934
|
/**
|
|
5934
5935
|
* `org_settings.queue_timeout_ms BIGINT` (nullable): per-org dispatch-queue job
|
|
@@ -5941,7 +5942,7 @@ var _081_org_settings_queue_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
|
5941
5942
|
* `cacheOrgId` in scope; fleet-wide tunables live on `cluster_settings`
|
|
5942
5943
|
* (migration 080). Idempotent.
|
|
5943
5944
|
*/
|
|
5944
|
-
async function up$
|
|
5945
|
+
async function up$79(db) {
|
|
5945
5946
|
if ((await sql`
|
|
5946
5947
|
SELECT EXISTS (
|
|
5947
5948
|
SELECT 1 FROM information_schema.columns
|
|
@@ -5955,7 +5956,7 @@ async function up$78(db) {
|
|
|
5955
5956
|
ADD COLUMN queue_timeout_ms BIGINT
|
|
5956
5957
|
`.execute(db);
|
|
5957
5958
|
}
|
|
5958
|
-
async function down$
|
|
5959
|
+
async function down$79(db) {
|
|
5959
5960
|
await sql`
|
|
5960
5961
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS queue_timeout_ms
|
|
5961
5962
|
`.execute(db);
|
|
@@ -5963,8 +5964,8 @@ async function down$78(db) {
|
|
|
5963
5964
|
//#endregion
|
|
5964
5965
|
//#region src/db/migrations/082_host_s3_reachable.ts
|
|
5965
5966
|
var _082_host_s3_reachable_exports = /* @__PURE__ */ __exportAll({
|
|
5966
|
-
down: () => down$
|
|
5967
|
-
up: () => up$
|
|
5967
|
+
down: () => down$78,
|
|
5968
|
+
up: () => up$78
|
|
5968
5969
|
});
|
|
5969
5970
|
/**
|
|
5970
5971
|
* Add `host_roster.s3_reachable`, a fresh-box bring-up delivery hint set via
|
|
@@ -5973,7 +5974,7 @@ var _082_host_s3_reachable_exports = /* @__PURE__ */ __exportAll({
|
|
|
5973
5974
|
* through the ops agent). NULL / false: the `ssh-push` fallback (the ops agent fetches the
|
|
5974
5975
|
* payload and scp's it to the box). Idempotent.
|
|
5975
5976
|
*/
|
|
5976
|
-
async function up$
|
|
5977
|
+
async function up$78(db) {
|
|
5977
5978
|
if ((await sql`
|
|
5978
5979
|
SELECT EXISTS (
|
|
5979
5980
|
SELECT 1 FROM information_schema.columns
|
|
@@ -5987,7 +5988,7 @@ async function up$77(db) {
|
|
|
5987
5988
|
ADD COLUMN s3_reachable BOOLEAN
|
|
5988
5989
|
`.execute(db);
|
|
5989
5990
|
}
|
|
5990
|
-
async function down$
|
|
5991
|
+
async function down$78(db) {
|
|
5991
5992
|
await sql`
|
|
5992
5993
|
ALTER TABLE public.host_roster DROP COLUMN IF EXISTS s3_reachable
|
|
5993
5994
|
`.execute(db);
|
|
@@ -5995,8 +5996,8 @@ async function down$77(db) {
|
|
|
5995
5996
|
//#endregion
|
|
5996
5997
|
//#region src/db/migrations/083_org_settings_artifact_caps.ts
|
|
5997
5998
|
var _083_org_settings_artifact_caps_exports = /* @__PURE__ */ __exportAll({
|
|
5998
|
-
down: () => down$
|
|
5999
|
-
up: () => up$
|
|
5999
|
+
down: () => down$77,
|
|
6000
|
+
up: () => up$77
|
|
6000
6001
|
});
|
|
6001
6002
|
/**
|
|
6002
6003
|
* Add `org_settings.artifact_max_bytes` + `artifact_max_per_run` (both nullable
|
|
@@ -6010,7 +6011,7 @@ var _083_org_settings_artifact_caps_exports = /* @__PURE__ */ __exportAll({
|
|
|
6010
6011
|
*
|
|
6011
6012
|
* Idempotent: guarded on column existence.
|
|
6012
6013
|
*/
|
|
6013
|
-
async function up$
|
|
6014
|
+
async function up$77(db) {
|
|
6014
6015
|
for (const col of ["artifact_max_bytes", "artifact_max_per_run"]) {
|
|
6015
6016
|
if ((await sql`
|
|
6016
6017
|
SELECT EXISTS (
|
|
@@ -6023,15 +6024,15 @@ async function up$76(db) {
|
|
|
6023
6024
|
await sql`ALTER TABLE public.org_settings ADD COLUMN ${sql.ref(col)} BIGINT`.execute(db);
|
|
6024
6025
|
}
|
|
6025
6026
|
}
|
|
6026
|
-
async function down$
|
|
6027
|
+
async function down$77(db) {
|
|
6027
6028
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS artifact_max_bytes`.execute(db);
|
|
6028
6029
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS artifact_max_per_run`.execute(db);
|
|
6029
6030
|
}
|
|
6030
6031
|
//#endregion
|
|
6031
6032
|
//#region src/db/migrations/084_orchestrator_signing_keys.ts
|
|
6032
6033
|
var _084_orchestrator_signing_keys_exports = /* @__PURE__ */ __exportAll({
|
|
6033
|
-
down: () => down$
|
|
6034
|
-
up: () => up$
|
|
6034
|
+
down: () => down$76,
|
|
6035
|
+
up: () => up$76
|
|
6035
6036
|
});
|
|
6036
6037
|
/**
|
|
6037
6038
|
* Add `orchestrator_signing_keys`: the cluster-scoped, long-lived ES256 keys that sign the
|
|
@@ -6044,12 +6045,12 @@ var _084_orchestrator_signing_keys_exports = /* @__PURE__ */ __exportAll({
|
|
|
6044
6045
|
* `scoped_secrets`), NULL for `aws-kms` / `command` custody where the private key never lives in
|
|
6045
6046
|
* the DB; `key_ref` then locates the external key (KMS ARN / signer command). Idempotent.
|
|
6046
6047
|
*/
|
|
6047
|
-
async function up$
|
|
6048
|
+
async function up$76(db) {
|
|
6048
6049
|
if (await tableExists$3(db, "orchestrator_signing_keys")) return;
|
|
6049
6050
|
await db.schema.createTable("orchestrator_signing_keys").addColumn("kid", "text", (c) => c.primaryKey()).addColumn("public_jwk", "jsonb", (c) => c.notNull()).addColumn("encrypted_private_jwk", "text").addColumn("key_version", "integer", (c) => c.notNull().defaultTo(1)).addColumn("alg", "text", (c) => c.notNull()).addColumn("signer_kind", "text", (c) => c.notNull()).addColumn("key_ref", "text").addColumn("status", "text", (c) => c.notNull().defaultTo("active")).addColumn("revocation_reason", "text").addColumn("created_at", "timestamptz", (c) => c.notNull().defaultTo(sql`now()`)).addColumn("activated_at", "timestamptz").addColumn("retired_at", "timestamptz").addColumn("revoked_at", "timestamptz").execute();
|
|
6050
6051
|
await db.schema.createIndex("idx_orch_signing_keys_status").on("orchestrator_signing_keys").column("status").execute();
|
|
6051
6052
|
}
|
|
6052
|
-
async function down$
|
|
6053
|
+
async function down$76(db) {
|
|
6053
6054
|
await db.schema.dropTable("orchestrator_signing_keys").ifExists().execute();
|
|
6054
6055
|
}
|
|
6055
6056
|
async function tableExists$3(db, table) {
|
|
@@ -6063,8 +6064,8 @@ async function tableExists$3(db, table) {
|
|
|
6063
6064
|
//#endregion
|
|
6064
6065
|
//#region src/db/migrations/085_cluster_settings_reroute_flap_grace_ms.ts
|
|
6065
6066
|
var _085_cluster_settings_reroute_flap_grace_ms_exports = /* @__PURE__ */ __exportAll({
|
|
6066
|
-
down: () => down$
|
|
6067
|
-
up: () => up$
|
|
6067
|
+
down: () => down$75,
|
|
6068
|
+
up: () => up$75
|
|
6068
6069
|
});
|
|
6069
6070
|
/**
|
|
6070
6071
|
* Fleet-wide grace window (ms) in which the recovery sweepers defer a rerouted job while its
|
|
@@ -6073,7 +6074,7 @@ var _085_cluster_settings_reroute_flap_grace_ms_exports = /* @__PURE__ */ __expo
|
|
|
6073
6074
|
*
|
|
6074
6075
|
* Idempotent: guarded on column existence.
|
|
6075
6076
|
*/
|
|
6076
|
-
async function up$
|
|
6077
|
+
async function up$75(db) {
|
|
6077
6078
|
if ((await sql`
|
|
6078
6079
|
SELECT EXISTS (
|
|
6079
6080
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6084,14 +6085,14 @@ async function up$74(db) {
|
|
|
6084
6085
|
`.execute(db)).rows[0]?.exists) return;
|
|
6085
6086
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN reroute_flap_grace_ms BIGINT`.execute(db);
|
|
6086
6087
|
}
|
|
6087
|
-
async function down$
|
|
6088
|
+
async function down$75(db) {
|
|
6088
6089
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS reroute_flap_grace_ms`.execute(db);
|
|
6089
6090
|
}
|
|
6090
6091
|
//#endregion
|
|
6091
6092
|
//#region src/db/migrations/086_cluster_settings_max_fanout_hosts.ts
|
|
6092
6093
|
var _086_cluster_settings_max_fanout_hosts_exports = /* @__PURE__ */ __exportAll({
|
|
6093
|
-
down: () => down$
|
|
6094
|
-
up: () => up$
|
|
6094
|
+
down: () => down$74,
|
|
6095
|
+
up: () => up$74
|
|
6095
6096
|
});
|
|
6096
6097
|
/**
|
|
6097
6098
|
* Add `cluster_settings.max_fanout_hosts` (nullable INTEGER).
|
|
@@ -6101,7 +6102,7 @@ var _086_cluster_settings_max_fanout_hosts_exports = /* @__PURE__ */ __exportAll
|
|
|
6101
6102
|
*
|
|
6102
6103
|
* Idempotent: guarded on column existence.
|
|
6103
6104
|
*/
|
|
6104
|
-
async function up$
|
|
6105
|
+
async function up$74(db) {
|
|
6105
6106
|
if ((await sql`
|
|
6106
6107
|
SELECT EXISTS (
|
|
6107
6108
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6112,14 +6113,14 @@ async function up$73(db) {
|
|
|
6112
6113
|
`.execute(db)).rows[0]?.exists) return;
|
|
6113
6114
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN max_fanout_hosts INTEGER`.execute(db);
|
|
6114
6115
|
}
|
|
6115
|
-
async function down$
|
|
6116
|
+
async function down$74(db) {
|
|
6116
6117
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS max_fanout_hosts`.execute(db);
|
|
6117
6118
|
}
|
|
6118
6119
|
//#endregion
|
|
6119
6120
|
//#region src/db/migrations/087_cluster_settings_event_router_rate_limit.ts
|
|
6120
6121
|
var _087_cluster_settings_event_router_rate_limit_exports = /* @__PURE__ */ __exportAll({
|
|
6121
|
-
down: () => down$
|
|
6122
|
-
up: () => up$
|
|
6122
|
+
down: () => down$73,
|
|
6123
|
+
up: () => up$73
|
|
6123
6124
|
});
|
|
6124
6125
|
/**
|
|
6125
6126
|
* Add `cluster_settings.event_router_rate_limit_per_workflow_per_minute` (nullable INTEGER).
|
|
@@ -6131,7 +6132,7 @@ var _087_cluster_settings_event_router_rate_limit_exports = /* @__PURE__ */ __ex
|
|
|
6131
6132
|
*
|
|
6132
6133
|
* Idempotent: guarded on column existence.
|
|
6133
6134
|
*/
|
|
6134
|
-
async function up$
|
|
6135
|
+
async function up$73(db) {
|
|
6135
6136
|
if ((await sql`
|
|
6136
6137
|
SELECT EXISTS (
|
|
6137
6138
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6142,14 +6143,14 @@ async function up$72(db) {
|
|
|
6142
6143
|
`.execute(db)).rows[0]?.exists) return;
|
|
6143
6144
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN event_router_rate_limit_per_workflow_per_minute INTEGER`.execute(db);
|
|
6144
6145
|
}
|
|
6145
|
-
async function down$
|
|
6146
|
+
async function down$73(db) {
|
|
6146
6147
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS event_router_rate_limit_per_workflow_per_minute`.execute(db);
|
|
6147
6148
|
}
|
|
6148
6149
|
//#endregion
|
|
6149
6150
|
//#region src/db/migrations/088_cluster_settings_cache_max_tarball_bytes.ts
|
|
6150
6151
|
var _088_cluster_settings_cache_max_tarball_bytes_exports = /* @__PURE__ */ __exportAll({
|
|
6151
|
-
down: () => down$
|
|
6152
|
-
up: () => up$
|
|
6152
|
+
down: () => down$72,
|
|
6153
|
+
up: () => up$72
|
|
6153
6154
|
});
|
|
6154
6155
|
/**
|
|
6155
6156
|
* Add `cluster_settings.cache_max_tarball_bytes` (nullable BIGINT).
|
|
@@ -6159,7 +6160,7 @@ var _088_cluster_settings_cache_max_tarball_bytes_exports = /* @__PURE__ */ __ex
|
|
|
6159
6160
|
*
|
|
6160
6161
|
* Idempotent: guarded on column existence.
|
|
6161
6162
|
*/
|
|
6162
|
-
async function up$
|
|
6163
|
+
async function up$72(db) {
|
|
6163
6164
|
if ((await sql`
|
|
6164
6165
|
SELECT EXISTS (
|
|
6165
6166
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6170,14 +6171,14 @@ async function up$71(db) {
|
|
|
6170
6171
|
`.execute(db)).rows[0]?.exists) return;
|
|
6171
6172
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN cache_max_tarball_bytes BIGINT`.execute(db);
|
|
6172
6173
|
}
|
|
6173
|
-
async function down$
|
|
6174
|
+
async function down$72(db) {
|
|
6174
6175
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS cache_max_tarball_bytes`.execute(db);
|
|
6175
6176
|
}
|
|
6176
6177
|
//#endregion
|
|
6177
6178
|
//#region src/db/migrations/089_cluster_settings_cache_ttl_days.ts
|
|
6178
6179
|
var _089_cluster_settings_cache_ttl_days_exports = /* @__PURE__ */ __exportAll({
|
|
6179
|
-
down: () => down$
|
|
6180
|
-
up: () => up$
|
|
6180
|
+
down: () => down$71,
|
|
6181
|
+
up: () => up$71
|
|
6181
6182
|
});
|
|
6182
6183
|
/**
|
|
6183
6184
|
* Fleet-wide dependency-cache entry TTL (days): an entry unread for longer expires on the next
|
|
@@ -6185,7 +6186,7 @@ var _089_cluster_settings_cache_ttl_days_exports = /* @__PURE__ */ __exportAll({
|
|
|
6185
6186
|
*
|
|
6186
6187
|
* Idempotent: guarded on column existence.
|
|
6187
6188
|
*/
|
|
6188
|
-
async function up$
|
|
6189
|
+
async function up$71(db) {
|
|
6189
6190
|
if ((await sql`
|
|
6190
6191
|
SELECT EXISTS (
|
|
6191
6192
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6196,21 +6197,21 @@ async function up$70(db) {
|
|
|
6196
6197
|
`.execute(db)).rows[0]?.exists) return;
|
|
6197
6198
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN cache_ttl_days INTEGER`.execute(db);
|
|
6198
6199
|
}
|
|
6199
|
-
async function down$
|
|
6200
|
+
async function down$71(db) {
|
|
6200
6201
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS cache_ttl_days`.execute(db);
|
|
6201
6202
|
}
|
|
6202
6203
|
//#endregion
|
|
6203
6204
|
//#region src/db/migrations/090_cluster_settings_concurrency_wait_timeout_ms.ts
|
|
6204
6205
|
var _090_cluster_settings_concurrency_wait_timeout_ms_exports = /* @__PURE__ */ __exportAll({
|
|
6205
|
-
down: () => down$
|
|
6206
|
-
up: () => up$
|
|
6206
|
+
down: () => down$70,
|
|
6207
|
+
up: () => up$70
|
|
6207
6208
|
});
|
|
6208
6209
|
/**
|
|
6209
6210
|
* Add `cluster_settings.concurrency_wait_timeout_ms`: the fleet-wide agent concurrency-slot wait
|
|
6210
6211
|
* timeout (ms), pushed to the agent on `job.dispatch`. NULL is the cluster default
|
|
6211
6212
|
* (`config.concurrencyWaitTimeoutMs`, `KICI_CONCURRENCY_WAIT_TIMEOUT_MS`). Idempotent.
|
|
6212
6213
|
*/
|
|
6213
|
-
async function up$
|
|
6214
|
+
async function up$70(db) {
|
|
6214
6215
|
if ((await sql`
|
|
6215
6216
|
SELECT EXISTS (
|
|
6216
6217
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6221,21 +6222,21 @@ async function up$69(db) {
|
|
|
6221
6222
|
`.execute(db)).rows[0]?.exists) return;
|
|
6222
6223
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN concurrency_wait_timeout_ms BIGINT`.execute(db);
|
|
6223
6224
|
}
|
|
6224
|
-
async function down$
|
|
6225
|
+
async function down$70(db) {
|
|
6225
6226
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS concurrency_wait_timeout_ms`.execute(db);
|
|
6226
6227
|
}
|
|
6227
6228
|
//#endregion
|
|
6228
6229
|
//#region src/db/migrations/091_cluster_settings_agent_token_ttl_ms.ts
|
|
6229
6230
|
var _091_cluster_settings_agent_token_ttl_ms_exports = /* @__PURE__ */ __exportAll({
|
|
6230
|
-
down: () => down$
|
|
6231
|
-
up: () => up$
|
|
6231
|
+
down: () => down$69,
|
|
6232
|
+
up: () => up$69
|
|
6232
6233
|
});
|
|
6233
6234
|
/**
|
|
6234
6235
|
* `cluster_settings.agent_token_ttl_ms` (nullable BIGINT): fleet-wide ephemeral
|
|
6235
6236
|
* agent-token TTL (ms), resolved by the leader at spawn. NULL → cluster default
|
|
6236
6237
|
* (`config.agentTokenTtlMs`, `KICI_AGENT_TOKEN_TTL_MS`). Idempotent.
|
|
6237
6238
|
*/
|
|
6238
|
-
async function up$
|
|
6239
|
+
async function up$69(db) {
|
|
6239
6240
|
if ((await sql`
|
|
6240
6241
|
SELECT EXISTS (
|
|
6241
6242
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6246,14 +6247,14 @@ async function up$68(db) {
|
|
|
6246
6247
|
`.execute(db)).rows[0]?.exists) return;
|
|
6247
6248
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN agent_token_ttl_ms BIGINT`.execute(db);
|
|
6248
6249
|
}
|
|
6249
|
-
async function down$
|
|
6250
|
+
async function down$69(db) {
|
|
6250
6251
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS agent_token_ttl_ms`.execute(db);
|
|
6251
6252
|
}
|
|
6252
6253
|
//#endregion
|
|
6253
6254
|
//#region src/db/migrations/092_cluster_settings_version.ts
|
|
6254
6255
|
var _092_cluster_settings_version_exports = /* @__PURE__ */ __exportAll({
|
|
6255
|
-
down: () => down$
|
|
6256
|
-
up: () => up$
|
|
6256
|
+
down: () => down$68,
|
|
6257
|
+
up: () => up$68
|
|
6257
6258
|
});
|
|
6258
6259
|
/**
|
|
6259
6260
|
* `cluster_settings.version`, monotonic and bumped on each settings change. The leader
|
|
@@ -6263,7 +6264,7 @@ var _092_cluster_settings_version_exports = /* @__PURE__ */ __exportAll({
|
|
|
6263
6264
|
*
|
|
6264
6265
|
* Idempotent: guarded on column existence.
|
|
6265
6266
|
*/
|
|
6266
|
-
async function up$
|
|
6267
|
+
async function up$68(db) {
|
|
6267
6268
|
if ((await sql`
|
|
6268
6269
|
SELECT EXISTS (
|
|
6269
6270
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6274,14 +6275,14 @@ async function up$67(db) {
|
|
|
6274
6275
|
`.execute(db)).rows[0]?.exists) return;
|
|
6275
6276
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN version BIGINT NOT NULL DEFAULT 0`.execute(db);
|
|
6276
6277
|
}
|
|
6277
|
-
async function down$
|
|
6278
|
+
async function down$68(db) {
|
|
6278
6279
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS version`.execute(db);
|
|
6279
6280
|
}
|
|
6280
6281
|
//#endregion
|
|
6281
6282
|
//#region src/db/migrations/093_org_settings_sandbox_allowlist.ts
|
|
6282
6283
|
var _093_org_settings_sandbox_allowlist_exports = /* @__PURE__ */ __exportAll({
|
|
6283
|
-
down: () => down$
|
|
6284
|
-
up: () => up$
|
|
6284
|
+
down: () => down$67,
|
|
6285
|
+
up: () => up$67
|
|
6285
6286
|
});
|
|
6286
6287
|
/**
|
|
6287
6288
|
* Add the per-org container-sandbox escape-hatch allow-list to `org_settings`:
|
|
@@ -6308,7 +6309,7 @@ async function columnExists$14(db, column) {
|
|
|
6308
6309
|
) AS exists
|
|
6309
6310
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
6310
6311
|
}
|
|
6311
|
-
async function up$
|
|
6312
|
+
async function up$67(db) {
|
|
6312
6313
|
if (!await columnExists$14(db, "sandbox_allowed_capabilities")) await sql`
|
|
6313
6314
|
ALTER TABLE public.org_settings
|
|
6314
6315
|
ADD COLUMN sandbox_allowed_capabilities TEXT[]
|
|
@@ -6318,7 +6319,7 @@ async function up$66(db) {
|
|
|
6318
6319
|
ADD COLUMN sandbox_allow_host_network BOOLEAN
|
|
6319
6320
|
`.execute(db);
|
|
6320
6321
|
}
|
|
6321
|
-
async function down$
|
|
6322
|
+
async function down$67(db) {
|
|
6322
6323
|
await sql`
|
|
6323
6324
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS sandbox_allowed_capabilities
|
|
6324
6325
|
`.execute(db);
|
|
@@ -6329,8 +6330,8 @@ async function down$66(db) {
|
|
|
6329
6330
|
//#endregion
|
|
6330
6331
|
//#region src/db/migrations/094_dashboard_encryption_keys.ts
|
|
6331
6332
|
var _094_dashboard_encryption_keys_exports = /* @__PURE__ */ __exportAll({
|
|
6332
|
-
down: () => down$
|
|
6333
|
-
up: () => up$
|
|
6333
|
+
down: () => down$66,
|
|
6334
|
+
up: () => up$66
|
|
6334
6335
|
});
|
|
6335
6336
|
/**
|
|
6336
6337
|
* Add `dashboard_encryption_keys`: the cluster-scoped, long-lived X25519 keypair for
|
|
@@ -6344,12 +6345,12 @@ var _094_dashboard_encryption_keys_exports = /* @__PURE__ */ __exportAll({
|
|
|
6344
6345
|
* `revoked` and leaves the JWKS, but its row stays so already-sealed envelopes decrypt.
|
|
6345
6346
|
* Idempotent.
|
|
6346
6347
|
*/
|
|
6347
|
-
async function up$
|
|
6348
|
+
async function up$66(db) {
|
|
6348
6349
|
if (await tableExists$2(db, "dashboard_encryption_keys")) return;
|
|
6349
6350
|
await db.schema.createTable("dashboard_encryption_keys").addColumn("kid", "text", (c) => c.primaryKey()).addColumn("public_jwk", "jsonb", (c) => c.notNull()).addColumn("encrypted_private_key", "text", (c) => c.notNull()).addColumn("status", "text", (c) => c.notNull().defaultTo("active")).addColumn("revocation_reason", "text").addColumn("created_at", "timestamptz", (c) => c.notNull().defaultTo(sql`now()`)).addColumn("activated_at", "timestamptz").addColumn("revoked_at", "timestamptz").execute();
|
|
6350
6351
|
await db.schema.createIndex("idx_dashboard_encryption_keys_status").on("dashboard_encryption_keys").column("status").execute();
|
|
6351
6352
|
}
|
|
6352
|
-
async function down$
|
|
6353
|
+
async function down$66(db) {
|
|
6353
6354
|
await db.schema.dropTable("dashboard_encryption_keys").ifExists().execute();
|
|
6354
6355
|
}
|
|
6355
6356
|
async function tableExists$2(db, table) {
|
|
@@ -6363,8 +6364,8 @@ async function tableExists$2(db, table) {
|
|
|
6363
6364
|
//#endregion
|
|
6364
6365
|
//#region src/db/migrations/095_dashboard_write_policy_tristate.ts
|
|
6365
6366
|
var _095_dashboard_write_policy_tristate_exports = /* @__PURE__ */ __exportAll({
|
|
6366
|
-
down: () => down$
|
|
6367
|
-
up: () => up$
|
|
6367
|
+
down: () => down$65,
|
|
6368
|
+
up: () => up$65
|
|
6368
6369
|
});
|
|
6369
6370
|
/**
|
|
6370
6371
|
* Migrate stored `org_settings.dashboard_write_policy` JSONB from the legacy
|
|
@@ -6378,7 +6379,7 @@ var _095_dashboard_write_policy_tristate_exports = /* @__PURE__ */ __exportAll({
|
|
|
6378
6379
|
* Runtime reads also coerce booleans, so an un-migrated row is never mis-read;
|
|
6379
6380
|
* this normalizes the at-rest shape to what the tri-state writer produces.
|
|
6380
6381
|
*/
|
|
6381
|
-
async function up$
|
|
6382
|
+
async function up$65(db) {
|
|
6382
6383
|
await sql`
|
|
6383
6384
|
UPDATE org_settings
|
|
6384
6385
|
SET dashboard_write_policy = COALESCE(
|
|
@@ -6405,12 +6406,12 @@ async function up$64(db) {
|
|
|
6405
6406
|
)
|
|
6406
6407
|
`.execute(db);
|
|
6407
6408
|
}
|
|
6408
|
-
async function down$
|
|
6409
|
+
async function down$65() {}
|
|
6409
6410
|
//#endregion
|
|
6410
6411
|
//#region src/db/migrations/096_multi_schedule_cron_last_fired.ts
|
|
6411
6412
|
var _096_multi_schedule_cron_last_fired_exports = /* @__PURE__ */ __exportAll({
|
|
6412
|
-
down: () => down$
|
|
6413
|
-
up: () => up$
|
|
6413
|
+
down: () => down$64,
|
|
6414
|
+
up: () => up$64
|
|
6414
6415
|
});
|
|
6415
6416
|
/**
|
|
6416
6417
|
* Keys cron last-fired per (registration, schedule), so a workflow with several schedule()
|
|
@@ -6443,7 +6444,7 @@ async function primaryKeyColumns(db) {
|
|
|
6443
6444
|
ORDER BY a.attnum
|
|
6444
6445
|
`.execute(db)).rows.map((row) => row.attname);
|
|
6445
6446
|
}
|
|
6446
|
-
async function up$
|
|
6447
|
+
async function up$64(db) {
|
|
6447
6448
|
if (!await columnExists$13(db, "schedule_key")) await sql`ALTER TABLE public.cron_last_fired ADD COLUMN schedule_key text`.execute(db);
|
|
6448
6449
|
await sql`
|
|
6449
6450
|
UPDATE public.cron_last_fired clf
|
|
@@ -6470,7 +6471,7 @@ async function up$63(db) {
|
|
|
6470
6471
|
`.execute(db);
|
|
6471
6472
|
}
|
|
6472
6473
|
}
|
|
6473
|
-
async function down$
|
|
6474
|
+
async function down$64(db) {
|
|
6474
6475
|
await sql`
|
|
6475
6476
|
DELETE FROM public.cron_last_fired a
|
|
6476
6477
|
USING public.cron_last_fired b
|
|
@@ -6487,8 +6488,8 @@ async function down$63(db) {
|
|
|
6487
6488
|
//#endregion
|
|
6488
6489
|
//#region src/db/migrations/097_execution_runs_pr_number.ts
|
|
6489
6490
|
var _097_execution_runs_pr_number_exports = /* @__PURE__ */ __exportAll({
|
|
6490
|
-
down: () => down$
|
|
6491
|
-
up: () => up$
|
|
6491
|
+
down: () => down$63,
|
|
6492
|
+
up: () => up$63
|
|
6492
6493
|
});
|
|
6493
6494
|
/**
|
|
6494
6495
|
* `execution_runs.pr_number` lets `/kici approve|reject` scope hold selection to the comment's
|
|
@@ -6507,13 +6508,13 @@ async function columnExists$12(db, column) {
|
|
|
6507
6508
|
) AS exists
|
|
6508
6509
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
6509
6510
|
}
|
|
6510
|
-
async function up$
|
|
6511
|
+
async function up$63(db) {
|
|
6511
6512
|
if (!await columnExists$12(db, "pr_number")) await sql`
|
|
6512
6513
|
ALTER TABLE public.execution_runs
|
|
6513
6514
|
ADD COLUMN pr_number INTEGER
|
|
6514
6515
|
`.execute(db);
|
|
6515
6516
|
}
|
|
6516
|
-
async function down$
|
|
6517
|
+
async function down$63(db) {
|
|
6517
6518
|
await sql`
|
|
6518
6519
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS pr_number
|
|
6519
6520
|
`.execute(db);
|
|
@@ -6521,8 +6522,8 @@ async function down$62(db) {
|
|
|
6521
6522
|
//#endregion
|
|
6522
6523
|
//#region src/db/migrations/098_execution_runs_customer_id.ts
|
|
6523
6524
|
var _098_execution_runs_customer_id_exports = /* @__PURE__ */ __exportAll({
|
|
6524
|
-
down: () => down$
|
|
6525
|
-
up: () => up$
|
|
6525
|
+
down: () => down$62,
|
|
6526
|
+
up: () => up$62
|
|
6526
6527
|
});
|
|
6527
6528
|
/**
|
|
6528
6529
|
* Denormalize the owning org onto `execution_runs` so the concurrency-gate
|
|
@@ -6550,7 +6551,7 @@ async function columnExists$11(db, column) {
|
|
|
6550
6551
|
) AS exists
|
|
6551
6552
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
6552
6553
|
}
|
|
6553
|
-
async function up$
|
|
6554
|
+
async function up$62(db) {
|
|
6554
6555
|
if (!await columnExists$11(db, "customer_id")) {
|
|
6555
6556
|
await sql`
|
|
6556
6557
|
ALTER TABLE public.execution_runs
|
|
@@ -6574,7 +6575,7 @@ async function up$61(db) {
|
|
|
6574
6575
|
ON public.execution_runs (customer_id, context)
|
|
6575
6576
|
`.execute(db);
|
|
6576
6577
|
}
|
|
6577
|
-
async function down$
|
|
6578
|
+
async function down$62(db) {
|
|
6578
6579
|
await sql`DROP INDEX IF EXISTS execution_runs_customer_id_context_idx`.execute(db);
|
|
6579
6580
|
await sql`
|
|
6580
6581
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS customer_id
|
|
@@ -6583,8 +6584,8 @@ async function down$61(db) {
|
|
|
6583
6584
|
//#endregion
|
|
6584
6585
|
//#region src/db/migrations/099_cluster_settings_dashboard_verified_issuer.ts
|
|
6585
6586
|
var _099_cluster_settings_dashboard_verified_issuer_exports = /* @__PURE__ */ __exportAll({
|
|
6586
|
-
down: () => down$
|
|
6587
|
-
up: () => up$
|
|
6587
|
+
down: () => down$61,
|
|
6588
|
+
up: () => up$61
|
|
6588
6589
|
});
|
|
6589
6590
|
/**
|
|
6590
6591
|
* Add `cluster_settings.dashboard_verified_issuer` (nullable text).
|
|
@@ -6600,7 +6601,7 @@ var _099_cluster_settings_dashboard_verified_issuer_exports = /* @__PURE__ */ __
|
|
|
6600
6601
|
*
|
|
6601
6602
|
* Idempotent: guarded on column existence.
|
|
6602
6603
|
*/
|
|
6603
|
-
async function up$
|
|
6604
|
+
async function up$61(db) {
|
|
6604
6605
|
if ((await sql`
|
|
6605
6606
|
SELECT EXISTS (
|
|
6606
6607
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6611,14 +6612,14 @@ async function up$60(db) {
|
|
|
6611
6612
|
`.execute(db)).rows[0]?.exists) return;
|
|
6612
6613
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN dashboard_verified_issuer TEXT`.execute(db);
|
|
6613
6614
|
}
|
|
6614
|
-
async function down$
|
|
6615
|
+
async function down$61(db) {
|
|
6615
6616
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS dashboard_verified_issuer`.execute(db);
|
|
6616
6617
|
}
|
|
6617
6618
|
//#endregion
|
|
6618
6619
|
//#region src/db/migrations/100_held_runs_hold_type_vocabulary.ts
|
|
6619
6620
|
var _100_held_runs_hold_type_vocabulary_exports = /* @__PURE__ */ __exportAll({
|
|
6620
|
-
down: () => down$
|
|
6621
|
-
up: () => up$
|
|
6621
|
+
down: () => down$60,
|
|
6622
|
+
up: () => up$60
|
|
6622
6623
|
});
|
|
6623
6624
|
/**
|
|
6624
6625
|
* Realign `held_runs.hold_type` onto the engine's `HoldType` vocabulary.
|
|
@@ -6635,7 +6636,7 @@ var _100_held_runs_hold_type_vocabulary_exports = /* @__PURE__ */ __exportAll({
|
|
|
6635
6636
|
*
|
|
6636
6637
|
* Idempotent: a second run matches no rows.
|
|
6637
6638
|
*/
|
|
6638
|
-
async function up$
|
|
6639
|
+
async function up$60(db) {
|
|
6639
6640
|
await sql`UPDATE public.held_runs SET hold_type = 'reviewer' WHERE hold_type = 'approval'`.execute(db);
|
|
6640
6641
|
await sql`UPDATE public.held_runs SET hold_type = 'timer' WHERE hold_type = 'wait_timer'`.execute(db);
|
|
6641
6642
|
}
|
|
@@ -6649,15 +6650,15 @@ async function up$59(db) {
|
|
|
6649
6650
|
* `wait_timer` alone, so leaving those rows spelled `timer` would strand them
|
|
6650
6651
|
* in the expire-and-fail path.
|
|
6651
6652
|
*/
|
|
6652
|
-
async function down$
|
|
6653
|
+
async function down$60(db) {
|
|
6653
6654
|
await sql`UPDATE public.held_runs SET hold_type = 'approval' WHERE hold_type = 'reviewer'`.execute(db);
|
|
6654
6655
|
await sql`UPDATE public.held_runs SET hold_type = 'wait_timer' WHERE hold_type = 'timer'`.execute(db);
|
|
6655
6656
|
}
|
|
6656
6657
|
//#endregion
|
|
6657
6658
|
//#region src/db/migrations/101_contexts_hold_expiry_drop_default.ts
|
|
6658
6659
|
var _101_contexts_hold_expiry_drop_default_exports = /* @__PURE__ */ __exportAll({
|
|
6659
|
-
down: () => down$
|
|
6660
|
-
up: () => up$
|
|
6660
|
+
down: () => down$59,
|
|
6661
|
+
up: () => up$59
|
|
6661
6662
|
});
|
|
6662
6663
|
/**
|
|
6663
6664
|
* Give the context hold expiry a single default, and retire the stored zeroes.
|
|
@@ -6674,7 +6675,7 @@ var _101_contexts_hold_expiry_drop_default_exports = /* @__PURE__ */ __exportAll
|
|
|
6674
6675
|
* Idempotent: dropping an absent default is a no-op and the UPDATE matches no
|
|
6675
6676
|
* rows on a second run.
|
|
6676
6677
|
*/
|
|
6677
|
-
async function up$
|
|
6678
|
+
async function up$59(db) {
|
|
6678
6679
|
await sql`ALTER TABLE public.contexts ALTER COLUMN hold_expiry_seconds DROP DEFAULT`.execute(db);
|
|
6679
6680
|
await sql`UPDATE public.contexts SET hold_expiry_seconds = NULL WHERE hold_expiry_seconds = 0`.execute(db);
|
|
6680
6681
|
}
|
|
@@ -6684,14 +6685,14 @@ async function up$58(db) {
|
|
|
6684
6685
|
* Deliberately asymmetric: zeroed rows are NOT recreated. They now look like a
|
|
6685
6686
|
* deliberate NULL, and a `0` would resume cancelling every hold on its context.
|
|
6686
6687
|
*/
|
|
6687
|
-
async function down$
|
|
6688
|
+
async function down$59(db) {
|
|
6688
6689
|
await sql`ALTER TABLE public.contexts ALTER COLUMN hold_expiry_seconds SET DEFAULT 86400`.execute(db);
|
|
6689
6690
|
}
|
|
6690
6691
|
//#endregion
|
|
6691
6692
|
//#region src/db/migrations/102_dispatch_queue_agent_id.ts
|
|
6692
6693
|
var _102_dispatch_queue_agent_id_exports = /* @__PURE__ */ __exportAll({
|
|
6693
|
-
down: () => down$
|
|
6694
|
-
up: () => up$
|
|
6694
|
+
down: () => down$58,
|
|
6695
|
+
up: () => up$58
|
|
6695
6696
|
});
|
|
6696
6697
|
/**
|
|
6697
6698
|
* Add `dispatch_queue.agent_id` (nullable text).
|
|
@@ -6704,7 +6705,7 @@ var _102_dispatch_queue_agent_id_exports = /* @__PURE__ */ __exportAll({
|
|
|
6704
6705
|
* No backfill: older rows keep a NULL owner and resolve to "not owned", as before.
|
|
6705
6706
|
* Idempotent: guarded on column existence.
|
|
6706
6707
|
*/
|
|
6707
|
-
async function up$
|
|
6708
|
+
async function up$58(db) {
|
|
6708
6709
|
if ((await sql`
|
|
6709
6710
|
SELECT EXISTS (
|
|
6710
6711
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6715,14 +6716,14 @@ async function up$57(db) {
|
|
|
6715
6716
|
`.execute(db)).rows[0]?.exists) return;
|
|
6716
6717
|
await sql`ALTER TABLE public.dispatch_queue ADD COLUMN agent_id TEXT`.execute(db);
|
|
6717
6718
|
}
|
|
6718
|
-
async function down$
|
|
6719
|
+
async function down$58(db) {
|
|
6719
6720
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS agent_id`.execute(db);
|
|
6720
6721
|
}
|
|
6721
6722
|
//#endregion
|
|
6722
6723
|
//#region src/db/migrations/103_cluster_settings_ownership_db_check_timeout_ms.ts
|
|
6723
6724
|
var _103_cluster_settings_ownership_db_check_timeout_ms_exports = /* @__PURE__ */ __exportAll({
|
|
6724
|
-
down: () => down$
|
|
6725
|
-
up: () => up$
|
|
6725
|
+
down: () => down$57,
|
|
6726
|
+
up: () => up$57
|
|
6726
6727
|
});
|
|
6727
6728
|
/**
|
|
6728
6729
|
* Deadline for one DB-backed agent-ownership lookup, which runs inbound on every job-scoped
|
|
@@ -6734,7 +6735,7 @@ var _103_cluster_settings_ownership_db_check_timeout_ms_exports = /* @__PURE__ *
|
|
|
6734
6735
|
*
|
|
6735
6736
|
* Idempotent: guarded on column existence.
|
|
6736
6737
|
*/
|
|
6737
|
-
async function up$
|
|
6738
|
+
async function up$57(db) {
|
|
6738
6739
|
if ((await sql`
|
|
6739
6740
|
SELECT EXISTS (
|
|
6740
6741
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6745,14 +6746,14 @@ async function up$56(db) {
|
|
|
6745
6746
|
`.execute(db)).rows[0]?.exists) return;
|
|
6746
6747
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN ownership_db_check_timeout_ms BIGINT`.execute(db);
|
|
6747
6748
|
}
|
|
6748
|
-
async function down$
|
|
6749
|
+
async function down$57(db) {
|
|
6749
6750
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ownership_db_check_timeout_ms`.execute(db);
|
|
6750
6751
|
}
|
|
6751
6752
|
//#endregion
|
|
6752
6753
|
//#region src/db/migrations/104_check_run_terminal_sent.ts
|
|
6753
6754
|
var _104_check_run_terminal_sent_exports = /* @__PURE__ */ __exportAll({
|
|
6754
|
-
down: () => down$
|
|
6755
|
-
up: () => up$
|
|
6755
|
+
down: () => down$56,
|
|
6756
|
+
up: () => up$56
|
|
6756
6757
|
});
|
|
6757
6758
|
/**
|
|
6758
6759
|
* Add `check_run_tracking.terminal_sent_at`.
|
|
@@ -6766,7 +6767,7 @@ var _104_check_run_terminal_sent_exports = /* @__PURE__ */ __exportAll({
|
|
|
6766
6767
|
* this table (a tracking write must never break check-run reporting), so NULL means "no record
|
|
6767
6768
|
* of sending it", not "never sent". Idempotent.
|
|
6768
6769
|
*/
|
|
6769
|
-
async function up$
|
|
6770
|
+
async function up$56(db) {
|
|
6770
6771
|
if ((await sql`
|
|
6771
6772
|
SELECT EXISTS (
|
|
6772
6773
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6777,14 +6778,14 @@ async function up$55(db) {
|
|
|
6777
6778
|
`.execute(db)).rows[0]?.exists) return;
|
|
6778
6779
|
await sql`ALTER TABLE public.check_run_tracking ADD COLUMN terminal_sent_at TIMESTAMPTZ`.execute(db);
|
|
6779
6780
|
}
|
|
6780
|
-
async function down$
|
|
6781
|
+
async function down$56(db) {
|
|
6781
6782
|
await sql`ALTER TABLE public.check_run_tracking DROP COLUMN IF EXISTS terminal_sent_at`.execute(db);
|
|
6782
6783
|
}
|
|
6783
6784
|
//#endregion
|
|
6784
6785
|
//#region src/db/migrations/105_org_trust_policy.ts
|
|
6785
6786
|
var _105_org_trust_policy_exports = /* @__PURE__ */ __exportAll({
|
|
6786
|
-
down: () => down$
|
|
6787
|
-
up: () => up$
|
|
6787
|
+
down: () => down$55,
|
|
6788
|
+
up: () => up$55
|
|
6788
6789
|
});
|
|
6789
6790
|
/**
|
|
6790
6791
|
* Create `org_trust_policy` — the orchestrator's cache of the Platform-owned org
|
|
@@ -6799,7 +6800,7 @@ var _105_org_trust_policy_exports = /* @__PURE__ */ __exportAll({
|
|
|
6799
6800
|
*
|
|
6800
6801
|
* Idempotent: guarded by IF NOT EXISTS, so a re-run is a no-op.
|
|
6801
6802
|
*/
|
|
6802
|
-
async function up$
|
|
6803
|
+
async function up$55(db) {
|
|
6803
6804
|
await sql`
|
|
6804
6805
|
CREATE TABLE IF NOT EXISTS public.org_trust_policy (
|
|
6805
6806
|
customer_id TEXT PRIMARY KEY,
|
|
@@ -6812,14 +6813,14 @@ async function up$54(db) {
|
|
|
6812
6813
|
)
|
|
6813
6814
|
`.execute(db);
|
|
6814
6815
|
}
|
|
6815
|
-
async function down$
|
|
6816
|
+
async function down$55(db) {
|
|
6816
6817
|
await sql`DROP TABLE IF EXISTS public.org_trust_policy`.execute(db);
|
|
6817
6818
|
}
|
|
6818
6819
|
//#endregion
|
|
6819
6820
|
//#region src/db/migrations/106_cluster_settings_check_run_tracking_ttl_days.ts
|
|
6820
6821
|
var _106_cluster_settings_check_run_tracking_ttl_days_exports = /* @__PURE__ */ __exportAll({
|
|
6821
|
-
down: () => down$
|
|
6822
|
-
up: () => up$
|
|
6822
|
+
down: () => down$54,
|
|
6823
|
+
up: () => up$54
|
|
6823
6824
|
});
|
|
6824
6825
|
/**
|
|
6825
6826
|
* Add `cluster_settings.check_run_tracking_ttl_days`: the hourly cleanup sweep deletes
|
|
@@ -6827,7 +6828,7 @@ var _106_cluster_settings_check_run_tracking_ttl_days_exports = /* @__PURE__ */
|
|
|
6827
6828
|
* orchestrator's configured default. Cluster-global, not `org_settings`, because the sweep runs
|
|
6828
6829
|
* fleet-wide with no tenant in scope at the read site. Idempotent.
|
|
6829
6830
|
*/
|
|
6830
|
-
async function up$
|
|
6831
|
+
async function up$54(db) {
|
|
6831
6832
|
if ((await sql`
|
|
6832
6833
|
SELECT EXISTS (
|
|
6833
6834
|
SELECT 1 FROM information_schema.columns
|
|
@@ -6838,14 +6839,14 @@ async function up$53(db) {
|
|
|
6838
6839
|
`.execute(db)).rows[0]?.exists) return;
|
|
6839
6840
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN check_run_tracking_ttl_days INTEGER`.execute(db);
|
|
6840
6841
|
}
|
|
6841
|
-
async function down$
|
|
6842
|
+
async function down$54(db) {
|
|
6842
6843
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS check_run_tracking_ttl_days`.execute(db);
|
|
6843
6844
|
}
|
|
6844
6845
|
//#endregion
|
|
6845
6846
|
//#region src/db/migrations/107_check_run_tracking_updated_at_index.ts
|
|
6846
6847
|
var _107_check_run_tracking_updated_at_index_exports = /* @__PURE__ */ __exportAll({
|
|
6847
|
-
down: () => down$
|
|
6848
|
-
up: () => up$
|
|
6848
|
+
down: () => down$53,
|
|
6849
|
+
up: () => up$53
|
|
6849
6850
|
});
|
|
6850
6851
|
/**
|
|
6851
6852
|
* Add `idx_check_run_tracking_updated_at` on `check_run_tracking (updated_at)`.
|
|
@@ -6860,20 +6861,20 @@ var _107_check_run_tracking_updated_at_index_exports = /* @__PURE__ */ __exportA
|
|
|
6860
6861
|
* Mirrors `idx_dispatch_queue_run_id` (072) and `idx_request_idempotency_created_at` (068), which
|
|
6861
6862
|
* also index a TTL sweep's prune predicate. Idempotent (`IF NOT EXISTS`).
|
|
6862
6863
|
*/
|
|
6863
|
-
async function up$
|
|
6864
|
+
async function up$53(db) {
|
|
6864
6865
|
await sql`
|
|
6865
6866
|
CREATE INDEX IF NOT EXISTS idx_check_run_tracking_updated_at
|
|
6866
6867
|
ON public.check_run_tracking (updated_at)
|
|
6867
6868
|
`.execute(db);
|
|
6868
6869
|
}
|
|
6869
|
-
async function down$
|
|
6870
|
+
async function down$53(db) {
|
|
6870
6871
|
await sql`DROP INDEX IF EXISTS public.idx_check_run_tracking_updated_at`.execute(db);
|
|
6871
6872
|
}
|
|
6872
6873
|
//#endregion
|
|
6873
6874
|
//#region src/db/migrations/108_unroutable_fast_fail.ts
|
|
6874
6875
|
var _108_unroutable_fast_fail_exports = /* @__PURE__ */ __exportAll({
|
|
6875
|
-
down: () => down$
|
|
6876
|
-
up: () => up$
|
|
6876
|
+
down: () => down$52,
|
|
6877
|
+
up: () => up$52
|
|
6877
6878
|
});
|
|
6878
6879
|
/**
|
|
6879
6880
|
* Fast-fail support for jobs nothing in the fleet can run.
|
|
@@ -6904,12 +6905,12 @@ async function columnExists$10(db, table, column) {
|
|
|
6904
6905
|
) AS exists
|
|
6905
6906
|
`.execute(db)).rows[0]?.exists === true;
|
|
6906
6907
|
}
|
|
6907
|
-
async function up$
|
|
6908
|
+
async function up$52(db) {
|
|
6908
6909
|
if (!await columnExists$10(db, "cluster_settings", "unroutable_grace_ms")) await sql`ALTER TABLE public.cluster_settings ADD COLUMN unroutable_grace_ms INTEGER`.execute(db);
|
|
6909
6910
|
if (!await columnExists$10(db, "dispatch_queue", "unroutable_since")) await sql`ALTER TABLE public.dispatch_queue ADD COLUMN unroutable_since TIMESTAMPTZ`.execute(db);
|
|
6910
6911
|
if (!await columnExists$10(db, "execution_jobs", "routing_reason")) await sql`ALTER TABLE public.execution_jobs ADD COLUMN routing_reason TEXT`.execute(db);
|
|
6911
6912
|
}
|
|
6912
|
-
async function down$
|
|
6913
|
+
async function down$52(db) {
|
|
6913
6914
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS routing_reason`.execute(db);
|
|
6914
6915
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS unroutable_since`.execute(db);
|
|
6915
6916
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS unroutable_grace_ms`.execute(db);
|
|
@@ -6917,8 +6918,8 @@ async function down$51(db) {
|
|
|
6917
6918
|
//#endregion
|
|
6918
6919
|
//#region src/db/migrations/109_cluster_settings_cache_knobs.ts
|
|
6919
6920
|
var _109_cluster_settings_cache_knobs_exports = /* @__PURE__ */ __exportAll({
|
|
6920
|
-
down: () => down$
|
|
6921
|
-
up: () => up$
|
|
6921
|
+
down: () => down$51,
|
|
6922
|
+
up: () => up$51
|
|
6922
6923
|
});
|
|
6923
6924
|
/**
|
|
6924
6925
|
* Cluster-global tunables for the lock-file cache and the Tier-1 content-requirements cache.
|
|
@@ -6950,17 +6951,17 @@ const COLUMNS$7 = [
|
|
|
6950
6951
|
"content_cache_max_bytes",
|
|
6951
6952
|
"content_cache_ttl_ms"
|
|
6952
6953
|
];
|
|
6953
|
-
async function up$
|
|
6954
|
+
async function up$51(db) {
|
|
6954
6955
|
for (const column of COLUMNS$7) if (!await columnExists$9(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
6955
6956
|
}
|
|
6956
|
-
async function down$
|
|
6957
|
+
async function down$51(db) {
|
|
6957
6958
|
for (const column of COLUMNS$7) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
6958
6959
|
}
|
|
6959
6960
|
//#endregion
|
|
6960
6961
|
//#region src/db/migrations/110_cluster_settings_global_eval_knobs.ts
|
|
6961
6962
|
var _110_cluster_settings_global_eval_knobs_exports = /* @__PURE__ */ __exportAll({
|
|
6962
|
-
down: () => down$
|
|
6963
|
-
up: () => up$
|
|
6963
|
+
down: () => down$50,
|
|
6964
|
+
up: () => up$50
|
|
6964
6965
|
});
|
|
6965
6966
|
/**
|
|
6966
6967
|
* Cluster-global tunables for the Tier-2 global eval round — the pre-run job
|
|
@@ -6993,17 +6994,17 @@ const COLUMNS$6 = [
|
|
|
6993
6994
|
"global_eval_candidate_timeout_ms",
|
|
6994
6995
|
"global_eval_cache_max"
|
|
6995
6996
|
];
|
|
6996
|
-
async function up$
|
|
6997
|
+
async function up$50(db) {
|
|
6997
6998
|
for (const column of COLUMNS$6) if (!await columnExists$8(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
6998
6999
|
}
|
|
6999
|
-
async function down$
|
|
7000
|
+
async function down$50(db) {
|
|
7000
7001
|
for (const column of COLUMNS$6) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
7001
7002
|
}
|
|
7002
7003
|
//#endregion
|
|
7003
7004
|
//#region src/db/migrations/111_cluster_settings_global_eval_wait.ts
|
|
7004
7005
|
var _111_cluster_settings_global_eval_wait_exports = /* @__PURE__ */ __exportAll({
|
|
7005
|
-
down: () => down$
|
|
7006
|
-
up: () => up$
|
|
7006
|
+
down: () => down$49,
|
|
7007
|
+
up: () => up$49
|
|
7007
7008
|
});
|
|
7008
7009
|
/**
|
|
7009
7010
|
* Cluster-global ceiling on how long webhook processing waits for a Tier-2
|
|
@@ -7027,17 +7028,17 @@ async function columnExists$7(db, table, column) {
|
|
|
7027
7028
|
`.execute(db)).rows[0]?.exists === true;
|
|
7028
7029
|
}
|
|
7029
7030
|
const COLUMNS$5 = ["global_eval_wait_timeout_ms"];
|
|
7030
|
-
async function up$
|
|
7031
|
+
async function up$49(db) {
|
|
7031
7032
|
for (const column of COLUMNS$5) if (!await columnExists$7(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
7032
7033
|
}
|
|
7033
|
-
async function down$
|
|
7034
|
+
async function down$49(db) {
|
|
7034
7035
|
for (const column of COLUMNS$5) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
7035
7036
|
}
|
|
7036
7037
|
//#endregion
|
|
7037
7038
|
//#region src/db/migrations/112_execution_runs_workflow_repo.ts
|
|
7038
7039
|
var _112_execution_runs_workflow_repo_exports = /* @__PURE__ */ __exportAll({
|
|
7039
|
-
down: () => down$
|
|
7040
|
-
up: () => up$
|
|
7040
|
+
down: () => down$48,
|
|
7041
|
+
up: () => up$48
|
|
7041
7042
|
});
|
|
7042
7043
|
/**
|
|
7043
7044
|
* Record which repository DEFINED the workflow a run executed.
|
|
@@ -7067,13 +7068,13 @@ async function colExists$9(db, table, name) {
|
|
|
7067
7068
|
) AS exists
|
|
7068
7069
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
7069
7070
|
}
|
|
7070
|
-
async function up$
|
|
7071
|
+
async function up$48(db) {
|
|
7071
7072
|
if (!await colExists$9(db, "execution_runs", "workflow_repo_identifier")) await sql`
|
|
7072
7073
|
ALTER TABLE public.execution_runs
|
|
7073
7074
|
ADD COLUMN workflow_repo_identifier text
|
|
7074
7075
|
`.execute(db);
|
|
7075
7076
|
}
|
|
7076
|
-
async function down$
|
|
7077
|
+
async function down$48(db) {
|
|
7077
7078
|
await sql`
|
|
7078
7079
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS workflow_repo_identifier
|
|
7079
7080
|
`.execute(db);
|
|
@@ -7081,8 +7082,8 @@ async function down$47(db) {
|
|
|
7081
7082
|
//#endregion
|
|
7082
7083
|
//#region src/db/migrations/113_execution_runs_workflow_repo_index.ts
|
|
7083
7084
|
var _113_execution_runs_workflow_repo_index_exports = /* @__PURE__ */ __exportAll({
|
|
7084
|
-
down: () => down$
|
|
7085
|
-
up: () => up$
|
|
7085
|
+
down: () => down$47,
|
|
7086
|
+
up: () => up$47
|
|
7086
7087
|
});
|
|
7087
7088
|
/**
|
|
7088
7089
|
* Add the partial index `idx_execution_runs_workflow_repo` on
|
|
@@ -7101,21 +7102,21 @@ var _113_execution_runs_workflow_repo_index_exports = /* @__PURE__ */ __exportAl
|
|
|
7101
7102
|
*
|
|
7102
7103
|
* Idempotent: `IF NOT EXISTS`.
|
|
7103
7104
|
*/
|
|
7104
|
-
async function up$
|
|
7105
|
+
async function up$47(db) {
|
|
7105
7106
|
await sql`
|
|
7106
7107
|
CREATE INDEX IF NOT EXISTS idx_execution_runs_workflow_repo
|
|
7107
7108
|
ON public.execution_runs (workflow_repo_identifier)
|
|
7108
7109
|
WHERE workflow_repo_identifier IS NOT NULL
|
|
7109
7110
|
`.execute(db);
|
|
7110
7111
|
}
|
|
7111
|
-
async function down$
|
|
7112
|
+
async function down$47(db) {
|
|
7112
7113
|
await sql`DROP INDEX IF EXISTS public.idx_execution_runs_workflow_repo`.execute(db);
|
|
7113
7114
|
}
|
|
7114
7115
|
//#endregion
|
|
7115
7116
|
//#region src/db/migrations/114_ingest_queue_claim.ts
|
|
7116
7117
|
var _114_ingest_queue_claim_exports = /* @__PURE__ */ __exportAll({
|
|
7117
|
-
down: () => down$
|
|
7118
|
-
up: () => up$
|
|
7118
|
+
down: () => down$46,
|
|
7119
|
+
up: () => up$46
|
|
7119
7120
|
});
|
|
7120
7121
|
/**
|
|
7121
7122
|
* Claim bookkeeping for the durable ingest queue.
|
|
@@ -7140,13 +7141,13 @@ async function columnExists$6(db, table, column) {
|
|
|
7140
7141
|
) AS exists
|
|
7141
7142
|
`.execute(db)).rows[0]?.exists === true;
|
|
7142
7143
|
}
|
|
7143
|
-
async function up$
|
|
7144
|
+
async function up$46(db) {
|
|
7144
7145
|
if (!await columnExists$6(db, "ingest_overflow_buffer", "claimed_at")) await sql`ALTER TABLE public.ingest_overflow_buffer ADD COLUMN claimed_at TIMESTAMPTZ`.execute(db);
|
|
7145
7146
|
if (!await columnExists$6(db, "cluster_settings", "ingest_overflow_claim_timeout_ms")) await sql`
|
|
7146
7147
|
ALTER TABLE public.cluster_settings ADD COLUMN ingest_overflow_claim_timeout_ms INTEGER
|
|
7147
7148
|
`.execute(db);
|
|
7148
7149
|
}
|
|
7149
|
-
async function down$
|
|
7150
|
+
async function down$46(db) {
|
|
7150
7151
|
await sql`
|
|
7151
7152
|
ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ingest_overflow_claim_timeout_ms
|
|
7152
7153
|
`.execute(db);
|
|
@@ -7157,8 +7158,8 @@ async function down$45(db) {
|
|
|
7157
7158
|
//#endregion
|
|
7158
7159
|
//#region src/db/migrations/115_global_workflows_cluster_switch.ts
|
|
7159
7160
|
var _115_global_workflows_cluster_switch_exports = /* @__PURE__ */ __exportAll({
|
|
7160
|
-
down: () => down$
|
|
7161
|
-
up: () => up$
|
|
7161
|
+
down: () => down$45,
|
|
7162
|
+
up: () => up$45
|
|
7162
7163
|
});
|
|
7163
7164
|
/**
|
|
7164
7165
|
* Moves the global-workflows master switch from `org_settings` to `cluster_settings`. Whether
|
|
@@ -7186,7 +7187,7 @@ async function columnExists$5(db, table, column) {
|
|
|
7186
7187
|
) AS exists
|
|
7187
7188
|
`.execute(db)).rows[0]?.exists === true;
|
|
7188
7189
|
}
|
|
7189
|
-
async function up$
|
|
7190
|
+
async function up$45(db) {
|
|
7190
7191
|
if (!await columnExists$5(db, "cluster_settings", "global_workflows_enabled")) await sql`ALTER TABLE public.cluster_settings ADD COLUMN global_workflows_enabled BOOLEAN`.execute(db);
|
|
7191
7192
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS global_workflows_enabled`.execute(db);
|
|
7192
7193
|
}
|
|
@@ -7194,7 +7195,7 @@ async function up$44(db) {
|
|
|
7194
7195
|
* Restores the org column as NOT NULL DEFAULT false. The per-org values `up` dropped are
|
|
7195
7196
|
* unrecoverable, so every org comes back at the opt-in default.
|
|
7196
7197
|
*/
|
|
7197
|
-
async function down$
|
|
7198
|
+
async function down$45(db) {
|
|
7198
7199
|
if (!await columnExists$5(db, "org_settings", "global_workflows_enabled")) await sql`
|
|
7199
7200
|
ALTER TABLE public.org_settings
|
|
7200
7201
|
ADD COLUMN global_workflows_enabled BOOLEAN NOT NULL DEFAULT false
|
|
@@ -7204,20 +7205,20 @@ async function down$44(db) {
|
|
|
7204
7205
|
//#endregion
|
|
7205
7206
|
//#region src/db/migrations/116_org_plan_headroom.ts
|
|
7206
7207
|
var _116_org_plan_headroom_exports = /* @__PURE__ */ __exportAll({
|
|
7207
|
-
down: () => down$
|
|
7208
|
-
up: () => up$
|
|
7208
|
+
down: () => down$44,
|
|
7209
|
+
up: () => up$44
|
|
7209
7210
|
});
|
|
7210
|
-
async function up$
|
|
7211
|
+
async function up$44(db) {
|
|
7211
7212
|
await db.schema.createTable("org_plan_headroom").ifNotExists().addColumn("id", "varchar(16)", (col) => col.primaryKey()).addColumn("max_worker_peers", "integer", (col) => col.notNull()).addColumn("org_limit", "integer", (col) => col.notNull()).addColumn("org_total", "integer", (col) => col.notNull()).addColumn("evict_excess", "boolean", (col) => col.notNull().defaultTo(false)).addColumn("updated_at", sql`timestamptz`, (col) => col.notNull()).execute();
|
|
7212
7213
|
}
|
|
7213
|
-
async function down$
|
|
7214
|
+
async function down$44(db) {
|
|
7214
7215
|
await db.schema.dropTable("org_plan_headroom").ifExists().execute();
|
|
7215
7216
|
}
|
|
7216
7217
|
//#endregion
|
|
7217
7218
|
//#region src/db/migrations/117_invoke_gate_proxy_jobs.ts
|
|
7218
7219
|
var _117_invoke_gate_proxy_jobs_exports = /* @__PURE__ */ __exportAll({
|
|
7219
|
-
down: () => down$
|
|
7220
|
-
up: () => up$
|
|
7220
|
+
down: () => down$43,
|
|
7221
|
+
up: () => up$43
|
|
7221
7222
|
});
|
|
7222
7223
|
/**
|
|
7223
7224
|
* An invoke gate summons the source repo's opt-in workflows and tracks each spawned run as a
|
|
@@ -7244,7 +7245,7 @@ async function colExists$8(db, table, name) {
|
|
|
7244
7245
|
) AS exists
|
|
7245
7246
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
7246
7247
|
}
|
|
7247
|
-
async function up$
|
|
7248
|
+
async function up$43(db) {
|
|
7248
7249
|
if (!await colExists$8(db, "execution_jobs", "job_kind")) await sql`
|
|
7249
7250
|
ALTER TABLE public.execution_jobs
|
|
7250
7251
|
ADD COLUMN job_kind text NOT NULL DEFAULT 'standard'
|
|
@@ -7262,7 +7263,7 @@ async function up$42(db) {
|
|
|
7262
7263
|
ADD COLUMN summoned_by_proxy_job text
|
|
7263
7264
|
`.execute(db);
|
|
7264
7265
|
}
|
|
7265
|
-
async function down$
|
|
7266
|
+
async function down$43(db) {
|
|
7266
7267
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS job_kind`.execute(db);
|
|
7267
7268
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS summoned_run_id`.execute(db);
|
|
7268
7269
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS summoned_by_run_id`.execute(db);
|
|
@@ -7271,8 +7272,8 @@ async function down$42(db) {
|
|
|
7271
7272
|
//#endregion
|
|
7272
7273
|
//#region src/db/migrations/118_invoke_gate_scheduling.ts
|
|
7273
7274
|
var _118_invoke_gate_scheduling_exports = /* @__PURE__ */ __exportAll({
|
|
7274
|
-
down: () => down$
|
|
7275
|
-
up: () => up$
|
|
7275
|
+
down: () => down$42,
|
|
7276
|
+
up: () => up$42
|
|
7276
7277
|
});
|
|
7277
7278
|
/**
|
|
7278
7279
|
* Scheduling columns for the invoke gate: the pieces the orchestrator needs to
|
|
@@ -7304,7 +7305,7 @@ async function colExists$7(db, table, name) {
|
|
|
7304
7305
|
) AS exists
|
|
7305
7306
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
7306
7307
|
}
|
|
7307
|
-
async function up$
|
|
7308
|
+
async function up$42(db) {
|
|
7308
7309
|
if (!await colExists$7(db, "execution_jobs", "timeout_ms")) await sql`
|
|
7309
7310
|
ALTER TABLE public.execution_jobs
|
|
7310
7311
|
ADD COLUMN timeout_ms integer
|
|
@@ -7318,7 +7319,7 @@ async function up$41(db) {
|
|
|
7318
7319
|
ADD COLUMN invoke_config text
|
|
7319
7320
|
`.execute(db);
|
|
7320
7321
|
}
|
|
7321
|
-
async function down$
|
|
7322
|
+
async function down$42(db) {
|
|
7322
7323
|
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS timeout_ms`.execute(db);
|
|
7323
7324
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS chain_depth`.execute(db);
|
|
7324
7325
|
await sql`ALTER TABLE public.pending_job_contexts DROP COLUMN IF EXISTS invoke_config`.execute(db);
|
|
@@ -7326,8 +7327,8 @@ async function down$41(db) {
|
|
|
7326
7327
|
//#endregion
|
|
7327
7328
|
//#region src/db/migrations/119_scaler_ha_ownership.ts
|
|
7328
7329
|
var _119_scaler_ha_ownership_exports = /* @__PURE__ */ __exportAll({
|
|
7329
|
-
down: () => down$
|
|
7330
|
-
up: () => up$
|
|
7330
|
+
down: () => down$41,
|
|
7331
|
+
up: () => up$41
|
|
7331
7332
|
});
|
|
7332
7333
|
/**
|
|
7333
7334
|
* HA ownership for event-scaler provisions.
|
|
@@ -7372,7 +7373,7 @@ const SPAWNING_COLUMNS = [
|
|
|
7372
7373
|
["roles", "JSONB"],
|
|
7373
7374
|
["backend_type", "TEXT"]
|
|
7374
7375
|
];
|
|
7375
|
-
async function up$
|
|
7376
|
+
async function up$41(db) {
|
|
7376
7377
|
if (!await tableExists$1(db, "scaler_pending_claims")) {
|
|
7377
7378
|
await sql`
|
|
7378
7379
|
CREATE TABLE public.scaler_pending_claims (
|
|
@@ -7418,7 +7419,7 @@ async function up$40(db) {
|
|
|
7418
7419
|
ON public.scaler_reservations (owner_instance_id)
|
|
7419
7420
|
`.execute(db);
|
|
7420
7421
|
}
|
|
7421
|
-
async function down$
|
|
7422
|
+
async function down$41(db) {
|
|
7422
7423
|
await sql`DROP TABLE IF EXISTS public.scaler_pending_claims`.execute(db);
|
|
7423
7424
|
await sql`DROP INDEX IF EXISTS public.idx_scaler_spawning_agents_scaler_name`.execute(db);
|
|
7424
7425
|
for (const [name] of SPAWNING_COLUMNS) await sql`
|
|
@@ -7431,8 +7432,8 @@ async function down$40(db) {
|
|
|
7431
7432
|
//#endregion
|
|
7432
7433
|
//#region src/db/migrations/120_cluster_settings_scaler_reaper.ts
|
|
7433
7434
|
var _120_cluster_settings_scaler_reaper_exports = /* @__PURE__ */ __exportAll({
|
|
7434
|
-
down: () => down$
|
|
7435
|
-
up: () => up$
|
|
7435
|
+
down: () => down$40,
|
|
7436
|
+
up: () => up$40
|
|
7436
7437
|
});
|
|
7437
7438
|
/**
|
|
7438
7439
|
* Cluster-global tunables for the leader-gated event-scaler provision reaper: additive, nullable
|
|
@@ -7466,17 +7467,17 @@ const COLUMNS$4 = [
|
|
|
7466
7467
|
"scaler_reap_reattempt_interval_ms",
|
|
7467
7468
|
"scaler_claim_retention_ms"
|
|
7468
7469
|
];
|
|
7469
|
-
async function up$
|
|
7470
|
+
async function up$40(db) {
|
|
7470
7471
|
for (const column of COLUMNS$4) if (!await columnExists$4(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
7471
7472
|
}
|
|
7472
|
-
async function down$
|
|
7473
|
+
async function down$40(db) {
|
|
7473
7474
|
for (const column of COLUMNS$4) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
7474
7475
|
}
|
|
7475
7476
|
//#endregion
|
|
7476
7477
|
//#region src/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.ts
|
|
7477
7478
|
var _121_org_settings_allow_untrusted_dockerfile_builds_exports = /* @__PURE__ */ __exportAll({
|
|
7478
|
-
down: () => down$
|
|
7479
|
-
up: () => up$
|
|
7479
|
+
down: () => down$39,
|
|
7480
|
+
up: () => up$39
|
|
7480
7481
|
});
|
|
7481
7482
|
/**
|
|
7482
7483
|
* Add `org_settings.allow_untrusted_dockerfile_builds boolean NOT NULL DEFAULT false`.
|
|
@@ -7492,7 +7493,7 @@ var _121_org_settings_allow_untrusted_dockerfile_builds_exports = /* @__PURE__ *
|
|
|
7492
7493
|
*
|
|
7493
7494
|
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
7494
7495
|
*/
|
|
7495
|
-
async function up$
|
|
7496
|
+
async function up$39(db) {
|
|
7496
7497
|
if ((await sql`
|
|
7497
7498
|
SELECT EXISTS (
|
|
7498
7499
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7506,7 +7507,7 @@ async function up$38(db) {
|
|
|
7506
7507
|
ADD COLUMN allow_untrusted_dockerfile_builds boolean NOT NULL DEFAULT false
|
|
7507
7508
|
`.execute(db);
|
|
7508
7509
|
}
|
|
7509
|
-
async function down$
|
|
7510
|
+
async function down$39(db) {
|
|
7510
7511
|
await sql`
|
|
7511
7512
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS allow_untrusted_dockerfile_builds
|
|
7512
7513
|
`.execute(db);
|
|
@@ -7514,8 +7515,8 @@ async function down$38(db) {
|
|
|
7514
7515
|
//#endregion
|
|
7515
7516
|
//#region src/db/migrations/122_host_roster_scaler_managed.ts
|
|
7516
7517
|
var _122_host_roster_scaler_managed_exports = /* @__PURE__ */ __exportAll({
|
|
7517
|
-
down: () => down$
|
|
7518
|
-
up: () => up$
|
|
7518
|
+
down: () => down$38,
|
|
7519
|
+
up: () => up$38
|
|
7519
7520
|
});
|
|
7520
7521
|
/**
|
|
7521
7522
|
* Add `host_roster.scaler_managed`: whether a scaler backend spawned the agent.
|
|
@@ -7531,7 +7532,7 @@ var _122_host_roster_scaler_managed_exports = /* @__PURE__ */ __exportAll({
|
|
|
7531
7532
|
* DEFAULT false is load-bearing: a pre-existing row reads as not-scaler-managed, so an existing
|
|
7532
7533
|
* fleet host stays a fan-out target without re-registering. Idempotent.
|
|
7533
7534
|
*/
|
|
7534
|
-
async function up$
|
|
7535
|
+
async function up$38(db) {
|
|
7535
7536
|
if ((await sql`
|
|
7536
7537
|
SELECT EXISTS (
|
|
7537
7538
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7545,7 +7546,7 @@ async function up$37(db) {
|
|
|
7545
7546
|
ADD COLUMN scaler_managed boolean NOT NULL DEFAULT false
|
|
7546
7547
|
`.execute(db);
|
|
7547
7548
|
}
|
|
7548
|
-
async function down$
|
|
7549
|
+
async function down$38(db) {
|
|
7549
7550
|
await sql`
|
|
7550
7551
|
ALTER TABLE public.host_roster DROP COLUMN IF EXISTS scaler_managed
|
|
7551
7552
|
`.execute(db);
|
|
@@ -7553,8 +7554,8 @@ async function down$37(db) {
|
|
|
7553
7554
|
//#endregion
|
|
7554
7555
|
//#region src/db/migrations/123_workflow_registrations_default_branch.ts
|
|
7555
7556
|
var _123_workflow_registrations_default_branch_exports = /* @__PURE__ */ __exportAll({
|
|
7556
|
-
down: () => down$
|
|
7557
|
-
up: () => up$
|
|
7557
|
+
down: () => down$37,
|
|
7558
|
+
up: () => up$37
|
|
7558
7559
|
});
|
|
7559
7560
|
/**
|
|
7560
7561
|
* Add `workflow_registrations.default_branch`.
|
|
@@ -7568,7 +7569,7 @@ var _123_workflow_registrations_default_branch_exports = /* @__PURE__ */ __expor
|
|
|
7568
7569
|
* Dispatch reads NULL as "no branch" and the context branch gate rejects with its named cause; a
|
|
7569
7570
|
* DEFAULT would invent a branch the registration never proved. Idempotent.
|
|
7570
7571
|
*/
|
|
7571
|
-
async function up$
|
|
7572
|
+
async function up$37(db) {
|
|
7572
7573
|
if ((await sql`
|
|
7573
7574
|
SELECT EXISTS (
|
|
7574
7575
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7582,7 +7583,7 @@ async function up$36(db) {
|
|
|
7582
7583
|
ADD COLUMN default_branch text
|
|
7583
7584
|
`.execute(db);
|
|
7584
7585
|
}
|
|
7585
|
-
async function down$
|
|
7586
|
+
async function down$37(db) {
|
|
7586
7587
|
await sql`
|
|
7587
7588
|
ALTER TABLE public.workflow_registrations DROP COLUMN IF EXISTS default_branch
|
|
7588
7589
|
`.execute(db);
|
|
@@ -7590,8 +7591,8 @@ async function down$36(db) {
|
|
|
7590
7591
|
//#endregion
|
|
7591
7592
|
//#region src/db/migrations/124_cluster_settings_provision_backoff.ts
|
|
7592
7593
|
var _124_cluster_settings_provision_backoff_exports = /* @__PURE__ */ __exportAll({
|
|
7593
|
-
down: () => down$
|
|
7594
|
-
up: () => up$
|
|
7594
|
+
down: () => down$36,
|
|
7595
|
+
up: () => up$36
|
|
7595
7596
|
});
|
|
7596
7597
|
/**
|
|
7597
7598
|
* Cluster-global tunables for backing off a repeatedly failing external (event) scaler.
|
|
@@ -7627,17 +7628,17 @@ const COLUMNS$3 = [
|
|
|
7627
7628
|
"scaler_provision_backoff_max_ms",
|
|
7628
7629
|
"scaler_provision_max_consecutive_failures"
|
|
7629
7630
|
];
|
|
7630
|
-
async function up$
|
|
7631
|
+
async function up$36(db) {
|
|
7631
7632
|
for (const column of COLUMNS$3) if (!await columnExists$3(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
7632
7633
|
}
|
|
7633
|
-
async function down$
|
|
7634
|
+
async function down$36(db) {
|
|
7634
7635
|
for (const column of COLUMNS$3) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
7635
7636
|
}
|
|
7636
7637
|
//#endregion
|
|
7637
7638
|
//#region src/db/migrations/125_org_trust_directory.ts
|
|
7638
7639
|
var _125_org_trust_directory_exports = /* @__PURE__ */ __exportAll({
|
|
7639
|
-
down: () => down$
|
|
7640
|
-
up: () => up$
|
|
7640
|
+
down: () => down$35,
|
|
7641
|
+
up: () => up$35
|
|
7641
7642
|
});
|
|
7642
7643
|
/**
|
|
7643
7644
|
* Create `org_trust_directory`: the orchestrator's cache of the Platform-owned approval directory
|
|
@@ -7657,7 +7658,7 @@ var _125_org_trust_directory_exports = /* @__PURE__ */ __exportAll({
|
|
|
7657
7658
|
* when a Platform is attached, so there is one writer and no counterpart to
|
|
7658
7659
|
* `org_trust_policy.source`. Idempotent (IF NOT EXISTS).
|
|
7659
7660
|
*/
|
|
7660
|
-
async function up$
|
|
7661
|
+
async function up$35(db) {
|
|
7661
7662
|
await sql`
|
|
7662
7663
|
CREATE TABLE IF NOT EXISTS public.org_trust_directory (
|
|
7663
7664
|
customer_id TEXT PRIMARY KEY,
|
|
@@ -7668,14 +7669,14 @@ async function up$34(db) {
|
|
|
7668
7669
|
)
|
|
7669
7670
|
`.execute(db);
|
|
7670
7671
|
}
|
|
7671
|
-
async function down$
|
|
7672
|
+
async function down$35(db) {
|
|
7672
7673
|
await sql`DROP TABLE IF EXISTS public.org_trust_directory`.execute(db);
|
|
7673
7674
|
}
|
|
7674
7675
|
//#endregion
|
|
7675
7676
|
//#region src/db/migrations/126_held_runs_posted_pending_check.ts
|
|
7676
7677
|
var _126_held_runs_posted_pending_check_exports = /* @__PURE__ */ __exportAll({
|
|
7677
|
-
down: () => down$
|
|
7678
|
-
up: () => up$
|
|
7678
|
+
down: () => down$34,
|
|
7679
|
+
up: () => up$34
|
|
7679
7680
|
});
|
|
7680
7681
|
/**
|
|
7681
7682
|
* Add `held_runs.posted_pending_check boolean` — whether this hold's pending
|
|
@@ -7695,7 +7696,7 @@ var _126_held_runs_posted_pending_check_exports = /* @__PURE__ */ __exportAll({
|
|
|
7695
7696
|
*
|
|
7696
7697
|
* Idempotent.
|
|
7697
7698
|
*/
|
|
7698
|
-
async function up$
|
|
7699
|
+
async function up$34(db) {
|
|
7699
7700
|
if ((await sql`
|
|
7700
7701
|
SELECT EXISTS (
|
|
7701
7702
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7709,7 +7710,7 @@ async function up$33(db) {
|
|
|
7709
7710
|
ADD COLUMN posted_pending_check boolean
|
|
7710
7711
|
`.execute(db);
|
|
7711
7712
|
}
|
|
7712
|
-
async function down$
|
|
7713
|
+
async function down$34(db) {
|
|
7713
7714
|
await sql`
|
|
7714
7715
|
ALTER TABLE public.held_runs DROP COLUMN IF EXISTS posted_pending_check
|
|
7715
7716
|
`.execute(db);
|
|
@@ -7717,8 +7718,8 @@ async function down$33(db) {
|
|
|
7717
7718
|
//#endregion
|
|
7718
7719
|
//#region src/db/migrations/127_org_trust_policy_approval_expiry_seconds.ts
|
|
7719
7720
|
var _127_org_trust_policy_approval_expiry_seconds_exports = /* @__PURE__ */ __exportAll({
|
|
7720
|
-
down: () => down$
|
|
7721
|
-
up: () => up$
|
|
7721
|
+
down: () => down$33,
|
|
7722
|
+
up: () => up$33
|
|
7722
7723
|
});
|
|
7723
7724
|
/**
|
|
7724
7725
|
* Add `org_trust_policy.approval_expiry_seconds` (nullable INTEGER).
|
|
@@ -7734,7 +7735,7 @@ var _127_org_trust_policy_approval_expiry_seconds_exports = /* @__PURE__ */ __ex
|
|
|
7734
7735
|
*
|
|
7735
7736
|
* Idempotent: guarded on column existence.
|
|
7736
7737
|
*/
|
|
7737
|
-
async function up$
|
|
7738
|
+
async function up$33(db) {
|
|
7738
7739
|
if ((await sql`
|
|
7739
7740
|
SELECT EXISTS (
|
|
7740
7741
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7745,14 +7746,14 @@ async function up$32(db) {
|
|
|
7745
7746
|
`.execute(db)).rows[0]?.exists) return;
|
|
7746
7747
|
await sql`ALTER TABLE public.org_trust_policy ADD COLUMN approval_expiry_seconds INTEGER`.execute(db);
|
|
7747
7748
|
}
|
|
7748
|
-
async function down$
|
|
7749
|
+
async function down$33(db) {
|
|
7749
7750
|
await sql`ALTER TABLE public.org_trust_policy DROP COLUMN IF EXISTS approval_expiry_seconds`.execute(db);
|
|
7750
7751
|
}
|
|
7751
7752
|
//#endregion
|
|
7752
7753
|
//#region src/db/migrations/128_execution_runs_global_eval_round.ts
|
|
7753
7754
|
var _128_execution_runs_global_eval_round_exports = /* @__PURE__ */ __exportAll({
|
|
7754
|
-
down: () => down$
|
|
7755
|
-
up: () => up$
|
|
7755
|
+
down: () => down$32,
|
|
7756
|
+
up: () => up$32
|
|
7756
7757
|
});
|
|
7757
7758
|
/**
|
|
7758
7759
|
* Add `execution_runs.is_global_eval_round boolean NOT NULL DEFAULT false` —
|
|
@@ -7768,7 +7769,7 @@ var _128_execution_runs_global_eval_round_exports = /* @__PURE__ */ __exportAll(
|
|
|
7768
7769
|
* `NOT NULL DEFAULT false`: every pre-existing row is an ordinary run, and no
|
|
7769
7770
|
* third "unknown" answer exists for a null to carry. Idempotent.
|
|
7770
7771
|
*/
|
|
7771
|
-
async function up$
|
|
7772
|
+
async function up$32(db) {
|
|
7772
7773
|
if ((await sql`
|
|
7773
7774
|
SELECT EXISTS (
|
|
7774
7775
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7782,7 +7783,7 @@ async function up$31(db) {
|
|
|
7782
7783
|
ADD COLUMN is_global_eval_round BOOLEAN NOT NULL DEFAULT FALSE
|
|
7783
7784
|
`.execute(db);
|
|
7784
7785
|
}
|
|
7785
|
-
async function down$
|
|
7786
|
+
async function down$32(db) {
|
|
7786
7787
|
await sql`
|
|
7787
7788
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS is_global_eval_round
|
|
7788
7789
|
`.execute(db);
|
|
@@ -7790,8 +7791,8 @@ async function down$31(db) {
|
|
|
7790
7791
|
//#endregion
|
|
7791
7792
|
//#region src/db/migrations/129_execution_runs_dispatch_routing_key.ts
|
|
7792
7793
|
var _129_execution_runs_dispatch_routing_key_exports = /* @__PURE__ */ __exportAll({
|
|
7793
|
-
down: () => down$
|
|
7794
|
-
up: () => up$
|
|
7794
|
+
down: () => down$31,
|
|
7795
|
+
up: () => up$31
|
|
7795
7796
|
});
|
|
7796
7797
|
/**
|
|
7797
7798
|
* Add `execution_runs.dispatch_routing_key TEXT NULL` — the source whose
|
|
@@ -7810,7 +7811,7 @@ var _129_execution_runs_dispatch_routing_key_exports = /* @__PURE__ */ __exportA
|
|
|
7810
7811
|
* Idempotent: the add is guarded on existence and the drop uses IF EXISTS, so a
|
|
7811
7812
|
* re-run is a no-op.
|
|
7812
7813
|
*/
|
|
7813
|
-
async function up$
|
|
7814
|
+
async function up$31(db) {
|
|
7814
7815
|
if ((await sql`
|
|
7815
7816
|
SELECT EXISTS (
|
|
7816
7817
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7824,7 +7825,7 @@ async function up$30(db) {
|
|
|
7824
7825
|
ADD COLUMN dispatch_routing_key TEXT
|
|
7825
7826
|
`.execute(db);
|
|
7826
7827
|
}
|
|
7827
|
-
async function down$
|
|
7828
|
+
async function down$31(db) {
|
|
7828
7829
|
await sql`
|
|
7829
7830
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS dispatch_routing_key
|
|
7830
7831
|
`.execute(db);
|
|
@@ -7832,8 +7833,8 @@ async function down$30(db) {
|
|
|
7832
7833
|
//#endregion
|
|
7833
7834
|
//#region src/db/migrations/130_scaler_provision_outcomes.ts
|
|
7834
7835
|
var _130_scaler_provision_outcomes_exports = /* @__PURE__ */ __exportAll({
|
|
7835
|
-
down: () => down$
|
|
7836
|
-
up: () => up$
|
|
7836
|
+
down: () => down$30,
|
|
7837
|
+
up: () => up$30
|
|
7837
7838
|
});
|
|
7838
7839
|
/**
|
|
7839
7840
|
* Durable per-provision outcome, keyed by agent id.
|
|
@@ -7856,7 +7857,7 @@ var _130_scaler_provision_outcomes_exports = /* @__PURE__ */ __exportAll({
|
|
|
7856
7857
|
* Idempotent: each statement is IF NOT EXISTS, covering a database with the table but not the
|
|
7857
7858
|
* index, which a table-existence probe would skip.
|
|
7858
7859
|
*/
|
|
7859
|
-
async function up$
|
|
7860
|
+
async function up$30(db) {
|
|
7860
7861
|
await sql`
|
|
7861
7862
|
CREATE TABLE IF NOT EXISTS public.scaler_provision_outcomes (
|
|
7862
7863
|
agent_id TEXT PRIMARY KEY,
|
|
@@ -7874,14 +7875,14 @@ async function up$29(db) {
|
|
|
7874
7875
|
ON public.scaler_provision_outcomes (updated_at)
|
|
7875
7876
|
`.execute(db);
|
|
7876
7877
|
}
|
|
7877
|
-
async function down$
|
|
7878
|
+
async function down$30(db) {
|
|
7878
7879
|
await sql`DROP TABLE IF EXISTS public.scaler_provision_outcomes`.execute(db);
|
|
7879
7880
|
}
|
|
7880
7881
|
//#endregion
|
|
7881
7882
|
//#region src/db/migrations/131_execution_jobs_git_credentials.ts
|
|
7882
7883
|
var _131_execution_jobs_git_credentials_exports = /* @__PURE__ */ __exportAll({
|
|
7883
|
-
down: () => down$
|
|
7884
|
-
up: () => up$
|
|
7884
|
+
down: () => down$29,
|
|
7885
|
+
up: () => up$29
|
|
7885
7886
|
});
|
|
7886
7887
|
/**
|
|
7887
7888
|
* Add `execution_jobs.git_credentials`: the job lock entry's `gitCredentials` map, as server
|
|
@@ -7899,7 +7900,7 @@ var _131_execution_jobs_git_credentials_exports = /* @__PURE__ */ __exportAll({
|
|
|
7899
7900
|
* dispatch loop, so NULL also covers "not written yet", which the relay resolves against the
|
|
7900
7901
|
* job's dispatch record (`git/job-context.ts`). Idempotent.
|
|
7901
7902
|
*/
|
|
7902
|
-
async function up$
|
|
7903
|
+
async function up$29(db) {
|
|
7903
7904
|
if ((await sql`
|
|
7904
7905
|
SELECT EXISTS (
|
|
7905
7906
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7913,7 +7914,7 @@ async function up$28(db) {
|
|
|
7913
7914
|
ADD COLUMN git_credentials JSONB
|
|
7914
7915
|
`.execute(db);
|
|
7915
7916
|
}
|
|
7916
|
-
async function down$
|
|
7917
|
+
async function down$29(db) {
|
|
7917
7918
|
await sql`
|
|
7918
7919
|
ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS git_credentials
|
|
7919
7920
|
`.execute(db);
|
|
@@ -7921,8 +7922,8 @@ async function down$28(db) {
|
|
|
7921
7922
|
//#endregion
|
|
7922
7923
|
//#region src/db/migrations/132_execution_runs_trigger_event.ts
|
|
7923
7924
|
var _132_execution_runs_trigger_event_exports = /* @__PURE__ */ __exportAll({
|
|
7924
|
-
down: () => down$
|
|
7925
|
-
up: () => up$
|
|
7925
|
+
down: () => down$28,
|
|
7926
|
+
up: () => up$28
|
|
7926
7927
|
});
|
|
7927
7928
|
/**
|
|
7928
7929
|
* Add `execution_runs.trigger_event`: the event type that started the run (`push`, `pr:open`,
|
|
@@ -7933,7 +7934,7 @@ var _132_execution_runs_trigger_event_exports = /* @__PURE__ */ __exportAll({
|
|
|
7933
7934
|
* in. An unknown trigger fails a `triggerTypeFilters` rule closed, withholding the credential.
|
|
7934
7935
|
* Idempotent.
|
|
7935
7936
|
*/
|
|
7936
|
-
async function up$
|
|
7937
|
+
async function up$28(db) {
|
|
7937
7938
|
if ((await sql`
|
|
7938
7939
|
SELECT EXISTS (
|
|
7939
7940
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7947,7 +7948,7 @@ async function up$27(db) {
|
|
|
7947
7948
|
ADD COLUMN trigger_event TEXT
|
|
7948
7949
|
`.execute(db);
|
|
7949
7950
|
}
|
|
7950
|
-
async function down$
|
|
7951
|
+
async function down$28(db) {
|
|
7951
7952
|
await sql`
|
|
7952
7953
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS trigger_event
|
|
7953
7954
|
`.execute(db);
|
|
@@ -7955,8 +7956,8 @@ async function down$27(db) {
|
|
|
7955
7956
|
//#endregion
|
|
7956
7957
|
//#region src/db/migrations/133_dispatch_queue_source_tar_digest.ts
|
|
7957
7958
|
var _133_dispatch_queue_source_tar_digest_exports = /* @__PURE__ */ __exportAll({
|
|
7958
|
-
down: () => down$
|
|
7959
|
-
up: () => up$
|
|
7959
|
+
down: () => down$27,
|
|
7960
|
+
up: () => up$27
|
|
7960
7961
|
});
|
|
7961
7962
|
/**
|
|
7962
7963
|
* Add `dispatch_queue.source_tar_digest TEXT NULL` — the SHA-256 of the source
|
|
@@ -7974,7 +7975,7 @@ var _133_dispatch_queue_source_tar_digest_exports = /* @__PURE__ */ __exportAll(
|
|
|
7974
7975
|
* Idempotent: the add is guarded on existence and the drop uses IF EXISTS, so a
|
|
7975
7976
|
* re-run is a no-op.
|
|
7976
7977
|
*/
|
|
7977
|
-
async function up$
|
|
7978
|
+
async function up$27(db) {
|
|
7978
7979
|
if ((await sql`
|
|
7979
7980
|
SELECT EXISTS (
|
|
7980
7981
|
SELECT 1 FROM information_schema.columns
|
|
@@ -7988,7 +7989,7 @@ async function up$26(db) {
|
|
|
7988
7989
|
ADD COLUMN source_tar_digest TEXT
|
|
7989
7990
|
`.execute(db);
|
|
7990
7991
|
}
|
|
7991
|
-
async function down$
|
|
7992
|
+
async function down$27(db) {
|
|
7992
7993
|
await sql`
|
|
7993
7994
|
ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS source_tar_digest
|
|
7994
7995
|
`.execute(db);
|
|
@@ -7996,8 +7997,8 @@ async function down$26(db) {
|
|
|
7996
7997
|
//#endregion
|
|
7997
7998
|
//#region src/db/migrations/134_dispatch_queue_ownership.ts
|
|
7998
7999
|
var _134_dispatch_queue_ownership_exports = /* @__PURE__ */ __exportAll({
|
|
7999
|
-
down: () => down$
|
|
8000
|
-
up: () => up$
|
|
8000
|
+
down: () => down$26,
|
|
8001
|
+
up: () => up$26
|
|
8001
8002
|
});
|
|
8002
8003
|
/**
|
|
8003
8004
|
* Coordinator ownership for the job-dispatch plane.
|
|
@@ -8040,7 +8041,7 @@ async function colExists$5(db, table, name) {
|
|
|
8040
8041
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8041
8042
|
}
|
|
8042
8043
|
const DISPATCH_QUEUE_COLUMNS = [["owner_instance_id", "TEXT"], ["dispatched_at", "TIMESTAMPTZ"]];
|
|
8043
|
-
async function up$
|
|
8044
|
+
async function up$26(db) {
|
|
8044
8045
|
for (const [name, type] of DISPATCH_QUEUE_COLUMNS) if (!await colExists$5(db, "dispatch_queue", name)) await sql`
|
|
8045
8046
|
ALTER TABLE public.dispatch_queue
|
|
8046
8047
|
ADD COLUMN ${sql.raw(name)} ${sql.raw(type)}
|
|
@@ -8101,7 +8102,7 @@ async function up$25(db) {
|
|
|
8101
8102
|
WHERE status = 'active'
|
|
8102
8103
|
`.execute(db);
|
|
8103
8104
|
}
|
|
8104
|
-
async function down$
|
|
8105
|
+
async function down$26(db) {
|
|
8105
8106
|
await sql`DROP INDEX IF EXISTS public.idx_concurrency_groups_active_unique`.execute(db);
|
|
8106
8107
|
await sql`DROP TABLE IF EXISTS public.cluster_instances`.execute(db);
|
|
8107
8108
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS cancelling_at`.execute(db);
|
|
@@ -8112,8 +8113,8 @@ async function down$25(db) {
|
|
|
8112
8113
|
//#endregion
|
|
8113
8114
|
//#region src/db/migrations/135_cluster_settings_retention_days.ts
|
|
8114
8115
|
var _135_cluster_settings_retention_days_exports = /* @__PURE__ */ __exportAll({
|
|
8115
|
-
down: () => down$
|
|
8116
|
-
up: () => up$
|
|
8116
|
+
down: () => down$25,
|
|
8117
|
+
up: () => up$25
|
|
8117
8118
|
});
|
|
8118
8119
|
/**
|
|
8119
8120
|
* Database-side retention windows on `cluster_settings`. Cold-store
|
|
@@ -8167,20 +8168,20 @@ async function columnExists$2(db, column) {
|
|
|
8167
8168
|
) AS exists
|
|
8168
8169
|
`.execute(db)).rows[0]?.exists === true;
|
|
8169
8170
|
}
|
|
8170
|
-
async function up$
|
|
8171
|
+
async function up$25(db) {
|
|
8171
8172
|
for (const { name, type } of COLUMNS$2) {
|
|
8172
8173
|
if (await columnExists$2(db, name)) continue;
|
|
8173
8174
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.raw(name)} ${sql.raw(type)}`.execute(db);
|
|
8174
8175
|
}
|
|
8175
8176
|
}
|
|
8176
|
-
async function down$
|
|
8177
|
+
async function down$25(db) {
|
|
8177
8178
|
for (const { name } of COLUMNS$2) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.raw(name)}`.execute(db);
|
|
8178
8179
|
}
|
|
8179
8180
|
//#endregion
|
|
8180
8181
|
//#region src/db/migrations/136_master_key_wrapped_tables_key_version.ts
|
|
8181
8182
|
var _136_master_key_wrapped_tables_key_version_exports = /* @__PURE__ */ __exportAll({
|
|
8182
|
-
down: () => down$
|
|
8183
|
-
up: () => up$
|
|
8183
|
+
down: () => down$24,
|
|
8184
|
+
up: () => up$24
|
|
8184
8185
|
});
|
|
8185
8186
|
/**
|
|
8186
8187
|
* `key_version` on the master-key-wrapped tables that lacked it (`orchestrator_signing_keys`
|
|
@@ -8198,7 +8199,7 @@ const TABLES = [
|
|
|
8198
8199
|
"run_ephemeral_keys",
|
|
8199
8200
|
"run_secret_outputs"
|
|
8200
8201
|
];
|
|
8201
|
-
async function up$
|
|
8202
|
+
async function up$24(db) {
|
|
8202
8203
|
for (const table of TABLES) {
|
|
8203
8204
|
if ((await sql`
|
|
8204
8205
|
SELECT EXISTS (
|
|
@@ -8214,7 +8215,7 @@ async function up$23(db) {
|
|
|
8214
8215
|
`.execute(db);
|
|
8215
8216
|
}
|
|
8216
8217
|
}
|
|
8217
|
-
async function down$
|
|
8218
|
+
async function down$24(db) {
|
|
8218
8219
|
for (const table of TABLES) await sql`
|
|
8219
8220
|
ALTER TABLE public.${sql.raw(table)} DROP COLUMN IF EXISTS key_version
|
|
8220
8221
|
`.execute(db);
|
|
@@ -8222,8 +8223,8 @@ async function down$23(db) {
|
|
|
8222
8223
|
//#endregion
|
|
8223
8224
|
//#region src/db/migrations/137_execution_runs_pr_head_context.ts
|
|
8224
8225
|
var _137_execution_runs_pr_head_context_exports = /* @__PURE__ */ __exportAll({
|
|
8225
|
-
down: () => down$
|
|
8226
|
-
up: () => up$
|
|
8226
|
+
down: () => down$23,
|
|
8227
|
+
up: () => up$23
|
|
8227
8228
|
});
|
|
8228
8229
|
/**
|
|
8229
8230
|
* Add the pull-request head context to `execution_runs`: `head_ref TEXT`,
|
|
@@ -8251,7 +8252,7 @@ const COLUMNS$1 = [
|
|
|
8251
8252
|
["head_repository", "TEXT"],
|
|
8252
8253
|
["is_fork", "BOOLEAN"]
|
|
8253
8254
|
];
|
|
8254
|
-
async function up$
|
|
8255
|
+
async function up$23(db) {
|
|
8255
8256
|
for (const [name, type] of COLUMNS$1) {
|
|
8256
8257
|
if ((await sql`
|
|
8257
8258
|
SELECT EXISTS (
|
|
@@ -8267,7 +8268,7 @@ async function up$22(db) {
|
|
|
8267
8268
|
`.execute(db);
|
|
8268
8269
|
}
|
|
8269
8270
|
}
|
|
8270
|
-
async function down$
|
|
8271
|
+
async function down$23(db) {
|
|
8271
8272
|
for (const [name] of COLUMNS$1) await sql`
|
|
8272
8273
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS ${sql.raw(name)}
|
|
8273
8274
|
`.execute(db);
|
|
@@ -8275,8 +8276,8 @@ async function down$22(db) {
|
|
|
8275
8276
|
//#endregion
|
|
8276
8277
|
//#region src/db/migrations/138_execution_runs_subject_trigger_event.ts
|
|
8277
8278
|
var _138_execution_runs_subject_trigger_event_exports = /* @__PURE__ */ __exportAll({
|
|
8278
|
-
down: () => down$
|
|
8279
|
-
up: () => up$
|
|
8279
|
+
down: () => down$22,
|
|
8280
|
+
up: () => up$22
|
|
8280
8281
|
});
|
|
8281
8282
|
/**
|
|
8282
8283
|
* Add `execution_runs.subject_trigger_event`.
|
|
@@ -8295,7 +8296,7 @@ var _138_execution_runs_subject_trigger_event_exports = /* @__PURE__ */ __export
|
|
|
8295
8296
|
* policy pins. Idempotent.
|
|
8296
8297
|
*/
|
|
8297
8298
|
const COLUMN$1 = "subject_trigger_event";
|
|
8298
|
-
async function up$
|
|
8299
|
+
async function up$22(db) {
|
|
8299
8300
|
if ((await sql`
|
|
8300
8301
|
SELECT EXISTS (
|
|
8301
8302
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8309,7 +8310,7 @@ async function up$21(db) {
|
|
|
8309
8310
|
ADD COLUMN ${sql.raw(COLUMN$1)} TEXT
|
|
8310
8311
|
`.execute(db);
|
|
8311
8312
|
}
|
|
8312
|
-
async function down$
|
|
8313
|
+
async function down$22(db) {
|
|
8313
8314
|
await sql`
|
|
8314
8315
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS ${sql.raw(COLUMN$1)}
|
|
8315
8316
|
`.execute(db);
|
|
@@ -8317,8 +8318,8 @@ async function down$21(db) {
|
|
|
8317
8318
|
//#endregion
|
|
8318
8319
|
//#region src/db/migrations/139_admin_token_subject.ts
|
|
8319
8320
|
var _139_admin_token_subject_exports = /* @__PURE__ */ __exportAll({
|
|
8320
|
-
down: () => down$
|
|
8321
|
-
up: () => up$
|
|
8321
|
+
down: () => down$21,
|
|
8322
|
+
up: () => up$21
|
|
8322
8323
|
});
|
|
8323
8324
|
/**
|
|
8324
8325
|
* Add `admin_tokens.subject TEXT`, nullable.
|
|
@@ -8338,7 +8339,7 @@ var _139_admin_token_subject_exports = /* @__PURE__ */ __exportAll({
|
|
|
8338
8339
|
* recorded holder. Idempotent.
|
|
8339
8340
|
*/
|
|
8340
8341
|
const COLUMN = "subject";
|
|
8341
|
-
async function up$
|
|
8342
|
+
async function up$21(db) {
|
|
8342
8343
|
if ((await sql`
|
|
8343
8344
|
SELECT EXISTS (
|
|
8344
8345
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8352,7 +8353,7 @@ async function up$20(db) {
|
|
|
8352
8353
|
ADD COLUMN ${sql.raw(COLUMN)} TEXT
|
|
8353
8354
|
`.execute(db);
|
|
8354
8355
|
}
|
|
8355
|
-
async function down$
|
|
8356
|
+
async function down$21(db) {
|
|
8356
8357
|
await sql`
|
|
8357
8358
|
ALTER TABLE public.admin_tokens DROP COLUMN IF EXISTS ${sql.raw(COLUMN)}
|
|
8358
8359
|
`.execute(db);
|
|
@@ -8360,8 +8361,8 @@ async function down$20(db) {
|
|
|
8360
8361
|
//#endregion
|
|
8361
8362
|
//#region src/db/migrations/140_dispatch_queue_canonical_labels.ts
|
|
8362
8363
|
var _140_dispatch_queue_canonical_labels_exports = /* @__PURE__ */ __exportAll({
|
|
8363
|
-
down: () => down$
|
|
8364
|
-
up: () => up$
|
|
8364
|
+
down: () => down$20,
|
|
8365
|
+
up: () => up$20
|
|
8365
8366
|
});
|
|
8366
8367
|
/**
|
|
8367
8368
|
* The whitespace `btrim` strips, matching the `String.prototype.trim` that `canonicalizeLabel`
|
|
@@ -8399,7 +8400,7 @@ const TRIM_CHARS = String.raw`E' \t\n\r\f\x0B'`;
|
|
|
8399
8400
|
*
|
|
8400
8401
|
* Idempotent: each `UPDATE` selects only rows with a non-canonical element.
|
|
8401
8402
|
*/
|
|
8402
|
-
async function up$
|
|
8403
|
+
async function up$20(db) {
|
|
8403
8404
|
const trim = sql.raw(TRIM_CHARS);
|
|
8404
8405
|
await sql`
|
|
8405
8406
|
UPDATE public.dispatch_queue
|
|
@@ -8434,12 +8435,12 @@ async function up$19(db) {
|
|
|
8434
8435
|
* compares agent labels verbatim against canonicalized rows, so a fleet with non-lowercase
|
|
8435
8436
|
* labels strands those rows until they expire, drain, or are re-enqueued.
|
|
8436
8437
|
*/
|
|
8437
|
-
async function down$
|
|
8438
|
+
async function down$20() {}
|
|
8438
8439
|
//#endregion
|
|
8439
8440
|
//#region src/db/migrations/141_event_log_shed.ts
|
|
8440
8441
|
var _141_event_log_shed_exports = /* @__PURE__ */ __exportAll({
|
|
8441
|
-
down: () => down$
|
|
8442
|
-
up: () => up$
|
|
8442
|
+
down: () => down$19,
|
|
8443
|
+
up: () => up$19
|
|
8443
8444
|
});
|
|
8444
8445
|
/**
|
|
8445
8446
|
* Extend the event_log.status CHECK constraint with 'shed' so the orchestrator
|
|
@@ -8452,7 +8453,7 @@ var _141_event_log_shed_exports = /* @__PURE__ */ __exportAll({
|
|
|
8452
8453
|
*
|
|
8453
8454
|
* Idempotent: the DROP ... IF EXISTS / re-ADD pair re-runs cleanly.
|
|
8454
8455
|
*/
|
|
8455
|
-
async function up$
|
|
8456
|
+
async function up$19(db) {
|
|
8456
8457
|
await sql`ALTER TABLE event_log DROP CONSTRAINT IF EXISTS event_log_status_check`.execute(db);
|
|
8457
8458
|
await sql`
|
|
8458
8459
|
ALTER TABLE event_log ADD CONSTRAINT event_log_status_check
|
|
@@ -8462,7 +8463,7 @@ async function up$18(db) {
|
|
|
8462
8463
|
])))
|
|
8463
8464
|
`.execute(db);
|
|
8464
8465
|
}
|
|
8465
|
-
async function down$
|
|
8466
|
+
async function down$19(db) {
|
|
8466
8467
|
await sql`ALTER TABLE event_log DROP CONSTRAINT IF EXISTS event_log_status_check`.execute(db);
|
|
8467
8468
|
await sql`
|
|
8468
8469
|
ALTER TABLE event_log ADD CONSTRAINT event_log_status_check
|
|
@@ -8475,8 +8476,8 @@ async function down$18(db) {
|
|
|
8475
8476
|
//#endregion
|
|
8476
8477
|
//#region src/db/migrations/142_sweep_deprecated_columns.ts
|
|
8477
8478
|
var _142_sweep_deprecated_columns_exports = /* @__PURE__ */ __exportAll({
|
|
8478
|
-
down: () => down$
|
|
8479
|
-
up: () => up$
|
|
8479
|
+
down: () => down$18,
|
|
8480
|
+
up: () => up$18
|
|
8480
8481
|
});
|
|
8481
8482
|
/**
|
|
8482
8483
|
* Sweep the columns and stored values no code path reads or writes. Data first, then schema:
|
|
@@ -8497,7 +8498,7 @@ var _142_sweep_deprecated_columns_exports = /* @__PURE__ */ __exportAll({
|
|
|
8497
8498
|
* Idempotent: every UPDATE matches nothing on a re-run and every DROP is IF EXISTS.
|
|
8498
8499
|
*/
|
|
8499
8500
|
const BATCH_SIZE$1 = 5e3;
|
|
8500
|
-
async function up$
|
|
8501
|
+
async function up$18(db) {
|
|
8501
8502
|
for (;;) if (((await sql`
|
|
8502
8503
|
UPDATE public.execution_runs
|
|
8503
8504
|
SET trust_tier = 'unknown'
|
|
@@ -8523,12 +8524,12 @@ async function up$17(db) {
|
|
|
8523
8524
|
await sql`ALTER TABLE public.org_trust_policy DROP COLUMN IF EXISTS workflow_change_policy`.execute(db);
|
|
8524
8525
|
await sql`ALTER TABLE public.dispatch_queue DROP COLUMN IF EXISTS source_tar_hash`.execute(db);
|
|
8525
8526
|
}
|
|
8526
|
-
async function down$
|
|
8527
|
+
async function down$18() {}
|
|
8527
8528
|
//#endregion
|
|
8528
8529
|
//#region src/db/migrations/143_execution_jobs_precursor_result.ts
|
|
8529
8530
|
var _143_execution_jobs_precursor_result_exports = /* @__PURE__ */ __exportAll({
|
|
8530
|
-
down: () => down$
|
|
8531
|
-
up: () => up$
|
|
8531
|
+
down: () => down$17,
|
|
8532
|
+
up: () => up$17
|
|
8532
8533
|
});
|
|
8533
8534
|
/**
|
|
8534
8535
|
* Add `execution_jobs.precursor_result`: the payload a precursor job (source-pack build, init,
|
|
@@ -8543,7 +8544,7 @@ var _143_execution_jobs_precursor_result_exports = /* @__PURE__ */ __exportAll({
|
|
|
8543
8544
|
* Nullable, no default: NULL means "no precursor payload" (every ordinary job and older row).
|
|
8544
8545
|
* Idempotent.
|
|
8545
8546
|
*/
|
|
8546
|
-
async function up$
|
|
8547
|
+
async function up$17(db) {
|
|
8547
8548
|
if ((await sql`
|
|
8548
8549
|
SELECT EXISTS (
|
|
8549
8550
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8557,7 +8558,7 @@ async function up$16(db) {
|
|
|
8557
8558
|
ADD COLUMN precursor_result JSONB
|
|
8558
8559
|
`.execute(db);
|
|
8559
8560
|
}
|
|
8560
|
-
async function down$
|
|
8561
|
+
async function down$17(db) {
|
|
8561
8562
|
await sql`
|
|
8562
8563
|
ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS precursor_result
|
|
8563
8564
|
`.execute(db);
|
|
@@ -8565,8 +8566,8 @@ async function down$16(db) {
|
|
|
8565
8566
|
//#endregion
|
|
8566
8567
|
//#region src/db/migrations/144_execution_runs_registration_window.ts
|
|
8567
8568
|
var _144_execution_runs_registration_window_exports = /* @__PURE__ */ __exportAll({
|
|
8568
|
-
down: () => down$
|
|
8569
|
-
up: () => up$
|
|
8569
|
+
down: () => down$16,
|
|
8570
|
+
up: () => up$16
|
|
8570
8571
|
});
|
|
8571
8572
|
/**
|
|
8572
8573
|
* Add `execution_runs.registration_window_instance_id TEXT NULL` — the
|
|
@@ -8588,7 +8589,7 @@ var _144_execution_runs_registration_window_exports = /* @__PURE__ */ __exportAl
|
|
|
8588
8589
|
*
|
|
8589
8590
|
* Idempotent: the add is guarded on existence and the drop uses IF EXISTS.
|
|
8590
8591
|
*/
|
|
8591
|
-
async function up$
|
|
8592
|
+
async function up$16(db) {
|
|
8592
8593
|
if ((await sql`
|
|
8593
8594
|
SELECT EXISTS (
|
|
8594
8595
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8602,7 +8603,7 @@ async function up$15(db) {
|
|
|
8602
8603
|
ADD COLUMN registration_window_instance_id TEXT
|
|
8603
8604
|
`.execute(db);
|
|
8604
8605
|
}
|
|
8605
|
-
async function down$
|
|
8606
|
+
async function down$16(db) {
|
|
8606
8607
|
await sql`
|
|
8607
8608
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS registration_window_instance_id
|
|
8608
8609
|
`.execute(db);
|
|
@@ -8610,8 +8611,8 @@ async function down$15(db) {
|
|
|
8610
8611
|
//#endregion
|
|
8611
8612
|
//#region src/db/migrations/145_execution_runs_workflow_provenance.ts
|
|
8612
8613
|
var _145_execution_runs_workflow_provenance_exports = /* @__PURE__ */ __exportAll({
|
|
8613
|
-
down: () => down$
|
|
8614
|
-
up: () => up$
|
|
8614
|
+
down: () => down$15,
|
|
8615
|
+
up: () => up$15
|
|
8615
8616
|
});
|
|
8616
8617
|
/**
|
|
8617
8618
|
* Record the workflow repository's commit and registered branch for a run whose
|
|
@@ -8638,19 +8639,19 @@ async function colExists$4(db, name) {
|
|
|
8638
8639
|
) AS exists
|
|
8639
8640
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8640
8641
|
}
|
|
8641
|
-
async function up$
|
|
8642
|
+
async function up$15(db) {
|
|
8642
8643
|
if (!await colExists$4(db, "workflow_sha")) await sql`ALTER TABLE public.execution_runs ADD COLUMN workflow_sha text`.execute(db);
|
|
8643
8644
|
if (!await colExists$4(db, "workflow_branch")) await sql`ALTER TABLE public.execution_runs ADD COLUMN workflow_branch text`.execute(db);
|
|
8644
8645
|
}
|
|
8645
|
-
async function down$
|
|
8646
|
+
async function down$15(db) {
|
|
8646
8647
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS workflow_branch`.execute(db);
|
|
8647
8648
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS workflow_sha`.execute(db);
|
|
8648
8649
|
}
|
|
8649
8650
|
//#endregion
|
|
8650
8651
|
//#region src/db/migrations/146_pending_job_contexts_context_resolution.ts
|
|
8651
8652
|
var _146_pending_job_contexts_context_resolution_exports = /* @__PURE__ */ __exportAll({
|
|
8652
|
-
down: () => down$
|
|
8653
|
-
up: () => up$
|
|
8653
|
+
down: () => down$14,
|
|
8654
|
+
up: () => up$14
|
|
8654
8655
|
});
|
|
8655
8656
|
/**
|
|
8656
8657
|
* Record, with a held job's pending dispatch context, what the release path
|
|
@@ -8676,18 +8677,18 @@ async function colExists$3(db) {
|
|
|
8676
8677
|
) AS exists
|
|
8677
8678
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8678
8679
|
}
|
|
8679
|
-
async function up$
|
|
8680
|
+
async function up$14(db) {
|
|
8680
8681
|
if (!await colExists$3(db)) await sql`ALTER TABLE public.pending_job_contexts ADD COLUMN context_resolution jsonb`.execute(db);
|
|
8681
8682
|
}
|
|
8682
|
-
async function down$
|
|
8683
|
+
async function down$14(db) {
|
|
8683
8684
|
await sql`ALTER TABLE public.pending_job_contexts DROP COLUMN IF EXISTS context_resolution`.execute(db);
|
|
8684
8685
|
}
|
|
8685
8686
|
//#endregion
|
|
8686
8687
|
//#region src/db/migrations/147_sealed_job_secrets.ts
|
|
8687
8688
|
var _147_sealed_job_secrets_exports = /* @__PURE__ */ __exportAll({
|
|
8688
8689
|
SEALED_SECRETS_TABLES: () => SEALED_SECRETS_TABLES,
|
|
8689
|
-
down: () => down$
|
|
8690
|
-
up: () => up$
|
|
8690
|
+
down: () => down$13,
|
|
8691
|
+
up: () => up$13
|
|
8691
8692
|
});
|
|
8692
8693
|
/**
|
|
8693
8694
|
* `sealed_secrets` holds a stored job's secret fields under the orchestrator master key, beside
|
|
@@ -8714,17 +8715,17 @@ async function colExists$2(db, table) {
|
|
|
8714
8715
|
) AS exists
|
|
8715
8716
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8716
8717
|
}
|
|
8717
|
-
async function up$
|
|
8718
|
+
async function up$13(db) {
|
|
8718
8719
|
for (const table of SEALED_SECRETS_TABLES) if (!await colExists$2(db, table)) await sql`ALTER TABLE ${sql.table(`public.${table}`)} ADD COLUMN sealed_secrets text`.execute(db);
|
|
8719
8720
|
}
|
|
8720
|
-
async function down$
|
|
8721
|
+
async function down$13(db) {
|
|
8721
8722
|
for (const table of SEALED_SECRETS_TABLES) await sql`ALTER TABLE ${sql.table(`public.${table}`)} DROP COLUMN IF EXISTS sealed_secrets`.execute(db);
|
|
8722
8723
|
}
|
|
8723
8724
|
//#endregion
|
|
8724
8725
|
//#region src/db/migrations/148_cluster_settings_sealed_secrets_retry_backoff_ms.ts
|
|
8725
8726
|
var _148_cluster_settings_sealed_secrets_retry_backoff_ms_exports = /* @__PURE__ */ __exportAll({
|
|
8726
|
-
down: () => down$
|
|
8727
|
-
up: () => up$
|
|
8727
|
+
down: () => down$12,
|
|
8728
|
+
up: () => up$12
|
|
8728
8729
|
});
|
|
8729
8730
|
/**
|
|
8730
8731
|
* How long a coordinator leaves a queued job alone after failing to open its sealed secrets
|
|
@@ -8737,7 +8738,7 @@ var _148_cluster_settings_sealed_secrets_retry_backoff_ms_exports = /* @__PURE__
|
|
|
8737
8738
|
*
|
|
8738
8739
|
* Idempotent: guarded on column existence.
|
|
8739
8740
|
*/
|
|
8740
|
-
async function up$
|
|
8741
|
+
async function up$12(db) {
|
|
8741
8742
|
if ((await sql`
|
|
8742
8743
|
SELECT EXISTS (
|
|
8743
8744
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8748,14 +8749,14 @@ async function up$11(db) {
|
|
|
8748
8749
|
`.execute(db)).rows[0]?.exists) return;
|
|
8749
8750
|
await sql`ALTER TABLE public.cluster_settings ADD COLUMN sealed_secrets_retry_backoff_ms BIGINT`.execute(db);
|
|
8750
8751
|
}
|
|
8751
|
-
async function down$
|
|
8752
|
+
async function down$12(db) {
|
|
8752
8753
|
await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS sealed_secrets_retry_backoff_ms`.execute(db);
|
|
8753
8754
|
}
|
|
8754
8755
|
//#endregion
|
|
8755
8756
|
//#region src/db/migrations/149_workflow_registrations_dep_cache_key.ts
|
|
8756
8757
|
var _149_workflow_registrations_dep_cache_key_exports = /* @__PURE__ */ __exportAll({
|
|
8757
|
-
down: () => down$
|
|
8758
|
-
up: () => up$
|
|
8758
|
+
down: () => down$11,
|
|
8759
|
+
up: () => up$11
|
|
8759
8760
|
});
|
|
8760
8761
|
/**
|
|
8761
8762
|
* The registering lock file's dependency-cache key: `lockfile_hash` (`lockfileHash`, the
|
|
@@ -8779,19 +8780,19 @@ async function colExists$1(db, name) {
|
|
|
8779
8780
|
) AS exists
|
|
8780
8781
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8781
8782
|
}
|
|
8782
|
-
async function up$
|
|
8783
|
+
async function up$11(db) {
|
|
8783
8784
|
if (!await colExists$1(db, "lockfile_hash")) await sql`ALTER TABLE public.workflow_registrations ADD COLUMN lockfile_hash text`.execute(db);
|
|
8784
8785
|
if (!await colExists$1(db, "siblings_digest")) await sql`ALTER TABLE public.workflow_registrations ADD COLUMN siblings_digest text`.execute(db);
|
|
8785
8786
|
}
|
|
8786
|
-
async function down$
|
|
8787
|
+
async function down$11(db) {
|
|
8787
8788
|
await sql`ALTER TABLE public.workflow_registrations DROP COLUMN IF EXISTS siblings_digest`.execute(db);
|
|
8788
8789
|
await sql`ALTER TABLE public.workflow_registrations DROP COLUMN IF EXISTS lockfile_hash`.execute(db);
|
|
8789
8790
|
}
|
|
8790
8791
|
//#endregion
|
|
8791
8792
|
//#region src/db/migrations/150_execution_runs_status_epoch.ts
|
|
8792
8793
|
var _150_execution_runs_status_epoch_exports = /* @__PURE__ */ __exportAll({
|
|
8793
|
-
down: () => down$
|
|
8794
|
-
up: () => up$
|
|
8794
|
+
down: () => down$10,
|
|
8795
|
+
up: () => up$10
|
|
8795
8796
|
});
|
|
8796
8797
|
/**
|
|
8797
8798
|
* Add `execution_runs.status_epoch`: the run's status generation. The tracker raises it each time
|
|
@@ -8802,7 +8803,7 @@ var _150_execution_runs_status_epoch_exports = /* @__PURE__ */ __exportAll({
|
|
|
8802
8803
|
* The constant default 0 adds the column without a table rewrite; no existing row was reopened
|
|
8803
8804
|
* under this counter. Idempotent.
|
|
8804
8805
|
*/
|
|
8805
|
-
async function up$
|
|
8806
|
+
async function up$10(db) {
|
|
8806
8807
|
if ((await sql`
|
|
8807
8808
|
SELECT EXISTS (
|
|
8808
8809
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8813,14 +8814,14 @@ async function up$9(db) {
|
|
|
8813
8814
|
`.execute(db)).rows[0]?.exists) return;
|
|
8814
8815
|
await sql`ALTER TABLE public.execution_runs ADD COLUMN status_epoch INTEGER NOT NULL DEFAULT 0`.execute(db);
|
|
8815
8816
|
}
|
|
8816
|
-
async function down$
|
|
8817
|
+
async function down$10(db) {
|
|
8817
8818
|
await sql`ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS status_epoch`.execute(db);
|
|
8818
8819
|
}
|
|
8819
8820
|
//#endregion
|
|
8820
8821
|
//#region src/db/migrations/151_workflow_registrations_dep_cache_key_sha.ts
|
|
8821
8822
|
var _151_workflow_registrations_dep_cache_key_sha_exports = /* @__PURE__ */ __exportAll({
|
|
8822
|
-
down: () => down$
|
|
8823
|
-
up: () => up$
|
|
8823
|
+
down: () => down$9,
|
|
8824
|
+
up: () => up$9
|
|
8824
8825
|
});
|
|
8825
8826
|
/**
|
|
8826
8827
|
* `dep_cache_key_sha`: the `commit_sha` stored with `lockfile_hash` and `siblings_digest`. A run
|
|
@@ -8844,18 +8845,18 @@ async function colExists(db) {
|
|
|
8844
8845
|
) AS exists
|
|
8845
8846
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
8846
8847
|
}
|
|
8847
|
-
async function up$
|
|
8848
|
+
async function up$9(db) {
|
|
8848
8849
|
if (await colExists(db)) return;
|
|
8849
8850
|
await sql`ALTER TABLE public.workflow_registrations ADD COLUMN dep_cache_key_sha text`.execute(db);
|
|
8850
8851
|
}
|
|
8851
|
-
async function down$
|
|
8852
|
+
async function down$9(db) {
|
|
8852
8853
|
await sql`ALTER TABLE public.workflow_registrations DROP COLUMN IF EXISTS dep_cache_key_sha`.execute(db);
|
|
8853
8854
|
}
|
|
8854
8855
|
//#endregion
|
|
8855
8856
|
//#region src/db/migrations/152_org_settings_cache_upload_settle_timeout.ts
|
|
8856
8857
|
var _152_org_settings_cache_upload_settle_timeout_exports = /* @__PURE__ */ __exportAll({
|
|
8857
|
-
down: () => down$
|
|
8858
|
-
up: () => up$
|
|
8858
|
+
down: () => down$8,
|
|
8859
|
+
up: () => up$8
|
|
8859
8860
|
});
|
|
8860
8861
|
/**
|
|
8861
8862
|
* Per-org bound on how long a build job's `job.status success` waits for the cache publish
|
|
@@ -8865,7 +8866,7 @@ var _152_org_settings_cache_upload_settle_timeout_exports = /* @__PURE__ */ __ex
|
|
|
8865
8866
|
*
|
|
8866
8867
|
* Idempotent.
|
|
8867
8868
|
*/
|
|
8868
|
-
async function up$
|
|
8869
|
+
async function up$8(db) {
|
|
8869
8870
|
if ((await sql`
|
|
8870
8871
|
SELECT EXISTS (
|
|
8871
8872
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8879,7 +8880,7 @@ async function up$7(db) {
|
|
|
8879
8880
|
ADD COLUMN cache_upload_settle_timeout_ms BIGINT
|
|
8880
8881
|
`.execute(db);
|
|
8881
8882
|
}
|
|
8882
|
-
async function down$
|
|
8883
|
+
async function down$8(db) {
|
|
8883
8884
|
await sql`
|
|
8884
8885
|
ALTER TABLE public.org_settings DROP COLUMN IF EXISTS cache_upload_settle_timeout_ms
|
|
8885
8886
|
`.execute(db);
|
|
@@ -8887,8 +8888,8 @@ async function down$7(db) {
|
|
|
8887
8888
|
//#endregion
|
|
8888
8889
|
//#region src/db/migrations/153_execution_runs_cancel_force.ts
|
|
8889
8890
|
var _153_execution_runs_cancel_force_exports = /* @__PURE__ */ __exportAll({
|
|
8890
|
-
down: () => down$
|
|
8891
|
-
up: () => up$
|
|
8891
|
+
down: () => down$7,
|
|
8892
|
+
up: () => up$7
|
|
8892
8893
|
});
|
|
8893
8894
|
/**
|
|
8894
8895
|
* Add `execution_runs.cancel_force BOOLEAN` (nullable, no default).
|
|
@@ -8902,7 +8903,7 @@ var _153_execution_runs_cancel_force_exports = /* @__PURE__ */ __exportAll({
|
|
|
8902
8903
|
*
|
|
8903
8904
|
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
8904
8905
|
*/
|
|
8905
|
-
async function up$
|
|
8906
|
+
async function up$7(db) {
|
|
8906
8907
|
if ((await sql`
|
|
8907
8908
|
SELECT EXISTS (
|
|
8908
8909
|
SELECT 1 FROM information_schema.columns
|
|
@@ -8916,7 +8917,7 @@ async function up$6(db) {
|
|
|
8916
8917
|
ADD COLUMN cancel_force BOOLEAN
|
|
8917
8918
|
`.execute(db);
|
|
8918
8919
|
}
|
|
8919
|
-
async function down$
|
|
8920
|
+
async function down$7(db) {
|
|
8920
8921
|
await sql`
|
|
8921
8922
|
ALTER TABLE public.execution_runs DROP COLUMN IF EXISTS cancel_force
|
|
8922
8923
|
`.execute(db);
|
|
@@ -8924,8 +8925,8 @@ async function down$6(db) {
|
|
|
8924
8925
|
//#endregion
|
|
8925
8926
|
//#region src/db/migrations/154_cluster_settings_firecracker_api_socket_wait.ts
|
|
8926
8927
|
var _154_cluster_settings_firecracker_api_socket_wait_exports = /* @__PURE__ */ __exportAll({
|
|
8927
|
-
down: () => down$
|
|
8928
|
-
up: () => up$
|
|
8928
|
+
down: () => down$6,
|
|
8929
|
+
up: () => up$6
|
|
8929
8930
|
});
|
|
8930
8931
|
/**
|
|
8931
8932
|
* Cluster-global wait for a Firecracker VM's API socket after the jailer starts.
|
|
@@ -8947,17 +8948,17 @@ async function columnExists$1(db, table, column) {
|
|
|
8947
8948
|
`.execute(db)).rows[0]?.exists === true;
|
|
8948
8949
|
}
|
|
8949
8950
|
const COLUMNS = ["firecracker_api_socket_wait_ms"];
|
|
8950
|
-
async function up$
|
|
8951
|
+
async function up$6(db) {
|
|
8951
8952
|
for (const column of COLUMNS) if (!await columnExists$1(db, "cluster_settings", column)) await sql`ALTER TABLE public.cluster_settings ADD COLUMN ${sql.ref(column)} BIGINT`.execute(db);
|
|
8952
8953
|
}
|
|
8953
|
-
async function down$
|
|
8954
|
+
async function down$6(db) {
|
|
8954
8955
|
for (const column of COLUMNS) await sql`ALTER TABLE public.cluster_settings DROP COLUMN IF EXISTS ${sql.ref(column)}`.execute(db);
|
|
8955
8956
|
}
|
|
8956
8957
|
//#endregion
|
|
8957
8958
|
//#region src/db/migrations/155_org_settings_reroute_spawn_retry.ts
|
|
8958
8959
|
var _155_org_settings_reroute_spawn_retry_exports = /* @__PURE__ */ __exportAll({
|
|
8959
|
-
down: () => down$
|
|
8960
|
-
up: () => up$
|
|
8960
|
+
down: () => down$5,
|
|
8961
|
+
up: () => up$5
|
|
8961
8962
|
});
|
|
8962
8963
|
/**
|
|
8963
8964
|
* Add the two per-org spawn-retry columns a worker applies to a rerouted job (both nullable):
|
|
@@ -8972,11 +8973,11 @@ var _155_org_settings_reroute_spawn_retry_exports = /* @__PURE__ */ __exportAll(
|
|
|
8972
8973
|
*
|
|
8973
8974
|
* Idempotent: each add is guarded on column existence.
|
|
8974
8975
|
*/
|
|
8975
|
-
async function up$
|
|
8976
|
+
async function up$5(db) {
|
|
8976
8977
|
await addColumnIfMissing(db, "reroute_spawn_max_attempts", "INTEGER");
|
|
8977
8978
|
await addColumnIfMissing(db, "reroute_spawn_retry_backoff_ms", "BIGINT");
|
|
8978
8979
|
}
|
|
8979
|
-
async function down$
|
|
8980
|
+
async function down$5(db) {
|
|
8980
8981
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS reroute_spawn_max_attempts`.execute(db);
|
|
8981
8982
|
await sql`ALTER TABLE public.org_settings DROP COLUMN IF EXISTS reroute_spawn_retry_backoff_ms`.execute(db);
|
|
8982
8983
|
}
|
|
@@ -8994,8 +8995,8 @@ async function addColumnIfMissing(db, column, type) {
|
|
|
8994
8995
|
//#endregion
|
|
8995
8996
|
//#region src/db/migrations/156_kici_events_match_outcome.ts
|
|
8996
8997
|
var _156_kici_events_match_outcome_exports = /* @__PURE__ */ __exportAll({
|
|
8997
|
-
down: () => down$
|
|
8998
|
-
up: () => up$
|
|
8998
|
+
down: () => down$4,
|
|
8999
|
+
up: () => up$4
|
|
8999
9000
|
});
|
|
9000
9001
|
/**
|
|
9001
9002
|
* Record how the event router resolved each internal event:
|
|
@@ -9010,12 +9011,12 @@ var _156_kici_events_match_outcome_exports = /* @__PURE__ */ __exportAll({
|
|
|
9010
9011
|
*
|
|
9011
9012
|
* Idempotent: `ADD COLUMN IF NOT EXISTS`.
|
|
9012
9013
|
*/
|
|
9013
|
-
async function up$
|
|
9014
|
+
async function up$4(db) {
|
|
9014
9015
|
await sql`ALTER TABLE public.kici_events
|
|
9015
9016
|
ADD COLUMN IF NOT EXISTS match_outcome TEXT,
|
|
9016
9017
|
ADD COLUMN IF NOT EXISTS matched_count INTEGER`.execute(db);
|
|
9017
9018
|
}
|
|
9018
|
-
async function down$
|
|
9019
|
+
async function down$4(db) {
|
|
9019
9020
|
await sql`ALTER TABLE public.kici_events
|
|
9020
9021
|
DROP COLUMN IF EXISTS match_outcome,
|
|
9021
9022
|
DROP COLUMN IF EXISTS matched_count`.execute(db);
|
|
@@ -9023,8 +9024,8 @@ async function down$3(db) {
|
|
|
9023
9024
|
//#endregion
|
|
9024
9025
|
//#region src/db/migrations/157_host_roster_identity_source.ts
|
|
9025
9026
|
var _157_host_roster_identity_source_exports = /* @__PURE__ */ __exportAll({
|
|
9026
|
-
down: () => down$
|
|
9027
|
-
up: () => up$
|
|
9027
|
+
down: () => down$3,
|
|
9028
|
+
up: () => up$3
|
|
9028
9029
|
});
|
|
9029
9030
|
/**
|
|
9030
9031
|
* `host_roster.identity_source` (`agent` | `operator` | `platform`): who last set a host's
|
|
@@ -9039,7 +9040,7 @@ var _157_host_roster_identity_source_exports = /* @__PURE__ */ __exportAll({
|
|
|
9039
9040
|
*
|
|
9040
9041
|
* Idempotent.
|
|
9041
9042
|
*/
|
|
9042
|
-
async function up$
|
|
9043
|
+
async function up$3(db) {
|
|
9043
9044
|
if ((await sql`
|
|
9044
9045
|
SELECT EXISTS (
|
|
9045
9046
|
SELECT 1 FROM information_schema.columns
|
|
@@ -9058,14 +9059,14 @@ async function up$2(db) {
|
|
|
9058
9059
|
UPDATE public.host_roster SET identity_source = 'agent' WHERE platform IS NOT NULL
|
|
9059
9060
|
`.execute(db);
|
|
9060
9061
|
}
|
|
9061
|
-
async function down$
|
|
9062
|
+
async function down$3(db) {
|
|
9062
9063
|
await sql`ALTER TABLE public.host_roster DROP COLUMN IF EXISTS identity_source`.execute(db);
|
|
9063
9064
|
}
|
|
9064
9065
|
//#endregion
|
|
9065
9066
|
//#region src/db/migrations/158_normalize_legacy_values.ts
|
|
9066
9067
|
var _158_normalize_legacy_values_exports = /* @__PURE__ */ __exportAll({
|
|
9067
|
-
down: () => down$
|
|
9068
|
-
up: () => up$
|
|
9068
|
+
down: () => down$2,
|
|
9069
|
+
up: () => up$2
|
|
9069
9070
|
});
|
|
9070
9071
|
/**
|
|
9071
9072
|
* Rewrite every stored legacy value the readers no longer accept, then drop
|
|
@@ -9108,7 +9109,7 @@ async function columnExists(db, table, column) {
|
|
|
9108
9109
|
) AS exists
|
|
9109
9110
|
`.execute(db)).rows[0]?.exists ?? false;
|
|
9110
9111
|
}
|
|
9111
|
-
async function up$
|
|
9112
|
+
async function up$2(db) {
|
|
9112
9113
|
await sql`UPDATE public.held_runs SET hold_type = 'reviewer' WHERE hold_type = 'approval'`.execute(db);
|
|
9113
9114
|
await sql`UPDATE public.held_runs SET hold_type = 'timer' WHERE hold_type = 'wait_timer'`.execute(db);
|
|
9114
9115
|
for (const table of STATUS_TABLES) {
|
|
@@ -9126,12 +9127,12 @@ async function up$1(db) {
|
|
|
9126
9127
|
await sql`ALTER TABLE public.org_trust_policy ALTER COLUMN approval_expiry_seconds SET NOT NULL`.execute(db);
|
|
9127
9128
|
await sql`ALTER TABLE public.org_trust_policy DROP COLUMN IF EXISTS approval_expiry_hours`.execute(db);
|
|
9128
9129
|
}
|
|
9129
|
-
async function down$
|
|
9130
|
+
async function down$2() {}
|
|
9130
9131
|
//#endregion
|
|
9131
9132
|
//#region src/db/migrations/159_org_id_widen_to_source_width.ts
|
|
9132
9133
|
var _159_org_id_widen_to_source_width_exports = /* @__PURE__ */ __exportAll({
|
|
9133
|
-
down: () => down,
|
|
9134
|
-
up: () => up
|
|
9134
|
+
down: () => down$1,
|
|
9135
|
+
up: () => up$1
|
|
9135
9136
|
});
|
|
9136
9137
|
/**
|
|
9137
9138
|
* Widen every `org_id varchar(16)` column to `varchar(255)`, the width of the `customer_id`
|
|
@@ -9158,14 +9159,40 @@ const ORG_ID_TABLES$1 = [
|
|
|
9158
9159
|
"held_runs",
|
|
9159
9160
|
"scoped_secrets"
|
|
9160
9161
|
];
|
|
9161
|
-
async function up(db) {
|
|
9162
|
+
async function up$1(db) {
|
|
9162
9163
|
for (const table of ORG_ID_TABLES$1) await sql.raw(`ALTER TABLE public.${table} ALTER COLUMN org_id TYPE varchar(255)`).execute(db);
|
|
9163
9164
|
}
|
|
9164
9165
|
/** Fails when a row holds an org id longer than 16 characters, rather than truncating it. */
|
|
9165
|
-
async function down(db) {
|
|
9166
|
+
async function down$1(db) {
|
|
9166
9167
|
for (const table of ORG_ID_TABLES$1) await sql.raw(`ALTER TABLE public.${table} ALTER COLUMN org_id TYPE varchar(16)`).execute(db);
|
|
9167
9168
|
}
|
|
9168
9169
|
//#endregion
|
|
9170
|
+
//#region src/db/migrations/160_execution_jobs_workflow_name.ts
|
|
9171
|
+
var _160_execution_jobs_workflow_name_exports = /* @__PURE__ */ __exportAll({
|
|
9172
|
+
down: () => down,
|
|
9173
|
+
up: () => up
|
|
9174
|
+
});
|
|
9175
|
+
/**
|
|
9176
|
+
* `execution_jobs.workflow_name`: the workflow that defines the job. A fixture
|
|
9177
|
+
* run with no `--workflow` runs every matched workflow under one run id, so
|
|
9178
|
+
* `execution_runs.workflow_name` (the first matched workflow) does not say
|
|
9179
|
+
* which workflow a job belongs to.
|
|
9180
|
+
*
|
|
9181
|
+
* Nullable, with no backfill: a row written before this column reads as
|
|
9182
|
+
* unknown, and the readers fall back to the run's workflow for a run that can
|
|
9183
|
+
* span only one.
|
|
9184
|
+
*
|
|
9185
|
+
* Idempotent.
|
|
9186
|
+
*/
|
|
9187
|
+
async function up(db) {
|
|
9188
|
+
await sql`
|
|
9189
|
+
ALTER TABLE public.execution_jobs ADD COLUMN IF NOT EXISTS workflow_name text
|
|
9190
|
+
`.execute(db);
|
|
9191
|
+
}
|
|
9192
|
+
async function down(db) {
|
|
9193
|
+
await sql`ALTER TABLE public.execution_jobs DROP COLUMN IF EXISTS workflow_name`.execute(db);
|
|
9194
|
+
}
|
|
9195
|
+
//#endregion
|
|
9169
9196
|
//#region src/db/migration-provider.ts
|
|
9170
9197
|
function createMigrationProvider() {
|
|
9171
9198
|
return { async getMigrations() {
|
|
@@ -9328,7 +9355,8 @@ function createMigrationProvider() {
|
|
|
9328
9355
|
"156_kici_events_match_outcome": _156_kici_events_match_outcome_exports,
|
|
9329
9356
|
"157_host_roster_identity_source": _157_host_roster_identity_source_exports,
|
|
9330
9357
|
"158_normalize_legacy_values": _158_normalize_legacy_values_exports,
|
|
9331
|
-
"159_org_id_widen_to_source_width": _159_org_id_widen_to_source_width_exports
|
|
9358
|
+
"159_org_id_widen_to_source_width": _159_org_id_widen_to_source_width_exports,
|
|
9359
|
+
"160_execution_jobs_workflow_name": _160_execution_jobs_workflow_name_exports
|
|
9332
9360
|
};
|
|
9333
9361
|
} };
|
|
9334
9362
|
}
|
|
@@ -11162,6 +11190,11 @@ const SCHEMA_SNAPSHOT = {
|
|
|
11162
11190
|
nullable: true,
|
|
11163
11191
|
default: null
|
|
11164
11192
|
},
|
|
11193
|
+
"execution_jobs.workflow_name": {
|
|
11194
|
+
type: "text",
|
|
11195
|
+
nullable: true,
|
|
11196
|
+
default: null
|
|
11197
|
+
},
|
|
11165
11198
|
"execution_runs.archive_object_key": {
|
|
11166
11199
|
type: "text",
|
|
11167
11200
|
nullable: true,
|
|
@@ -18769,8 +18802,10 @@ function renderSourceListText(githubSources, genericSources, hasOrg, opts) {
|
|
|
18769
18802
|
console.log("Tip: use --org <orgId> to also list generic sources.");
|
|
18770
18803
|
}
|
|
18771
18804
|
}
|
|
18772
|
-
/**
|
|
18773
|
-
|
|
18805
|
+
/** Mirrors the kici-admin global `--url`: KICI_ADMIN_URL, read at parse time, else the default. */
|
|
18806
|
+
function baseUrlOption() {
|
|
18807
|
+
return new Option("--base-url <url>", "Orchestrator base URL").env("KICI_ADMIN_URL").default(DEFAULT_ADMIN_URL);
|
|
18808
|
+
}
|
|
18774
18809
|
/** Null when the row is not a valid local source. */
|
|
18775
18810
|
function parseLocalConfig(s) {
|
|
18776
18811
|
if (s.provider_type !== "local" || !s.git_config) return null;
|
|
@@ -19382,7 +19417,7 @@ function registerSourceCommands(program, getClient) {
|
|
|
19382
19417
|
await getClient().disableGenericSource(id);
|
|
19383
19418
|
console.log(`Generic source disabled: ${id}`);
|
|
19384
19419
|
}));
|
|
19385
|
-
src.command("trigger-local <id>").description("Trigger a run against a local source (reads HEAD when --ref/--sha omitted)").option("--event <event>", "push | pull_request", "push").option("--ref <ref>", "Git ref (default: repo HEAD branch)").option("--sha <sha>", "Commit SHA (default: repo HEAD)").option("--before <sha>", "Commit before the push; the changed files are before..sha (default: parent of --sha)").option("--repo-full-name <name>", "owner/name identifier used in the payload", "local/repo").
|
|
19420
|
+
src.command("trigger-local <id>").description("Trigger a run against a local source (reads HEAD when --ref/--sha omitted)").option("--event <event>", "push | pull_request", "push").option("--ref <ref>", "Git ref (default: repo HEAD branch)").option("--sha <sha>", "Commit SHA (default: repo HEAD)").option("--before <sha>", "Commit before the push; the changed files are before..sha (default: parent of --sha)").option("--repo-full-name <name>", "owner/name identifier used in the payload", "local/repo").addOption(baseUrlOption()).action(cliAction(async (id, opts) => {
|
|
19386
19421
|
const { source } = await getClient().getGenericSource(id);
|
|
19387
19422
|
const cfg = parseLocalConfig(source);
|
|
19388
19423
|
if (!cfg) {
|
|
@@ -19409,7 +19444,7 @@ function registerSourceCommands(program, getClient) {
|
|
|
19409
19444
|
console.log(`Triggered local source ${id}: HTTP ${status}`);
|
|
19410
19445
|
if (status >= 400) process.exit(1);
|
|
19411
19446
|
}));
|
|
19412
|
-
src.command("install-hook <id>").description("Install a post-receive hook in the local source repo that triggers runs on push").option("--repo <path>", "Repo path (default: the source repoBasePath)").
|
|
19447
|
+
src.command("install-hook <id>").description("Install a post-receive hook in the local source repo that triggers runs on push").option("--repo <path>", "Repo path (default: the source repoBasePath)").addOption(baseUrlOption()).action(cliAction(async (id, opts) => {
|
|
19413
19448
|
const { source } = await getClient().getGenericSource(id);
|
|
19414
19449
|
const cfg = parseLocalConfig(source);
|
|
19415
19450
|
if (!cfg) {
|
|
@@ -19585,6 +19620,33 @@ function registerWorkflowCommands(program, getClient) {
|
|
|
19585
19620
|
}));
|
|
19586
19621
|
}
|
|
19587
19622
|
//#endregion
|
|
19623
|
+
//#region src/cli/commands/shared/run-ref.ts
|
|
19624
|
+
/** Resolve a `kici-admin runs` run id: a full id, or a unique prefix (like a git short SHA). */
|
|
19625
|
+
const AMBIGUOUS_SHOWN = 5;
|
|
19626
|
+
const FIND_HINT = "'kici-admin runs list' shows full run ids";
|
|
19627
|
+
/** The full run id `ref` names; a prefix resolves through the run list. */
|
|
19628
|
+
async function resolveRunRef(client, ref) {
|
|
19629
|
+
const parsed = parseRunIdRef(ref);
|
|
19630
|
+
if (parsed.kind === "uuid") return parsed.runId;
|
|
19631
|
+
if (parsed.kind === "invalid") throw new Error(invalidRunIdMessage(ref, parsed.reason, FIND_HINT));
|
|
19632
|
+
const { runs, total } = await client.listRuns({
|
|
19633
|
+
runIdPrefix: parsed.hex,
|
|
19634
|
+
limit: AMBIGUOUS_SHOWN
|
|
19635
|
+
});
|
|
19636
|
+
const ids = runs.map((r) => String(r.runId));
|
|
19637
|
+
const matches = ids.filter((id) => runIdHasPrefix(id, parsed.hex));
|
|
19638
|
+
if (matches.length < ids.length && total > ids.length) throw new Error(prefixUnsupported(ref));
|
|
19639
|
+
return pickRunIdMatch({
|
|
19640
|
+
ref,
|
|
19641
|
+
matches,
|
|
19642
|
+
unseen: total - ids.length,
|
|
19643
|
+
findHint: FIND_HINT
|
|
19644
|
+
});
|
|
19645
|
+
}
|
|
19646
|
+
function prefixUnsupported(ref) {
|
|
19647
|
+
return `This orchestrator cannot look up the run id prefix '${ref}'; pass the full run id (${FIND_HINT}).`;
|
|
19648
|
+
}
|
|
19649
|
+
//#endregion
|
|
19588
19650
|
//#region src/cli/commands/runs.ts
|
|
19589
19651
|
function formatDuration(ms) {
|
|
19590
19652
|
if (ms == null) return "-";
|
|
@@ -19593,6 +19655,25 @@ function formatDuration(ms) {
|
|
|
19593
19655
|
if (secs < 60) return `${secs}s`;
|
|
19594
19656
|
return `${Math.floor(secs / 60)}m${secs % 60}s`;
|
|
19595
19657
|
}
|
|
19658
|
+
/** Every workflow a run spans; an older orchestrator reports only the first. */
|
|
19659
|
+
function runWorkflows(run) {
|
|
19660
|
+
return run.workflowNames?.length ? run.workflowNames : [run.workflowName];
|
|
19661
|
+
}
|
|
19662
|
+
/**
|
|
19663
|
+
* The `workflow` cell of `runs list`: the run's workflow, plus how many more it
|
|
19664
|
+
* spans (`hello-world +3`), so a run of several workflows never reads as one.
|
|
19665
|
+
*/
|
|
19666
|
+
function workflowListCell(run) {
|
|
19667
|
+
const names = runWorkflows(run);
|
|
19668
|
+
return names.length > 1 ? `${names[0]} +${names.length - 1}` : names[0];
|
|
19669
|
+
}
|
|
19670
|
+
/**
|
|
19671
|
+
* A job's label in the per-job lines: qualified with its workflow when the run
|
|
19672
|
+
* spans several, where two jobs can share a name.
|
|
19673
|
+
*/
|
|
19674
|
+
function jobLabel(job, spansWorkflows) {
|
|
19675
|
+
return spansWorkflows && job.workflowName ? `${job.workflowName} / ${job.jobName}` : job.jobName;
|
|
19676
|
+
}
|
|
19596
19677
|
/**
|
|
19597
19678
|
* Header lines naming where an organization-wide run's workflow is defined.
|
|
19598
19679
|
* "Defined in" prints only when the workflow repository differs from the run's
|
|
@@ -19606,6 +19687,42 @@ function workflowProvenanceLines(run) {
|
|
|
19606
19687
|
if (run.workflowBranch) lines.push(` Workflow branch: ${run.workflowBranch}`);
|
|
19607
19688
|
return lines;
|
|
19608
19689
|
}
|
|
19690
|
+
/**
|
|
19691
|
+
* A job's steps in run order: setup and init pseudo-steps first, whatever order the
|
|
19692
|
+
* orchestrator sent. An older orchestrator orders init steps by their stored index, last.
|
|
19693
|
+
*/
|
|
19694
|
+
function stepsInRunOrder(steps) {
|
|
19695
|
+
return [...steps].sort(compareStepsByPhase);
|
|
19696
|
+
}
|
|
19697
|
+
/**
|
|
19698
|
+
* The `#` cell of a step row: the step index, or `init[<n>]` for an init step, whose
|
|
19699
|
+
* stored index is a high internal value and not a position among the steps.
|
|
19700
|
+
*/
|
|
19701
|
+
function stepNumberCell(step) {
|
|
19702
|
+
const initIndex = initStepIndex(step.stepType);
|
|
19703
|
+
return initIndex === void 0 ? String(step.stepIndex) : initStepLabel(initIndex);
|
|
19704
|
+
}
|
|
19705
|
+
/** The `type` cell of a `runs show` step row: blank for a plain step, `init` for any init. */
|
|
19706
|
+
function stepTypeCell(stepType) {
|
|
19707
|
+
if (stepPhase(stepType) === StepPhase.enum.init) return StepPhase.enum.init;
|
|
19708
|
+
return stepType === "step" ? "" : stepType;
|
|
19709
|
+
}
|
|
19710
|
+
/**
|
|
19711
|
+
* The stored step index `runs logs --step` names. An init step is shown as `init[<n>]`,
|
|
19712
|
+
* not by its stored index, so that label resolves through the job's steps; any other
|
|
19713
|
+
* value passes through for the server to validate.
|
|
19714
|
+
*/
|
|
19715
|
+
async function resolveStepRef(client, runId, jobId, step) {
|
|
19716
|
+
const ref = String(step);
|
|
19717
|
+
const initIndex = parseInitStepRef(ref);
|
|
19718
|
+
if (initIndex === void 0) return ref;
|
|
19719
|
+
const { jobs } = await client.getRunJobs(runId, { includeSteps: true });
|
|
19720
|
+
const job = jobs.find((j) => j.jobId === jobId);
|
|
19721
|
+
if (!job) throw new Error(`Job ${jobId} not found in run ${runId}`);
|
|
19722
|
+
const match = (job.steps ?? []).find((s) => s.stepType === initStepType(initIndex));
|
|
19723
|
+
if (!match) throw new Error(`Job ${jobId} has no ${initStepLabel(initIndex)} step`);
|
|
19724
|
+
return String(match.stepIndex);
|
|
19725
|
+
}
|
|
19609
19726
|
/** The step index of a job's setup log: the clone, the install and the module load. */
|
|
19610
19727
|
const SETUP_LOG_STEP_INDEX = -1;
|
|
19611
19728
|
/**
|
|
@@ -19613,14 +19730,15 @@ const SETUP_LOG_STEP_INDEX = -1;
|
|
|
19613
19730
|
* recorded, or a log is stored and holds nothing. `null` when the step has
|
|
19614
19731
|
* lines, or when the orchestrator does not report which case applies.
|
|
19615
19732
|
*/
|
|
19616
|
-
function emptyStepLogNote(
|
|
19733
|
+
function emptyStepLogNote(step, logs) {
|
|
19617
19734
|
if (logs.totalLines > 0 || logs.recorded === void 0) return null;
|
|
19618
|
-
if (
|
|
19619
|
-
return logs.recorded ? `(the log for step ${
|
|
19735
|
+
if (step === SETUP_LOG_STEP_INDEX) return logs.recorded ? "(the setup log for this job is empty)" : "(no setup log recorded for this job)";
|
|
19736
|
+
return logs.recorded ? `(the log for step ${step} is empty)` : `(no log recorded for step ${step})`;
|
|
19620
19737
|
}
|
|
19738
|
+
const RUN_ID_ARG_HELP = "Run id, or its first 4 or more characters";
|
|
19621
19739
|
function registerRunsCommands(program, getClient) {
|
|
19622
19740
|
const runs = program.command("runs").description("Inspect execution runs, jobs, and steps");
|
|
19623
|
-
runs.command("list").description("List execution runs (admin API: /api/v1/admin/runs)").option("--status <statuses>", "Filter by run status. Accepts a single value or a comma-separated list (e.g. success,failed)").option("--workflow-name <name>", "Filter by workflow name").option("--repo <ownerRepo>", "Filter by repo identifier (owner/repo)").option("--since <iso8601>", "Only include runs with created_at strictly later than this ISO-8601 timestamp").option("--count", "Return only the count of matching runs, skipping the row listing").option("--limit <n>", "Max results (default 20, max 100)", "20").option("--offset <n>", "Skip first N results", "0").option("--json", "Emit raw JSON instead of a table").action(cliAction(async (opts) => {
|
|
19741
|
+
runs.command("list").description("List execution runs (admin API: /api/v1/admin/runs)").option("--status <statuses>", "Filter by run status. Accepts a single value or a comma-separated list (e.g. success,failed)").option("--workflow-name <name>", "Filter by workflow name. A run that spans several workflows matches any of them").option("--repo <ownerRepo>", "Filter by repo identifier (owner/repo)").option("--since <iso8601>", "Only include runs with created_at strictly later than this ISO-8601 timestamp").option("--count", "Return only the count of matching runs, skipping the row listing").option("--limit <n>", "Max results (default 20, max 100)", "20").option("--offset <n>", "Skip first N results", "0").option("--json", "Emit raw JSON instead of a table").action(cliAction(async (opts) => {
|
|
19624
19742
|
if (opts.count) {
|
|
19625
19743
|
const data = await getClient().countRuns({
|
|
19626
19744
|
status: opts.status,
|
|
@@ -19660,7 +19778,7 @@ function registerRunsCommands(program, getClient) {
|
|
|
19660
19778
|
];
|
|
19661
19779
|
const rows = data.runs.map((r) => [
|
|
19662
19780
|
r.runId,
|
|
19663
|
-
r
|
|
19781
|
+
workflowListCell(r),
|
|
19664
19782
|
r.status,
|
|
19665
19783
|
r.repoIdentifier,
|
|
19666
19784
|
r.ref,
|
|
@@ -19672,7 +19790,8 @@ function registerRunsCommands(program, getClient) {
|
|
|
19672
19790
|
console.log("");
|
|
19673
19791
|
console.log(`Showing ${data.runs.length} of ${data.total} (offset ${data.offset}, limit ${data.limit})`);
|
|
19674
19792
|
}));
|
|
19675
|
-
runs.command("show
|
|
19793
|
+
runs.command("show").argument("<runId>", RUN_ID_ARG_HELP).description("Show run detail with jobs and steps").option("--json", "Emit raw JSON instead of formatted output").action(cliAction(async (runRef, opts) => {
|
|
19794
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19676
19795
|
const client = getClient();
|
|
19677
19796
|
const [runRespRaw, jobsRespRaw] = await Promise.all([client.getRun(runId), client.getRunJobs(runId, { includeSteps: true })]);
|
|
19678
19797
|
const runResp = runRespRaw;
|
|
@@ -19686,8 +19805,11 @@ function registerRunsCommands(program, getClient) {
|
|
|
19686
19805
|
return;
|
|
19687
19806
|
}
|
|
19688
19807
|
const { run, jobs } = data;
|
|
19808
|
+
const workflows = runWorkflows(run);
|
|
19809
|
+
const spansWorkflows = workflows.length > 1;
|
|
19689
19810
|
console.log(`Run: ${run.runId}`);
|
|
19690
|
-
console.log(`
|
|
19811
|
+
if (spansWorkflows) console.log(` Workflows: ${workflows.join(", ")}`);
|
|
19812
|
+
else console.log(` Workflow: ${run.workflowName}`);
|
|
19691
19813
|
console.log(` Status: ${run.status}`);
|
|
19692
19814
|
console.log(` Repo: ${run.repoIdentifier}`);
|
|
19693
19815
|
console.log(` Ref: ${run.ref}`);
|
|
@@ -19713,6 +19835,7 @@ function registerRunsCommands(program, getClient) {
|
|
|
19713
19835
|
const jobHeaders = [
|
|
19714
19836
|
"job_id",
|
|
19715
19837
|
"name",
|
|
19838
|
+
"workflow",
|
|
19716
19839
|
"status",
|
|
19717
19840
|
"agent",
|
|
19718
19841
|
"duration",
|
|
@@ -19721,6 +19844,7 @@ function registerRunsCommands(program, getClient) {
|
|
|
19721
19844
|
const jobRows = jobs.map((j) => [
|
|
19722
19845
|
j.jobId,
|
|
19723
19846
|
j.jobName,
|
|
19847
|
+
j.workflowName ?? "-",
|
|
19724
19848
|
j.status,
|
|
19725
19849
|
j.agentId ?? "-",
|
|
19726
19850
|
formatDuration(j.durationMs),
|
|
@@ -19730,12 +19854,12 @@ function registerRunsCommands(program, getClient) {
|
|
|
19730
19854
|
const unroutableJobs = jobs.filter((j) => j.routingReason && (j.status === ExecutionJobStatus.enum.pending || j.status === ExecutionJobStatus.enum.queued));
|
|
19731
19855
|
if (unroutableJobs.length > 0) {
|
|
19732
19856
|
console.log("");
|
|
19733
|
-
for (const job of unroutableJobs) console.log(` ! ${job
|
|
19857
|
+
for (const job of unroutableJobs) console.log(` ! ${jobLabel(job, spansWorkflows)}: ${job.routingReason}`);
|
|
19734
19858
|
}
|
|
19735
19859
|
const jobsWithSteps = jobs.filter((j) => (j.steps?.length ?? 0) > 0);
|
|
19736
19860
|
if (jobsWithSteps.length > 0) for (const job of jobsWithSteps) {
|
|
19737
19861
|
console.log("");
|
|
19738
|
-
console.log(`Steps for ${job
|
|
19862
|
+
console.log(`Steps for ${jobLabel(job, spansWorkflows)} (${job.jobId}):`);
|
|
19739
19863
|
const stepHeaders = [
|
|
19740
19864
|
"#",
|
|
19741
19865
|
"name",
|
|
@@ -19744,18 +19868,19 @@ function registerRunsCommands(program, getClient) {
|
|
|
19744
19868
|
"duration",
|
|
19745
19869
|
"type"
|
|
19746
19870
|
];
|
|
19747
|
-
const stepRows = (job.steps ?? []).map((s) => [
|
|
19748
|
-
|
|
19871
|
+
const stepRows = stepsInRunOrder(job.steps ?? []).map((s) => [
|
|
19872
|
+
stepNumberCell(s),
|
|
19749
19873
|
s.stepName,
|
|
19750
19874
|
s.status,
|
|
19751
19875
|
s.exitCode != null ? String(s.exitCode) : "-",
|
|
19752
19876
|
formatDuration(s.durationMs),
|
|
19753
|
-
s.stepType
|
|
19877
|
+
stepTypeCell(s.stepType)
|
|
19754
19878
|
]);
|
|
19755
19879
|
console.log(renderTable(stepHeaders, stepRows));
|
|
19756
19880
|
}
|
|
19757
19881
|
}));
|
|
19758
|
-
runs.command("structured
|
|
19882
|
+
runs.command("structured").argument("<runId>", RUN_ID_ARG_HELP).description("Show the provenance-tagged structured run result (agent read path; /structured)").option("--json", "Emit the raw AgentRunResult (untrusted envelopes preserved)").action(cliAction(async (runRef, opts) => {
|
|
19883
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19759
19884
|
const result = await getClient().getRunStructured(runId);
|
|
19760
19885
|
if (opts.json) {
|
|
19761
19886
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -19798,8 +19923,8 @@ function registerRunsCommands(program, getClient) {
|
|
|
19798
19923
|
"exit",
|
|
19799
19924
|
"duration"
|
|
19800
19925
|
];
|
|
19801
|
-
const stepRows = job.steps.map((s) => [
|
|
19802
|
-
|
|
19926
|
+
const stepRows = stepsInRunOrder(job.steps).map((s) => [
|
|
19927
|
+
stepNumberCell(s),
|
|
19803
19928
|
uv(s.stepName),
|
|
19804
19929
|
s.status,
|
|
19805
19930
|
s.exitCode != null ? String(s.exitCode) : "-",
|
|
@@ -19808,7 +19933,8 @@ function registerRunsCommands(program, getClient) {
|
|
|
19808
19933
|
console.log(renderTable(stepHeaders, stepRows));
|
|
19809
19934
|
}
|
|
19810
19935
|
}));
|
|
19811
|
-
runs.command("jobs
|
|
19936
|
+
runs.command("jobs").argument("<runId>", RUN_ID_ARG_HELP).description("List jobs for a run (admin API: /api/v1/admin/runs/:runId/jobs)").option("--include-steps", "Embed step list inside each job (default false)").option("--json", "Emit raw JSON instead of a table").action(cliAction(async (runRef, opts) => {
|
|
19937
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19812
19938
|
const response = await getClient().getRunJobs(runId, { includeSteps: Boolean(opts.includeSteps) });
|
|
19813
19939
|
if (opts.json) {
|
|
19814
19940
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -19821,6 +19947,7 @@ function registerRunsCommands(program, getClient) {
|
|
|
19821
19947
|
const headers = [
|
|
19822
19948
|
"job_id",
|
|
19823
19949
|
"name",
|
|
19950
|
+
"workflow",
|
|
19824
19951
|
"status",
|
|
19825
19952
|
"agent",
|
|
19826
19953
|
"duration",
|
|
@@ -19829,38 +19956,44 @@ function registerRunsCommands(program, getClient) {
|
|
|
19829
19956
|
const rows = response.jobs.map((j) => [
|
|
19830
19957
|
j.jobId,
|
|
19831
19958
|
j.jobName,
|
|
19959
|
+
j.workflowName ?? "-",
|
|
19832
19960
|
j.status,
|
|
19833
19961
|
j.agentId ?? "-",
|
|
19834
19962
|
formatDuration(j.durationMs),
|
|
19835
19963
|
j.startedAt ?? "-"
|
|
19836
19964
|
]);
|
|
19837
19965
|
console.log(renderTable(headers, rows));
|
|
19838
|
-
if (opts.includeSteps)
|
|
19839
|
-
const
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
s
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19966
|
+
if (opts.includeSteps) {
|
|
19967
|
+
const spansWorkflows = new Set(response.jobs.map((j) => j.workflowName).filter(Boolean)).size > 1;
|
|
19968
|
+
for (const job of response.jobs) {
|
|
19969
|
+
const steps = job.steps ?? [];
|
|
19970
|
+
if (steps.length === 0) continue;
|
|
19971
|
+
console.log("");
|
|
19972
|
+
console.log(`Steps for ${jobLabel(job, spansWorkflows)} (${job.jobId}):`);
|
|
19973
|
+
const stepHeaders = [
|
|
19974
|
+
"#",
|
|
19975
|
+
"name",
|
|
19976
|
+
"status",
|
|
19977
|
+
"exit",
|
|
19978
|
+
"duration"
|
|
19979
|
+
];
|
|
19980
|
+
const stepRows = stepsInRunOrder(steps).map((s) => [
|
|
19981
|
+
stepNumberCell(s),
|
|
19982
|
+
s.stepName,
|
|
19983
|
+
s.status,
|
|
19984
|
+
s.exitCode != null ? String(s.exitCode) : "-",
|
|
19985
|
+
formatDuration(s.durationMs)
|
|
19986
|
+
]);
|
|
19987
|
+
console.log(renderTable(stepHeaders, stepRows));
|
|
19988
|
+
}
|
|
19858
19989
|
}
|
|
19859
19990
|
}));
|
|
19860
|
-
runs.command("logs
|
|
19991
|
+
runs.command("logs").argument("<runId>", RUN_ID_ARG_HELP).description("Print a page of a step log (admin API: /api/v1/admin/runs/:runId/jobs/:jobId/steps/:i/logs)").requiredOption("--job <jobId>", "Job id (the dispatch_queue row id for an eval round)").option("--step <n>", "Step index (default 0; -1 is the job setup log), or an init step as init[<n>]", "0").option("--limit <n>", "Max lines to return (default 500, server caps at 2000)", "500").option("--cursor <c>", "Line-offset cursor from a previous page").option("--json", "Emit raw JSON instead of plain lines").action(cliAction(async (runRef, opts) => {
|
|
19992
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19993
|
+
const stepIndex = await resolveStepRef(getClient(), runId, String(opts.job), opts.step);
|
|
19861
19994
|
const params = new URLSearchParams({ limit: String(opts.limit) });
|
|
19862
19995
|
if (opts.cursor) params.set("cursor", String(opts.cursor));
|
|
19863
|
-
const path = `/api/v1/admin/runs/${encodeURIComponent(runId)}/jobs/${encodeURIComponent(String(opts.job))}/steps/${encodeURIComponent(
|
|
19996
|
+
const path = `/api/v1/admin/runs/${encodeURIComponent(runId)}/jobs/${encodeURIComponent(String(opts.job))}/steps/${encodeURIComponent(stepIndex)}/logs?${params.toString()}`;
|
|
19864
19997
|
const response = await getClient().get(path);
|
|
19865
19998
|
if (opts.json) {
|
|
19866
19999
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -19868,10 +20001,12 @@ function registerRunsCommands(program, getClient) {
|
|
|
19868
20001
|
}
|
|
19869
20002
|
for (const line of response.lines) console.log(line.value);
|
|
19870
20003
|
if (response.nextCursor) console.error(`(more: re-run with --cursor ${response.nextCursor})`);
|
|
19871
|
-
const
|
|
20004
|
+
const initIndex = parseInitStepRef(String(opts.step));
|
|
20005
|
+
const note = emptyStepLogNote(initIndex === void 0 ? parseInt(stepIndex, 10) : initStepLabel(initIndex), response);
|
|
19872
20006
|
if (note) console.error(note);
|
|
19873
20007
|
}));
|
|
19874
|
-
runs.command("ephemeral-key
|
|
20008
|
+
runs.command("ephemeral-key").argument("<runId>", RUN_ID_ARG_HELP).description("Show whether the run-ephemeral key has been scrubbed yet").option("--json", "Emit raw JSON instead of plain text").action(cliAction(async (runRef, opts) => {
|
|
20009
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19875
20010
|
const response = await getClient().getRunEphemeralKey(runId);
|
|
19876
20011
|
if (opts.json) {
|
|
19877
20012
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -19885,7 +20020,8 @@ function registerRunsCommands(program, getClient) {
|
|
|
19885
20020
|
console.log(`created_at: -`);
|
|
19886
20021
|
}
|
|
19887
20022
|
}));
|
|
19888
|
-
runs.command("secret-outputs
|
|
20023
|
+
runs.command("secret-outputs").argument("<runId>", RUN_ID_ARG_HELP).description("List per-job secret outputs (masked by default; --reveal decrypts and audits)").option("--output-key <key>", "Filter to a single output_key").option("--reveal", "Decrypt and print plaintext values. Audited with actor=secret-outputs.reveal; requires secret.reveal permission").option("--json", "Emit raw JSON instead of a table").action(cliAction(async (runRef, opts) => {
|
|
20024
|
+
const runId = await resolveRunRef(getClient(), runRef);
|
|
19889
20025
|
if (opts.reveal) process.stderr.write("⚠ --reveal will decrypt secret values; this call is recorded in secret_audit_log.\n");
|
|
19890
20026
|
const response = await getClient().getRunSecretOutputs(runId, {
|
|
19891
20027
|
outputKey: opts.outputKey,
|
|
@@ -26820,7 +26956,7 @@ init_manifest();
|
|
|
26820
26956
|
const ALL_PLATFORMS = AgentPlatform.options;
|
|
26821
26957
|
/** The orchestrator's own version (single-version invariant) = the packaged agent version. */
|
|
26822
26958
|
function resolveKiciVersion() {
|
|
26823
|
-
return "0.
|
|
26959
|
+
return "0.21.0";
|
|
26824
26960
|
}
|
|
26825
26961
|
/** Parse the --platform value: default set | single | CSV | `all`. */
|
|
26826
26962
|
function parsePlatforms(raw) {
|
|
@@ -30530,6 +30666,16 @@ function registerQueueCommands(program, getClient) {
|
|
|
30530
30666
|
}
|
|
30531
30667
|
//#endregion
|
|
30532
30668
|
//#region src/cli/commands/execution.ts
|
|
30669
|
+
/**
|
|
30670
|
+
* The full run id `execution show` was given. Over the admin API a prefix resolves
|
|
30671
|
+
* like `kici-admin runs show`; the direct-database path takes a full id only.
|
|
30672
|
+
*/
|
|
30673
|
+
async function resolveExecutionRunRef(ref, client) {
|
|
30674
|
+
if (client) return resolveRunRef(client, ref);
|
|
30675
|
+
const parsed = parseRunIdRef(ref);
|
|
30676
|
+
if (parsed.kind === "uuid") return parsed.runId;
|
|
30677
|
+
throw new Error(`Invalid run id '${ref}': --database-url needs a full run id. Drop --database-url to look up a prefix over the admin API ('kici-admin execution list' shows full run ids).`);
|
|
30678
|
+
}
|
|
30533
30679
|
function printRunsTable(runs) {
|
|
30534
30680
|
if (runs.length === 0) {
|
|
30535
30681
|
console.log("No execution runs found.");
|
|
@@ -30601,8 +30747,9 @@ function registerExecutionCommands(program, getClient) {
|
|
|
30601
30747
|
printJsonOr(opts.json, result, (r) => printRunsTable(r.runs));
|
|
30602
30748
|
}
|
|
30603
30749
|
}));
|
|
30604
|
-
exec.command("show <runId>").description("Show one run + its jobs (by run_id)").option(DIRECT_DB_URL_FLAG, DIRECT_DB_URL_HELP).option("--json", "Emit JSON output").action(cliAction(async (
|
|
30750
|
+
exec.command("show <runId>").description("Show one run + its jobs (by run_id, or its first 4+ characters)").option(DIRECT_DB_URL_FLAG, DIRECT_DB_URL_HELP).option("--json", "Emit JSON output").action(cliAction(async (runRef, opts) => {
|
|
30605
30751
|
const dbUrl = resolveDirectDbUrl(opts.databaseUrl);
|
|
30752
|
+
const runId = await resolveExecutionRunRef(runRef, dbUrl ? void 0 : getClient());
|
|
30606
30753
|
const result = dbUrl ? await showExecutionRunDirect(dbUrl, { runId }) : await getClient().get(`/api/v1/admin/executions/${encodeURIComponent(runId)}`);
|
|
30607
30754
|
printJsonOr(opts.json, result, (r) => printRunShow(r.run, r.jobs));
|
|
30608
30755
|
}));
|
|
@@ -37069,7 +37216,7 @@ function routeRootArgs(root, args) {
|
|
|
37069
37216
|
* build entry; the fallback covers a source run (tests, `tsx`), the same shape
|
|
37070
37217
|
* `server.ts` and `standalone.ts` use for `ORCHESTRATOR_VERSION`.
|
|
37071
37218
|
*/
|
|
37072
|
-
const CLI_VERSION = "0.
|
|
37219
|
+
const CLI_VERSION = "0.21.0";
|
|
37073
37220
|
/**
|
|
37074
37221
|
* Root command whose option parsing first routes argv through
|
|
37075
37222
|
* {@link routeRootArgs}: a leading `--version` prints the CLI version, and an
|
|
@@ -37092,7 +37239,7 @@ var KiciAdminProgram = class extends Command {
|
|
|
37092
37239
|
*/
|
|
37093
37240
|
function buildProgram() {
|
|
37094
37241
|
const program = new KiciAdminProgram();
|
|
37095
|
-
program.name("kici-admin").description("KiCI orchestrator admin CLI for managing config, secrets, and tokens").version(CLI_VERSION, `-V, ${ROOT_VERSION_FLAG}`, "output the version number (--version also works before a command)").
|
|
37242
|
+
program.name("kici-admin").description("KiCI orchestrator admin CLI for managing config, secrets, and tokens").version(CLI_VERSION, `-V, ${ROOT_VERSION_FLAG}`, "output the version number (--version also works before a command)").addOption(new Option("-u, --url <url>", "Orchestrator URL").env("KICI_ADMIN_URL").default(DEFAULT_ADMIN_URL)).addOption(new Option("-t, --token <token>", "Admin API token").env("KICI_ADMIN_TOKEN"));
|
|
37096
37243
|
/** Lazy, so --help works without --token. */
|
|
37097
37244
|
function getClient() {
|
|
37098
37245
|
const opts = program.opts();
|