@kici-dev/orchestrator 0.1.27 → 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 +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 +22 -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 +9818 -3408
- 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 +363 -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/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 +421 -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 +604 -16
- package/dist/lockfile-cache.d.ts +4 -0
- package/dist/lockfile-validate.d.ts +16 -9
- package/dist/metrics/prometheus.d.ts +112 -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/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 +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 +32 -32
- 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 +35769 -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 +34831 -25317
- 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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Realign `held_runs.hold_type` onto the engine's `HoldType` vocabulary.
|
|
4
|
+
*
|
|
5
|
+
* The column carries two spellings the gates never emit: `approval` for a
|
|
6
|
+
* reviewer hold and `wait_timer` for a workflow-install wait hold. The
|
|
7
|
+
* dashboard switches on the gate vocabulary, so both fall through to the gray
|
|
8
|
+
* unknown-type badge — and two semantically identical wait holds render
|
|
9
|
+
* differently depending on which gate produced them.
|
|
10
|
+
*
|
|
11
|
+
* Writers emit the gate vocabulary; this backfills the history. The read path
|
|
12
|
+
* also normalizes (`normalizePersistedHoldType`) and the wait-hold release
|
|
13
|
+
* sweep matches both spellings, so a row written by an un-upgraded
|
|
14
|
+
* orchestrator behaves correctly whether or not this has run — the two sides
|
|
15
|
+
* deploy independently.
|
|
16
|
+
*
|
|
17
|
+
* Idempotent: a second run matches no rows.
|
|
18
|
+
*/
|
|
19
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Rewrite the gate vocabulary back to the legacy spellings.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately asymmetric: it rewrites *every* `reviewer` / `timer` row,
|
|
24
|
+
* including rows that were always written that way (a dispatch-gate wait hold
|
|
25
|
+
* has persisted as `timer` all along). That is the right trade for a rollback —
|
|
26
|
+
* an orchestrator running the older code matches its wait-hold release sweep on
|
|
27
|
+
* `wait_timer` alone, so leaving those rows spelled `timer` would strand them
|
|
28
|
+
* in the expire-and-fail path.
|
|
29
|
+
*/
|
|
30
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=100_held_runs_hold_type_vocabulary.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Give the context hold expiry a single default, and retire the stored zeroes.
|
|
4
|
+
*
|
|
5
|
+
* `contexts.hold_expiry_seconds` carried `DEFAULT 86400` while every read-side
|
|
6
|
+
* fallback and the operator docs used 3600 — so a context created without an
|
|
7
|
+
* expiry held for 24 h, and one whose expiry was cleared held for 1 h. Dropping
|
|
8
|
+
* the DDL default (rather than moving it to 3600) makes both paths land on NULL
|
|
9
|
+
* and resolve through `DEFAULT_HOLD_EXPIRY_SECONDS`, so the two cannot drift
|
|
10
|
+
* apart again.
|
|
11
|
+
*
|
|
12
|
+
* The backfill is the other half of rejecting a zero expiry at the write
|
|
13
|
+
* boundary: a stored `0` puts every hold's deadline at the current instant, so
|
|
14
|
+
* the hold is swept to `expired` before a reviewer can act. Validation alone
|
|
15
|
+
* only stops new zeroes arriving; these rows already exist and there was no CLI
|
|
16
|
+
* path to notice them.
|
|
17
|
+
*
|
|
18
|
+
* Idempotent: dropping an absent default is a no-op and the UPDATE matches no
|
|
19
|
+
* rows on a second run.
|
|
20
|
+
*/
|
|
21
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Restore the column's original default.
|
|
24
|
+
*
|
|
25
|
+
* Deliberately asymmetric: the zeroed rows are NOT recreated. After the
|
|
26
|
+
* backfill they are indistinguishable from a deliberate NULL, and a row put
|
|
27
|
+
* back to `0` would resume cancelling every hold on its context — so a
|
|
28
|
+
* rollback keeps them on the fallback rather than re-breaking them.
|
|
29
|
+
*/
|
|
30
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=101_contexts_hold_expiry_drop_default.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `dispatch_queue.agent_id` (nullable text).
|
|
4
|
+
*
|
|
5
|
+
* The durable record of which agent a job was dispatched to. `ack_agent_id` is
|
|
6
|
+
* cleared the moment the agent answers the dispatch, so it cannot answer "who
|
|
7
|
+
* owns this job?" for the rest of the job's life; this column is written at
|
|
8
|
+
* dispatch and cleared only on requeue, so a coordinator that never saw the
|
|
9
|
+
* dispatch — a freshly-elected leader after a failover — can still resolve
|
|
10
|
+
* ownership of a live `dispatched` row straight from the database.
|
|
11
|
+
*
|
|
12
|
+
* Nullable with no backfill: a row dispatched before this migration keeps a NULL
|
|
13
|
+
* owner and resolves to "not owned", which is the behaviour it already had.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: guarded on column existence; a re-run on a DB that already has the
|
|
16
|
+
* column is a no-op.
|
|
17
|
+
*/
|
|
18
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
19
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=102_dispatch_queue_agent_id.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `cluster_settings.ownership_db_check_timeout_ms` (nullable bigint).
|
|
4
|
+
*
|
|
5
|
+
* Deadline for a single database-backed agent-ownership lookup. The lookup runs
|
|
6
|
+
* on the inbound path of every job-scoped agent frame whose in-memory ownership
|
|
7
|
+
* check misses, so a slow database would otherwise stall the frame; past the
|
|
8
|
+
* deadline the lookup resolves as undecided and the frame is refused without
|
|
9
|
+
* counting an ownership violation.
|
|
10
|
+
*
|
|
11
|
+
* Cluster-global (every coordinator talks to the same database), so it lives on
|
|
12
|
+
* `cluster_settings` rather than `org_settings`. NULL ⇒ the orchestrator's own
|
|
13
|
+
* configured default applies.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: guarded on column existence; a re-run on a DB that already has the
|
|
16
|
+
* column is a no-op.
|
|
17
|
+
*/
|
|
18
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
19
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=103_cluster_settings_ownership_db_check_timeout_ms.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `check_run_tracking.terminal_sent_at` (nullable timestamptz).
|
|
4
|
+
*
|
|
5
|
+
* `check_run_id` is written at CREATE time, while the check run is still
|
|
6
|
+
* `queued`, so it proves creation and never completion. Without a completion
|
|
7
|
+
* signal a check run stuck `queued` on the provider is indistinguishable from
|
|
8
|
+
* the provider simply lagging, which is what made a check-run poll timeout
|
|
9
|
+
* unattributable: nothing on our side recorded whether the terminal update had
|
|
10
|
+
* been sent at all.
|
|
11
|
+
*
|
|
12
|
+
* Stamped only after the provider accepts a `completed` update. Nullable and
|
|
13
|
+
* best-effort like every write on this table — a tracking write must never
|
|
14
|
+
* break check-run reporting — so NULL means "we have no record of sending it",
|
|
15
|
+
* not "it was never sent".
|
|
16
|
+
*
|
|
17
|
+
* Idempotent: guarded on column existence; a re-run on a DB that already has
|
|
18
|
+
* the column is a no-op.
|
|
19
|
+
*/
|
|
20
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
21
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=104_check_run_terminal_sent.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Create `org_trust_policy` — the orchestrator's cache of the Platform-owned org
|
|
4
|
+
* trust policy pushed on `trust_policy.update`.
|
|
5
|
+
*
|
|
6
|
+
* A dedicated table rather than `org_settings` columns, because this is
|
|
7
|
+
* Platform-owned policy the orchestrator consumes, not operator-owned config the
|
|
8
|
+
* operator tunes. `source` records which of the two wrote the row so the admin
|
|
9
|
+
* surface can present a Platform-managed policy as read-only.
|
|
10
|
+
*
|
|
11
|
+
* Persisting rather than caching in memory is deliberate: a security policy that
|
|
12
|
+
* silently reverts to a default across a restart is worse than one that is never
|
|
13
|
+
* applied.
|
|
14
|
+
*
|
|
15
|
+
* Idempotent: guarded by IF NOT EXISTS, so a re-run is a no-op.
|
|
16
|
+
*/
|
|
17
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
18
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=105_org_trust_policy.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `cluster_settings.check_run_tracking_ttl_days` (nullable integer).
|
|
4
|
+
*
|
|
5
|
+
* Retention window for `check_run_tracking` rows. The hourly cleanup sweep
|
|
6
|
+
* deletes rows untouched for longer than this; 0 disables the sweep.
|
|
7
|
+
*
|
|
8
|
+
* Cluster-global (the sweep runs once per fleet on the cleanup tick, with no
|
|
9
|
+
* tenant in scope at the read site), so it lives on `cluster_settings` rather
|
|
10
|
+
* than `org_settings`. NULL means the orchestrator's own configured default
|
|
11
|
+
* applies.
|
|
12
|
+
*
|
|
13
|
+
* Idempotent: guarded on column existence; a re-run on a database that already
|
|
14
|
+
* has the column is a no-op.
|
|
15
|
+
*/
|
|
16
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
17
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=106_cluster_settings_check_run_tracking_ttl_days.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Kysely } from 'kysely';
|
|
2
|
+
/**
|
|
3
|
+
* Add `idx_check_run_tracking_updated_at` on `check_run_tracking (updated_at)`.
|
|
4
|
+
*
|
|
5
|
+
* `CheckRunTrackingStore.pruneStale` — the hourly retention sweep — filters
|
|
6
|
+
* `WHERE updated_at < now() - <window>`. The table already carries two indexes
|
|
7
|
+
* — the primary key on `(provider, owner, repo, sha, check_name)` and the
|
|
8
|
+
* partial `idx_check_run_tracking_run_id` — but `updated_at` leads neither, so
|
|
9
|
+
* that predicate can use neither and without this index every sweep
|
|
10
|
+
* sequentially scans the whole table. The scan
|
|
11
|
+
* is worst exactly where it hurts: a deployment that accumulated rows before
|
|
12
|
+
* retention existed has the largest table and gets the scan hourly, on every
|
|
13
|
+
* coordinator, since the cleanup tick is not leader-gated.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors `idx_dispatch_queue_run_id` (migration 072) and
|
|
16
|
+
* `idx_request_idempotency_created_at` (migration 068), both of which exist to
|
|
17
|
+
* index a TTL sweep's prune predicate.
|
|
18
|
+
*
|
|
19
|
+
* Idempotent: `IF NOT EXISTS` makes a re-run a no-op.
|
|
20
|
+
*/
|
|
21
|
+
export declare function up(db: Kysely<unknown>): Promise<void>;
|
|
22
|
+
export declare function down(db: Kysely<unknown>): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=107_check_run_tracking_updated_at_index.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import type { Database, DashboardEncryptionKeyRow } from '../types.js';
|
|
3
|
+
/** Lifecycle status values for a dashboard-encryption key. */
|
|
4
|
+
export declare const DashboardEncryptionKeyStatus: {
|
|
5
|
+
readonly active: 'active';
|
|
6
|
+
readonly revoked: 'revoked';
|
|
7
|
+
};
|
|
8
|
+
export type DashboardEncryptionKeyStatus = (typeof DashboardEncryptionKeyStatus)[keyof typeof DashboardEncryptionKeyStatus];
|
|
9
|
+
export interface UpsertActiveEncryptionKeyInput {
|
|
10
|
+
kid: string;
|
|
11
|
+
public_jwk: Record<string, unknown>;
|
|
12
|
+
/** AES-256-GCM-wrapped DER private key (master-key wrapped). */
|
|
13
|
+
encrypted_private_key: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Repository for the orchestrator's dashboard-encryption (X25519) keys. One
|
|
17
|
+
* `active` key seals browser writes; a rotated-out key is `revoked`, which drops
|
|
18
|
+
* it from the published JWKS ({@link listNonRevoked}) so new seals only ever use
|
|
19
|
+
* the current key, while its row — and therefore its wrapped private half —
|
|
20
|
+
* stays on record ({@link getByKid}) so an envelope a browser already sealed to
|
|
21
|
+
* the old `kid` still decrypts. Mirrors the activate/demote transaction shape of
|
|
22
|
+
* `OrchestratorSigningKeyRepo`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class DashboardEncryptionKeyRepo {
|
|
25
|
+
private readonly db;
|
|
26
|
+
constructor(db: Kysely<Database>);
|
|
27
|
+
/** Public keys published in the JWKS (the active key; revoked ones drop out). */
|
|
28
|
+
listNonRevoked(): Promise<DashboardEncryptionKeyRow[]>;
|
|
29
|
+
/** Every key on record: the active one plus every rotated-out (revoked) one. */
|
|
30
|
+
listServed(): Promise<DashboardEncryptionKeyRow[]>;
|
|
31
|
+
/** The single currently-active key row, or null when none is active. */
|
|
32
|
+
getActiveRow(): Promise<DashboardEncryptionKeyRow | null>;
|
|
33
|
+
/** Resolve a key (active or rotated-out) by kid, or null. */
|
|
34
|
+
getByKid(kid: string): Promise<DashboardEncryptionKeyRow | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Activate `input.kid`. If already active, no-op. Otherwise demote any
|
|
37
|
+
* current active key to `revoked` and insert this kid as `active`, in one
|
|
38
|
+
* transaction. Returns true when a NEW kid was activated (caller audits).
|
|
39
|
+
*/
|
|
40
|
+
upsertActive(input: UpsertActiveEncryptionKeyInput): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Mark a key revoked (rotation / compromise). It leaves the published JWKS
|
|
43
|
+
* immediately, but its private half stays on record, so a browser still
|
|
44
|
+
* holding the old kid keeps decrypting until the row is deleted.
|
|
45
|
+
*/
|
|
46
|
+
revoke(kid: string, reason: string): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=dashboard-encryption-keys-repo.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Kysely } from 'kysely';
|
|
2
|
+
import type { Database, OrchestratorSigningKeyRow } from '../types.js';
|
|
3
|
+
export interface UpsertActiveInput {
|
|
4
|
+
kid: string;
|
|
5
|
+
public_jwk: Record<string, unknown>;
|
|
6
|
+
/** Wrapped private JWK for `db` custody; null for `aws-kms` / `command`. */
|
|
7
|
+
encrypted_private_jwk: string | null;
|
|
8
|
+
alg: string;
|
|
9
|
+
signer_kind: string;
|
|
10
|
+
key_ref: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Repository for the orchestrator's provenance signing keys. Ports the Platform's
|
|
14
|
+
* `signing-keys-repo.ts` status model (activate / retire / revoke) and adds
|
|
15
|
+
* `encrypted_private_jwk` custody for `db` keys.
|
|
16
|
+
*/
|
|
17
|
+
export declare class OrchestratorSigningKeyRepo {
|
|
18
|
+
private readonly db;
|
|
19
|
+
constructor(db: Kysely<Database>);
|
|
20
|
+
/** Public keys served in the JWKS / trusted for verification (everything except revoked). */
|
|
21
|
+
listTrusted(): Promise<OrchestratorSigningKeyRow[]>;
|
|
22
|
+
/** The single currently-active key row, or null when none is active. */
|
|
23
|
+
getActiveRow(): Promise<OrchestratorSigningKeyRow | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Activate `input.kid`. If it is already active, no-op. Otherwise demote any
|
|
26
|
+
* current active key to `retiring`, upsert this kid as `active`, in one
|
|
27
|
+
* transaction. Returns true when a NEW kid was activated (caller audits).
|
|
28
|
+
* Refuses to reactivate a `revoked` kid.
|
|
29
|
+
*/
|
|
30
|
+
upsertActive(input: UpsertActiveInput): Promise<boolean>;
|
|
31
|
+
retire(kid: string): Promise<void>;
|
|
32
|
+
revoke(kid: string, reason: string): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=signing-keys-repo.d.ts.map
|