@kici-dev/orchestrator 0.1.26 → 0.2.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.
Files changed (310) hide show
  1. package/dist/__test-helpers__/mock-db.d.ts +2 -0
  2. package/dist/agent/dispatcher.d.ts +52 -2
  3. package/dist/agent/host-roster-reaper.d.ts +1 -2
  4. package/dist/agent/host-roster.d.ts +34 -0
  5. package/dist/agent/ownership-refusal.d.ts +12 -0
  6. package/dist/agent/ownership-tracker.d.ts +64 -16
  7. package/dist/agent/token-store.d.ts +13 -0
  8. package/dist/agent-packaging/availability.d.ts +27 -0
  9. package/dist/agent-packaging/build-package.d.ts +16 -0
  10. package/dist/agent-packaging/download.d.ts +30 -0
  11. package/dist/agent-packaging/index.d.ts +9 -0
  12. package/dist/agent-packaging/install-closure.d.ts +30 -0
  13. package/dist/agent-packaging/node-binary.d.ts +26 -0
  14. package/dist/agent-packaging/refresh.d.ts +50 -0
  15. package/dist/agent-packaging/store.d.ts +15 -0
  16. package/dist/agent-packaging/upload.d.ts +24 -0
  17. package/dist/app-on-error.d.ts +29 -0
  18. package/dist/app.d.ts +69 -8
  19. package/dist/approvals/apply-decision.d.ts +1 -1
  20. package/dist/approvals/step-approval-bridge.d.ts +1 -1
  21. package/dist/artifacts/artifact-store.d.ts +233 -0
  22. package/dist/artifacts/failure-messages.d.ts +46 -0
  23. package/dist/audit/access-log.d.ts +18 -1
  24. package/dist/cache/dep-cache.d.ts +15 -0
  25. package/dist/cache/pending-inits.d.ts +4 -4
  26. package/dist/cache/user-cache.d.ts +37 -0
  27. package/dist/cancel/cancel-run.d.ts +10 -3
  28. package/dist/cancel/dashboard-cancel-handler.d.ts +19 -0
  29. package/dist/cli/api-client.d.ts +51 -5
  30. package/dist/cli/commands/agent-package.d.ts +34 -0
  31. package/dist/cli/commands/check-run.d.ts +26 -0
  32. package/dist/cli/commands/cluster-settings.d.ts +55 -0
  33. package/dist/cli/commands/context.d.ts +25 -0
  34. package/dist/cli/commands/dashboard-encryption-key.d.ts +3 -0
  35. package/dist/cli/commands/db-backup.d.ts +71 -0
  36. package/dist/cli/commands/debug-bundle.d.ts +1 -1
  37. package/dist/cli/commands/orchestrator-service/drain.d.ts +31 -0
  38. package/dist/cli/commands/orchestrator-service/index.d.ts +7 -4
  39. package/dist/cli/commands/orchestrator-service/install-env.d.ts +58 -0
  40. package/dist/cli/commands/secret.d.ts +45 -1
  41. package/dist/cli/commands/shared/admin-cli-access-log.d.ts +46 -0
  42. package/dist/cli/commands/shared/versioned-upgrade.d.ts +65 -2
  43. package/dist/cli/commands/signing-key.d.ts +3 -0
  44. package/dist/cli/commands/source.d.ts +12 -0
  45. package/dist/cli/commands/token.d.ts +9 -0
  46. package/dist/cli/commands/trust-policy.d.ts +48 -0
  47. package/dist/cli/commands/variable.d.ts +6 -6
  48. package/dist/cli/join.d.ts +1 -1
  49. package/dist/cli/service/index.d.ts +2 -2
  50. package/dist/cli/service/instance/manifest.d.ts +17 -0
  51. package/dist/cli/service/instance/resolve.d.ts +11 -0
  52. package/dist/cli/service/windows.d.ts +6 -0
  53. package/dist/cli/wizard/orchestrator-wizard.d.ts +39 -11
  54. package/dist/cli.js +10263 -3667
  55. package/dist/cluster/cluster-settings-reader.d.ts +78 -0
  56. package/dist/cluster/coordinator.d.ts +81 -9
  57. package/dist/cluster/join-client.d.ts +1 -1
  58. package/dist/cluster/leader-gated-scheduler.d.ts +50 -0
  59. package/dist/cluster/orphan-recovery.d.ts +14 -0
  60. package/dist/cluster/peer-client.d.ts +12 -2
  61. package/dist/cluster/peer-handler.d.ts +15 -4
  62. package/dist/cluster/peer-registry.d.ts +12 -0
  63. package/dist/cluster/verified-issuer-poller.d.ts +11 -0
  64. package/dist/cluster/verified-issuer.d.ts +63 -0
  65. package/dist/cold-store/tables/access-log.d.ts +1 -1
  66. package/dist/cold-store/tables/event-log.d.ts +1 -1
  67. package/dist/cold-store/tables/execution-jobs.d.ts +1 -1
  68. package/dist/cold-store/tables/execution-runs.d.ts +1 -1
  69. package/dist/cold-store/tables/execution-steps.d.ts +1 -1
  70. package/dist/cold-store/tables/secret-audit-log.d.ts +1 -1
  71. package/dist/config/loader.d.ts +1 -1
  72. package/dist/config/resolver.d.ts +2 -1
  73. package/dist/config/schema.d.ts +8 -6
  74. package/dist/config/types.d.ts +3 -2
  75. package/dist/config.d.ts +372 -46
  76. package/dist/contexts/binding-store.d.ts +36 -0
  77. package/dist/contexts/context-store.d.ts +100 -0
  78. package/dist/contexts/glob-specificity.d.ts +30 -0
  79. package/dist/{environments → contexts}/held-runs.d.ts +64 -32
  80. package/dist/{environments → contexts}/index.d.ts +1 -1
  81. package/dist/contexts/protection/aggregate.d.ts +43 -0
  82. package/dist/contexts/protection/branch-gate.d.ts +5 -0
  83. package/dist/contexts/protection/concurrency-gate.d.ts +4 -0
  84. package/dist/{environments → contexts}/protection/pipeline.d.ts +3 -3
  85. package/dist/contexts/protection/reviewer-gate.d.ts +4 -0
  86. package/dist/{environments → contexts}/protection/satisfiability.d.ts +22 -22
  87. package/dist/contexts/protection/trust-gate.d.ts +4 -0
  88. package/dist/contexts/protection/wait-timer-gate.d.ts +4 -0
  89. package/dist/contexts/variable-store.d.ts +39 -0
  90. package/dist/cron/cron-scheduler.d.ts +24 -4
  91. package/dist/cron/cron-store.d.ts +21 -7
  92. package/dist/dashboard/attestation-filters.d.ts +94 -74
  93. package/dist/dashboard/handler.d.ts +63 -3
  94. package/dist/db/migration-test-harness.d.ts +41 -0
  95. package/dist/db/migrations/067_environments_to_contexts.d.ts +36 -0
  96. package/dist/db/migrations/068_request_idempotency.d.ts +17 -0
  97. package/dist/db/migrations/069_reroute_tunables.d.ts +21 -0
  98. package/dist/db/migrations/070_execution_runs_failure_class.d.ts +4 -0
  99. package/dist/db/migrations/071_batch_accumulation.d.ts +26 -0
  100. package/dist/db/migrations/072_dispatch_queue_run_id_index.d.ts +15 -0
  101. package/dist/db/migrations/073_org_settings_ingest_concurrency.d.ts +13 -0
  102. package/dist/db/migrations/074_normalize_zero_concurrency_limit.d.ts +13 -0
  103. package/dist/db/migrations/075_ingest_overflow_buffer.d.ts +16 -0
  104. package/dist/db/migrations/076_artifacts.d.ts +19 -0
  105. package/dist/db/migrations/077_backup_runs.d.ts +13 -0
  106. package/dist/db/migrations/078_org_settings_backup_staleness.d.ts +12 -0
  107. package/dist/db/migrations/079_org_settings_scaler_spawn_timeout.d.ts +14 -0
  108. package/dist/db/migrations/080_cluster_settings.d.ts +17 -0
  109. package/dist/db/migrations/081_org_settings_queue_timeout.d.ts +19 -0
  110. package/dist/db/migrations/082_host_s3_reachable.d.ts +16 -0
  111. package/dist/db/migrations/083_org_settings_artifact_caps.d.ts +18 -0
  112. package/dist/db/migrations/084_orchestrator_signing_keys.d.ts +20 -0
  113. package/dist/db/migrations/085_cluster_settings_reroute_flap_grace_ms.d.ts +12 -0
  114. package/dist/db/migrations/086_cluster_settings_max_fanout_hosts.d.ts +12 -0
  115. package/dist/db/migrations/087_cluster_settings_event_router_rate_limit.d.ts +12 -0
  116. package/dist/db/migrations/088_cluster_settings_cache_max_tarball_bytes.d.ts +12 -0
  117. package/dist/db/migrations/089_cluster_settings_cache_ttl_days.d.ts +12 -0
  118. package/dist/db/migrations/090_cluster_settings_concurrency_wait_timeout_ms.d.ts +12 -0
  119. package/dist/db/migrations/091_cluster_settings_agent_token_ttl_ms.d.ts +12 -0
  120. package/dist/db/migrations/092_cluster_settings_version.d.ts +16 -0
  121. package/dist/db/migrations/093_org_settings_sandbox_allowlist.d.ts +4 -0
  122. package/dist/db/migrations/094_dashboard_encryption_keys.d.ts +21 -0
  123. package/dist/db/migrations/095_dashboard_write_policy_tristate.d.ts +20 -0
  124. package/dist/db/migrations/096_multi_schedule_cron_last_fired.d.ts +4 -0
  125. package/dist/db/migrations/097_execution_runs_pr_number.d.ts +4 -0
  126. package/dist/db/migrations/098_execution_runs_customer_id.d.ts +4 -0
  127. package/dist/db/migrations/099_cluster_settings_dashboard_verified_issuer.d.ts +21 -0
  128. package/dist/db/migrations/100_held_runs_hold_type_vocabulary.d.ts +31 -0
  129. package/dist/db/migrations/101_contexts_hold_expiry_drop_default.d.ts +31 -0
  130. package/dist/db/migrations/102_dispatch_queue_agent_id.d.ts +20 -0
  131. package/dist/db/migrations/103_cluster_settings_ownership_db_check_timeout_ms.d.ts +20 -0
  132. package/dist/db/migrations/104_check_run_terminal_sent.d.ts +22 -0
  133. package/dist/db/migrations/105_org_trust_policy.d.ts +19 -0
  134. package/dist/db/migrations/106_cluster_settings_check_run_tracking_ttl_days.d.ts +18 -0
  135. package/dist/db/migrations/107_check_run_tracking_updated_at_index.d.ts +23 -0
  136. package/dist/db/repos/dashboard-encryption-keys-repo.d.ts +48 -0
  137. package/dist/db/repos/signing-keys-repo.d.ts +34 -0
  138. package/dist/db/types.d.ts +499 -66
  139. package/dist/deployment/deployment-identity.d.ts +87 -2
  140. package/dist/diagnostics/checks/backup.d.ts +18 -0
  141. package/dist/diagnostics/checks/index.d.ts +2 -1
  142. package/dist/diagnostics/fleet-collector.d.ts +1 -1
  143. package/dist/drain/drain-controller.d.ts +52 -0
  144. package/dist/events/batch-accumulator.d.ts +63 -0
  145. package/dist/events/circuit-breaker.d.ts +9 -3
  146. package/dist/events/event-emitter.d.ts +31 -0
  147. package/dist/events/event-retry-scanner.d.ts +12 -2
  148. package/dist/events/event-router.d.ts +29 -0
  149. package/dist/firecracker/host-network.d.ts +2 -0
  150. package/dist/firecracker/net-interfaces.d.ts +14 -0
  151. package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +19 -9
  152. package/dist/index.d.ts +2 -0
  153. package/dist/index.js +625 -22
  154. package/dist/lockfile-cache.d.ts +4 -0
  155. package/dist/lockfile-validate.d.ts +16 -9
  156. package/dist/metrics/prometheus.d.ts +114 -15
  157. package/dist/oidc/aws-kms-signer.d.ts +37 -0
  158. package/dist/oidc/command-signer.d.ts +23 -0
  159. package/dist/oidc/db-signer.d.ts +48 -0
  160. package/dist/oidc/id-token-claims.d.ts +76 -0
  161. package/dist/oidc/jwt.d.ts +18 -0
  162. package/dist/oidc/local-dev-signer.d.ts +31 -0
  163. package/dist/oidc/local-mint.d.ts +77 -0
  164. package/dist/oidc/oidc-mint-registration.d.ts +65 -0
  165. package/dist/oidc/orchestrator-mint.d.ts +97 -0
  166. package/dist/oidc/orchestrator-signer-factory.d.ts +33 -0
  167. package/dist/oidc/reconcile-signing-key.d.ts +21 -0
  168. package/dist/oidc/signer.d.ts +25 -0
  169. package/dist/oidc/signing-key-status.d.ts +23 -0
  170. package/dist/orchestrator-core.d.ts +42 -2
  171. package/dist/pipeline/decorating-secret-resolver.d.ts +5 -4
  172. package/dist/pipeline/dispatch-matched-workflow.d.ts +44 -3
  173. package/dist/pipeline/inline-eval.d.ts +2 -2
  174. package/dist/pipeline/install-secrets-resolver.d.ts +25 -14
  175. package/dist/pipeline/{job-environments.d.ts → job-contexts.d.ts} +23 -23
  176. package/dist/pipeline/manual-schedule.d.ts +28 -14
  177. package/dist/pipeline/pending-workflow-context.d.ts +1 -1
  178. package/dist/pipeline/process-webhook.d.ts +57 -2
  179. package/dist/pipeline/processor.d.ts +49 -13
  180. package/dist/pipeline/request-idempotency.d.ts +28 -0
  181. package/dist/pipeline/rerun.d.ts +20 -13
  182. package/dist/pipeline/resolve-sandbox-grant.d.ts +28 -0
  183. package/dist/pipeline/resume-workflow.d.ts +1 -1
  184. package/dist/pipeline/route-or-dispatch-jobs.d.ts +71 -0
  185. package/dist/pipeline/sandbox-allowlist-reader.d.ts +33 -0
  186. package/dist/pipeline/test-pipeline.d.ts +2 -2
  187. package/dist/policy/dashboard-write-policy.d.ts +9 -4
  188. package/dist/provenance/backfill-run.d.ts +1 -0
  189. package/dist/provenance/trust-root.d.ts +20 -0
  190. package/dist/provider-registry.d.ts +8 -0
  191. package/dist/providers/generic/normalizer.d.ts +1 -1
  192. package/dist/providers/github/auth.d.ts +1 -1
  193. package/dist/providers/github/changed-files.d.ts +14 -6
  194. package/dist/providers/github/check-status-poster.d.ts +19 -3
  195. package/dist/providers/github/contributor-resolver.d.ts +1 -1
  196. package/dist/providers/github/lock-file.d.ts +1 -1
  197. package/dist/providers/github/normalizer.d.ts +1 -1
  198. package/dist/providers/github/repo-url.d.ts +1 -1
  199. package/dist/providers/local/index.d.ts +1 -0
  200. package/dist/providers/local/local-source-config.d.ts +1 -0
  201. package/dist/providers/local/lock-file-fetcher.d.ts +1 -1
  202. package/dist/providers/local/normalizer.d.ts +1 -1
  203. package/dist/providers/local/repo-url-builder.d.ts +1 -1
  204. package/dist/providers/universal-git/changed-files.d.ts +8 -7
  205. package/dist/providers/universal-git/clone-token.d.ts +1 -1
  206. package/dist/providers/universal-git/config.d.ts +4 -4
  207. package/dist/providers/universal-git/index.d.ts +5 -1
  208. package/dist/providers/universal-git/lock-file.d.ts +6 -1
  209. package/dist/providers/universal-git/normalizer.d.ts +1 -1
  210. package/dist/providers/universal-git/repo-url.d.ts +1 -1
  211. package/dist/queue/cleanup.d.ts +69 -8
  212. package/dist/queue/job-queue.d.ts +94 -14
  213. package/dist/queue/scheduled-job.d.ts +2 -2
  214. package/dist/registration/registration-index.d.ts +1 -1
  215. package/dist/reporting/agent-failure-category.d.ts +4 -1
  216. package/dist/reporting/check-run-reporter.d.ts +34 -14
  217. package/dist/reporting/check-run-tracking-store.d.ts +70 -8
  218. package/dist/reporting/execution-tracker.d.ts +173 -17
  219. package/dist/reporting/fs-log-storage.d.ts +31 -2
  220. package/dist/reporting/job-check-run-completion.d.ts +50 -0
  221. package/dist/reporting/log-chunk-sink.d.ts +47 -0
  222. package/dist/reporting/log-retention.d.ts +16 -0
  223. package/dist/reporting/log-storage.d.ts +64 -4
  224. package/dist/reporting/log-writer.d.ts +22 -7
  225. package/dist/reporting/peer-log-normalize.d.ts +14 -0
  226. package/dist/reporting/run-aggregator.d.ts +36 -36
  227. package/dist/reporting/s3-log-storage.d.ts +102 -8
  228. package/dist/routes/admin-auth.d.ts +90 -0
  229. package/dist/routes/admin-cluster-settings.d.ts +31 -0
  230. package/dist/routes/admin-contexts.d.ts +47 -0
  231. package/dist/routes/admin-events.d.ts +3 -0
  232. package/dist/routes/admin-orchestrator-drain.d.ts +35 -0
  233. package/dist/routes/admin-registrations.d.ts +2 -2
  234. package/dist/routes/admin-runs.d.ts +9 -0
  235. package/dist/routes/admin-sources.d.ts +7 -0
  236. package/dist/routes/admin-trust-policy.d.ts +49 -0
  237. package/dist/routes/admin.d.ts +15 -1
  238. package/dist/routes/github-webhook.d.ts +9 -3
  239. package/dist/routes/provenance-oidc.d.ts +38 -0
  240. package/dist/routes/verify-attestation.d.ts +21 -0
  241. package/dist/scaler/bare-metal-backend.d.ts +9 -2
  242. package/dist/scaler/config.d.ts +25 -4
  243. package/dist/scaler/container-backend.d.ts +9 -1
  244. package/dist/scaler/firecracker-backend.d.ts +29 -2
  245. package/dist/scaler/index.d.ts +1 -1
  246. package/dist/scaler/manager.d.ts +166 -8
  247. package/dist/scaler/pending-scale-sweeper.d.ts +35 -0
  248. package/dist/scaler/types.d.ts +75 -6
  249. package/dist/secrets/backend-registry.d.ts +32 -1
  250. package/dist/secrets/context-secret-resolver.d.ts +30 -0
  251. package/dist/secrets/dashboard-encryption-key.d.ts +48 -0
  252. package/dist/secrets/ephemeral-keys.d.ts +16 -0
  253. package/dist/secrets/index.d.ts +1 -1
  254. package/dist/secrets/pg-secret-store.d.ts +13 -3
  255. package/dist/secrets/rbac.d.ts +5 -1
  256. package/dist/secrets/routing-key-scope.d.ts +6 -0
  257. package/dist/secrets/scope-routing.d.ts +126 -0
  258. package/dist/secrets/secret-resolver.d.ts +19 -32
  259. package/dist/secrets/token-manager.d.ts +5 -1
  260. package/dist/security/comment-handler.d.ts +1 -1
  261. package/dist/security/contributor-cache.d.ts +9 -1
  262. package/dist/security/trust-policy-gate.d.ts +117 -0
  263. package/dist/security/trust-policy-store.d.ts +78 -0
  264. package/dist/server.js +44012 -32721
  265. package/dist/sources/source-manager.d.ts +24 -0
  266. package/dist/stale-detector/stale-run-detector.d.ts +8 -1
  267. package/dist/standalone.js +44106 -33690
  268. package/dist/storage/blob-routes.d.ts +16 -0
  269. package/dist/storage/filesystem.d.ts +17 -0
  270. package/dist/storage/key-discriminator.d.ts +20 -0
  271. package/dist/storage/s3.d.ts +2 -0
  272. package/dist/storage/types.d.ts +16 -0
  273. package/dist/webhook/dedup.d.ts +9 -1
  274. package/dist/webhook/event-log.d.ts +13 -2
  275. package/dist/webhook/generic-sources-listener.d.ts +4 -0
  276. package/dist/webhook/ingest-admission.d.ts +140 -0
  277. package/dist/webhook/ingest-overflow-buffer.d.ts +27 -0
  278. package/dist/webhook/ingest-overflow-replayer.d.ts +49 -0
  279. package/dist/webhook/ingest-overflow-types.d.ts +73 -0
  280. package/dist/webhook/loop-lag-source.d.ts +40 -0
  281. package/dist/webhook/observed-relay-guard.d.ts +40 -0
  282. package/dist/webhook/org-ingest-cap-reader.d.ts +24 -0
  283. package/dist/webhook/register-source-bundle.d.ts +3 -0
  284. package/dist/webhook/relay-reinject.d.ts +43 -0
  285. package/dist/worker/in-memory-job-queue.d.ts +8 -3
  286. package/dist/worker-core.d.ts +10 -0
  287. package/dist/ws/agent-api-registry.d.ts +20 -0
  288. package/dist/ws/agent-handler.d.ts +63 -7
  289. package/dist/ws/bringup-api.d.ts +99 -0
  290. package/dist/ws/{dashboard-env-handler.d.ts → dashboard-context-handler.d.ts} +43 -25
  291. package/dist/ws/dashboard-run-state-handler.d.ts +31 -0
  292. package/dist/ws/failure-messages.d.ts +29 -0
  293. package/dist/ws/oidc-token-relay.d.ts +15 -0
  294. package/dist/ws/ownership-gate.d.ts +22 -0
  295. package/dist/ws/platform-client.d.ts +96 -1
  296. package/dist/ws/replay-chunker.d.ts +37 -0
  297. package/installer-image-digests.json +3 -3
  298. package/package.json +22 -21
  299. package/sbom.spdx.json +1245 -1793
  300. package/dist/cli/commands/environment.d.ts +0 -25
  301. package/dist/environments/binding-store.d.ts +0 -36
  302. package/dist/environments/environment-store.d.ts +0 -87
  303. package/dist/environments/protection/aggregate.d.ts +0 -43
  304. package/dist/environments/protection/branch-gate.d.ts +0 -5
  305. package/dist/environments/protection/concurrency-gate.d.ts +0 -7
  306. package/dist/environments/protection/reviewer-gate.d.ts +0 -7
  307. package/dist/environments/protection/trust-gate.d.ts +0 -7
  308. package/dist/environments/protection/wait-timer-gate.d.ts +0 -7
  309. package/dist/environments/variable-store.d.ts +0 -39
  310. package/dist/routes/admin-environments.d.ts +0 -47
@@ -0,0 +1,17 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Create `cluster_settings`: a single-row (id='default') table of fleet-wide
4
+ * operator tunables. Each knob column is nullable; NULL = "use the cluster
5
+ * default from config.ts". Distinct from org_settings (per customer_id) — these
6
+ * knobs have no per-tenant meaning (process-global singletons, ingest before
7
+ * org resolution, per-agent-instance, leader-only sweepers), so they live on a
8
+ * dedicated cluster-global table rather than a magic customer_id row.
9
+ *
10
+ * Read via ClusterSettingsReader (whole-row, short-TTL cache); written via the
11
+ * `/api/v1/admin/cluster-settings` route and `kici-admin cluster-settings` CLI.
12
+ *
13
+ * Idempotent: a re-run on a DB that already has the table is a no-op.
14
+ */
15
+ export declare function up(db: Kysely<unknown>): Promise<void>;
16
+ export declare function down(db: Kysely<unknown>): Promise<void>;
17
+ //# sourceMappingURL=080_cluster_settings.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `org_settings.queue_timeout_ms BIGINT` (nullable).
4
+ *
5
+ * Per-org dispatch-queue job timeout. A queued job's deadline is
6
+ * `job.timeoutMs ?? <per-org queue_timeout_ms> ?? config.queueTimeoutMs`.
7
+ * NULL falls back to the cluster-wide default (`KICI_QUEUE_TIMEOUT_MS`,
8
+ * default 1h). Operators tune it per tenant via
9
+ * `kici-admin org-settings queue-timeout`.
10
+ *
11
+ * This is the one genuinely per-job tunable from the tunables audit — the
12
+ * read site (`JobQueue.enqueue`) has the job's `cacheOrgId` in scope. The
13
+ * fleet-wide tunables live on `cluster_settings` (migration 080) instead.
14
+ *
15
+ * Idempotent: a re-run on a DB that already has the column is a no-op.
16
+ */
17
+ export declare function up(db: Kysely<unknown>): Promise<void>;
18
+ export declare function down(db: Kysely<unknown>): Promise<void>;
19
+ //# sourceMappingURL=081_org_settings_queue_timeout.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `host_roster.s3_reachable BOOLEAN` (nullable).
4
+ *
5
+ * Per-host delivery hint for fresh-box bring-up: when true, the box can reach
6
+ * the orchestrator's object storage, so the bring-up handler picks the
7
+ * `s3-direct` delivery mode (the box pulls the payload via a presigned URL
8
+ * itself, no 50 MB through the ops agent). NULL / false ⇒ the conservative
9
+ * `ssh-push` fallback (the ops agent fetches the payload and streams it to the
10
+ * box over scp). Declared via `kici-admin host declare --s3-reachable`.
11
+ *
12
+ * Idempotent: a re-run on a DB that already has the column is a no-op.
13
+ */
14
+ export declare function up(db: Kysely<unknown>): Promise<void>;
15
+ export declare function down(db: Kysely<unknown>): Promise<void>;
16
+ //# sourceMappingURL=082_host_s3_reachable.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `org_settings.artifact_max_bytes` + `artifact_max_per_run` (both nullable
4
+ * BIGINT).
5
+ *
6
+ * Per-org overrides of the per-artifact size cap and per-run artifact count cap
7
+ * for user-facing artifacts (ctx.artifacts). NULL falls back to the cluster-wide
8
+ * default (`config.artifactMaxBytes` / `config.artifactMaxPerRun`,
9
+ * `KICI_ARTIFACT_MAX_BYTES` / `KICI_ARTIFACT_MAX_PER_RUN`). Operators tune them
10
+ * per tenant via `kici-admin org-settings artifacts set-max-bytes` /
11
+ * `set-max-per-run`.
12
+ *
13
+ * Idempotent: guarded on column existence; a re-run on a DB that already has a
14
+ * column is a no-op.
15
+ */
16
+ export declare function up(db: Kysely<unknown>): Promise<void>;
17
+ export declare function down(db: Kysely<unknown>): Promise<void>;
18
+ //# sourceMappingURL=083_org_settings_artifact_caps.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add the `orchestrator_signing_keys` table: the cluster-scoped, long-lived
4
+ * ES256 provenance signing keys the orchestrator uses to sign its own build
5
+ * attestations. One `active` key signs; rotated-out keys go `retiring` then
6
+ * `retired` (still served in the JWKS so historical attestations keep
7
+ * verifying); `revoked` keys are removed from the trust root.
8
+ *
9
+ * `public_jwk` is the non-secret public half served at `/.well-known/jwks.json`.
10
+ * `encrypted_private_jwk` holds the AES-256-GCM-wrapped private JWK for `db`
11
+ * custody (wrapped with the orchestrator's `KICI_SECRET_KEY` master key, same
12
+ * posture as `scoped_secrets`) and is NULL for `aws-kms` / `command` custody
13
+ * where the private key never lives in the DB. `key_ref` locates the external
14
+ * key (KMS ARN / signer command) for non-`db` custody.
15
+ *
16
+ * Idempotent: guarded on table existence.
17
+ */
18
+ export declare function up(db: Kysely<unknown>): Promise<void>;
19
+ export declare function down(db: Kysely<unknown>): Promise<void>;
20
+ //# sourceMappingURL=084_orchestrator_signing_keys.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.reroute_flap_grace_ms` (nullable BIGINT).
4
+ *
5
+ * Fleet-wide grace window (ms) during which a rerouted job stays deferred from the recovery sweepers while its worker peer momentarily flaps. NULL → cluster default (`config.rerouteFlapGraceMs`, `KICI_REROUTE_FLAP_GRACE_MS`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=085_cluster_settings_reroute_flap_grace_ms.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.max_fanout_hosts` (nullable INTEGER).
4
+ *
5
+ * Fleet-wide cap on `runsOnAll` per-host fan-out children. NULL → cluster default (`config.maxFanoutHosts`, `KICI_MAX_FANOUT_HOSTS`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=086_cluster_settings_max_fanout_hosts.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.event_router_rate_limit_per_workflow_per_minute` (nullable INTEGER).
4
+ *
5
+ * Fleet-wide per-(source routing key + event) sliding-window rate limit (events/minute) for the event router. NULL → cluster default (`config.eventRouterRateLimitPerWorkflowPerMinute`, `KICI_EVENT_ROUTER_RATE_LIMIT_PER_WORKFLOW_PER_MINUTE`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=087_cluster_settings_event_router_rate_limit.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.cache_max_tarball_bytes` (nullable BIGINT).
4
+ *
5
+ * Fleet-wide maximum dependency-cache tarball size (bytes); a larger store is rejected. NULL → cluster default (`config.cacheMaxTarballBytes`, `KICI_CACHE_MAX_TARBALL_BYTES`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=088_cluster_settings_cache_max_tarball_bytes.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.cache_ttl_days` (nullable INTEGER).
4
+ *
5
+ * Fleet-wide dependency-cache entry TTL (days). An entry unread for longer is treated as expired on the next lookup. NULL → cluster default (`config.cacheTtlDays`, `KICI_CACHE_TTL_DAYS`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=089_cluster_settings_cache_ttl_days.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.concurrency_wait_timeout_ms` (nullable BIGINT).
4
+ *
5
+ * Fleet-wide agent concurrency-slot wait timeout (ms), pushed to the agent on `job.dispatch`. NULL → cluster default (`config.concurrencyWaitTimeoutMs`, `KICI_CONCURRENCY_WAIT_TIMEOUT_MS`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=090_cluster_settings_concurrency_wait_timeout_ms.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.agent_token_ttl_ms` (nullable BIGINT).
4
+ *
5
+ * Fleet-wide ephemeral agent-token TTL (ms), resolved by the leader at spawn. NULL → cluster default (`config.agentTokenTtlMs`, `KICI_AGENT_TOKEN_TTL_MS`).
6
+ *
7
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
8
+ * the column is a no-op.
9
+ */
10
+ export declare function up(db: Kysely<unknown>): Promise<void>;
11
+ export declare function down(db: Kysely<unknown>): Promise<void>;
12
+ //# sourceMappingURL=091_cluster_settings_agent_token_ttl_ms.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.version` (monotonic BIGINT, bumped on each settings
4
+ * change).
5
+ *
6
+ * The leader advertises this version on `peer.heartbeat` so DB-less workers can
7
+ * detect a change and pull the worker-relevant settings snapshot. DB-backed
8
+ * (not an in-memory counter) so it survives leader failover: a newly-elected
9
+ * leader continues monotonically from the row's current value.
10
+ *
11
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
12
+ * the column is a no-op.
13
+ */
14
+ export declare function up(db: Kysely<unknown>): Promise<void>;
15
+ export declare function down(db: Kysely<unknown>): Promise<void>;
16
+ //# sourceMappingURL=092_cluster_settings_version.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { type Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=093_org_settings_sandbox_allowlist.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add the `dashboard_encryption_keys` table: the cluster-scoped, long-lived
4
+ * X25519 keypair the orchestrator owns for browser-sealed dashboard writes.
5
+ * Under the `encrypted` dashboard-write posture the browser seals a secret /
6
+ * variable value to the `active` key's public half before it leaves the page,
7
+ * so the hosted Platform relays only opaque ciphertext.
8
+ *
9
+ * Modeled on `orchestrator_signing_keys` (migration 084). `public_jwk` is the
10
+ * non-secret OKP/X25519 public JWK (`use:'enc'`) served at
11
+ * `/.well-known/jwks.json`. `encrypted_private_key` holds the AES-256-GCM
12
+ * master-key-wrapped (KICI_SECRET_KEY) DER private key — db custody only, so it
13
+ * is NOT NULL. One `active` key seals; a rotated-out key goes `revoked` and
14
+ * leaves the published JWKS, while its row stays so envelopes already sealed to
15
+ * it still decrypt.
16
+ *
17
+ * Idempotent: guarded on table existence.
18
+ */
19
+ export declare function up(db: Kysely<unknown>): Promise<void>;
20
+ export declare function down(db: Kysely<unknown>): Promise<void>;
21
+ //# sourceMappingURL=094_dashboard_encryption_keys.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Migrate stored `org_settings.dashboard_write_policy` JSONB from the legacy
4
+ * boolean shape to the tri-state `permissive | encrypted | disabled` shape:
5
+ *
6
+ * - `false` (disabled) → `"disabled"`
7
+ * - `true` (permissive) → key dropped (permissive is the absent-key default,
8
+ * keeping the JSONB minimal — matches setDashboardWritePolicy normalization)
9
+ * - already-string enum values → left untouched (idempotent re-run)
10
+ *
11
+ * Runtime reads coerce booleans defensively too (so an un-migrated row is never
12
+ * mis-read), but this migration normalizes the at-rest shape so the stored JSONB
13
+ * matches what the tri-state writer produces.
14
+ *
15
+ * Pure SQL rewrite: for each row, rebuild the object keeping only non-`true`
16
+ * entries and mapping `false` → `'disabled'`, leaving existing string values.
17
+ */
18
+ export declare function up(db: Kysely<unknown>): Promise<void>;
19
+ export declare function down(): Promise<void>;
20
+ //# sourceMappingURL=095_dashboard_write_policy_tristate.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { type Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=096_multi_schedule_cron_last_fired.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { type Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=097_execution_runs_pr_number.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { type Kysely } from 'kysely';
2
+ export declare function up(db: Kysely<unknown>): Promise<void>;
3
+ export declare function down(db: Kysely<unknown>): Promise<void>;
4
+ //# sourceMappingURL=098_execution_runs_customer_id.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.dashboard_verified_issuer` (nullable text).
4
+ *
5
+ * The verified-tier origin the dashboard fetches the orchestrator's X25519
6
+ * dashboard-encryption public key from — and always displays next to a secret /
7
+ * variable entry field — under the `encrypted` dashboard-write posture. Fetching
8
+ * the key straight from the customer's own origin makes TLS to that domain the
9
+ * trust root, so an active hosted-control-plane MITM of the key cannot happen.
10
+ *
11
+ * Cluster-global (one orchestrator identity, one `.well-known`), not per-tenant,
12
+ * so it lives on `cluster_settings` rather than `org_settings`. The tier is
13
+ * explicit opt-in with no environment fallback: NULL ⇒ the verified tier is not
14
+ * offered and the convenient tier is used.
15
+ *
16
+ * Idempotent: guarded on column existence; a re-run on a DB that already has the
17
+ * column is a no-op.
18
+ */
19
+ export declare function up(db: Kysely<unknown>): Promise<void>;
20
+ export declare function down(db: Kysely<unknown>): Promise<void>;
21
+ //# sourceMappingURL=099_cluster_settings_dashboard_verified_issuer.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Realign `held_runs.hold_type` onto the engine's `HoldType` vocabulary.
4
+ *
5
+ * The column carries two spellings the gates never emit: `approval` for a
6
+ * reviewer hold and `wait_timer` for a workflow-install wait hold. The
7
+ * dashboard switches on the gate vocabulary, so both fall through to the gray
8
+ * unknown-type badge — and two semantically identical wait holds render
9
+ * differently depending on which gate produced them.
10
+ *
11
+ * Writers emit the gate vocabulary; this backfills the history. The read path
12
+ * also normalizes (`normalizePersistedHoldType`) and the wait-hold release
13
+ * sweep matches both spellings, so a row written by an un-upgraded
14
+ * orchestrator behaves correctly whether or not this has run — the two sides
15
+ * deploy independently.
16
+ *
17
+ * Idempotent: a second run matches no rows.
18
+ */
19
+ export declare function up(db: Kysely<unknown>): Promise<void>;
20
+ /**
21
+ * Rewrite the gate vocabulary back to the legacy spellings.
22
+ *
23
+ * Deliberately asymmetric: it rewrites *every* `reviewer` / `timer` row,
24
+ * including rows that were always written that way (a dispatch-gate wait hold
25
+ * has persisted as `timer` all along). That is the right trade for a rollback —
26
+ * an orchestrator running the older code matches its wait-hold release sweep on
27
+ * `wait_timer` alone, so leaving those rows spelled `timer` would strand them
28
+ * in the expire-and-fail path.
29
+ */
30
+ export declare function down(db: Kysely<unknown>): Promise<void>;
31
+ //# sourceMappingURL=100_held_runs_hold_type_vocabulary.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Give the context hold expiry a single default, and retire the stored zeroes.
4
+ *
5
+ * `contexts.hold_expiry_seconds` carried `DEFAULT 86400` while every read-side
6
+ * fallback and the operator docs used 3600 — so a context created without an
7
+ * expiry held for 24 h, and one whose expiry was cleared held for 1 h. Dropping
8
+ * the DDL default (rather than moving it to 3600) makes both paths land on NULL
9
+ * and resolve through `DEFAULT_HOLD_EXPIRY_SECONDS`, so the two cannot drift
10
+ * apart again.
11
+ *
12
+ * The backfill is the other half of rejecting a zero expiry at the write
13
+ * boundary: a stored `0` puts every hold's deadline at the current instant, so
14
+ * the hold is swept to `expired` before a reviewer can act. Validation alone
15
+ * only stops new zeroes arriving; these rows already exist and there was no CLI
16
+ * path to notice them.
17
+ *
18
+ * Idempotent: dropping an absent default is a no-op and the UPDATE matches no
19
+ * rows on a second run.
20
+ */
21
+ export declare function up(db: Kysely<unknown>): Promise<void>;
22
+ /**
23
+ * Restore the column's original default.
24
+ *
25
+ * Deliberately asymmetric: the zeroed rows are NOT recreated. After the
26
+ * backfill they are indistinguishable from a deliberate NULL, and a row put
27
+ * back to `0` would resume cancelling every hold on its context — so a
28
+ * rollback keeps them on the fallback rather than re-breaking them.
29
+ */
30
+ export declare function down(db: Kysely<unknown>): Promise<void>;
31
+ //# sourceMappingURL=101_contexts_hold_expiry_drop_default.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `dispatch_queue.agent_id` (nullable text).
4
+ *
5
+ * The durable record of which agent a job was dispatched to. `ack_agent_id` is
6
+ * cleared the moment the agent answers the dispatch, so it cannot answer "who
7
+ * owns this job?" for the rest of the job's life; this column is written at
8
+ * dispatch and cleared only on requeue, so a coordinator that never saw the
9
+ * dispatch — a freshly-elected leader after a failover — can still resolve
10
+ * ownership of a live `dispatched` row straight from the database.
11
+ *
12
+ * Nullable with no backfill: a row dispatched before this migration keeps a NULL
13
+ * owner and resolves to "not owned", which is the behaviour it already had.
14
+ *
15
+ * Idempotent: guarded on column existence; a re-run on a DB that already has the
16
+ * column is a no-op.
17
+ */
18
+ export declare function up(db: Kysely<unknown>): Promise<void>;
19
+ export declare function down(db: Kysely<unknown>): Promise<void>;
20
+ //# sourceMappingURL=102_dispatch_queue_agent_id.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.ownership_db_check_timeout_ms` (nullable bigint).
4
+ *
5
+ * Deadline for a single database-backed agent-ownership lookup. The lookup runs
6
+ * on the inbound path of every job-scoped agent frame whose in-memory ownership
7
+ * check misses, so a slow database would otherwise stall the frame; past the
8
+ * deadline the lookup resolves as undecided and the frame is refused without
9
+ * counting an ownership violation.
10
+ *
11
+ * Cluster-global (every coordinator talks to the same database), so it lives on
12
+ * `cluster_settings` rather than `org_settings`. NULL ⇒ the orchestrator's own
13
+ * configured default applies.
14
+ *
15
+ * Idempotent: guarded on column existence; a re-run on a DB that already has the
16
+ * column is a no-op.
17
+ */
18
+ export declare function up(db: Kysely<unknown>): Promise<void>;
19
+ export declare function down(db: Kysely<unknown>): Promise<void>;
20
+ //# sourceMappingURL=103_cluster_settings_ownership_db_check_timeout_ms.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `check_run_tracking.terminal_sent_at` (nullable timestamptz).
4
+ *
5
+ * `check_run_id` is written at CREATE time, while the check run is still
6
+ * `queued`, so it proves creation and never completion. Without a completion
7
+ * signal a check run stuck `queued` on the provider is indistinguishable from
8
+ * the provider simply lagging, which is what made a check-run poll timeout
9
+ * unattributable: nothing on our side recorded whether the terminal update had
10
+ * been sent at all.
11
+ *
12
+ * Stamped only after the provider accepts a `completed` update. Nullable and
13
+ * best-effort like every write on this table — a tracking write must never
14
+ * break check-run reporting — so NULL means "we have no record of sending it",
15
+ * not "it was never sent".
16
+ *
17
+ * Idempotent: guarded on column existence; a re-run on a DB that already has
18
+ * the column is a no-op.
19
+ */
20
+ export declare function up(db: Kysely<unknown>): Promise<void>;
21
+ export declare function down(db: Kysely<unknown>): Promise<void>;
22
+ //# sourceMappingURL=104_check_run_terminal_sent.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Create `org_trust_policy` — the orchestrator's cache of the Platform-owned org
4
+ * trust policy pushed on `trust_policy.update`.
5
+ *
6
+ * A dedicated table rather than `org_settings` columns, because this is
7
+ * Platform-owned policy the orchestrator consumes, not operator-owned config the
8
+ * operator tunes. `source` records which of the two wrote the row so the admin
9
+ * surface can present a Platform-managed policy as read-only.
10
+ *
11
+ * Persisting rather than caching in memory is deliberate: a security policy that
12
+ * silently reverts to a default across a restart is worse than one that is never
13
+ * applied.
14
+ *
15
+ * Idempotent: guarded by IF NOT EXISTS, so a re-run is a no-op.
16
+ */
17
+ export declare function up(db: Kysely<unknown>): Promise<void>;
18
+ export declare function down(db: Kysely<unknown>): Promise<void>;
19
+ //# sourceMappingURL=105_org_trust_policy.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `cluster_settings.check_run_tracking_ttl_days` (nullable integer).
4
+ *
5
+ * Retention window for `check_run_tracking` rows. The hourly cleanup sweep
6
+ * deletes rows untouched for longer than this; 0 disables the sweep.
7
+ *
8
+ * Cluster-global (the sweep runs once per fleet on the cleanup tick, with no
9
+ * tenant in scope at the read site), so it lives on `cluster_settings` rather
10
+ * than `org_settings`. NULL means the orchestrator's own configured default
11
+ * applies.
12
+ *
13
+ * Idempotent: guarded on column existence; a re-run on a database that already
14
+ * has the column is a no-op.
15
+ */
16
+ export declare function up(db: Kysely<unknown>): Promise<void>;
17
+ export declare function down(db: Kysely<unknown>): Promise<void>;
18
+ //# sourceMappingURL=106_cluster_settings_check_run_tracking_ttl_days.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { type Kysely } from 'kysely';
2
+ /**
3
+ * Add `idx_check_run_tracking_updated_at` on `check_run_tracking (updated_at)`.
4
+ *
5
+ * `CheckRunTrackingStore.pruneStale` — the hourly retention sweep — filters
6
+ * `WHERE updated_at < now() - <window>`. The table already carries two indexes
7
+ * — the primary key on `(provider, owner, repo, sha, check_name)` and the
8
+ * partial `idx_check_run_tracking_run_id` — but `updated_at` leads neither, so
9
+ * that predicate can use neither and without this index every sweep
10
+ * sequentially scans the whole table. The scan
11
+ * is worst exactly where it hurts: a deployment that accumulated rows before
12
+ * retention existed has the largest table and gets the scan hourly, on every
13
+ * coordinator, since the cleanup tick is not leader-gated.
14
+ *
15
+ * Mirrors `idx_dispatch_queue_run_id` (migration 072) and
16
+ * `idx_request_idempotency_created_at` (migration 068), both of which exist to
17
+ * index a TTL sweep's prune predicate.
18
+ *
19
+ * Idempotent: `IF NOT EXISTS` makes a re-run a no-op.
20
+ */
21
+ export declare function up(db: Kysely<unknown>): Promise<void>;
22
+ export declare function down(db: Kysely<unknown>): Promise<void>;
23
+ //# sourceMappingURL=107_check_run_tracking_updated_at_index.d.ts.map
@@ -0,0 +1,48 @@
1
+ import type { Kysely } from 'kysely';
2
+ import type { Database, DashboardEncryptionKeyRow } from '../types.js';
3
+ /** Lifecycle status values for a dashboard-encryption key. */
4
+ export declare const DashboardEncryptionKeyStatus: {
5
+ readonly active: 'active';
6
+ readonly revoked: 'revoked';
7
+ };
8
+ export type DashboardEncryptionKeyStatus = (typeof DashboardEncryptionKeyStatus)[keyof typeof DashboardEncryptionKeyStatus];
9
+ export interface UpsertActiveEncryptionKeyInput {
10
+ kid: string;
11
+ public_jwk: Record<string, unknown>;
12
+ /** AES-256-GCM-wrapped DER private key (master-key wrapped). */
13
+ encrypted_private_key: string;
14
+ }
15
+ /**
16
+ * Repository for the orchestrator's dashboard-encryption (X25519) keys. One
17
+ * `active` key seals browser writes; a rotated-out key is `revoked`, which drops
18
+ * it from the published JWKS ({@link listNonRevoked}) so new seals only ever use
19
+ * the current key, while its row — and therefore its wrapped private half —
20
+ * stays on record ({@link getByKid}) so an envelope a browser already sealed to
21
+ * the old `kid` still decrypts. Mirrors the activate/demote transaction shape of
22
+ * `OrchestratorSigningKeyRepo`.
23
+ */
24
+ export declare class DashboardEncryptionKeyRepo {
25
+ private readonly db;
26
+ constructor(db: Kysely<Database>);
27
+ /** Public keys published in the JWKS (the active key; revoked ones drop out). */
28
+ listNonRevoked(): Promise<DashboardEncryptionKeyRow[]>;
29
+ /** Every key on record: the active one plus every rotated-out (revoked) one. */
30
+ listServed(): Promise<DashboardEncryptionKeyRow[]>;
31
+ /** The single currently-active key row, or null when none is active. */
32
+ getActiveRow(): Promise<DashboardEncryptionKeyRow | null>;
33
+ /** Resolve a key (active or rotated-out) by kid, or null. */
34
+ getByKid(kid: string): Promise<DashboardEncryptionKeyRow | null>;
35
+ /**
36
+ * Activate `input.kid`. If already active, no-op. Otherwise demote any
37
+ * current active key to `revoked` and insert this kid as `active`, in one
38
+ * transaction. Returns true when a NEW kid was activated (caller audits).
39
+ */
40
+ upsertActive(input: UpsertActiveEncryptionKeyInput): Promise<boolean>;
41
+ /**
42
+ * Mark a key revoked (rotation / compromise). It leaves the published JWKS
43
+ * immediately, but its private half stays on record, so a browser still
44
+ * holding the old kid keeps decrypting until the row is deleted.
45
+ */
46
+ revoke(kid: string, reason: string): Promise<void>;
47
+ }
48
+ //# sourceMappingURL=dashboard-encryption-keys-repo.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { Kysely } from 'kysely';
2
+ import type { Database, OrchestratorSigningKeyRow } from '../types.js';
3
+ export interface UpsertActiveInput {
4
+ kid: string;
5
+ public_jwk: Record<string, unknown>;
6
+ /** Wrapped private JWK for `db` custody; null for `aws-kms` / `command`. */
7
+ encrypted_private_jwk: string | null;
8
+ alg: string;
9
+ signer_kind: string;
10
+ key_ref: string | null;
11
+ }
12
+ /**
13
+ * Repository for the orchestrator's provenance signing keys. Ports the Platform's
14
+ * `signing-keys-repo.ts` status model (activate / retire / revoke) and adds
15
+ * `encrypted_private_jwk` custody for `db` keys.
16
+ */
17
+ export declare class OrchestratorSigningKeyRepo {
18
+ private readonly db;
19
+ constructor(db: Kysely<Database>);
20
+ /** Public keys served in the JWKS / trusted for verification (everything except revoked). */
21
+ listTrusted(): Promise<OrchestratorSigningKeyRow[]>;
22
+ /** The single currently-active key row, or null when none is active. */
23
+ getActiveRow(): Promise<OrchestratorSigningKeyRow | null>;
24
+ /**
25
+ * Activate `input.kid`. If it is already active, no-op. Otherwise demote any
26
+ * current active key to `retiring`, upsert this kid as `active`, in one
27
+ * transaction. Returns true when a NEW kid was activated (caller audits).
28
+ * Refuses to reactivate a `revoked` kid.
29
+ */
30
+ upsertActive(input: UpsertActiveInput): Promise<boolean>;
31
+ retire(kid: string): Promise<void>;
32
+ revoke(kid: string, reason: string): Promise<void>;
33
+ }
34
+ //# sourceMappingURL=signing-keys-repo.d.ts.map