@kici-dev/orchestrator 0.1.27 → 0.3.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 +56 -4
- 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/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 +44 -1
- 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/dashboard-encryption-key.d.ts +3 -0
- package/dist/cli/commands/db-backup.d.ts +71 -0
- 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/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/wizard/orchestrator-wizard.d.ts +39 -11
- package/dist/cli.js +9921 -3409
- 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 +9 -6
- package/dist/config/types.d.ts +5 -2
- package/dist/config.d.ts +366 -53
- package/dist/contexts/context-store.d.ts +21 -8
- package/dist/contexts/glob-specificity.d.ts +30 -0
- package/dist/contexts/held-runs.d.ts +51 -19
- package/dist/contexts/protection/aggregate.d.ts +2 -2
- package/dist/contexts/protection/concurrency-gate.d.ts +0 -3
- package/dist/contexts/protection/reviewer-gate.d.ts +0 -3
- package/dist/contexts/protection/satisfiability.d.ts +1 -1
- package/dist/contexts/protection/trust-gate.d.ts +0 -3
- package/dist/contexts/protection/wait-timer-gate.d.ts +0 -3
- 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 +92 -74
- package/dist/dashboard/handler.d.ts +35 -1
- package/dist/db/migration-test-harness.d.ts +41 -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/migrations/108_unroutable_fast_fail.d.ts +4 -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 +441 -7
- 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 +18 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +654 -29
- package/dist/lockfile-cache.d.ts +4 -0
- package/dist/lockfile-validate.d.ts +16 -9
- package/dist/metrics/prometheus.d.ts +113 -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 +22 -9
- package/dist/oidc/jwt.d.ts +5 -2
- package/dist/oidc/local-dev-signer.d.ts +1 -1
- package/dist/oidc/oidc-mint-registration.d.ts +27 -11
- 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 +3 -2
- package/dist/pipeline/dispatch-matched-workflow.d.ts +41 -0
- package/dist/pipeline/install-secrets-resolver.d.ts +12 -1
- package/dist/pipeline/manual-schedule.d.ts +20 -13
- 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 +44 -8
- package/dist/pipeline/rerun.d.ts +12 -13
- package/dist/pipeline/resolve-sandbox-grant.d.ts +28 -0
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +71 -0
- package/dist/pipeline/sandbox-allowlist-reader.d.ts +33 -0
- 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 +13 -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/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/bootstrap.d.ts +5 -0
- package/dist/queue/cleanup.d.ts +72 -9
- package/dist/queue/job-queue.d.ts +141 -14
- package/dist/queue/scheduled-job.d.ts +3 -2
- package/dist/queue/terminalize-unroutable.d.ts +53 -0
- package/dist/queue/unroutable-probe.d.ts +52 -0
- 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 +156 -10
- 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 +50 -33
- 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-events.d.ts +3 -0
- package/dist/routes/admin-orchestrator-drain.d.ts +35 -0
- 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/dashboard-encryption-key.d.ts +48 -0
- package/dist/secrets/ephemeral-keys.d.ts +16 -0
- package/dist/secrets/pg-secret-store.d.ts +10 -0
- 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 +1 -14
- package/dist/secrets/token-manager.d.ts +5 -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 +36074 -25052
- package/dist/sources/source-manager.d.ts +24 -0
- package/dist/stale-detector/stale-run-detector.d.ts +7 -0
- package/dist/standalone.js +35203 -25387
- 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-context-handler.d.ts +28 -10
- 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 +9 -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 +1240 -1788
|
@@ -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 —
|
|
@@ -87,6 +102,7 @@ interface DashboardHandlerDeps {
|
|
|
87
102
|
*/
|
|
88
103
|
onCancel: (runId: string, cancelledBy: string | null, cancelledByAgentLabel: string | null, force?: boolean) => Promise<{
|
|
89
104
|
cancelledJobs: number;
|
|
105
|
+
alreadyTerminal?: boolean;
|
|
90
106
|
}>;
|
|
91
107
|
/**
|
|
92
108
|
* Callback for handling manual schedule trigger requests.
|
|
@@ -124,6 +140,7 @@ export declare class DashboardHandler {
|
|
|
124
140
|
private readonly db;
|
|
125
141
|
private readonly logStorage;
|
|
126
142
|
private readonly provenanceStorage;
|
|
143
|
+
private readonly artifactStore;
|
|
127
144
|
private readonly send;
|
|
128
145
|
private readonly orchestratorId;
|
|
129
146
|
private readonly accessLog;
|
|
@@ -135,6 +152,7 @@ export declare class DashboardHandler {
|
|
|
135
152
|
private readonly coldStore;
|
|
136
153
|
private readonly eventStore;
|
|
137
154
|
private readonly retryAttestations;
|
|
155
|
+
private readonly provenanceSigningIssuer;
|
|
138
156
|
private readonly testMode;
|
|
139
157
|
private readonly testRerunDelayMs;
|
|
140
158
|
constructor(deps: DashboardHandlerDeps);
|
|
@@ -321,6 +339,13 @@ export declare class DashboardHandler {
|
|
|
321
339
|
* skipped (best-effort) rather than failing the whole list.
|
|
322
340
|
*/
|
|
323
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>;
|
|
324
349
|
/**
|
|
325
350
|
* Fetch + parse one attestation bundle from object storage. Returns the full
|
|
326
351
|
* detail item, or null when the bundle is missing or not valid JSON (logged).
|
|
@@ -392,6 +417,15 @@ export declare class DashboardHandler {
|
|
|
392
417
|
* deliveryId substring. All optional.
|
|
393
418
|
*/
|
|
394
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>;
|
|
395
429
|
/**
|
|
396
430
|
* Handle a dashboard.access-log.list request.
|
|
397
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,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
|
|
@@ -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,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,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
|