@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.
- package/dist/__test-helpers__/mock-db.d.ts +2 -0
- package/dist/agent/dispatcher.d.ts +52 -2
- package/dist/agent/host-roster-reaper.d.ts +1 -2
- package/dist/agent/host-roster.d.ts +34 -0
- package/dist/agent/ownership-refusal.d.ts +12 -0
- package/dist/agent/ownership-tracker.d.ts +64 -16
- package/dist/agent/token-store.d.ts +13 -0
- package/dist/agent-packaging/availability.d.ts +27 -0
- package/dist/agent-packaging/build-package.d.ts +16 -0
- package/dist/agent-packaging/download.d.ts +30 -0
- package/dist/agent-packaging/index.d.ts +9 -0
- package/dist/agent-packaging/install-closure.d.ts +30 -0
- package/dist/agent-packaging/node-binary.d.ts +26 -0
- package/dist/agent-packaging/refresh.d.ts +50 -0
- package/dist/agent-packaging/store.d.ts +15 -0
- package/dist/agent-packaging/upload.d.ts +24 -0
- package/dist/app-on-error.d.ts +29 -0
- package/dist/app.d.ts +69 -8
- package/dist/approvals/apply-decision.d.ts +1 -1
- package/dist/approvals/step-approval-bridge.d.ts +1 -1
- package/dist/artifacts/artifact-store.d.ts +233 -0
- package/dist/artifacts/failure-messages.d.ts +46 -0
- package/dist/audit/access-log.d.ts +18 -1
- package/dist/cache/dep-cache.d.ts +15 -0
- package/dist/cache/pending-inits.d.ts +4 -4
- package/dist/cache/user-cache.d.ts +37 -0
- package/dist/cancel/cancel-run.d.ts +10 -3
- package/dist/cancel/dashboard-cancel-handler.d.ts +19 -0
- package/dist/cli/api-client.d.ts +51 -5
- package/dist/cli/commands/agent-package.d.ts +34 -0
- package/dist/cli/commands/check-run.d.ts +26 -0
- package/dist/cli/commands/cluster-settings.d.ts +55 -0
- package/dist/cli/commands/context.d.ts +25 -0
- package/dist/cli/commands/dashboard-encryption-key.d.ts +3 -0
- package/dist/cli/commands/db-backup.d.ts +71 -0
- package/dist/cli/commands/debug-bundle.d.ts +1 -1
- package/dist/cli/commands/orchestrator-service/drain.d.ts +31 -0
- package/dist/cli/commands/orchestrator-service/index.d.ts +7 -4
- package/dist/cli/commands/orchestrator-service/install-env.d.ts +58 -0
- package/dist/cli/commands/secret.d.ts +45 -1
- package/dist/cli/commands/shared/admin-cli-access-log.d.ts +46 -0
- package/dist/cli/commands/shared/versioned-upgrade.d.ts +65 -2
- package/dist/cli/commands/signing-key.d.ts +3 -0
- package/dist/cli/commands/source.d.ts +12 -0
- package/dist/cli/commands/token.d.ts +9 -0
- package/dist/cli/commands/trust-policy.d.ts +48 -0
- package/dist/cli/commands/variable.d.ts +6 -6
- package/dist/cli/join.d.ts +1 -1
- package/dist/cli/service/index.d.ts +2 -2
- package/dist/cli/service/instance/manifest.d.ts +17 -0
- package/dist/cli/service/instance/resolve.d.ts +11 -0
- package/dist/cli/service/windows.d.ts +6 -0
- package/dist/cli/wizard/orchestrator-wizard.d.ts +39 -11
- package/dist/cli.js +10263 -3667
- package/dist/cluster/cluster-settings-reader.d.ts +78 -0
- package/dist/cluster/coordinator.d.ts +81 -9
- package/dist/cluster/join-client.d.ts +1 -1
- package/dist/cluster/leader-gated-scheduler.d.ts +50 -0
- package/dist/cluster/orphan-recovery.d.ts +14 -0
- package/dist/cluster/peer-client.d.ts +12 -2
- package/dist/cluster/peer-handler.d.ts +15 -4
- package/dist/cluster/peer-registry.d.ts +12 -0
- package/dist/cluster/verified-issuer-poller.d.ts +11 -0
- package/dist/cluster/verified-issuer.d.ts +63 -0
- package/dist/cold-store/tables/access-log.d.ts +1 -1
- package/dist/cold-store/tables/event-log.d.ts +1 -1
- package/dist/cold-store/tables/execution-jobs.d.ts +1 -1
- package/dist/cold-store/tables/execution-runs.d.ts +1 -1
- package/dist/cold-store/tables/execution-steps.d.ts +1 -1
- package/dist/cold-store/tables/secret-audit-log.d.ts +1 -1
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/resolver.d.ts +2 -1
- package/dist/config/schema.d.ts +8 -6
- package/dist/config/types.d.ts +3 -2
- package/dist/config.d.ts +372 -46
- package/dist/contexts/binding-store.d.ts +36 -0
- package/dist/contexts/context-store.d.ts +100 -0
- package/dist/contexts/glob-specificity.d.ts +30 -0
- package/dist/{environments → contexts}/held-runs.d.ts +64 -32
- package/dist/{environments → contexts}/index.d.ts +1 -1
- package/dist/contexts/protection/aggregate.d.ts +43 -0
- package/dist/contexts/protection/branch-gate.d.ts +5 -0
- package/dist/contexts/protection/concurrency-gate.d.ts +4 -0
- package/dist/{environments → contexts}/protection/pipeline.d.ts +3 -3
- package/dist/contexts/protection/reviewer-gate.d.ts +4 -0
- package/dist/{environments → contexts}/protection/satisfiability.d.ts +22 -22
- package/dist/contexts/protection/trust-gate.d.ts +4 -0
- package/dist/contexts/protection/wait-timer-gate.d.ts +4 -0
- package/dist/contexts/variable-store.d.ts +39 -0
- package/dist/cron/cron-scheduler.d.ts +24 -4
- package/dist/cron/cron-store.d.ts +21 -7
- package/dist/dashboard/attestation-filters.d.ts +94 -74
- package/dist/dashboard/handler.d.ts +63 -3
- package/dist/db/migration-test-harness.d.ts +41 -0
- package/dist/db/migrations/067_environments_to_contexts.d.ts +36 -0
- package/dist/db/migrations/068_request_idempotency.d.ts +17 -0
- package/dist/db/migrations/069_reroute_tunables.d.ts +21 -0
- package/dist/db/migrations/070_execution_runs_failure_class.d.ts +4 -0
- package/dist/db/migrations/071_batch_accumulation.d.ts +26 -0
- package/dist/db/migrations/072_dispatch_queue_run_id_index.d.ts +15 -0
- package/dist/db/migrations/073_org_settings_ingest_concurrency.d.ts +13 -0
- package/dist/db/migrations/074_normalize_zero_concurrency_limit.d.ts +13 -0
- package/dist/db/migrations/075_ingest_overflow_buffer.d.ts +16 -0
- package/dist/db/migrations/076_artifacts.d.ts +19 -0
- package/dist/db/migrations/077_backup_runs.d.ts +13 -0
- package/dist/db/migrations/078_org_settings_backup_staleness.d.ts +12 -0
- package/dist/db/migrations/079_org_settings_scaler_spawn_timeout.d.ts +14 -0
- package/dist/db/migrations/080_cluster_settings.d.ts +17 -0
- package/dist/db/migrations/081_org_settings_queue_timeout.d.ts +19 -0
- package/dist/db/migrations/082_host_s3_reachable.d.ts +16 -0
- package/dist/db/migrations/083_org_settings_artifact_caps.d.ts +18 -0
- package/dist/db/migrations/084_orchestrator_signing_keys.d.ts +20 -0
- package/dist/db/migrations/085_cluster_settings_reroute_flap_grace_ms.d.ts +12 -0
- package/dist/db/migrations/086_cluster_settings_max_fanout_hosts.d.ts +12 -0
- package/dist/db/migrations/087_cluster_settings_event_router_rate_limit.d.ts +12 -0
- package/dist/db/migrations/088_cluster_settings_cache_max_tarball_bytes.d.ts +12 -0
- package/dist/db/migrations/089_cluster_settings_cache_ttl_days.d.ts +12 -0
- package/dist/db/migrations/090_cluster_settings_concurrency_wait_timeout_ms.d.ts +12 -0
- package/dist/db/migrations/091_cluster_settings_agent_token_ttl_ms.d.ts +12 -0
- package/dist/db/migrations/092_cluster_settings_version.d.ts +16 -0
- package/dist/db/migrations/093_org_settings_sandbox_allowlist.d.ts +4 -0
- package/dist/db/migrations/094_dashboard_encryption_keys.d.ts +21 -0
- package/dist/db/migrations/095_dashboard_write_policy_tristate.d.ts +20 -0
- package/dist/db/migrations/096_multi_schedule_cron_last_fired.d.ts +4 -0
- package/dist/db/migrations/097_execution_runs_pr_number.d.ts +4 -0
- package/dist/db/migrations/098_execution_runs_customer_id.d.ts +4 -0
- package/dist/db/migrations/099_cluster_settings_dashboard_verified_issuer.d.ts +21 -0
- package/dist/db/migrations/100_held_runs_hold_type_vocabulary.d.ts +31 -0
- package/dist/db/migrations/101_contexts_hold_expiry_drop_default.d.ts +31 -0
- package/dist/db/migrations/102_dispatch_queue_agent_id.d.ts +20 -0
- package/dist/db/migrations/103_cluster_settings_ownership_db_check_timeout_ms.d.ts +20 -0
- package/dist/db/migrations/104_check_run_terminal_sent.d.ts +22 -0
- package/dist/db/migrations/105_org_trust_policy.d.ts +19 -0
- package/dist/db/migrations/106_cluster_settings_check_run_tracking_ttl_days.d.ts +18 -0
- package/dist/db/migrations/107_check_run_tracking_updated_at_index.d.ts +23 -0
- package/dist/db/repos/dashboard-encryption-keys-repo.d.ts +48 -0
- package/dist/db/repos/signing-keys-repo.d.ts +34 -0
- package/dist/db/types.d.ts +499 -66
- package/dist/deployment/deployment-identity.d.ts +87 -2
- package/dist/diagnostics/checks/backup.d.ts +18 -0
- package/dist/diagnostics/checks/index.d.ts +2 -1
- package/dist/diagnostics/fleet-collector.d.ts +1 -1
- package/dist/drain/drain-controller.d.ts +52 -0
- package/dist/events/batch-accumulator.d.ts +63 -0
- package/dist/events/circuit-breaker.d.ts +9 -3
- package/dist/events/event-emitter.d.ts +31 -0
- package/dist/events/event-retry-scanner.d.ts +12 -2
- package/dist/events/event-router.d.ts +29 -0
- package/dist/firecracker/host-network.d.ts +2 -0
- package/dist/firecracker/net-interfaces.d.ts +14 -0
- package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +19 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +625 -22
- package/dist/lockfile-cache.d.ts +4 -0
- package/dist/lockfile-validate.d.ts +16 -9
- package/dist/metrics/prometheus.d.ts +114 -15
- package/dist/oidc/aws-kms-signer.d.ts +37 -0
- package/dist/oidc/command-signer.d.ts +23 -0
- package/dist/oidc/db-signer.d.ts +48 -0
- package/dist/oidc/id-token-claims.d.ts +76 -0
- package/dist/oidc/jwt.d.ts +18 -0
- package/dist/oidc/local-dev-signer.d.ts +31 -0
- package/dist/oidc/local-mint.d.ts +77 -0
- package/dist/oidc/oidc-mint-registration.d.ts +65 -0
- package/dist/oidc/orchestrator-mint.d.ts +97 -0
- package/dist/oidc/orchestrator-signer-factory.d.ts +33 -0
- package/dist/oidc/reconcile-signing-key.d.ts +21 -0
- package/dist/oidc/signer.d.ts +25 -0
- package/dist/oidc/signing-key-status.d.ts +23 -0
- package/dist/orchestrator-core.d.ts +42 -2
- package/dist/pipeline/decorating-secret-resolver.d.ts +5 -4
- package/dist/pipeline/dispatch-matched-workflow.d.ts +44 -3
- package/dist/pipeline/inline-eval.d.ts +2 -2
- package/dist/pipeline/install-secrets-resolver.d.ts +25 -14
- package/dist/pipeline/{job-environments.d.ts → job-contexts.d.ts} +23 -23
- package/dist/pipeline/manual-schedule.d.ts +28 -14
- package/dist/pipeline/pending-workflow-context.d.ts +1 -1
- package/dist/pipeline/process-webhook.d.ts +57 -2
- package/dist/pipeline/processor.d.ts +49 -13
- package/dist/pipeline/request-idempotency.d.ts +28 -0
- package/dist/pipeline/rerun.d.ts +20 -13
- package/dist/pipeline/resolve-sandbox-grant.d.ts +28 -0
- package/dist/pipeline/resume-workflow.d.ts +1 -1
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +71 -0
- package/dist/pipeline/sandbox-allowlist-reader.d.ts +33 -0
- package/dist/pipeline/test-pipeline.d.ts +2 -2
- package/dist/policy/dashboard-write-policy.d.ts +9 -4
- package/dist/provenance/backfill-run.d.ts +1 -0
- package/dist/provenance/trust-root.d.ts +20 -0
- package/dist/provider-registry.d.ts +8 -0
- package/dist/providers/generic/normalizer.d.ts +1 -1
- package/dist/providers/github/auth.d.ts +1 -1
- package/dist/providers/github/changed-files.d.ts +14 -6
- package/dist/providers/github/check-status-poster.d.ts +19 -3
- package/dist/providers/github/contributor-resolver.d.ts +1 -1
- package/dist/providers/github/lock-file.d.ts +1 -1
- package/dist/providers/github/normalizer.d.ts +1 -1
- package/dist/providers/github/repo-url.d.ts +1 -1
- package/dist/providers/local/index.d.ts +1 -0
- package/dist/providers/local/local-source-config.d.ts +1 -0
- package/dist/providers/local/lock-file-fetcher.d.ts +1 -1
- package/dist/providers/local/normalizer.d.ts +1 -1
- package/dist/providers/local/repo-url-builder.d.ts +1 -1
- package/dist/providers/universal-git/changed-files.d.ts +8 -7
- package/dist/providers/universal-git/clone-token.d.ts +1 -1
- package/dist/providers/universal-git/config.d.ts +4 -4
- package/dist/providers/universal-git/index.d.ts +5 -1
- package/dist/providers/universal-git/lock-file.d.ts +6 -1
- package/dist/providers/universal-git/normalizer.d.ts +1 -1
- package/dist/providers/universal-git/repo-url.d.ts +1 -1
- package/dist/queue/cleanup.d.ts +69 -8
- package/dist/queue/job-queue.d.ts +94 -14
- package/dist/queue/scheduled-job.d.ts +2 -2
- package/dist/registration/registration-index.d.ts +1 -1
- package/dist/reporting/agent-failure-category.d.ts +4 -1
- package/dist/reporting/check-run-reporter.d.ts +34 -14
- package/dist/reporting/check-run-tracking-store.d.ts +70 -8
- package/dist/reporting/execution-tracker.d.ts +173 -17
- package/dist/reporting/fs-log-storage.d.ts +31 -2
- package/dist/reporting/job-check-run-completion.d.ts +50 -0
- package/dist/reporting/log-chunk-sink.d.ts +47 -0
- package/dist/reporting/log-retention.d.ts +16 -0
- package/dist/reporting/log-storage.d.ts +64 -4
- package/dist/reporting/log-writer.d.ts +22 -7
- package/dist/reporting/peer-log-normalize.d.ts +14 -0
- package/dist/reporting/run-aggregator.d.ts +36 -36
- package/dist/reporting/s3-log-storage.d.ts +102 -8
- package/dist/routes/admin-auth.d.ts +90 -0
- package/dist/routes/admin-cluster-settings.d.ts +31 -0
- package/dist/routes/admin-contexts.d.ts +47 -0
- package/dist/routes/admin-events.d.ts +3 -0
- package/dist/routes/admin-orchestrator-drain.d.ts +35 -0
- package/dist/routes/admin-registrations.d.ts +2 -2
- package/dist/routes/admin-runs.d.ts +9 -0
- package/dist/routes/admin-sources.d.ts +7 -0
- package/dist/routes/admin-trust-policy.d.ts +49 -0
- package/dist/routes/admin.d.ts +15 -1
- package/dist/routes/github-webhook.d.ts +9 -3
- package/dist/routes/provenance-oidc.d.ts +38 -0
- package/dist/routes/verify-attestation.d.ts +21 -0
- package/dist/scaler/bare-metal-backend.d.ts +9 -2
- package/dist/scaler/config.d.ts +25 -4
- package/dist/scaler/container-backend.d.ts +9 -1
- package/dist/scaler/firecracker-backend.d.ts +29 -2
- package/dist/scaler/index.d.ts +1 -1
- package/dist/scaler/manager.d.ts +166 -8
- package/dist/scaler/pending-scale-sweeper.d.ts +35 -0
- package/dist/scaler/types.d.ts +75 -6
- package/dist/secrets/backend-registry.d.ts +32 -1
- package/dist/secrets/context-secret-resolver.d.ts +30 -0
- package/dist/secrets/dashboard-encryption-key.d.ts +48 -0
- package/dist/secrets/ephemeral-keys.d.ts +16 -0
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/pg-secret-store.d.ts +13 -3
- package/dist/secrets/rbac.d.ts +5 -1
- package/dist/secrets/routing-key-scope.d.ts +6 -0
- package/dist/secrets/scope-routing.d.ts +126 -0
- package/dist/secrets/secret-resolver.d.ts +19 -32
- package/dist/secrets/token-manager.d.ts +5 -1
- package/dist/security/comment-handler.d.ts +1 -1
- package/dist/security/contributor-cache.d.ts +9 -1
- package/dist/security/trust-policy-gate.d.ts +117 -0
- package/dist/security/trust-policy-store.d.ts +78 -0
- package/dist/server.js +44012 -32721
- package/dist/sources/source-manager.d.ts +24 -0
- package/dist/stale-detector/stale-run-detector.d.ts +8 -1
- package/dist/standalone.js +44106 -33690
- package/dist/storage/blob-routes.d.ts +16 -0
- package/dist/storage/filesystem.d.ts +17 -0
- package/dist/storage/key-discriminator.d.ts +20 -0
- package/dist/storage/s3.d.ts +2 -0
- package/dist/storage/types.d.ts +16 -0
- package/dist/webhook/dedup.d.ts +9 -1
- package/dist/webhook/event-log.d.ts +13 -2
- package/dist/webhook/generic-sources-listener.d.ts +4 -0
- package/dist/webhook/ingest-admission.d.ts +140 -0
- package/dist/webhook/ingest-overflow-buffer.d.ts +27 -0
- package/dist/webhook/ingest-overflow-replayer.d.ts +49 -0
- package/dist/webhook/ingest-overflow-types.d.ts +73 -0
- package/dist/webhook/loop-lag-source.d.ts +40 -0
- package/dist/webhook/observed-relay-guard.d.ts +40 -0
- package/dist/webhook/org-ingest-cap-reader.d.ts +24 -0
- package/dist/webhook/register-source-bundle.d.ts +3 -0
- package/dist/webhook/relay-reinject.d.ts +43 -0
- package/dist/worker/in-memory-job-queue.d.ts +8 -3
- package/dist/worker-core.d.ts +10 -0
- package/dist/ws/agent-api-registry.d.ts +20 -0
- package/dist/ws/agent-handler.d.ts +63 -7
- package/dist/ws/bringup-api.d.ts +99 -0
- package/dist/ws/{dashboard-env-handler.d.ts → dashboard-context-handler.d.ts} +43 -25
- package/dist/ws/dashboard-run-state-handler.d.ts +31 -0
- package/dist/ws/failure-messages.d.ts +29 -0
- package/dist/ws/oidc-token-relay.d.ts +15 -0
- package/dist/ws/ownership-gate.d.ts +22 -0
- package/dist/ws/platform-client.d.ts +96 -1
- package/dist/ws/replay-chunker.d.ts +37 -0
- package/installer-image-digests.json +3 -3
- package/package.json +22 -21
- package/sbom.spdx.json +1245 -1793
- package/dist/cli/commands/environment.d.ts +0 -25
- package/dist/environments/binding-store.d.ts +0 -36
- package/dist/environments/environment-store.d.ts +0 -87
- package/dist/environments/protection/aggregate.d.ts +0 -43
- package/dist/environments/protection/branch-gate.d.ts +0 -5
- package/dist/environments/protection/concurrency-gate.d.ts +0 -7
- package/dist/environments/protection/reviewer-gate.d.ts +0 -7
- package/dist/environments/protection/trust-gate.d.ts +0 -7
- package/dist/environments/protection/wait-timer-gate.d.ts +0 -7
- package/dist/environments/variable-store.d.ts +0 -39
- package/dist/routes/admin-environments.d.ts +0 -47
|
@@ -12,54 +12,64 @@ import type { Database } from '../db/types.js';
|
|
|
12
12
|
* lists (repository / workflow come back null).
|
|
13
13
|
*/
|
|
14
14
|
export declare function baseAttestationsQuery(db: Kysely<Database>): import("kysely").SelectQueryBuilder<{
|
|
15
|
+
access_log: import("../db/types.js").AccessLogTable;
|
|
16
|
+
admin_tokens: import("../db/types.js").AdminTokenTable;
|
|
17
|
+
agent_tokens: import("../db/types.js").AgentTokenTable;
|
|
18
|
+
artifacts: import("../db/types.js").ArtifactsTable;
|
|
19
|
+
attestations: import("../db/types.js").AttestationsTable;
|
|
20
|
+
backup_runs: import("../db/types.js").BackupRunsTable;
|
|
21
|
+
batch_accumulation_items: import("../db/types.js").BatchAccumulationItemsTable;
|
|
22
|
+
batch_accumulation_windows: import("../db/types.js").BatchAccumulationWindowsTable;
|
|
23
|
+
check_run_tracking: import("../db/types.js").CheckRunTrackingTable;
|
|
15
24
|
cluster_meta: import("../db/types.js").ClusterMetaTable;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
cluster_settings: import("../db/types.js").ClusterSettingsTable;
|
|
26
|
+
cold_store_chunk_counts: import("../db/types.js").ColdStoreChunkCountsTable;
|
|
27
|
+
cold_store_chunks: import("../db/types.js").ColdStoreChunksTable;
|
|
28
|
+
concurrency_groups: import("../db/types.js").ConcurrencyGroupsTable;
|
|
29
|
+
config_versions: import("../db/types.js").ConfigVersionTable;
|
|
30
|
+
context_bindings: import("../db/types.js").ContextBindingsTable;
|
|
31
|
+
context_source_overrides: import("../db/types.js").ContextSourceOverridesTable;
|
|
32
|
+
context_variables: import("../db/types.js").ContextVariablesTable;
|
|
33
|
+
contexts: import("../db/types.js").ContextsTable;
|
|
34
|
+
cron_last_fired: import("../db/types.js").CronLastFiredTable;
|
|
35
|
+
cross_repo_trust: import("../db/types.js").CrossRepoTrustTable;
|
|
36
|
+
dashboard_encryption_keys: import("../db/types.js").DashboardEncryptionKeysTable;
|
|
19
37
|
dedup_cache: import("../db/types.js").DedupCacheTable;
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
dispatch_queue: import("../db/types.js").DispatchQueueTable;
|
|
39
|
+
event_log: import("../db/types.js").EventLogTable;
|
|
40
|
+
execution_job_needs: import("../db/types.js").ExecutionJobNeedsTable;
|
|
22
41
|
execution_jobs: import("../db/types.js").ExecutionJobTable;
|
|
42
|
+
execution_runs: import("kysely").Nullable<import("../db/types.js").ExecutionRunTable>;
|
|
23
43
|
execution_steps: import("../db/types.js").ExecutionStepTable;
|
|
24
|
-
raft_state: import("../db/types.js").RaftStateTable;
|
|
25
|
-
secret_audit_log: import("../db/types.js").SecretAuditLogTable;
|
|
26
|
-
scoped_secrets: import("../db/types.js").ScopedSecretsTable;
|
|
27
|
-
environment_bindings: import("../db/types.js").EnvironmentBindingsTable;
|
|
28
|
-
environment_variables: import("../db/types.js").EnvironmentVariablesTable;
|
|
29
|
-
environment_source_overrides: import("../db/types.js").EnvironmentSourceOverridesTable;
|
|
30
|
-
held_runs: import("../db/types.js").HeldRunsTable;
|
|
31
|
-
held_run_approvals: import("../db/types.js").HeldRunApprovalsTable;
|
|
32
|
-
admin_tokens: import("../db/types.js").AdminTokenTable;
|
|
33
|
-
agent_tokens: import("../db/types.js").AgentTokenTable;
|
|
34
|
-
config_versions: import("../db/types.js").ConfigVersionTable;
|
|
35
|
-
kici_events: import("../db/types.js").KiciEventTable;
|
|
36
44
|
generic_webhook_sources: import("../db/types.js").GenericWebhookSourceTable;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
run_ephemeral_keys: import("../db/types.js").RunEphemeralKeysTable;
|
|
43
|
-
run_secret_outputs: import("../db/types.js").RunSecretOutputsTable;
|
|
44
|
-
concurrency_groups: import("../db/types.js").ConcurrencyGroupsTable;
|
|
45
|
-
sources: import("../db/types.js").SourcesTable;
|
|
45
|
+
held_run_approvals: import("../db/types.js").HeldRunApprovalsTable;
|
|
46
|
+
held_runs: import("../db/types.js").HeldRunsTable;
|
|
47
|
+
host_roster: import("../db/types.js").HostRosterTable;
|
|
48
|
+
ingest_overflow_buffer: import("../db/types.js").IngestOverflowBufferTable;
|
|
49
|
+
ip_allocations: import("../db/types.js").IpAllocationTable;
|
|
46
50
|
join_tokens: import("../db/types.js").JoinTokenTable;
|
|
51
|
+
kici_events: import("../db/types.js").KiciEventTable;
|
|
52
|
+
orchestrator_signing_keys: import("../db/types.js").OrchestratorSigningKeysTable;
|
|
47
53
|
org_settings: import("../db/types.js").OrgSettingsTable;
|
|
48
|
-
|
|
54
|
+
org_trust_policy: import("../db/types.js").OrgTrustPolicyTable;
|
|
55
|
+
pending_attestations: import("../db/types.js").PendingAttestationsTable;
|
|
49
56
|
pending_job_contexts: import("../db/types.js").PendingJobContextsTable;
|
|
50
57
|
pending_workflow_contexts: import("../db/types.js").PendingWorkflowContextsTable;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
raft_state: import("../db/types.js").RaftStateTable;
|
|
59
|
+
registry_versions: import("../db/types.js").RegistryVersionsTable;
|
|
60
|
+
remote_sources: import("../db/types.js").RemoteSourcesTable;
|
|
61
|
+
request_idempotency: import("../db/types.js").RequestIdempotencyTable;
|
|
62
|
+
run_ephemeral_keys: import("../db/types.js").RunEphemeralKeysTable;
|
|
63
|
+
run_secret_outputs: import("../db/types.js").RunSecretOutputsTable;
|
|
57
64
|
scaler_agent_jobs: import("../db/types.js").ScalerAgentJobsTable;
|
|
58
65
|
scaler_reservations: import("../db/types.js").ScalerReservationsTable;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
scaler_spawning_agents: import("../db/types.js").ScalerSpawningAgentsTable;
|
|
67
|
+
scoped_secrets: import("../db/types.js").ScopedSecretsTable;
|
|
68
|
+
secret_audit_log: import("../db/types.js").SecretAuditLogTable;
|
|
69
|
+
sources: import("../db/types.js").SourcesTable;
|
|
70
|
+
test_uploads: import("../db/types.js").TestUploadsTable;
|
|
71
|
+
workflow_registrations: import("../db/types.js").WorkflowRegistrationsTable;
|
|
72
|
+
}, "attestations" | "execution_jobs" | "execution_runs", {}>;
|
|
63
73
|
export type AttestationsBaseQuery = ReturnType<typeof baseAttestationsQuery>;
|
|
64
74
|
/**
|
|
65
75
|
* Base query for the deferred-attestation outbox (`pending_attestations`),
|
|
@@ -73,54 +83,64 @@ export type AttestationsBaseQuery = ReturnType<typeof baseAttestationsQuery>;
|
|
|
73
83
|
* run / job still lists (repository / workflow / job name come back null).
|
|
74
84
|
*/
|
|
75
85
|
export declare function basePendingAttestationsQuery(db: Kysely<Database>): import("kysely").SelectQueryBuilder<{
|
|
86
|
+
access_log: import("../db/types.js").AccessLogTable;
|
|
87
|
+
admin_tokens: import("../db/types.js").AdminTokenTable;
|
|
88
|
+
agent_tokens: import("../db/types.js").AgentTokenTable;
|
|
89
|
+
artifacts: import("../db/types.js").ArtifactsTable;
|
|
90
|
+
attestations: import("../db/types.js").AttestationsTable;
|
|
91
|
+
backup_runs: import("../db/types.js").BackupRunsTable;
|
|
92
|
+
batch_accumulation_items: import("../db/types.js").BatchAccumulationItemsTable;
|
|
93
|
+
batch_accumulation_windows: import("../db/types.js").BatchAccumulationWindowsTable;
|
|
94
|
+
check_run_tracking: import("../db/types.js").CheckRunTrackingTable;
|
|
76
95
|
cluster_meta: import("../db/types.js").ClusterMetaTable;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
96
|
+
cluster_settings: import("../db/types.js").ClusterSettingsTable;
|
|
97
|
+
cold_store_chunk_counts: import("../db/types.js").ColdStoreChunkCountsTable;
|
|
98
|
+
cold_store_chunks: import("../db/types.js").ColdStoreChunksTable;
|
|
99
|
+
concurrency_groups: import("../db/types.js").ConcurrencyGroupsTable;
|
|
100
|
+
config_versions: import("../db/types.js").ConfigVersionTable;
|
|
101
|
+
context_bindings: import("../db/types.js").ContextBindingsTable;
|
|
102
|
+
context_source_overrides: import("../db/types.js").ContextSourceOverridesTable;
|
|
103
|
+
context_variables: import("../db/types.js").ContextVariablesTable;
|
|
104
|
+
contexts: import("../db/types.js").ContextsTable;
|
|
105
|
+
cron_last_fired: import("../db/types.js").CronLastFiredTable;
|
|
106
|
+
cross_repo_trust: import("../db/types.js").CrossRepoTrustTable;
|
|
107
|
+
dashboard_encryption_keys: import("../db/types.js").DashboardEncryptionKeysTable;
|
|
80
108
|
dedup_cache: import("../db/types.js").DedupCacheTable;
|
|
81
|
-
|
|
82
|
-
|
|
109
|
+
dispatch_queue: import("../db/types.js").DispatchQueueTable;
|
|
110
|
+
event_log: import("../db/types.js").EventLogTable;
|
|
111
|
+
execution_job_needs: import("../db/types.js").ExecutionJobNeedsTable;
|
|
83
112
|
execution_jobs: import("kysely").Nullable<import("../db/types.js").ExecutionJobTable>;
|
|
113
|
+
execution_runs: import("kysely").Nullable<import("../db/types.js").ExecutionRunTable>;
|
|
84
114
|
execution_steps: import("../db/types.js").ExecutionStepTable;
|
|
85
|
-
raft_state: import("../db/types.js").RaftStateTable;
|
|
86
|
-
secret_audit_log: import("../db/types.js").SecretAuditLogTable;
|
|
87
|
-
scoped_secrets: import("../db/types.js").ScopedSecretsTable;
|
|
88
|
-
environment_bindings: import("../db/types.js").EnvironmentBindingsTable;
|
|
89
|
-
environment_variables: import("../db/types.js").EnvironmentVariablesTable;
|
|
90
|
-
environment_source_overrides: import("../db/types.js").EnvironmentSourceOverridesTable;
|
|
91
|
-
held_runs: import("../db/types.js").HeldRunsTable;
|
|
92
|
-
held_run_approvals: import("../db/types.js").HeldRunApprovalsTable;
|
|
93
|
-
admin_tokens: import("../db/types.js").AdminTokenTable;
|
|
94
|
-
agent_tokens: import("../db/types.js").AgentTokenTable;
|
|
95
|
-
config_versions: import("../db/types.js").ConfigVersionTable;
|
|
96
|
-
kici_events: import("../db/types.js").KiciEventTable;
|
|
97
115
|
generic_webhook_sources: import("../db/types.js").GenericWebhookSourceTable;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
run_ephemeral_keys: import("../db/types.js").RunEphemeralKeysTable;
|
|
104
|
-
run_secret_outputs: import("../db/types.js").RunSecretOutputsTable;
|
|
105
|
-
concurrency_groups: import("../db/types.js").ConcurrencyGroupsTable;
|
|
106
|
-
sources: import("../db/types.js").SourcesTable;
|
|
116
|
+
held_run_approvals: import("../db/types.js").HeldRunApprovalsTable;
|
|
117
|
+
held_runs: import("../db/types.js").HeldRunsTable;
|
|
118
|
+
host_roster: import("../db/types.js").HostRosterTable;
|
|
119
|
+
ingest_overflow_buffer: import("../db/types.js").IngestOverflowBufferTable;
|
|
120
|
+
ip_allocations: import("../db/types.js").IpAllocationTable;
|
|
107
121
|
join_tokens: import("../db/types.js").JoinTokenTable;
|
|
122
|
+
kici_events: import("../db/types.js").KiciEventTable;
|
|
123
|
+
orchestrator_signing_keys: import("../db/types.js").OrchestratorSigningKeysTable;
|
|
108
124
|
org_settings: import("../db/types.js").OrgSettingsTable;
|
|
109
|
-
|
|
125
|
+
org_trust_policy: import("../db/types.js").OrgTrustPolicyTable;
|
|
126
|
+
pending_attestations: import("../db/types.js").PendingAttestationsTable;
|
|
110
127
|
pending_job_contexts: import("../db/types.js").PendingJobContextsTable;
|
|
111
128
|
pending_workflow_contexts: import("../db/types.js").PendingWorkflowContextsTable;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
raft_state: import("../db/types.js").RaftStateTable;
|
|
130
|
+
registry_versions: import("../db/types.js").RegistryVersionsTable;
|
|
131
|
+
remote_sources: import("../db/types.js").RemoteSourcesTable;
|
|
132
|
+
request_idempotency: import("../db/types.js").RequestIdempotencyTable;
|
|
133
|
+
run_ephemeral_keys: import("../db/types.js").RunEphemeralKeysTable;
|
|
134
|
+
run_secret_outputs: import("../db/types.js").RunSecretOutputsTable;
|
|
118
135
|
scaler_agent_jobs: import("../db/types.js").ScalerAgentJobsTable;
|
|
119
136
|
scaler_reservations: import("../db/types.js").ScalerReservationsTable;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
scaler_spawning_agents: import("../db/types.js").ScalerSpawningAgentsTable;
|
|
138
|
+
scoped_secrets: import("../db/types.js").ScopedSecretsTable;
|
|
139
|
+
secret_audit_log: import("../db/types.js").SecretAuditLogTable;
|
|
140
|
+
sources: import("../db/types.js").SourcesTable;
|
|
141
|
+
test_uploads: import("../db/types.js").TestUploadsTable;
|
|
142
|
+
workflow_registrations: import("../db/types.js").WorkflowRegistrationsTable;
|
|
143
|
+
}, "execution_jobs" | "execution_runs" | "pending_attestations", {}>;
|
|
124
144
|
/**
|
|
125
145
|
* Apply org-wide attestation filters to the base query. Digest is exact-match;
|
|
126
146
|
* name is an ILIKE substring; status / repository / workflow / job are equality;
|
|
@@ -13,15 +13,23 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type Kysely } from 'kysely';
|
|
15
15
|
import { type ColdStore } from '@kici-dev/shared';
|
|
16
|
-
import type { DashboardRunDetailRequest, DashboardRunsListRequest, DashboardRunsListResponse, DashboardRunsFiltersRequest, DashboardRunsFiltersResponse, DashboardSourcesListRequest, DashboardSourcesListResponse, DashboardStepLogsRequest, DashboardAttestationsListRequest, DashboardAttestationsListAllRequest, DashboardAttestationGetRequest, DashboardAttestationRetryRequest, DashboardPayloadRequest, DashboardOrchLogsRequest, DashboardEventLogListRequest, DashboardEventLogDetailRequest, DashboardEventLogPayloadStreamRequest, DashboardAccessLogListRequest, DashboardEventDlqListRequest, DashboardEventDlqCountRequest, DashboardEventDlqRetryRequest, DashboardEventDlqDiscardRequest, RunRerunRequest, RunCancelRequest, ManualScheduleRequest, DashboardRunStructuredRequest } from '@kici-dev/engine';
|
|
16
|
+
import type { DashboardRunDetailRequest, DashboardRunsListRequest, DashboardRunsListResponse, DashboardRunsFiltersRequest, DashboardRunsFiltersResponse, DashboardSourcesListRequest, DashboardSourcesListResponse, DashboardStepLogsRequest, DashboardAttestationsListRequest, DashboardAttestationsListAllRequest, DashboardAttestationGetRequest, DashboardAttestationRetryRequest, DashboardPayloadRequest, DashboardOrchLogsRequest, DashboardEventLogListRequest, DashboardEventLogActivityRequest, DashboardEventLogDetailRequest, DashboardEventLogPayloadStreamRequest, DashboardAccessLogListRequest, DashboardEventDlqListRequest, DashboardEventDlqCountRequest, DashboardEventDlqRetryRequest, DashboardEventDlqDiscardRequest, RunRerunRequest, RunCancelRequest, ManualScheduleRequest, DashboardRunStructuredRequest, DashboardArtifactsListRequest } from '@kici-dev/engine';
|
|
17
17
|
import type { Database } from '../db/types.js';
|
|
18
18
|
import type { LogStorage } from '../reporting/log-storage.js';
|
|
19
19
|
import type { CacheStorage } from '../storage/types.js';
|
|
20
|
+
import type { ArtifactStore } from '../artifacts/artifact-store.js';
|
|
20
21
|
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
21
22
|
import type { EventStore } from '../events/event-store.js';
|
|
22
23
|
interface DashboardHandlerDeps {
|
|
23
24
|
db: Kysely<Database>;
|
|
24
25
|
logStorage: LogStorage;
|
|
26
|
+
/**
|
|
27
|
+
* The orchestrator's own provenance issuer (`KICI_ORCHESTRATOR_PROVENANCE_ISSUER`)
|
|
28
|
+
* when it owns signing. Surfaced on attestations-list responses so the Platform
|
|
29
|
+
* returns it as `trustedIssuer` — the dashboard / CLI verify against the
|
|
30
|
+
* orchestrator that actually signed the bundles, not the Platform's own issuer.
|
|
31
|
+
*/
|
|
32
|
+
provenanceSigningIssuer?: string | null;
|
|
25
33
|
/**
|
|
26
34
|
* Object-storage backend for provenance bundles. The attestations handler
|
|
27
35
|
* reads each stored bundle by `storage_key` and inlines it into the response
|
|
@@ -31,6 +39,13 @@ interface DashboardHandlerDeps {
|
|
|
31
39
|
* (the same one P1.5 writes bundles to).
|
|
32
40
|
*/
|
|
33
41
|
provenanceStorage?: CacheStorage | null;
|
|
42
|
+
/**
|
|
43
|
+
* User-facing artifacts layer. Backs `dashboard.artifacts.list` — lists a
|
|
44
|
+
* run's named artifacts and mints a presigned GET per entry. Optional — when
|
|
45
|
+
* absent (orchestrator without a DB / cache storage) the handler replies with
|
|
46
|
+
* an `error` and an empty list.
|
|
47
|
+
*/
|
|
48
|
+
artifactStore?: ArtifactStore | null;
|
|
34
49
|
/**
|
|
35
50
|
* Drain the deferred-attestation outbox on demand (mints in this process,
|
|
36
51
|
* which owns the Platform WS). Backs `dashboard.attestation.retry`. Optional —
|
|
@@ -70,7 +85,14 @@ interface DashboardHandlerDeps {
|
|
|
70
85
|
* compat with mixed deploys; absent means the orchestrator falls
|
|
71
86
|
* back to the legacy "no PG row → throw" path.
|
|
72
87
|
*/
|
|
73
|
-
onRerun: (runId: string, triggeredBy: string | null, triggeredByAgentLabel: string | null,
|
|
88
|
+
onRerun: (runId: string, triggeredBy: string | null, triggeredByAgentLabel: string | null,
|
|
89
|
+
/**
|
|
90
|
+
* Platform-minted `requestId` for this rerun. Stable across an HA relay
|
|
91
|
+
* failover re-send, so the orchestrator uses it as an idempotency key: a
|
|
92
|
+
* re-sent request returns the first coordinator's run instead of minting a
|
|
93
|
+
* second one.
|
|
94
|
+
*/
|
|
95
|
+
requestId: string, routingKey?: string) => Promise<{
|
|
74
96
|
newRunId: string;
|
|
75
97
|
}>;
|
|
76
98
|
/**
|
|
@@ -80,12 +102,19 @@ interface DashboardHandlerDeps {
|
|
|
80
102
|
*/
|
|
81
103
|
onCancel: (runId: string, cancelledBy: string | null, cancelledByAgentLabel: string | null, force?: boolean) => Promise<{
|
|
82
104
|
cancelledJobs: number;
|
|
105
|
+
alreadyTerminal?: boolean;
|
|
83
106
|
}>;
|
|
84
107
|
/**
|
|
85
108
|
* Callback for handling manual schedule trigger requests.
|
|
86
109
|
* Returns { newRunId } on success or throws on failure.
|
|
87
110
|
*/
|
|
88
|
-
onManualSchedule: (registrationId: string, triggeredBy: string | null, triggeredByAgentLabel: string | null
|
|
111
|
+
onManualSchedule: (registrationId: string, triggeredBy: string | null, triggeredByAgentLabel: string | null,
|
|
112
|
+
/**
|
|
113
|
+
* Platform-minted `requestId` for this manual schedule. Used as an
|
|
114
|
+
* idempotency key so an HA relay failover re-send returns the first
|
|
115
|
+
* coordinator's run instead of minting a second one.
|
|
116
|
+
*/
|
|
117
|
+
requestId: string) => Promise<{
|
|
89
118
|
newRunId: string;
|
|
90
119
|
}>;
|
|
91
120
|
/**
|
|
@@ -95,11 +124,23 @@ interface DashboardHandlerDeps {
|
|
|
95
124
|
* deployments the store is wired by `bootstrapOrchestrator`.
|
|
96
125
|
*/
|
|
97
126
|
eventStore?: EventStore | null;
|
|
127
|
+
/**
|
|
128
|
+
* **Test-only.** Master switch for fault-injection knobs. When false the
|
|
129
|
+
* handler ignores every test-only knob below even if it is set.
|
|
130
|
+
*/
|
|
131
|
+
testMode?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* **Test-only.** When set (and `testMode` is true), `handleRerunRequest`
|
|
134
|
+
* sleeps this many ms before invoking `onRerun`, so an HA E2E can force a
|
|
135
|
+
* slow first coordinator and trigger a relay failover. Ignored in production.
|
|
136
|
+
*/
|
|
137
|
+
testRerunDelayMs?: number;
|
|
98
138
|
}
|
|
99
139
|
export declare class DashboardHandler {
|
|
100
140
|
private readonly db;
|
|
101
141
|
private readonly logStorage;
|
|
102
142
|
private readonly provenanceStorage;
|
|
143
|
+
private readonly artifactStore;
|
|
103
144
|
private readonly send;
|
|
104
145
|
private readonly orchestratorId;
|
|
105
146
|
private readonly accessLog;
|
|
@@ -111,6 +152,9 @@ export declare class DashboardHandler {
|
|
|
111
152
|
private readonly coldStore;
|
|
112
153
|
private readonly eventStore;
|
|
113
154
|
private readonly retryAttestations;
|
|
155
|
+
private readonly provenanceSigningIssuer;
|
|
156
|
+
private readonly testMode;
|
|
157
|
+
private readonly testRerunDelayMs;
|
|
114
158
|
constructor(deps: DashboardHandlerDeps);
|
|
115
159
|
/**
|
|
116
160
|
* Update the bound orgId + routingKey. Called from server.ts after resolving
|
|
@@ -295,6 +339,13 @@ export declare class DashboardHandler {
|
|
|
295
339
|
* skipped (best-effort) rather than failing the whole list.
|
|
296
340
|
*/
|
|
297
341
|
handleAttestationsList(msg: DashboardAttestationsListRequest): Promise<void>;
|
|
342
|
+
/**
|
|
343
|
+
* Handle a dashboard.artifacts.list request: list the run's named artifacts
|
|
344
|
+
* with a presigned GET per entry. Mirrors `handleAttestationsList` (per-run
|
|
345
|
+
* org resolution + `recordAccess` + `send`). Org is resolved server-side from
|
|
346
|
+
* the run row, never the wire, so the listing cannot cross tenants.
|
|
347
|
+
*/
|
|
348
|
+
handleArtifactsList(msg: DashboardArtifactsListRequest): Promise<void>;
|
|
298
349
|
/**
|
|
299
350
|
* Fetch + parse one attestation bundle from object storage. Returns the full
|
|
300
351
|
* detail item, or null when the bundle is missing or not valid JSON (logged).
|
|
@@ -366,6 +417,15 @@ export declare class DashboardHandler {
|
|
|
366
417
|
* deliveryId substring. All optional.
|
|
367
418
|
*/
|
|
368
419
|
handleEventLogList(msg: DashboardEventLogListRequest): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Handle a dashboard.event-log.activity request — windowed aggregate counts
|
|
422
|
+
* for the org (matched vs unmatched vs lockfile-missing), the
|
|
423
|
+
* orchestrator-only facts the Platform relay cannot compute (it only sees
|
|
424
|
+
* "delivered", not whether a trigger matched). Powers the Runs-page misconfig
|
|
425
|
+
* strip + the `kici runs` hint. Aggregate counts only — no payloads, no repo
|
|
426
|
+
* identifiers — so the Platform route serves them to all org members.
|
|
427
|
+
*/
|
|
428
|
+
handleEventLogActivity(msg: DashboardEventLogActivityRequest): Promise<void>;
|
|
369
429
|
/**
|
|
370
430
|
* Handle a dashboard.access-log.list request.
|
|
371
431
|
*
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test harness for the per-migration real-Postgres suites.
|
|
3
|
+
*
|
|
4
|
+
* A test named `NNN_thing.test.ts` documents the schema that migration `NNN`
|
|
5
|
+
* produces, so it must apply the migration set only as far as `NNN`. Applying
|
|
6
|
+
* the whole set instead runs the assertions against the schema at the head of
|
|
7
|
+
* the migration list, where a later migration may already have dropped or
|
|
8
|
+
* reshaped the column under test — the test then fails, or passes for the wrong
|
|
9
|
+
* reason. Those suites only execute when `KICI_TEST_ADMIN_DATABASE_URL` is set,
|
|
10
|
+
* so that rot stays invisible in a normal `pnpm test` run.
|
|
11
|
+
*
|
|
12
|
+
* The harness derives the target from the calling test file's own URL, so a
|
|
13
|
+
* test can neither name the wrong migration nor drift when a file is renamed.
|
|
14
|
+
* It has no fallback to the whole set: an unknown or no-op target throws.
|
|
15
|
+
*
|
|
16
|
+
* Repo/store tests outside `migrations/` (host roster, artifact store, the repo
|
|
17
|
+
* suites) legitimately want head-of-list schema and use `migrateToLatest()`
|
|
18
|
+
* directly instead.
|
|
19
|
+
*/
|
|
20
|
+
import type { Kysely } from 'kysely';
|
|
21
|
+
import { type MigrationResultSet } from 'kysely/migration';
|
|
22
|
+
/**
|
|
23
|
+
* Derive `030_held_runs_env_set_null` from a
|
|
24
|
+
* `.../migrations/030_held_runs_env_set_null.test.ts` module URL.
|
|
25
|
+
*
|
|
26
|
+
* Throws when the caller is not a per-migration test, so a copy-paste into an
|
|
27
|
+
* unrelated suite fails loudly instead of silently migrating somewhere odd.
|
|
28
|
+
*/
|
|
29
|
+
export declare function migrationNameFromTestUrl(testUrl: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Apply migrations `001..NNN` inclusive, where `NNN` is the migration the
|
|
32
|
+
* calling test file is named after. Pass `import.meta.url` as `testUrl`.
|
|
33
|
+
*
|
|
34
|
+
* Returns Kysely's result set so callers keep their own error handling
|
|
35
|
+
* (`if (error) throw error` / `expect(error).toBeUndefined()`). A target that
|
|
36
|
+
* does not exist surfaces as `error`; a target that applied nothing, or stopped
|
|
37
|
+
* somewhere other than itself, throws — neither can silently degrade into
|
|
38
|
+
* "the whole migration set ran".
|
|
39
|
+
*/
|
|
40
|
+
export declare function migrateToOwnMigration<DB>(db: Kysely<DB>, testUrl: string): Promise<MigrationResultSet>;
|
|
41
|
+
//# sourceMappingURL=migration-test-harness.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Rename the named-policy object from "environment" to "context" across the
|
|
4
|
+
* orchestrator schema. Data-preserving rename-in-place (never drop/recreate):
|
|
5
|
+
*
|
|
6
|
+
* Tables:
|
|
7
|
+
* - `environments` → `contexts`
|
|
8
|
+
* - `environment_bindings` → `context_bindings`
|
|
9
|
+
* - `environment_variables` → `context_variables`
|
|
10
|
+
* - `environment_source_overrides` → `context_source_overrides`
|
|
11
|
+
*
|
|
12
|
+
* Columns:
|
|
13
|
+
* - `context_bindings.environment_id` → `context_id`
|
|
14
|
+
* - `context_variables.environment_id` → `context_id`
|
|
15
|
+
* - `context_source_overrides.environment_id` → `context_id`
|
|
16
|
+
* - `held_runs.environment_id` → `context_id`
|
|
17
|
+
* - `execution_runs.environment` → `context`
|
|
18
|
+
* - `execution_runs.environment_id` → `context_id`
|
|
19
|
+
* - `execution_jobs.environments` → `contexts`
|
|
20
|
+
* - `execution_jobs.skipped_environments` → `skipped_contexts`
|
|
21
|
+
*
|
|
22
|
+
* Index:
|
|
23
|
+
* - `idx_execution_runs_environment_id` → `idx_execution_runs_context_id`
|
|
24
|
+
*
|
|
25
|
+
* Held-run enum values + defaults: `held_runs.queue_type` /
|
|
26
|
+
* `held_runs.trigger_source` default `'environment'` → `'context'` and existing
|
|
27
|
+
* `'environment'` rows are migrated to `'context'` (the `HeldRunQueueType` value
|
|
28
|
+
* rename).
|
|
29
|
+
*
|
|
30
|
+
* Foreign keys and remaining constraints/indexes follow the renamed tables and
|
|
31
|
+
* columns automatically (Postgres references them by identity, not name), so
|
|
32
|
+
* only the one hand-named index above needs an explicit rename.
|
|
33
|
+
*/
|
|
34
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
35
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=067_environments_to_contexts.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the `request_idempotency` claim table: a `request_id`-keyed record that
|
|
4
|
+
* makes run-minting dashboard requests (`run.rerun.request`,
|
|
5
|
+
* `run.manual_schedule.request`) idempotent on the Platform `requestId`. HA
|
|
6
|
+
* coordinator siblings share one orchestrator DB, so when the Platform relay
|
|
7
|
+
* fails over and re-sends the same request to a sibling, the atomic `INSERT …
|
|
8
|
+
* ON CONFLICT DO NOTHING` on `request_id` lets exactly one coordinator win —
|
|
9
|
+
* the loser returns the winner's `new_run_id` instead of minting a second run.
|
|
10
|
+
* Rows are pruned after 1h (far past the ~10s request budget) by the periodic
|
|
11
|
+
* cleanup tick.
|
|
12
|
+
*
|
|
13
|
+
* Idempotent: guarded on table existence.
|
|
14
|
+
*/
|
|
15
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
16
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=068_request_idempotency.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the three reroute-tunable columns to `org_settings` (all nullable):
|
|
4
|
+
*
|
|
5
|
+
* - `reroute_spawn_window_ms BIGINT` — how long the coordinator waits after a
|
|
6
|
+
* peer ACKs a reroute before treating "accepted but no progress" as a spawn
|
|
7
|
+
* failure and re-dispatching. NULL falls back to the cluster default
|
|
8
|
+
* (`rerouteSpawnWindowMs`, 90s).
|
|
9
|
+
* - `reroute_ack_timeout_ms BIGINT` — the reroute `sendAndWaitAck` deadline.
|
|
10
|
+
* NULL falls back to `rerouteAckTimeoutMs` (15s).
|
|
11
|
+
* - `reroute_max_hops INTEGER` — maximum peer hops for a rerouted job. NULL
|
|
12
|
+
* falls back to `rerouteMaxHops` (3).
|
|
13
|
+
*
|
|
14
|
+
* Operators tune them per-org via `kici-admin org-settings`.
|
|
15
|
+
*
|
|
16
|
+
* Idempotent: each column add is guarded on column existence, so a re-run on a
|
|
17
|
+
* DB that already has a column is a no-op for that column.
|
|
18
|
+
*/
|
|
19
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
20
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=069_reroute_tunables.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the batch-accumulation tables that back the `workflows_failed_batch`
|
|
4
|
+
* trigger.
|
|
5
|
+
*
|
|
6
|
+
* When a `workflow_complete(failed)` event matches a `workflowsFailedBatch`
|
|
7
|
+
* registration, the orchestrator buffers the failed run into a durable window
|
|
8
|
+
* instead of dispatching now. The first failure opens the window (`opened_at`);
|
|
9
|
+
* the Raft-leader-only scanner sweeps windows past `expires_at`, emits one
|
|
10
|
+
* `__workflows_failed_batch` event carrying the buffered runs, and deletes the
|
|
11
|
+
* window (cascading its items).
|
|
12
|
+
*
|
|
13
|
+
* `batch_accumulation_windows` holds one open window per subscribing workflow —
|
|
14
|
+
* `UNIQUE(registration_id)` enforces open-once so concurrent failures append to
|
|
15
|
+
* the same window rather than opening N of them. `routing_key` /
|
|
16
|
+
* `repo_identifier` are captured at open time so the leader sweep can emit the
|
|
17
|
+
* batch event without re-reading the registration index.
|
|
18
|
+
*
|
|
19
|
+
* `batch_accumulation_items` holds the buffered failed runs, deleted with their
|
|
20
|
+
* window via `ON DELETE CASCADE`.
|
|
21
|
+
*
|
|
22
|
+
* Idempotent: guarded on table existence.
|
|
23
|
+
*/
|
|
24
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
25
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=071_batch_accumulation.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `idx_dispatch_queue_run_id` on `dispatch_queue (run_id)`.
|
|
4
|
+
*
|
|
5
|
+
* `failByRunId`, `cancelByRunId`, and `getDispatchedJobIdsByRunId` all filter
|
|
6
|
+
* `WHERE run_id = ?`. Without this index every run-failure cascade and cancel
|
|
7
|
+
* does a full-table scan over the whole dispatch history, each scan holding a
|
|
8
|
+
* pooled connection longer than necessary. The terminal-row retention sweep
|
|
9
|
+
* (`pruneTerminalDispatchRows`) also benefits from cheaper row lookup.
|
|
10
|
+
*
|
|
11
|
+
* Idempotent: `IF NOT EXISTS` makes a re-run a no-op.
|
|
12
|
+
*/
|
|
13
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
14
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=072_dispatch_queue_run_id_index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `org_settings.ingest_max_concurrency BIGINT` (nullable).
|
|
4
|
+
*
|
|
5
|
+
* Per-org fairness cap for the webhook-ingest admission controller. NULL falls
|
|
6
|
+
* back to the cluster-wide default (`KICI_INGEST_ORG_MAX_CONCURRENCY`, default
|
|
7
|
+
* 32). Operators tune it per tenant via `kici-admin org-settings`.
|
|
8
|
+
*
|
|
9
|
+
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
10
|
+
*/
|
|
11
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=073_org_settings_ingest_concurrency.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize degenerate context concurrency limits. A `concurrency_limit` of 0
|
|
4
|
+
* (or any non-positive value) is meaningless — it wedged the workflow-install
|
|
5
|
+
* gate into an unreleasable concurrency hold. The write boundary now rejects it
|
|
6
|
+
* and the gate treats it as unlimited; this migration cleans up any pre-existing
|
|
7
|
+
* rows so the column only ever holds NULL (unlimited) or a positive integer.
|
|
8
|
+
* Idempotent; down() is a no-op (a normalized 0 cannot — and should not — be
|
|
9
|
+
* restored).
|
|
10
|
+
*/
|
|
11
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
export declare function down(_db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=074_normalize_zero_concurrency_limit.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Durable overflow buffer for shed webhook-ingest deliveries.
|
|
4
|
+
*
|
|
5
|
+
* When the ingest admission controller sheds a delivery (429 / shed_retry_later),
|
|
6
|
+
* the ingest path additively persists it here. A background replayer re-injects
|
|
7
|
+
* the oldest `buffered` rows through normal ingest once capacity recovers.
|
|
8
|
+
*
|
|
9
|
+
* `status` is constrained to the OverflowStatus enum; `source_kind` to
|
|
10
|
+
* OverflowSourceKind. The `(status, captured_at)` index backs the FIFO drain.
|
|
11
|
+
*
|
|
12
|
+
* Idempotent: a re-run on a DB that already has the table 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=075_ingest_overflow_buffer.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the `artifacts` table for user-facing build artifacts and the per-org
|
|
4
|
+
* artifact quota + TTL knobs on `org_settings`.
|
|
5
|
+
*
|
|
6
|
+
* When a workflow step calls `ctx.artifacts.upload(name, paths)`, the agent
|
|
7
|
+
* uploads the packed tarball to object storage under
|
|
8
|
+
* `artifacts/{run_id}/{name}-{discriminator}.tar.gz` (the discriminator is a
|
|
9
|
+
* hash of the exact name) and the orchestrator records one row here
|
|
10
|
+
* so a later job (`ctx.artifacts.download`) and the dashboard can resolve it.
|
|
11
|
+
* `UNIQUE (run_id, name)` is the immutability constraint — the first upload of a
|
|
12
|
+
* name within a run wins; a duplicate name fails at the DB layer as a backstop
|
|
13
|
+
* to the handler's pre-mint duplicate check.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: a re-run on a DB that already has the table / columns 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=076_artifacts.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the `backup_runs` table: one row per successful `kici-admin db backup`,
|
|
4
|
+
* recording when the orchestrator DB was last dumped plus the metadata needed
|
|
5
|
+
* to reason about a restore (dump path, size, secret-key generation, server
|
|
6
|
+
* version, migrations hash, host). The `checkBackupFreshness` diagnostic reads
|
|
7
|
+
* `MAX(created_at)` here to answer "when did we last back up?" on a live box.
|
|
8
|
+
*
|
|
9
|
+
* Idempotent: guarded on table existence.
|
|
10
|
+
*/
|
|
11
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=077_backup_runs.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add the nullable `org_settings.backup_staleness_warn_hours INTEGER` column:
|
|
4
|
+
* the per-org override for the DB-backup freshness diagnostic's WARN threshold.
|
|
5
|
+
* NULL falls back to the cluster default (`config.backupStalenessWarnHours`,
|
|
6
|
+
* 24h). Operators tune it per-org via `kici-admin org-settings backup-freshness`.
|
|
7
|
+
*
|
|
8
|
+
* Idempotent: guarded on column existence.
|
|
9
|
+
*/
|
|
10
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
11
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=078_org_settings_backup_staleness.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `org_settings.scaler_spawn_timeout_ms BIGINT` (nullable).
|
|
4
|
+
*
|
|
5
|
+
* Per-org deadline for a single scaler `backend.spawn` (image pull + container
|
|
6
|
+
* create + start). NULL falls back to the cluster-wide default
|
|
7
|
+
* (`KICI_SCALER_SPAWN_TIMEOUT_MS`, default 300s). Operators tune it per tenant
|
|
8
|
+
* via `kici-admin org-settings scaler-spawn-timeout`.
|
|
9
|
+
*
|
|
10
|
+
* Idempotent: a re-run on a DB that already has the column is a no-op.
|
|
11
|
+
*/
|
|
12
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
13
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=079_org_settings_scaler_spawn_timeout.d.ts.map
|