@kici-dev/orchestrator 0.17.0 → 0.18.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/agent/agent-version.d.ts +12 -21
- package/dist/agent/dispatcher.d.ts +283 -437
- package/dist/agent/host-roster-reaper.d.ts +8 -10
- package/dist/agent/host-roster.d.ts +77 -100
- package/dist/agent/ownership-refusal.d.ts +3 -5
- package/dist/agent/ownership-tracker.d.ts +42 -76
- package/dist/agent/registry.d.ts +121 -233
- package/dist/agent/token-store.d.ts +34 -77
- package/dist/agent-packaging/availability.d.ts +6 -9
- package/dist/agent-packaging/download.d.ts +6 -9
- package/dist/agent-packaging/install-closure.d.ts +9 -12
- package/dist/agent-packaging/node-binary.d.ts +6 -10
- package/dist/agent-packaging/node-runtime-members.d.ts +3 -5
- package/dist/agent-packaging/refresh.d.ts +12 -16
- package/dist/agent-packaging/store.d.ts +5 -6
- package/dist/agent-packaging/upload.d.ts +3 -4
- package/dist/app.d.ts +0 -3
- package/dist/approvals/apply-decision.d.ts +35 -52
- package/dist/approvals/approval-resolver.d.ts +11 -23
- package/dist/approvals/held-run-release-wiring.d.ts +14 -21
- package/dist/approvals/independent-wiring.d.ts +13 -20
- package/dist/approvals/resume-router.d.ts +1 -1
- package/dist/approvals/step-approval-bridge.d.ts +11 -21
- package/dist/approvals/triggerer-subject.d.ts +8 -10
- package/dist/artifacts/artifact-store.d.ts +55 -95
- package/dist/artifacts/failure-messages.d.ts +15 -20
- package/dist/audit/access-log.d.ts +27 -45
- package/dist/audit/sampling-rate-limiter.d.ts +11 -23
- package/dist/cache/agent-job-failed-error.d.ts +2 -3
- package/dist/cache/build-coordinator.d.ts +5 -28
- package/dist/cache/cache-upload-settle.d.ts +11 -11
- package/dist/cache/dep-cache.d.ts +32 -60
- package/dist/cache/dispatch-cache-ref-tracker.d.ts +15 -23
- package/dist/cache/global-eval-round-cache.d.ts +33 -41
- package/dist/cache/pending-builds.d.ts +2 -6
- package/dist/cache/pending-dynamics.d.ts +2 -7
- package/dist/cache/pending-global-evals.d.ts +9 -12
- package/dist/cache/pending-inits.d.ts +11 -22
- package/dist/cache/pending-precursor-db-watcher.d.ts +24 -32
- package/dist/cache/pending-tracker.d.ts +17 -45
- package/dist/cache/precursor-result.d.ts +17 -30
- package/dist/cache/source-cache.d.ts +36 -65
- package/dist/cache/user-cache.d.ts +21 -25
- package/dist/cancel/cancel-held-run.d.ts +13 -16
- package/dist/cancel/cancel-route-answer.d.ts +1 -2
- package/dist/cancel/cancel-run.d.ts +26 -50
- package/dist/cancel/dashboard-cancel-handler.d.ts +2 -2
- package/dist/cancel/peer-job-cancel.d.ts +11 -14
- package/dist/cancel/sweep-stuck-cancelling.d.ts +9 -13
- package/dist/cli/api-client.d.ts +25 -76
- package/dist/cli/commands/access-log.d.ts +4 -24
- package/dist/cli/commands/agent-package.d.ts +7 -15
- package/dist/cli/commands/agent-service/agent-env.d.ts +3 -6
- package/dist/cli/commands/agent-service/index.d.ts +4 -10
- package/dist/cli/commands/agent-service/install.d.ts +4 -11
- package/dist/cli/commands/agent-service/status.d.ts +4 -9
- package/dist/cli/commands/agent-service/upgrade.d.ts +4 -16
- package/dist/cli/commands/agent.d.ts +12 -25
- package/dist/cli/commands/api-key.d.ts +5 -12
- package/dist/cli/commands/attestations-list.d.ts +7 -17
- package/dist/cli/commands/attestations-retry.d.ts +5 -11
- package/dist/cli/commands/attestations-reverify.d.ts +4 -5
- package/dist/cli/commands/attestations.d.ts +3 -8
- package/dist/cli/commands/audit.d.ts +1 -5
- package/dist/cli/commands/backend.d.ts +2 -11
- package/dist/cli/commands/check-run.d.ts +7 -18
- package/dist/cli/commands/cluster-name.d.ts +5 -12
- package/dist/cli/commands/cluster-settings.d.ts +28 -53
- package/dist/cli/commands/cold-store.d.ts +7 -15
- package/dist/cli/commands/config.d.ts +9 -20
- package/dist/cli/commands/context.d.ts +8 -20
- package/dist/cli/commands/dashboard-encryption-key.d.ts +9 -14
- package/dist/cli/commands/db-backup.d.ts +17 -32
- package/dist/cli/commands/db.d.ts +3 -4
- package/dist/cli/commands/debug-bundle.d.ts +3 -10
- package/dist/cli/commands/diagnose.d.ts +3 -14
- package/dist/cli/commands/event-dlq.d.ts +4 -12
- package/dist/cli/commands/event-log.d.ts +2 -20
- package/dist/cli/commands/execution.d.ts +3 -9
- package/dist/cli/commands/firecracker/index.d.ts +3 -6
- package/dist/cli/commands/held-run.d.ts +23 -37
- package/dist/cli/commands/host.d.ts +4 -11
- package/dist/cli/commands/inspect-bundle.d.ts +3 -11
- package/dist/cli/commands/local-hook.d.ts +2 -10
- package/dist/cli/commands/local-trigger.d.ts +2 -2
- package/dist/cli/commands/orchestrator-service/drain.d.ts +3 -6
- package/dist/cli/commands/orchestrator-service/index.d.ts +6 -14
- package/dist/cli/commands/orchestrator-service/install-env.d.ts +25 -49
- package/dist/cli/commands/orchestrator-service/install.d.ts +2 -5
- package/dist/cli/commands/orchestrator-service/status.d.ts +10 -22
- package/dist/cli/commands/orchestrator-service/upgrade.d.ts +6 -15
- package/dist/cli/commands/org-settings.d.ts +5 -11
- package/dist/cli/commands/peer.d.ts +5 -10
- package/dist/cli/commands/queue.d.ts +3 -9
- package/dist/cli/commands/registration.d.ts +4 -8
- package/dist/cli/commands/remote-source.d.ts +6 -12
- package/dist/cli/commands/rotate.d.ts +1 -5
- package/dist/cli/commands/runs.d.ts +1 -30
- package/dist/cli/commands/scaler.d.ts +5 -12
- package/dist/cli/commands/secret.d.ts +1 -9
- package/dist/cli/commands/service-health.d.ts +5 -10
- package/dist/cli/commands/shared/admin-cli-access-log.d.ts +10 -19
- package/dist/cli/commands/shared/bare-metal-binary-check.d.ts +86 -0
- package/dist/cli/commands/shared/cli-action.d.ts +1 -4
- package/dist/cli/commands/shared/confirm.d.ts +5 -10
- package/dist/cli/commands/shared/db.d.ts +1 -12
- package/dist/cli/commands/shared/env-file-mode.d.ts +6 -9
- package/dist/cli/commands/shared/secret-input.d.ts +7 -21
- package/dist/cli/commands/shared/service-verbs.d.ts +6 -12
- package/dist/cli/commands/shared/unbound-context-warning.d.ts +2 -4
- package/dist/cli/commands/shared/upgrade-hooks.d.ts +7 -16
- package/dist/cli/commands/shared/upgrade-safety.d.ts +20 -31
- package/dist/cli/commands/shared/versioned-upgrade.d.ts +83 -161
- package/dist/cli/commands/signing-key.d.ts +4 -9
- package/dist/cli/commands/source-manifest.d.ts +11 -14
- package/dist/cli/commands/source.d.ts +7 -32
- package/dist/cli/commands/token.d.ts +4 -15
- package/dist/cli/commands/trust-policy.d.ts +35 -88
- package/dist/cli/commands/variable.d.ts +3 -5
- package/dist/cli/commands/workflow.d.ts +3 -24
- package/dist/cli/join.d.ts +3 -6
- package/dist/cli/kici-admin.d.ts +11 -29
- package/dist/cli/lazy-deps/cache.d.ts +1 -14
- package/dist/cli/lazy-deps/downloader.d.ts +4 -27
- package/dist/cli/lazy-deps/registry.d.ts +5 -25
- package/dist/cli/local-github-ingress-url.d.ts +5 -7
- package/dist/cli/loopback-callback.d.ts +6 -7
- package/dist/cli/open-browser.d.ts +4 -8
- package/dist/cli/root-option-routing.d.ts +17 -29
- package/dist/cli/service/backup-timer.d.ts +16 -39
- package/dist/cli/service/compose-path.d.ts +3 -7
- package/dist/cli/service/compose.d.ts +12 -30
- package/dist/cli/service/deploy-env.d.ts +6 -18
- package/dist/cli/service/entrypoint.d.ts +14 -25
- package/dist/cli/service/env-assignment.d.ts +6 -17
- package/dist/cli/service/image-digests.d.ts +6 -15
- package/dist/cli/service/index.d.ts +2 -18
- package/dist/cli/service/instance/index-file.d.ts +9 -16
- package/dist/cli/service/instance/manifest.d.ts +33 -59
- package/dist/cli/service/instance/resolve.d.ts +32 -68
- package/dist/cli/service/instance/types.d.ts +12 -29
- package/dist/cli/service/launchd.d.ts +29 -60
- package/dist/cli/service/platform-detect.d.ts +13 -68
- package/dist/cli/service/privilege.d.ts +12 -25
- package/dist/cli/service/shutdown-grace.d.ts +11 -20
- package/dist/cli/service/systemd.d.ts +7 -20
- package/dist/cli/service/types.d.ts +63 -114
- package/dist/cli/service/windows-acl.d.ts +14 -21
- package/dist/cli/service/windows-env-file.d.ts +10 -28
- package/dist/cli/service/windows.d.ts +15 -31
- package/dist/cli/webhook-url-notes.d.ts +4 -6
- package/dist/cli/wizard/agent-wizard.d.ts +3 -14
- package/dist/cli/wizard/orchestrator-wizard.d.ts +12 -37
- package/dist/cli/wizard/prompts.d.ts +6 -16
- package/dist/cli.js +4568 -6571
- package/dist/cluster/cluster-identity.d.ts +20 -32
- package/dist/cluster/cluster-settings-reader.d.ts +50 -77
- package/dist/cluster/coordinator-credential.d.ts +4 -5
- package/dist/cluster/coordinator.d.ts +76 -148
- package/dist/cluster/health-api.d.ts +2 -10
- package/dist/cluster/index.d.ts +1 -6
- package/dist/cluster/instance-heartbeat.d.ts +26 -42
- package/dist/cluster/join-client.d.ts +4 -7
- package/dist/cluster/join-handler.d.ts +3 -7
- package/dist/cluster/join-token.d.ts +13 -27
- package/dist/cluster/leader-gated-scheduler.d.ts +8 -17
- package/dist/cluster/orphan-recovery.d.ts +13 -35
- package/dist/cluster/peer-auth-coordinator.d.ts +2 -8
- package/dist/cluster/peer-client.d.ts +46 -76
- package/dist/cluster/peer-credentials.d.ts +24 -70
- package/dist/cluster/peer-crypto.d.ts +5 -26
- package/dist/cluster/peer-forget.d.ts +3 -3
- package/dist/cluster/peer-handler.d.ts +47 -71
- package/dist/cluster/peer-registry.d.ts +37 -106
- package/dist/cluster/plan-headroom-store.d.ts +4 -6
- package/dist/cluster/raft-state.d.ts +4 -13
- package/dist/cluster/raft.d.ts +18 -53
- package/dist/cluster/reconcile-identity.d.ts +8 -11
- package/dist/cluster/rerouted-job-guard.d.ts +7 -11
- package/dist/cluster/verified-issuer.d.ts +2 -3
- package/dist/cluster/worker-cluster-settings.d.ts +7 -10
- package/dist/cluster/worker-eviction.d.ts +16 -26
- package/dist/cold-store/load-access-log-range.d.ts +15 -31
- package/dist/cold-store/load-event-log-range.d.ts +13 -27
- package/dist/cold-store/load-secret-audit-log-range.d.ts +8 -12
- package/dist/cold-store/orchestrator-cold-store.d.ts +8 -28
- package/dist/cold-store/tables/access-log.d.ts +12 -14
- package/dist/cold-store/tables/event-log.d.ts +4 -8
- package/dist/cold-store/tables/execution-runs.d.ts +6 -11
- package/dist/cold-store/tables/secret-audit-log.d.ts +5 -12
- package/dist/concurrency/dispatch-next-queued.d.ts +13 -25
- package/dist/concurrency/queue-manager.d.ts +22 -54
- package/dist/concurrency/waiters.d.ts +15 -31
- package/dist/config/encryption.d.ts +0 -2
- package/dist/config/loader.d.ts +0 -1
- package/dist/config/reload.d.ts +0 -6
- package/dist/config/resolver.d.ts +0 -4
- package/dist/config/shared-store.d.ts +0 -2
- package/dist/config/types.d.ts +0 -3
- package/dist/content-requirements-cache.d.ts +0 -1
- package/dist/contexts/context-store.d.ts +0 -2
- package/dist/contexts/held-runs.d.ts +0 -2
- package/dist/contexts/variable-store.d.ts +0 -2
- package/dist/dashboard/attestation-filters.d.ts +13 -18
- package/dist/dashboard/handler.d.ts +143 -307
- package/dist/db/client.d.ts +2 -6
- package/dist/db/deferred-index-build.d.ts +8 -10
- package/dist/db/deferred-indexes.d.ts +15 -22
- package/dist/db/migration-provider.d.ts +2 -4
- package/dist/db/migration-test-harness.d.ts +26 -44
- package/dist/db/migrations/001_initial.d.ts +1 -4
- package/dist/db/migrations/002_config_versions_key_version.d.ts +5 -8
- package/dist/db/migrations/003_access_log.d.ts +10 -15
- package/dist/db/migrations/004_rename_bundle_to_source.d.ts +7 -9
- package/dist/db/migrations/005_cold_store_chunk_counter.d.ts +4 -10
- package/dist/db/migrations/006_runs_jobs_steps_archived_at.d.ts +9 -29
- package/dist/db/migrations/007_audit_logs_archived_at.d.ts +11 -30
- package/dist/db/migrations/008_event_log_archived_at.d.ts +14 -29
- package/dist/db/migrations/009_access_log_trigram.d.ts +4 -8
- package/dist/db/migrations/010_cold_store_chunks.d.ts +16 -26
- package/dist/db/migrations/011_drop_source_secrets_notify.d.ts +6 -14
- package/dist/db/migrations/012_peer_credentials_active_uniq.d.ts +9 -14
- package/dist/db/migrations/013_execution_log_bytes.d.ts +5 -13
- package/dist/db/migrations/014_kici_events_lease_retry.d.ts +14 -27
- package/dist/db/migrations/015_org_settings_customer_scoped.d.ts +12 -17
- package/dist/db/migrations/016_org_settings_allow_http_npm.d.ts +4 -6
- package/dist/db/migrations/019_generic_sources_change_notify.d.ts +13 -17
- package/dist/db/migrations/020_org_settings_dashboard_write_policy.d.ts +5 -8
- package/dist/db/migrations/021_check_run_tracking.d.ts +5 -17
- package/dist/db/migrations/022_scaler_manager_state.d.ts +10 -20
- package/dist/db/migrations/023_dispatch_queue_recovery_deadline.d.ts +7 -18
- package/dist/db/migrations/024_dispatch_queue_provisioning_error.d.ts +5 -11
- package/dist/db/migrations/025_init_failure.d.ts +5 -9
- package/dist/db/migrations/027_workflow_timeout.d.ts +5 -13
- package/dist/db/migrations/029_dispatch_queue_attempts.d.ts +4 -10
- package/dist/db/migrations/030_held_runs_env_set_null.d.ts +5 -6
- package/dist/db/migrations/031_dispatch_queue_ack_deadline.d.ts +6 -12
- package/dist/db/migrations/033_org_settings_approval.d.ts +7 -10
- package/dist/db/migrations/034_held_runs_generalize.d.ts +10 -18
- package/dist/db/migrations/035_pending_workflow_contexts.d.ts +4 -5
- package/dist/db/migrations/037_generic_sources_provider_type_local.d.ts +5 -6
- package/dist/db/migrations/038_remote_sources.d.ts +5 -7
- package/dist/db/migrations/045_host_properties.d.ts +5 -9
- package/dist/db/migrations/046_join_token_consumed_by_instance.d.ts +5 -10
- package/dist/db/migrations/048_host_reboot_pending.d.ts +6 -12
- package/dist/db/migrations/049_held_runs_payload.d.ts +3 -8
- package/dist/db/migrations/050_sources_slug.d.ts +4 -5
- package/dist/db/migrations/051_binding_host_pattern.d.ts +7 -10
- package/dist/db/migrations/052_host_reach_metadata.d.ts +8 -11
- package/dist/db/migrations/053_agent_token_single_use.d.ts +6 -10
- package/dist/db/migrations/054_local_working_tree.d.ts +4 -6
- package/dist/db/migrations/055_agent_token_mandatory_labels.d.ts +6 -11
- package/dist/db/migrations/056_execution_jobs_environments.d.ts +4 -11
- package/dist/db/migrations/064_execution_jobs_skipped_environments.d.ts +6 -9
- package/dist/db/migrations/065_pending_attestations.d.ts +9 -12
- package/dist/db/migrations/066_pending_attestations_rejected.d.ts +4 -7
- package/dist/db/migrations/068_request_idempotency.d.ts +7 -9
- package/dist/db/migrations/069_reroute_tunables.d.ts +6 -14
- package/dist/db/migrations/071_batch_accumulation.d.ts +8 -16
- package/dist/db/migrations/072_dispatch_queue_run_id_index.d.ts +3 -9
- package/dist/db/migrations/074_normalize_zero_concurrency_limit.d.ts +4 -7
- package/dist/db/migrations/076_artifacts.d.ts +7 -8
- package/dist/db/migrations/078_org_settings_backup_staleness.d.ts +3 -6
- package/dist/db/migrations/079_org_settings_scaler_spawn_timeout.d.ts +4 -8
- package/dist/db/migrations/080_cluster_settings.d.ts +6 -10
- package/dist/db/migrations/081_org_settings_queue_timeout.d.ts +7 -11
- package/dist/db/migrations/082_host_s3_reachable.d.ts +5 -10
- package/dist/db/migrations/083_org_settings_artifact_caps.d.ts +6 -8
- package/dist/db/migrations/084_orchestrator_signing_keys.d.ts +8 -13
- package/dist/db/migrations/085_cluster_settings_reroute_flap_grace_ms.d.ts +4 -5
- package/dist/db/migrations/086_cluster_settings_max_fanout_hosts.d.ts +3 -3
- package/dist/db/migrations/087_cluster_settings_event_router_rate_limit.d.ts +5 -3
- package/dist/db/migrations/088_cluster_settings_cache_max_tarball_bytes.d.ts +3 -3
- package/dist/db/migrations/089_cluster_settings_cache_ttl_days.d.ts +3 -5
- package/dist/db/migrations/090_cluster_settings_concurrency_wait_timeout_ms.d.ts +3 -6
- package/dist/db/migrations/091_cluster_settings_agent_token_ttl_ms.d.ts +3 -6
- package/dist/db/migrations/092_cluster_settings_version.d.ts +5 -9
- package/dist/db/migrations/094_dashboard_encryption_keys.d.ts +9 -14
- package/dist/db/migrations/095_dashboard_write_policy_tristate.d.ts +2 -6
- package/dist/db/migrations/099_cluster_settings_dashboard_verified_issuer.d.ts +8 -11
- package/dist/db/migrations/101_contexts_hold_expiry_drop_default.d.ts +9 -15
- package/dist/db/migrations/102_dispatch_queue_agent_id.d.ts +6 -11
- package/dist/db/migrations/103_cluster_settings_ownership_db_check_timeout_ms.d.ts +6 -12
- package/dist/db/migrations/104_check_run_terminal_sent.d.ts +8 -14
- package/dist/db/migrations/105_org_trust_policy.d.ts +5 -7
- package/dist/db/migrations/106_cluster_settings_check_run_tracking_ttl_days.d.ts +4 -12
- package/dist/db/migrations/107_check_run_tracking_updated_at_index.d.ts +8 -14
- package/dist/db/migrations/113_execution_runs_workflow_repo_index.d.ts +10 -19
- package/dist/db/migrations/115_global_workflows_cluster_switch.d.ts +2 -3
- package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +7 -8
- package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +9 -16
- package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +8 -16
- package/dist/db/migrations/125_org_trust_directory.d.ts +13 -21
- package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +10 -16
- package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +8 -16
- package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +6 -11
- package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +8 -11
- package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +13 -20
- package/dist/db/migrations/131_execution_jobs_git_credentials.d.ts +12 -22
- package/dist/db/migrations/132_execution_runs_trigger_event.d.ts +6 -16
- package/dist/db/migrations/133_dispatch_queue_source_tar_digest.d.ts +6 -9
- package/dist/db/migrations/140_dispatch_queue_canonical_labels.d.ts +22 -40
- package/dist/db/migrations/143_execution_jobs_precursor_result.d.ts +9 -18
- package/dist/db/migrations/144_execution_runs_registration_window.d.ts +12 -20
- package/dist/db/migrations/147_sealed_job_secrets.d.ts +5 -9
- package/dist/db/migrations/148_cluster_settings_sealed_secrets_retry_backoff_ms.d.ts +7 -13
- package/dist/db/migrations/150_execution_runs_status_epoch.d.ts +6 -11
- package/dist/db/migrations/152_org_settings_cache_upload_settle_timeout.d.ts +5 -8
- package/dist/db/migrations/157_host_roster_identity_source.d.ts +9 -13
- package/dist/db/migrations/159_org_id_widen_to_source_width.d.ts +5 -0
- package/dist/db/migrator.d.ts +17 -25
- package/dist/db/notify-listener.d.ts +8 -11
- package/dist/db/repos/dashboard-encryption-keys-repo.d.ts +9 -10
- package/dist/db/synthetic-job-ids.d.ts +6 -8
- package/dist/db/types.d.ts +531 -1058
- package/dist/deployment/deployment-identity.d.ts +42 -60
- package/dist/diagnostics/bundle-reader.d.ts +3 -15
- package/dist/diagnostics/bundle-writer.d.ts +5 -12
- package/dist/diagnostics/checks/agents.d.ts +1 -7
- package/dist/diagnostics/checks/backup.d.ts +7 -10
- package/dist/diagnostics/checks/certs.d.ts +1 -6
- package/dist/diagnostics/checks/config.d.ts +2 -5
- package/dist/diagnostics/checks/db.d.ts +1 -1
- package/dist/diagnostics/checks/disk.d.ts +1 -6
- package/dist/diagnostics/checks/firecracker-network.d.ts +3 -3
- package/dist/diagnostics/checks/index.d.ts +0 -6
- package/dist/diagnostics/checks/retention.d.ts +3 -6
- package/dist/diagnostics/checks/scaler.d.ts +3 -7
- package/dist/diagnostics/checks/ws.d.ts +1 -6
- package/dist/diagnostics/fleet-collector.d.ts +11 -14
- package/dist/diagnostics/fleet-constants.d.ts +1 -3
- package/dist/diagnostics/fleet-selection.d.ts +3 -7
- package/dist/diagnostics/fleet-topology.d.ts +2 -6
- package/dist/diagnostics/fleet-wiring.d.ts +6 -12
- package/dist/diagnostics/index.d.ts +0 -5
- package/dist/diagnostics/runner.d.ts +4 -8
- package/dist/diagnostics/types.d.ts +10 -21
- package/dist/drain/drain-controller.d.ts +16 -22
- package/dist/entry-helpers.d.ts +0 -2
- package/dist/events/circuit-breaker.d.ts +0 -3
- package/dist/events/event-router.d.ts +1 -2
- package/dist/events/event-store.d.ts +0 -9
- package/dist/events/trust-store.d.ts +0 -3
- package/dist/events/types.d.ts +0 -9
- package/dist/firecracker/host-network.d.ts +24 -30
- package/dist/firecracker/net-interfaces.d.ts +4 -7
- package/dist/helpers/rate-limiter.d.ts +0 -1
- package/dist/index.js +240 -482
- package/dist/metrics/agent-metrics-aggregator.d.ts +24 -67
- package/dist/metrics/metrics-reporter.d.ts +4 -13
- package/dist/metrics/prometheus.d.ts +47 -81
- package/dist/orchestrator-core.d.ts +3 -7
- package/dist/pipeline/content-filter.d.ts +20 -30
- package/dist/pipeline/cross-source-tally.d.ts +7 -8
- package/dist/pipeline/decorating-secret-resolver.d.ts +4 -8
- package/dist/pipeline/degraded-reason.d.ts +3 -4
- package/dist/pipeline/direct-ingress-deps.d.ts +15 -24
- package/dist/pipeline/dispatch-matched-workflow.d.ts +289 -525
- package/dist/pipeline/flatten-lock-steps.d.ts +4 -6
- package/dist/pipeline/global-dispatch-identity.d.ts +5 -10
- package/dist/pipeline/global-eval-round.d.ts +65 -151
- package/dist/pipeline/global-round-hold.d.ts +5 -7
- package/dist/pipeline/held-context-data.d.ts +5 -8
- package/dist/pipeline/held-round-registrations.d.ts +8 -11
- package/dist/pipeline/install-gate.d.ts +15 -25
- package/dist/pipeline/install-secrets-resolver.d.ts +24 -34
- package/dist/pipeline/internal-event-pipeline.d.ts +45 -62
- package/dist/pipeline/invoke-gate.d.ts +27 -40
- package/dist/pipeline/job-contexts.d.ts +19 -36
- package/dist/pipeline/manual-schedule.d.ts +7 -13
- package/dist/pipeline/needs-scheduler.d.ts +29 -46
- package/dist/pipeline/pending-workflow-context.d.ts +14 -28
- package/dist/pipeline/process-webhook.d.ts +88 -123
- package/dist/pipeline/processor.d.ts +209 -355
- package/dist/pipeline/remote-source-store.d.ts +5 -8
- package/dist/pipeline/request-idempotency.d.ts +10 -13
- package/dist/pipeline/rerun-global.d.ts +6 -7
- package/dist/pipeline/rerun-inputs.d.ts +23 -37
- package/dist/pipeline/rerun.d.ts +34 -57
- package/dist/pipeline/resolve-sandbox-grant.d.ts +5 -10
- package/dist/pipeline/resume-workflow.d.ts +28 -34
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +19 -30
- package/dist/pipeline/run-event-context.d.ts +16 -21
- package/dist/pipeline/sandbox-allowlist-reader.d.ts +7 -11
- package/dist/pipeline/security-hold-check.d.ts +56 -80
- package/dist/pipeline/test-pipeline.d.ts +20 -46
- package/dist/pipeline/unbound-job-context.d.ts +6 -9
- package/dist/pipeline/undispatched-hold-checks.d.ts +4 -6
- package/dist/pipeline/wave-scheduler.d.ts +15 -22
- package/dist/pipeline/webhook-payload-store.d.ts +3 -10
- package/dist/pipeline/workflow-lock-at-sha.d.ts +14 -20
- package/dist/policy/dashboard-write-policy.d.ts +1 -1
- package/dist/provider-registry.d.ts +0 -19
- package/dist/providers/generic/index.d.ts +0 -2
- package/dist/providers/generic/normalizer.d.ts +0 -1
- package/dist/providers/generic/verification.d.ts +0 -8
- package/dist/providers/github/auth.d.ts +0 -1
- package/dist/providers/github/changed-files.d.ts +2 -1
- package/dist/providers/github/file-contents.d.ts +0 -4
- package/dist/providers/github/lock-file.d.ts +0 -4
- package/dist/providers/github/normalizer.d.ts +1 -9
- package/dist/providers/local/index.d.ts +1 -2
- package/dist/providers/local/lock-file-fetcher.d.ts +0 -4
- package/dist/providers/local/normalizer.d.ts +0 -10
- package/dist/providers/local/repo-url-builder.d.ts +0 -2
- package/dist/providers/universal-git/clone-token.d.ts +0 -2
- package/dist/providers/universal-git/lock-file.d.ts +0 -2
- package/dist/providers/universal-git/normalizer.d.ts +0 -2
- package/dist/queue/bootstrap.d.ts +3 -15
- package/dist/queue/cleanup.d.ts +29 -50
- package/dist/queue/depth-refresher.d.ts +21 -39
- package/dist/queue/job-queue.d.ts +112 -163
- package/dist/queue/retention.d.ts +23 -36
- package/dist/queue/scheduled-job.d.ts +17 -39
- package/dist/queue/terminalize-unroutable.d.ts +16 -18
- package/dist/queue/unroutable-probe.d.ts +15 -22
- package/dist/registration/extractor.d.ts +0 -6
- package/dist/registration/registration-index.d.ts +0 -6
- package/dist/registration/registration-store.d.ts +0 -9
- package/dist/reporting/agent-failure-category.d.ts +3 -5
- package/dist/reporting/check-run-reporter.d.ts +142 -316
- package/dist/reporting/check-run-summary.d.ts +16 -35
- package/dist/reporting/check-run-tracking-store.d.ts +54 -107
- package/dist/reporting/execution-tracker.d.ts +356 -526
- package/dist/reporting/fs-log-storage.d.ts +31 -33
- package/dist/reporting/job-check-run-completion.d.ts +14 -22
- package/dist/reporting/log-chunk-sink.d.ts +11 -16
- package/dist/reporting/log-pull-handler.d.ts +4 -13
- package/dist/reporting/log-retention.d.ts +3 -4
- package/dist/reporting/log-storage.d.ts +24 -52
- package/dist/reporting/log-writer.d.ts +28 -56
- package/dist/reporting/peer-log-normalize.d.ts +4 -8
- package/dist/reporting/run-aggregator.d.ts +6 -11
- package/dist/reporting/run-summary-fields.d.ts +5 -8
- package/dist/reporting/s3-log-storage.d.ts +31 -50
- package/dist/reporting/step-display-order.d.ts +11 -21
- package/dist/reporting/step-log-buffer.d.ts +7 -28
- package/dist/reporting/step-log-reader.d.ts +11 -19
- package/dist/routes/admin-access-log.d.ts +4 -6
- package/dist/routes/admin-auth.d.ts +17 -38
- package/dist/routes/admin-backends.d.ts +3 -14
- package/dist/routes/admin-cluster-name.d.ts +13 -21
- package/dist/routes/admin-cluster-settings.d.ts +6 -9
- package/dist/routes/admin-config.d.ts +7 -19
- package/dist/routes/admin-contexts.d.ts +6 -13
- package/dist/routes/admin-db.d.ts +5 -10
- package/dist/routes/admin-event-dlq.d.ts +3 -5
- package/dist/routes/admin-event-inspect.d.ts +3 -4
- package/dist/routes/admin-event-log.d.ts +3 -7
- package/dist/routes/admin-events.d.ts +16 -30
- package/dist/routes/admin-held-runs.d.ts +52 -76
- package/dist/routes/admin-maintenance.d.ts +3 -6
- package/dist/routes/admin-orchestrator-drain.d.ts +0 -2
- package/dist/routes/admin-org-settings.d.ts +8 -14
- package/dist/routes/admin-peer-forget.d.ts +0 -1
- package/dist/routes/admin-queue-execution.d.ts +3 -3
- package/dist/routes/admin-registrations.d.ts +3 -12
- package/dist/routes/admin-runs.d.ts +16 -29
- package/dist/routes/admin-scaler-orphans.d.ts +4 -4
- package/dist/routes/admin-scaler-reload.d.ts +5 -8
- package/dist/routes/admin-scheduled-jobs.d.ts +3 -4
- package/dist/routes/admin-sources.d.ts +20 -29
- package/dist/routes/admin-trust-policy.d.ts +31 -48
- package/dist/routes/admin.d.ts +67 -94
- package/dist/routes/caller-identity.d.ts +5 -12
- package/dist/routes/capabilities.d.ts +8 -13
- package/dist/routes/diagnostics.d.ts +2 -10
- package/dist/routes/fleet.d.ts +1 -2
- package/dist/routes/github-webhook.d.ts +2 -5
- package/dist/routes/health.d.ts +6 -19
- package/dist/routes/provenance-oidc.d.ts +3 -3
- package/dist/routes/uploads.d.ts +5 -11
- package/dist/routes/webhooks.d.ts +2 -24
- package/dist/scaler/agent-binary-location.d.ts +77 -0
- package/dist/scaler/agent-fit.d.ts +2 -2
- package/dist/scaler/backend-factory.d.ts +10 -18
- package/dist/scaler/bare-metal-backend.d.ts +28 -45
- package/dist/scaler/claim-store.d.ts +20 -43
- package/dist/scaler/config.d.ts +10 -37
- package/dist/scaler/container-backend.d.ts +22 -35
- package/dist/scaler/container-hostconfig.d.ts +10 -16
- package/dist/scaler/container-routing.d.ts +10 -13
- package/dist/scaler/disk-guard.d.ts +2 -3
- package/dist/scaler/event-backend.d.ts +33 -58
- package/dist/scaler/event-provision-reaper.d.ts +61 -84
- package/dist/scaler/failure-tracker.d.ts +6 -13
- package/dist/scaler/file-tail.d.ts +6 -19
- package/dist/scaler/firecracker-api.d.ts +19 -63
- package/dist/scaler/firecracker-backend.d.ts +142 -258
- package/dist/scaler/host-access.d.ts +7 -10
- package/dist/scaler/index.d.ts +3 -6
- package/dist/scaler/ip-allocator.d.ts +30 -82
- package/dist/scaler/label-matcher.d.ts +14 -35
- package/dist/scaler/log-forwarder.d.ts +6 -25
- package/dist/scaler/machine-ledger.d.ts +39 -86
- package/dist/scaler/manager.d.ts +517 -787
- package/dist/scaler/pending-scale-sweeper.d.ts +8 -11
- package/dist/scaler/reap-orphans.d.ts +8 -12
- package/dist/scaler/resolve-container-auth.d.ts +12 -21
- package/dist/scaler/scaler-events.d.ts +2 -5
- package/dist/scaler/scaler-state-store.d.ts +127 -189
- package/dist/scaler/spawn-errors.d.ts +1 -4
- package/dist/scaler/startup-orphan-sweep.d.ts +3 -4
- package/dist/scaler/startup-tools-check.d.ts +21 -0
- package/dist/scaler/types.d.ts +142 -255
- package/dist/scaler/vm-job-bindings.d.ts +5 -9
- package/dist/scaler/warm-pool.d.ts +46 -93
- package/dist/secrets/audit-logger.d.ts +0 -3
- package/dist/secrets/backend-health.d.ts +0 -9
- package/dist/secrets/backend-registry.d.ts +0 -9
- package/dist/secrets/cleanup.d.ts +0 -1
- package/dist/secrets/config.d.ts +0 -3
- package/dist/secrets/ephemeral-keys.d.ts +0 -3
- package/dist/secrets/pg-secret-store.d.ts +0 -3
- package/dist/secrets/rbac.d.ts +0 -6
- package/dist/secrets/secret-output-store.d.ts +0 -6
- package/dist/secrets/secret-resolver.d.ts +2 -6
- package/dist/secrets/token-manager.d.ts +0 -4
- package/dist/secrets/vault-secret-store.d.ts +0 -13
- package/dist/security/comment-handler.d.ts +0 -2
- package/dist/security/workflow-diff.d.ts +1 -1
- package/dist/server.js +7500 -12629
- package/dist/sources/source-manager.d.ts +0 -3
- package/dist/sources/source-store.d.ts +0 -9
- package/dist/sources/source-validator.d.ts +0 -3
- package/dist/stale-detector/all-terminal-runs.d.ts +8 -11
- package/dist/stale-detector/gate-deadline-detector.d.ts +14 -19
- package/dist/stale-detector/reboot-deadline-sweep.d.ts +7 -11
- package/dist/stale-detector/stale-dispatch-candidates.d.ts +13 -20
- package/dist/stale-detector/stale-run-detector.d.ts +74 -121
- package/dist/stale-detector/workflow-deadline-detector.d.ts +15 -43
- package/dist/standalone.js +7141 -11957
- package/dist/storage/blob-routes.d.ts +10 -19
- package/dist/storage/filesystem.d.ts +19 -29
- package/dist/storage/index.d.ts +2 -10
- package/dist/storage/key-discriminator.d.ts +8 -10
- package/dist/storage/loopback-guard.d.ts +27 -45
- package/dist/storage/s3.d.ts +25 -52
- package/dist/storage/sign-url.d.ts +7 -22
- package/dist/storage/types.d.ts +44 -70
- package/dist/webhook/event-log.d.ts +0 -2
- package/dist/webhook/generic-sources.d.ts +0 -21
- package/dist/webhook/ingest-admission.d.ts +0 -1
- package/dist/webhook/relay-buffer.d.ts +2 -2
- package/dist/webhook/verify-inbound.d.ts +0 -1
- package/dist/worker/in-memory-execution-tracker.d.ts +9 -31
- package/dist/worker/in-memory-job-queue.d.ts +32 -72
- package/dist/worker/peer-outbox.d.ts +5 -8
- package/dist/worker/reroute-dispatch.d.ts +4 -6
- package/dist/worker/static-agent-token-store.d.ts +6 -27
- package/dist/worker/worker-outbox-relay.d.ts +2 -2
- package/dist/worker/worker-status.d.ts +3 -20
- package/dist/ws/agent-api-registry.d.ts +8 -27
- package/dist/ws/agent-handler.d.ts +63 -110
- package/dist/ws/agent-heartbeat.d.ts +5 -12
- package/dist/ws/bringup-api.d.ts +31 -38
- package/dist/ws/dashboard-backends-handler.d.ts +12 -22
- package/dist/ws/dashboard-context-handler.d.ts +37 -80
- package/dist/ws/dashboard-diagnostics-handler.d.ts +8 -25
- package/dist/ws/dashboard-dispatch-guard.d.ts +3 -4
- package/dist/ws/dashboard-fleet-handler.d.ts +9 -13
- package/dist/ws/dashboard-fleet-write-handler.d.ts +7 -21
- package/dist/ws/dashboard-global-workflows-handler.d.ts +22 -44
- package/dist/ws/dashboard-registrations-handler.d.ts +10 -27
- package/dist/ws/dashboard-run-state-handler.d.ts +10 -13
- package/dist/ws/event-buffer.d.ts +3 -6
- package/dist/ws/execution-status-frame.d.ts +7 -10
- package/dist/ws/failure-messages.d.ts +9 -14
- package/dist/ws/fleet-agent-collector.d.ts +6 -12
- package/dist/ws/fleet-runs-on-all.d.ts +1 -6
- package/dist/ws/git-credential-relay.d.ts +12 -20
- package/dist/ws/inventory-api.d.ts +4 -5
- package/dist/ws/observer-registry.d.ts +14 -59
- package/dist/ws/ownership-gate.d.ts +1 -1
- package/dist/ws/platform-client.d.ts +21 -30
- package/dist/ws/replay-chunker.d.ts +7 -10
- package/dist/ws/server-options.d.ts +5 -9
- package/dist/ws/test-relay-handlers.d.ts +36 -60
- package/installer-image-digests.json +3 -3
- package/package.json +6 -5
- package/sbom.spdx.json +53 -53
- package/dist/__test-helpers__/fake-scaler-state-store.d.ts +0 -24
- package/dist/__test-helpers__/mock-db-query.d.ts +0 -129
- package/dist/__test-helpers__/mock-db.d.ts +0 -134
- package/dist/__test-helpers__/mock-ws.d.ts +0 -13
- package/dist/__test-helpers__/peer-mutual-auth.d.ts +0 -42
- package/dist/__test-helpers__/scratch-db.d.ts +0 -16
- package/dist/__test-helpers__/test-db.d.ts +0 -34
- package/dist/pipeline/dispatch-matched-workflow.test-helpers.d.ts +0 -121
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Core webhook processing pipeline
|
|
2
|
+
* Core webhook processing pipeline: dedup -> normalize event -> fetch lock file ->
|
|
3
|
+
* get changed files -> match triggers -> cache check -> dispatch jobs.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* dedup -> normalize event -> fetch lock file -> get changed files ->
|
|
6
|
-
* match triggers -> cache check -> dispatch jobs
|
|
5
|
+
* Provider-agnostic: every provider-specific operation goes through the ProviderRegistry.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Decision traces are forwarded to Platform via platformClient.send() (which buffers
|
|
12
|
-
* internally when disconnected -- the caller does NOT check connection state).
|
|
7
|
+
* Decision traces go to the Platform via platformClient.send(), which buffers while
|
|
8
|
+
* disconnected, so the caller does NOT check connection state.
|
|
13
9
|
*/
|
|
14
10
|
import { type Kysely } from 'kysely';
|
|
15
11
|
import type { Database } from '../db/types.js';
|
|
@@ -63,12 +59,10 @@ import type { TrustPolicyStore } from '../security/trust-policy-store.js';
|
|
|
63
59
|
import type { TrustDirectoryStore } from '../security/trust-directory-store.js';
|
|
64
60
|
import { type ContextDataDeps, type DeferredContextResolution } from './held-context-data.js';
|
|
65
61
|
/**
|
|
66
|
-
* Pending dispatch context for
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* Entries are cleaned up after dispatch or when the run completes.
|
|
62
|
+
* Pending dispatch context for a job gated by the needs scheduler, keyed by
|
|
63
|
+
* `${runId}:${jobName}`. Stored at processWebhook time for every non-root static
|
|
64
|
+
* job; consumed by onJobReady once its upstreams are satisfied; cleaned up after
|
|
65
|
+
* dispatch or on run completion.
|
|
72
66
|
*/
|
|
73
67
|
interface PendingJobContext {
|
|
74
68
|
jobInput: QueuedJobInput;
|
|
@@ -80,10 +74,9 @@ interface PendingJobContext {
|
|
|
80
74
|
*/
|
|
81
75
|
invoke?: InvokeGateParams;
|
|
82
76
|
/**
|
|
83
|
-
* Set for a job bound to a context:
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* bound context, which dispatches its stored input unchanged.
|
|
77
|
+
* Set for a job bound to a context: `dispatchReadyJob` resolves the context
|
|
78
|
+
* variables and secrets from it, since `jobInput` is stored without them.
|
|
79
|
+
* Absent when no context is bound; the stored input dispatches unchanged.
|
|
87
80
|
*/
|
|
88
81
|
contextResolution?: DeferredContextResolution;
|
|
89
82
|
/**
|
|
@@ -93,15 +86,11 @@ interface PendingJobContext {
|
|
|
93
86
|
*/
|
|
94
87
|
secretsUnavailable?: string;
|
|
95
88
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Register an eval gate and return a promise that resolves when the scheduler
|
|
98
|
-
* opens it (the eval job's upstream needs are all satisfied).
|
|
99
|
-
*/
|
|
89
|
+
/** Register an eval gate; resolves when the scheduler opens it. */
|
|
100
90
|
export declare function trackEvalGate(runId: string, evalJobName: string): Promise<void>;
|
|
101
91
|
/**
|
|
102
|
-
* Open a registered eval gate
|
|
103
|
-
*
|
|
104
|
-
* handled the ready signal itself and must not run the normal dispatch path).
|
|
92
|
+
* Open a registered eval gate. Returns true when one existed, so the scheduler
|
|
93
|
+
* must not also run the normal dispatch path.
|
|
105
94
|
*/
|
|
106
95
|
export declare function openEvalGate(runId: string, evalJobName: string): boolean;
|
|
107
96
|
/** True when a job name is a result-aware dynamic eval job awaiting its gate. */
|
|
@@ -109,45 +98,35 @@ export declare function isEvalGatePending(runId: string, evalJobName: string): b
|
|
|
109
98
|
/** Clear all eval gates for a run (called on run completion / cleanup). */
|
|
110
99
|
export declare function clearEvalGatesForRun(runId: string): void;
|
|
111
100
|
/**
|
|
112
|
-
* Store a pending dispatch context
|
|
113
|
-
* by the needs scheduler. The key is `${runId}:${jobName}`.
|
|
114
|
-
* Writes to both in-memory Map and DB table for crash recovery.
|
|
101
|
+
* Store a pending dispatch context in memory and in the DB (for crash recovery).
|
|
115
102
|
* @internal Exported for testing
|
|
116
103
|
*/
|
|
117
104
|
export declare function storePendingJobContext(db: Kysely<Database> | undefined, runId: string, jobName: string, ctx: PendingJobContext): Promise<void>;
|
|
118
105
|
/**
|
|
119
|
-
* Consume
|
|
120
|
-
*
|
|
121
|
-
* Deletes from both in-memory Map and DB table.
|
|
106
|
+
* Consume a pending dispatch context from memory and the DB; undefined when none
|
|
107
|
+
* is stored (e.g. the job already dispatched).
|
|
122
108
|
*
|
|
123
|
-
* Cluster correctness: `
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* tracked the upstream job's completion — which, for a rerouted upstream,
|
|
127
|
-
* is a different peer whose Map is empty. Falling through to an atomic
|
|
128
|
-
* `DELETE ... RETURNING` ensures exactly one peer claims the context.
|
|
109
|
+
* Cluster correctness: `onJobReady` fires on whichever peer tracked the upstream's
|
|
110
|
+
* completion, which for a rerouted upstream is not the ingesting peer, so its Map
|
|
111
|
+
* is empty. The atomic `DELETE ... RETURNING` fallback lets exactly one peer claim it.
|
|
129
112
|
* @internal Exported for testing
|
|
130
113
|
*/
|
|
131
114
|
export declare function consumePendingJobContext(db: Kysely<Database> | undefined, runId: string, jobName: string): Promise<PendingJobContext | undefined>;
|
|
132
|
-
/**
|
|
133
|
-
* Clean up all pending dispatch contexts for a run (called on run completion).
|
|
134
|
-
* Deletes from both in-memory Map and DB table.
|
|
135
|
-
*/
|
|
115
|
+
/** Drop a run's pending dispatch contexts from memory and the DB on run completion. */
|
|
136
116
|
export declare function cleanupPendingJobContexts(db: Kysely<Database> | undefined, runId: string): Promise<void>;
|
|
137
117
|
/**
|
|
138
|
-
* Restore
|
|
139
|
-
*
|
|
140
|
-
* dispatchReadyJob has context available for recovered jobs.
|
|
118
|
+
* Restore pending job contexts from the DB into memory. Runs on startup before
|
|
119
|
+
* the needs scheduler recovery loop, so dispatchReadyJob has them for recovered jobs.
|
|
141
120
|
*/
|
|
142
121
|
export declare function restorePendingJobContexts(db: Kysely<Database>): Promise<number>;
|
|
143
122
|
/**
|
|
144
|
-
* Clear
|
|
123
|
+
* Clear the in-memory pending job contexts.
|
|
145
124
|
* @internal Exported for testing only.
|
|
146
125
|
*/
|
|
147
126
|
export declare function clearPendingJobContextsMap(): void;
|
|
148
127
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
128
|
+
* A root job (no concrete needs, no dependsOnGroups) dispatches immediately;
|
|
129
|
+
* others wait for the scheduler.
|
|
151
130
|
*/
|
|
152
131
|
export declare function isRootJob(lockJob: LockJob): boolean;
|
|
153
132
|
/**
|
|
@@ -155,44 +134,24 @@ export declare function isRootJob(lockJob: LockJob): boolean;
|
|
|
155
134
|
* webhook's provider bundle first, then falling back to other provider bundles
|
|
156
135
|
* registered against the SAME customer's registrations for the SAME repo.
|
|
157
136
|
*
|
|
158
|
-
* Why
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* push sent through the internal ingress) arrives for a repo whose lock file
|
|
163
|
-
* is only accessible via a different provider (e.g., github), the inbound
|
|
164
|
-
* fetcher returns null and trigger matching silently drops the webhook.
|
|
165
|
-
* This resolver lets the pipeline consult OTHER bundles whose registrations
|
|
166
|
-
* prove they own the repo for the same tenant.
|
|
137
|
+
* Why: `lockFileFetcher` is bound to the inbound provider bundle. A local-sourced
|
|
138
|
+
* webhook (e.g. a failover-dispatch push through the internal ingress) for a repo
|
|
139
|
+
* whose lock file only another provider (e.g. github) can read gets null, and
|
|
140
|
+
* trigger matching silently drops the webhook.
|
|
167
141
|
*
|
|
168
|
-
* Tenant boundary (security-critical)
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* leakage is structurally impossible — a customer-B registration for
|
|
174
|
-
* `owner/repo` will never be returned when we pass `customerId = 'custA'`.
|
|
175
|
-
* The resolver also skips any registration whose `routingKey` matches the
|
|
176
|
-
* inbound routing key (no self-recursion) and dedupes by routing key so a
|
|
177
|
-
* repo with many workflows registered through the same source only
|
|
178
|
-
* triggers one fallback fetch.
|
|
142
|
+
* Tenant boundary (security-critical): the fallback iterates ONLY
|
|
143
|
+
* `registrationIndex.getByOrgAndRepo(customerId, repoIdentifier)`, keyed by
|
|
144
|
+
* `${customerId}|${repoIdentifier}`, so cross-customer leakage is structurally
|
|
145
|
+
* impossible. It skips the inbound routing key (no self-recursion) and dedupes by
|
|
146
|
+
* routing key, so many workflows from one source trigger one fallback fetch.
|
|
179
147
|
*
|
|
180
|
-
* Ordering
|
|
181
|
-
*
|
|
182
|
-
* Registrations are consulted in the order returned by the index (which
|
|
183
|
-
* preserves insertion order = createdAt ascending). The first non-null
|
|
184
|
-
* lock file wins. If all fallbacks return null the function returns null
|
|
185
|
-
* and the caller falls through to the existing `Lock file not found`
|
|
148
|
+
* Ordering: index order (createdAt ascending); the first non-null lock file wins.
|
|
149
|
+
* All null returns null, and the caller falls through to the `Lock file not found`
|
|
186
150
|
* global-workflow-matching path.
|
|
187
151
|
*
|
|
188
|
-
* Credentials
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* `providerContext`, NOT the inbound normalizer's credentials. This is
|
|
192
|
-
* load-bearing: the LocalWebhookNormalizer returns `{}` as
|
|
193
|
-
* credentials, which would never satisfy a github fetcher that requires
|
|
194
|
-
* `installationId`. The registration carries the correct credentials
|
|
195
|
-
* because it was created via the owning provider's source.
|
|
152
|
+
* Credentials: each fallback fetcher gets the REGISTRATION'S `providerContext`,
|
|
153
|
+
* NOT the inbound credentials. Load-bearing: LocalWebhookNormalizer returns `{}`,
|
|
154
|
+
* which never satisfies a github fetcher needing `installationId`.
|
|
196
155
|
*/
|
|
197
156
|
export declare function resolveLockFileWithFallback(args: {
|
|
198
157
|
inboundBundle: ProviderBundle;
|
|
@@ -207,105 +166,78 @@ export declare function resolveLockFileWithFallback(args: {
|
|
|
207
166
|
deliveryId: string;
|
|
208
167
|
/**
|
|
209
168
|
* False when cross-source repo mode already evaluated this delivery's
|
|
210
|
-
* other-source registrations for the
|
|
211
|
-
*
|
|
169
|
+
* other-source registrations for the repo, which the fallback would re-read.
|
|
170
|
+
* Defaults to true.
|
|
212
171
|
*/
|
|
213
172
|
allowRegistrationFallback?: boolean;
|
|
214
173
|
}): Promise<{
|
|
215
174
|
lockFile: FullLockFile | null;
|
|
216
175
|
resolvedVia: 'inbound' | 'fallback' | 'miss' | 'corrupt';
|
|
217
176
|
fallbackRoutingKey?: string;
|
|
218
|
-
/**
|
|
219
|
-
* site to swap repoUrlBuilder and cloneTokenProvider (Layer 4 cross-provider fix). */
|
|
177
|
+
/** Set on 'fallback': the dispatch site swaps in its repoUrlBuilder and cloneTokenProvider. */
|
|
220
178
|
fallbackBundle?: ProviderBundle;
|
|
221
|
-
/**
|
|
222
|
-
* Carries installationId etc. for clone token issuance. */
|
|
179
|
+
/** Set on 'fallback': the registration's providerContext (installationId etc.) for clone tokens. */
|
|
223
180
|
fallbackCredentials?: Record<string, unknown>;
|
|
224
|
-
/** Set
|
|
225
|
-
*
|
|
226
|
-
* so this is only surfaced when NOTHING resolved. */
|
|
181
|
+
/** Set on 'corrupt': the parse error. A valid fallback beats a corrupt inbound,
|
|
182
|
+
* so this surfaces only when NOTHING resolved. */
|
|
227
183
|
corruptError?: LockFileParseError;
|
|
228
184
|
}>;
|
|
229
185
|
/**
|
|
230
|
-
* Resolve the customer/org ID for a routing key
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* (the auto-provisioned anchor for Platform-relayed `kici run remote`, routing
|
|
235
|
-
* key `remote:<orgId>`). Falls back to '__default__' if none of the three
|
|
236
|
-
* tables has the routing key.
|
|
186
|
+
* Resolve the customer/org ID for a routing key from `sources` (GitHub App), then
|
|
187
|
+
* `generic_webhook_sources`, then `remote_sources` (the auto-provisioned anchor for
|
|
188
|
+
* Platform-relayed `kici run remote`, routing key `remote:<orgId>`); '__default__'
|
|
189
|
+
* when none has it.
|
|
237
190
|
*/
|
|
238
191
|
export declare function resolveOrgId(db: Kysely<Database>, routingKey: string): Promise<string>;
|
|
239
|
-
/**
|
|
240
|
-
* Map GitHub webhook event types to lock file trigger type strings.
|
|
241
|
-
* Used for global workflow matching via RegistrationIndex.getGlobalByTriggerType().
|
|
242
|
-
*/
|
|
192
|
+
/** Map a GitHub event type to its lock file trigger type, for RegistrationIndex.getGlobalByTriggerType(). */
|
|
243
193
|
export declare function eventTypeToTriggerType(eventType: string): string;
|
|
244
|
-
/**
|
|
245
|
-
* Extract a human-readable trigger event string from webhook info.
|
|
246
|
-
* Combines event type with action (e.g. "push", "pull_request:opened").
|
|
247
|
-
*/
|
|
194
|
+
/** Trigger event string: event plus action, e.g. "push", "pull_request:opened". */
|
|
248
195
|
export declare function buildTriggerEvent(event: string, action: string | null | undefined): string;
|
|
249
196
|
/**
|
|
250
|
-
* Best-effort
|
|
251
|
-
*
|
|
252
|
-
* canonical repo shape, so we probe the conventions a sender is most likely
|
|
253
|
-
* to use:
|
|
197
|
+
* Best-effort repo identifier from a generic webhook payload, for cross-source
|
|
198
|
+
* dispatch. Generic webhooks have no canonical repo shape, so this probes:
|
|
254
199
|
*
|
|
255
200
|
* 1. GitHub-style `repository.full_name` (`owner/repo`)
|
|
256
201
|
* 2. GitHub-style `repository.owner.login` + `repository.name`
|
|
257
202
|
* 3. Flat `repository` string (e.g. `{"repository": "owner/repo"}`)
|
|
258
203
|
*
|
|
259
|
-
*
|
|
260
|
-
* cross-source repo lookup is skipped (event-name fan-out still runs).
|
|
204
|
+
* Null skips the cross-source repo lookup; event-name fan-out still runs.
|
|
261
205
|
*/
|
|
262
206
|
export declare function extractInboundRepoIdentifier(payload: unknown): string | null;
|
|
263
207
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* issue_comment (issue.title) events.
|
|
208
|
+
* First line of the commit message for run display: push (head_commit.message),
|
|
209
|
+
* PR (pull_request.title), issue_comment (issue.title).
|
|
267
210
|
*
|
|
268
211
|
* The Tier-0 `commitMessage` trigger filter deliberately reads a DIFFERENT text
|
|
269
212
|
* (the full message, and PR title + body) — see `githubFilterText`.
|
|
270
213
|
*/
|
|
271
214
|
export declare function extractCommitMessage(event: string, payload: unknown): string | undefined;
|
|
272
215
|
/**
|
|
273
|
-
*
|
|
216
|
+
* Summary for a security hold check.
|
|
274
217
|
*
|
|
275
|
-
* `tier` is
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
* `buildReducedPrivilegeNote` (`../security/reduced-privilege-note.ts`) cannot
|
|
279
|
-
* disagree about which case a run is in.
|
|
218
|
+
* `tier` is undefined when trust never resolved (displayed as `unknown`). The
|
|
219
|
+
* caller never forges `unknown`, so this and `buildReducedPrivilegeNote`
|
|
220
|
+
* (`../security/reduced-privilege-note.ts`) cannot disagree about a run's case.
|
|
280
221
|
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* `/kici approve` replays its dispatch and its call site
|
|
285
|
-
* (`holdRunForSecurityPolicy`) appends the note; the trust-policy REJECTION
|
|
286
|
-
* never runs, so `buildSecurityRejectionSummary`'s call site appends nothing.
|
|
222
|
+
* The reduced-privilege note is the call site's job: a trust-policy HOLD stores a
|
|
223
|
+
* resume context that `/kici approve` replays, so `holdRunForSecurityPolicy`
|
|
224
|
+
* appends it; a trust-policy REJECTION never runs, so its call site appends nothing.
|
|
287
225
|
*/
|
|
288
226
|
export declare function buildSecurityHoldSummary(reason: string, tier: string | undefined, contributorUsername?: string): string;
|
|
289
227
|
/**
|
|
290
|
-
*
|
|
291
|
-
* REJECTED.
|
|
292
|
-
*
|
|
293
|
-
* Deliberately not `buildSecurityHoldSummary`: a rejected run creates no
|
|
294
|
-
* `held_runs` row, so telling the contributor to seek "approval from a user
|
|
295
|
-
* with ci_trust:write or higher" points at a queue the run will never appear
|
|
296
|
-
* in. Only an org policy change can unblock it.
|
|
228
|
+
* Failure check-run description for a run the org trust policy REJECTED.
|
|
297
229
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
230
|
+
* Not `buildSecurityHoldSummary`: a rejected run has no `held_runs` row, so
|
|
231
|
+
* "approval from a user with ci_trust:write" points at a queue it never joins;
|
|
232
|
+
* only an org policy change unblocks it. No reduced-privilege note either: beside
|
|
233
|
+
* "cannot be approved" it would read as the cause of failure for a run that never
|
|
234
|
+
* dispatched.
|
|
302
235
|
*/
|
|
303
236
|
export declare function buildSecurityRejectionSummary(reason: string, message: string, tier: string | undefined, contributorUsername?: string): string;
|
|
304
237
|
/**
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* reviewer satisfies the hold) falls back to a generic message.
|
|
238
|
+
* Pending check-run description for a job/workflow approval hold, naming the
|
|
239
|
+
* clauses ("team X", "user Y"). An empty list (any eligible reviewer) gets a
|
|
240
|
+
* generic message.
|
|
309
241
|
*/
|
|
310
242
|
export declare function summarizeApprovalClauses(clauses: ReadonlyArray<{
|
|
311
243
|
team: string;
|
|
@@ -313,202 +245,168 @@ export declare function summarizeApprovalClauses(clauses: ReadonlyArray<{
|
|
|
313
245
|
user: string;
|
|
314
246
|
}>): string;
|
|
315
247
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* description. Without this line the check names only the approval clauses — so
|
|
321
|
-
* the named approver approves, nothing runs, and the text does not change: a
|
|
322
|
-
* contributor is left with a satisfied requirement, no statement of what is
|
|
323
|
-
* still outstanding, and no idea that a different permission clears it. Naming
|
|
324
|
-
* the second gate and how it is released is the minimum that makes the check
|
|
325
|
-
* honest.
|
|
248
|
+
* Appended to an approval hold's check description when a security trust hold
|
|
249
|
+
* gates the SAME job. Both holds must clear and the check carries one description;
|
|
250
|
+
* without this line the named approver approves, nothing runs, and nothing says
|
|
251
|
+
* what is outstanding or that a different permission clears it.
|
|
326
252
|
*/
|
|
327
253
|
export declare const SECURITY_HOLD_ALSO_GATES_NOTE: string;
|
|
328
254
|
/**
|
|
329
|
-
* Dependencies for the processing pipeline.
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* sourceCache and buildCoordinator are optional for backward compatibility --
|
|
333
|
-
* existing tests and deployments without cache configured still work.
|
|
255
|
+
* Dependencies for the processing pipeline, all injected for testability.
|
|
256
|
+
* Optional caches keep tests and cache-less deployments working.
|
|
334
257
|
*/
|
|
335
258
|
export interface ProcessingDeps {
|
|
336
259
|
dedup: DedupCache;
|
|
337
260
|
providerRegistry: ProviderRegistry;
|
|
338
261
|
/**
|
|
339
262
|
* Re-register the provider bundle for a generic routing key from server
|
|
340
|
-
* truth
|
|
263
|
+
* truth; true when a bundle is now present.
|
|
341
264
|
*
|
|
342
|
-
* The registry is an in-memory CACHE of `generic_webhook_sources`,
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
* bundle whose normalizer reports "this payload has no repository", so the
|
|
348
|
-
* delivery was discarded with nothing above `debug` to say why.
|
|
265
|
+
* The registry is an in-memory CACHE of `generic_webhook_sources`, filled by
|
|
266
|
+
* startup enumeration, the admin write handler and the LISTEN/NOTIFY drain;
|
|
267
|
+
* none guarantees the entry exists when a delivery arrives. A miss is not
|
|
268
|
+
* benign: an unrelated `generic:` bundle would report "no repository" and the
|
|
269
|
+
* delivery would be discarded with nothing above `debug`.
|
|
349
270
|
*
|
|
350
|
-
* Optional
|
|
351
|
-
* keep the previous behaviour (a miss stays a miss, reported loudly).
|
|
271
|
+
* Optional: without it a miss stays a miss, reported loudly.
|
|
352
272
|
*/
|
|
353
273
|
ensureProviderBundle?: (routingKey: string) => Promise<boolean>;
|
|
354
274
|
lockFileCache: LockFileCache;
|
|
355
275
|
/**
|
|
356
|
-
* Cache for the Tier-1 `requires` static content filter (
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* a candidate carrying `requires` is dropped fail-visible rather than
|
|
360
|
-
* dispatched unfiltered (see content-filter.ts).
|
|
276
|
+
* Cache for the Tier-1 `requires` static content filter (file bytes keyed by
|
|
277
|
+
* (repo, sha, path)). When absent, a candidate carrying `requires` is dropped
|
|
278
|
+
* fail-visible rather than dispatched unfiltered (see content-filter.ts).
|
|
361
279
|
*/
|
|
362
280
|
contentRequirementsCache?: ContentRequirementsCache;
|
|
363
281
|
dispatcher: Dispatcher;
|
|
364
282
|
/** Null/undefined in Independent mode. send() buffers when disconnected. */
|
|
365
283
|
platformClient?: PlatformClient;
|
|
366
|
-
/**
|
|
284
|
+
/** If set, raw payloads go to {dir}/{repo}/{deliveryId}/payload.json. */
|
|
367
285
|
webhookPayloadDir?: string;
|
|
368
|
-
/**
|
|
286
|
+
/** Compiled workflow bundle cache; absent bypasses the cache. */
|
|
369
287
|
sourceCache?: SourceCache;
|
|
370
|
-
/**
|
|
288
|
+
/** Deduplicates concurrent builds; absent bypasses the cache. */
|
|
371
289
|
buildCoordinator?: BuildCoordinator;
|
|
372
|
-
/**
|
|
290
|
+
/** Dependency tarball cache; absent bypasses dep caching. */
|
|
373
291
|
depCache?: DepCache;
|
|
374
|
-
/**
|
|
292
|
+
/** Waits for build agents before dispatching execution jobs. */
|
|
375
293
|
pendingBuilds?: PendingBuildTracker;
|
|
376
|
-
/**
|
|
294
|
+
/** Waits for init agents to resolve dynamic fields before static dispatch. */
|
|
377
295
|
pendingInits?: PendingInitTracker;
|
|
378
|
-
/**
|
|
296
|
+
/** Waits for agents to evaluate DynamicJobFn into generated LockJob[]. */
|
|
379
297
|
pendingDynamics?: PendingDynamicTracker;
|
|
380
|
-
/**
|
|
298
|
+
/** Waits for the pre-run round that decides which global workflows apply. */
|
|
381
299
|
pendingGlobalEvals?: PendingGlobalEvalTracker;
|
|
382
|
-
/**
|
|
300
|
+
/** Pre-run global eval round result cache; absent re-runs every round. */
|
|
383
301
|
globalEvalCache?: GlobalEvalRoundCache;
|
|
384
|
-
/** Cluster default
|
|
385
|
-
*
|
|
302
|
+
/** Cluster default whole-round eval-agent budget (ms); live override
|
|
303
|
+
* `cluster_settings.global_eval_round_timeout_ms`. */
|
|
386
304
|
globalEvalRoundTimeoutMs?: number;
|
|
387
|
-
/** Cluster default
|
|
388
|
-
*
|
|
305
|
+
/** Cluster default per-candidate eval-agent budget (ms); live override
|
|
306
|
+
* `cluster_settings.global_eval_candidate_timeout_ms`. */
|
|
389
307
|
globalEvalCandidateTimeoutMs?: number;
|
|
390
|
-
/** Cluster default
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* per-cluster override is `cluster_settings.global_eval_wait_timeout_ms`. */
|
|
308
|
+
/** Cluster default orchestrator-side ceiling on awaiting a round (ms). Enforced
|
|
309
|
+
* here, not by the agent, so it also bounds a round no agent picked up. Live
|
|
310
|
+
* override `cluster_settings.global_eval_wait_timeout_ms`. */
|
|
394
311
|
globalEvalWaitTimeoutMs?: number;
|
|
395
|
-
/**
|
|
312
|
+
/** Sets pending/success/failure/error commit statuses. */
|
|
396
313
|
checkRunReporter?: CheckRunReporter;
|
|
397
|
-
/**
|
|
314
|
+
/** DB persistence of executions; absent skips tracking. */
|
|
398
315
|
executionTracker?: ExecutionTracker;
|
|
399
|
-
/**
|
|
316
|
+
/** Picks the execution target platform/arch; absent defaults to linux/x64. */
|
|
400
317
|
agentRegistry?: AgentRegistry;
|
|
401
|
-
/**
|
|
318
|
+
/** Multi-orchestrator job routing; absent dispatches every job locally. */
|
|
402
319
|
coordinator?: RunCoordinator;
|
|
403
|
-
/**
|
|
320
|
+
/** Dispatch-time secret resolution; absent leaves secrets unresolved. */
|
|
404
321
|
secretResolver?: SecretResolverApi;
|
|
405
322
|
/**
|
|
406
|
-
* Cached per-org container-sandbox escape-hatch allow-list
|
|
407
|
-
*
|
|
408
|
-
*
|
|
323
|
+
* Cached per-org container-sandbox escape-hatch allow-list. When absent, dispatch
|
|
324
|
+
* uses the deny-all allow-list, so no workflow can escalate capabilities / host
|
|
325
|
+
* networking.
|
|
409
326
|
*/
|
|
410
327
|
sandboxAllowListReader?: SandboxAllowListReader;
|
|
411
|
-
/** Optional callback when source locations are extracted from a lock file workflow. */
|
|
412
328
|
onSourceLocationsExtracted?: (workflowName: string, jobName: string, sourceLocations: Array<{
|
|
413
329
|
file: string;
|
|
414
330
|
line: number;
|
|
415
331
|
column: number;
|
|
416
332
|
} | undefined>) => void;
|
|
417
|
-
/**
|
|
333
|
+
/** Lock file event subscriptions; absent leaves event routing inactive. */
|
|
418
334
|
eventRouter?: EventRouter;
|
|
419
335
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* silently reaching an agent). Built at the composition root.
|
|
336
|
+
* Summon callback + chain-depth bound, built at the composition root. When
|
|
337
|
+
* absent an invoke gate fails loudly rather than silently reaching an agent.
|
|
423
338
|
*/
|
|
424
339
|
invokeGateDeps?: InvokeGateDeps;
|
|
425
|
-
/**
|
|
340
|
+
/** Absent skips registration. */
|
|
426
341
|
registrationStore?: RegistrationStore;
|
|
427
|
-
/**
|
|
342
|
+
/** In-memory registration lookup; absent skips registration. */
|
|
428
343
|
registrationIndex?: RegistrationIndex;
|
|
429
|
-
/**
|
|
344
|
+
/** Refreshes the cron cache after registration changes; absent skips it. */
|
|
430
345
|
cronScheduler?: CronScheduler;
|
|
431
|
-
/**
|
|
346
|
+
/** Ephemeral key storage; absent disables cross-job secret outputs. */
|
|
432
347
|
db?: Kysely<Database>;
|
|
433
|
-
/**
|
|
348
|
+
/** KICI_SECRET_KEY, encrypts ephemeral private keys. Required when db is set. */
|
|
434
349
|
secretKey?: string;
|
|
435
|
-
/**
|
|
350
|
+
/** Persists webhook payloads; absent skips payload storage. */
|
|
436
351
|
logStorage?: LogStorage;
|
|
437
352
|
/**
|
|
438
|
-
* Durable step-log writer.
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
* already been returned by the time the init round resolves).
|
|
353
|
+
* Durable step-log writer. The deferred-init path writes a post-init env
|
|
354
|
+
* warning to the run's log stream, so a blocking `kici run remote` prints it
|
|
355
|
+
* (the accept response has already returned when the init round resolves).
|
|
442
356
|
*/
|
|
443
357
|
logWriter?: Pick<LogWriter, 'appendChunk' | 'drain'>;
|
|
444
|
-
/**
|
|
358
|
+
/** Deployment contexts; absent disables context features. */
|
|
445
359
|
contextStore?: ContextStore;
|
|
446
|
-
/**
|
|
360
|
+
/** Context variables; absent merges none. */
|
|
447
361
|
variableStore?: VariableStore;
|
|
448
|
-
/**
|
|
362
|
+
/** Persists protection rule holds; absent persists none. */
|
|
449
363
|
heldRunStore?: HeldRunStore;
|
|
450
|
-
/**
|
|
451
|
-
* Cache of the Platform-owned org trust policy. Read per PR event by the
|
|
452
|
-
* trust-policy gate. Optional so existing tests and independent deployments
|
|
453
|
-
* that construct deps by hand keep working.
|
|
454
|
-
*/
|
|
364
|
+
/** Cache of the Platform-owned org trust policy, read per PR event by the trust-policy gate. */
|
|
455
365
|
trustPolicyStore?: TrustPolicyStore;
|
|
456
366
|
/**
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* so a hand-built deps object never accidentally opens the gate.
|
|
367
|
+
* Decides what an absent trust policy means: Platform-attached modes fail closed
|
|
368
|
+
* (a push is imminent); independent mode has no upstream authority and keeps
|
|
369
|
+
* legacy behavior. The read site defaults to `'platform'` (fail-closed), so a
|
|
370
|
+
* hand-built deps object never opens the gate.
|
|
462
371
|
*/
|
|
463
372
|
orchestratorMode?: OrchestratorMode;
|
|
464
|
-
/**
|
|
373
|
+
/** Platform-pushed identity links for the comment-approval path; defaults to empty. */
|
|
465
374
|
identityLinks?: IdentityLink[];
|
|
466
|
-
/** ci_trust
|
|
375
|
+
/** Platform-pushed ci_trust levels per user ID; defaults to empty. */
|
|
467
376
|
orgMemberPermissions?: Map<string, PermissionLevel>;
|
|
468
377
|
/**
|
|
469
378
|
* Persisted approval directory, read at `/kici approve` time when neither
|
|
470
379
|
* `identityLinks` nor `orgMemberPermissions` was supplied.
|
|
471
380
|
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
* supplies
|
|
475
|
-
*
|
|
476
|
-
* the ONLY one an independent orchestrator has — supplies neither, and
|
|
477
|
-
* without this store its approval path would resolve an empty directory and
|
|
478
|
-
* refuse every commenter forever.
|
|
479
|
-
*
|
|
480
|
-
* Optional so a hand-built deps object keeps working; the read is skipped
|
|
481
|
-
* when it is absent.
|
|
381
|
+
* `server.ts` (the Platform-push path) always supplies both, so it never reads
|
|
382
|
+
* this. The direct-ingress pipeline in `app.ts` — the ONLY one an independent
|
|
383
|
+
* orchestrator has — supplies neither; without this store it would resolve an
|
|
384
|
+
* empty directory and refuse every commenter forever. Absent skips the read.
|
|
482
385
|
*/
|
|
483
386
|
trustDirectoryStore?: TrustDirectoryStore;
|
|
484
|
-
/**
|
|
387
|
+
/** Org-level global workflow permissions; absent leaves global workflows unrestricted. */
|
|
485
388
|
globalWorkflowPolicy?: GlobalWorkflowPolicy;
|
|
486
|
-
/**
|
|
389
|
+
/** Delivery log; absent persists nothing to event_log. */
|
|
487
390
|
eventLog?: EventLogRecorder;
|
|
488
|
-
/**
|
|
489
|
-
* Used by the eventLog writer to populate the source column. Defaults to
|
|
490
|
-
* 'direct' when omitted (independent / direct paths). */
|
|
391
|
+
/** event_log source column: 'relay' (Platform WS) or 'direct' (HTTP, the default). */
|
|
491
392
|
eventLogSource?: EventLogSource;
|
|
492
|
-
/**
|
|
493
|
-
* set, hold-creation audit rows (`held_run.request`) are skipped. */
|
|
393
|
+
/** Audit stream; absent skips hold-creation rows (`held_run.request`). */
|
|
494
394
|
accessLogWriter?: AccessLogWriter;
|
|
495
|
-
/**
|
|
496
|
-
* runsOnAll jobs cannot be resolved and fail at materialize. */
|
|
395
|
+
/** runsOnAll fan-out resolution; absent makes runsOnAll jobs fail at materialize. */
|
|
497
396
|
hostRosterStore?: HostRosterStore;
|
|
498
|
-
/**
|
|
397
|
+
/** For the cross-cluster host-fanout pin reroute. */
|
|
499
398
|
instanceId?: string;
|
|
500
|
-
/**
|
|
399
|
+
/** Grace before a disconnected static host reads unreachable (ms). */
|
|
501
400
|
rosterGraceMs?: number;
|
|
502
|
-
/** Cap on runsOnAll per-host children (default 1024). Cluster default;
|
|
503
|
-
*
|
|
401
|
+
/** Cap on runsOnAll per-host children (default 1024). Cluster default; live
|
|
402
|
+
* override `cluster_settings.max_fanout_hosts`. */
|
|
504
403
|
maxFanoutHosts?: number;
|
|
505
|
-
/**
|
|
404
|
+
/** Fleet-wide cluster tunables (max_fanout_hosts live override). */
|
|
506
405
|
clusterSettings?: ClusterSettingsReader;
|
|
507
406
|
}
|
|
508
407
|
/**
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
* saving one provider API call per webhook.
|
|
408
|
+
* Does any trigger use path filters? When none does, the changedFilesFetcher call
|
|
409
|
+
* is skipped, saving one provider API call per webhook.
|
|
512
410
|
*/
|
|
513
411
|
export declare function anyTriggerHasPathPatterns(workflows: LockWorkflow[]): boolean;
|
|
514
412
|
export { processWebhook } from './process-webhook.js';
|
|
@@ -519,31 +417,23 @@ export declare const PENDING_HOLD_RETRY_BASE_MS = 25;
|
|
|
519
417
|
/**
|
|
520
418
|
* Is there a still-pending hold for this (run, job)?
|
|
521
419
|
*
|
|
522
|
-
* `held_runs.job_id` carries the expanded job NAME for job-scoped holds,
|
|
523
|
-
*
|
|
524
|
-
*
|
|
420
|
+
* `held_runs.job_id` carries the expanded job NAME for job-scoped holds, the
|
|
421
|
+
* pending dispatch context's key. A missing row or non-pending status means
|
|
422
|
+
* nothing gates the job.
|
|
525
423
|
*
|
|
526
|
-
* **Fails CLOSED**
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* must leave `pending` before dispatch — so answering `false` on a read error
|
|
531
|
-
* dispatched a job with neither hold released and the approval boundary
|
|
532
|
-
* bypassed entirely. That is unrecoverable; the failure in the other direction
|
|
533
|
-
* is not.
|
|
424
|
+
* **Fails CLOSED** on a genuine read failure: the job is treated as held. This is
|
|
425
|
+
* the enforcement point for a job carrying two holds (reviewer and security rows,
|
|
426
|
+
* written together, BOTH must leave `pending`); answering `false` on error would
|
|
427
|
+
* dispatch with neither released, bypassing approval unrecoverably.
|
|
534
428
|
*
|
|
535
|
-
* A refusal
|
|
536
|
-
*
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
* ready jobs. So the worst case of a closed failure is a delay, against a
|
|
540
|
-
* silently bypassed approval for an open one.
|
|
429
|
+
* A refusal only delays: the context is not consumed (the check precedes the
|
|
430
|
+
* consume), every release path re-drives `dispatchReadyJob`, and the
|
|
431
|
+
* needs-scheduler recovery loop on the next start re-fires ready jobs of every
|
|
432
|
+
* non-terminal run.
|
|
541
433
|
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
* attempted {@link PENDING_HOLD_READ_ATTEMPTS} times with a short linear
|
|
546
|
-
* backoff before the refusal stands.
|
|
434
|
+
* Transient errors (deadlock, statement timeout, lost connection) must not park a
|
|
435
|
+
* job until restart, so the read is tried {@link PENDING_HOLD_READ_ATTEMPTS} times
|
|
436
|
+
* with a short linear backoff first.
|
|
547
437
|
*/
|
|
548
438
|
export declare function hasPendingHold(db: Kysely<Database>, runId: string, jobName: string, opts?: {
|
|
549
439
|
attempts?: number;
|
|
@@ -554,14 +444,11 @@ export declare const NEEDS_READ_ATTEMPTS = 3;
|
|
|
554
444
|
/** Linear backoff base between needs-verdict read attempts. */
|
|
555
445
|
export declare const NEEDS_RETRY_BASE_MS = 25;
|
|
556
446
|
/**
|
|
557
|
-
*
|
|
447
|
+
* Are a job's `needs` upstreams satisfied? For the dispatch guard.
|
|
558
448
|
*
|
|
559
|
-
* Fails CLOSED
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* still pending" — the recoverable branch, since the start-up recovery loop
|
|
563
|
-
* recomputes `needs_satisfied` for every non-terminal run and re-fires its ready
|
|
564
|
-
* jobs, and the stale-run expiry sweep is the backstop.
|
|
449
|
+
* Fails CLOSED like {@link hasPendingHold}: `{ satisfied: false }` reads as
|
|
450
|
+
* "upstream still pending", the recoverable branch (the start-up recovery loop
|
|
451
|
+
* re-fires ready jobs; the stale-run expiry sweep is the backstop).
|
|
565
452
|
*
|
|
566
453
|
* Reads only. It never writes `needs_satisfied` — the scheduler owns that claim.
|
|
567
454
|
*/
|
|
@@ -574,14 +461,12 @@ export declare function readNeedsVerdict(db: Kysely<Database>, runId: string, jo
|
|
|
574
461
|
reason?: string;
|
|
575
462
|
}>;
|
|
576
463
|
/**
|
|
577
|
-
* The
|
|
464
|
+
* The raw (snake_case) `contexts` row subset the ready-dispatch re-gate reads.
|
|
578
465
|
*
|
|
579
|
-
* `
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
* {@link DEFAULT_CONCURRENCY_STRATEGY} and an absent hold window to
|
|
584
|
-
* {@link DEFAULT_HOLD_EXPIRY_SECONDS}, which are also the columns' own defaults.
|
|
466
|
+
* `concurrency_strategy` and `hold_expiry_seconds` are optional because some
|
|
467
|
+
* release-path callers narrow their closure to `concurrency_limit`; absent values
|
|
468
|
+
* resolve to {@link DEFAULT_CONCURRENCY_STRATEGY} and
|
|
469
|
+
* {@link DEFAULT_HOLD_EXPIRY_SECONDS}, the columns' own defaults.
|
|
585
470
|
*/
|
|
586
471
|
export interface ReadyDispatchContextRow {
|
|
587
472
|
id: string;
|
|
@@ -594,18 +479,15 @@ export interface ReadyDispatchGateDeps {
|
|
|
594
479
|
matchContext: (orgId: string, name: string) => Promise<ReadyDispatchContextRow | null>;
|
|
595
480
|
heldRunStore: Pick<HeldRunStore, 'create'>;
|
|
596
481
|
/**
|
|
597
|
-
* Audits each re-hold
|
|
598
|
-
*
|
|
599
|
-
* still gates, exactly as the dispatch path's own `accessLogWriter?.record`
|
|
600
|
-
* degrades.
|
|
482
|
+
* Audits each re-hold with the `held_run.request` row the dispatch pass writes.
|
|
483
|
+
* Without a writer the gate still gates.
|
|
601
484
|
*/
|
|
602
485
|
accessLogWriter?: Pick<AccessLogWriter, 'record'>;
|
|
603
|
-
/**
|
|
486
|
+
/** Audit row attribution, when the call site knows it. */
|
|
604
487
|
routingKey?: string | null;
|
|
605
488
|
/**
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
* it is wired can still supply them.
|
|
489
|
+
* Stores for a released job's context variables and secrets. Called at release
|
|
490
|
+
* time, so stores built after wiring can still be supplied.
|
|
609
491
|
*/
|
|
610
492
|
contextData?: () => ContextDataDeps;
|
|
611
493
|
}
|
|
@@ -617,87 +499,59 @@ export interface RunConcurrency {
|
|
|
617
499
|
limit: number | null;
|
|
618
500
|
strategy: EngineContext['concurrencyStrategy'];
|
|
619
501
|
/**
|
|
620
|
-
* The context's
|
|
621
|
-
*
|
|
622
|
-
* context, or an operator's configured queue timeout applies to one path and
|
|
623
|
-
* not the other.
|
|
502
|
+
* The context's hold window, seconds, so this gate's queued holds expire on the
|
|
503
|
+
* dispatch pass's schedule and the configured queue timeout applies to both.
|
|
624
504
|
*/
|
|
625
505
|
holdExpirySeconds: number;
|
|
626
506
|
}
|
|
627
507
|
/**
|
|
628
|
-
* Resolve a run's bound context to
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* or the context it names no longer exists. That is the common case, so the cost
|
|
632
|
-
* on the ready-dispatch path is one indexed lookup by `run_id`.
|
|
508
|
+
* Resolve a run's bound context to concurrency gate inputs. `null` (no bound
|
|
509
|
+
* context, or it no longer exists) is the common case, costing one indexed
|
|
510
|
+
* lookup by `run_id`.
|
|
633
511
|
*/
|
|
634
512
|
export declare function resolveRunConcurrency(db: Kysely<Database>, matchContext: ReadyDispatchGateDeps['matchContext'], runId: string): Promise<RunConcurrency | null>;
|
|
635
513
|
/**
|
|
636
|
-
* Dispatch a job
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* Consumes the pending dispatch context stored at processWebhook time,
|
|
640
|
-
* dispatches the job through the normal dispatcher path, and updates the
|
|
641
|
-
* execution tracker with the real job ID.
|
|
514
|
+
* Dispatch a job the needs scheduler made ready (the tracker's onJobReady
|
|
515
|
+
* callback): consume its pending context, dispatch normally, and record the real
|
|
516
|
+
* job ID.
|
|
642
517
|
*/
|
|
643
518
|
export declare function dispatchReadyJob(runId: string, jobName: string, dispatcher: Dispatcher, executionTracker?: ExecutionTracker, coordinator?: RunCoordinator, db?: Kysely<Database>, invokeGateDeps?: InvokeGateDeps, gateDeps?: ReadyDispatchGateDeps): Promise<void>;
|
|
644
519
|
/**
|
|
645
|
-
*
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
* default that most forges mirror.
|
|
652
|
-
*
|
|
653
|
-
* `null` when neither source names one. Shared by `isDefaultBranchPush` (which
|
|
654
|
-
* compares it against the pushed branch) and the registration write path (which
|
|
655
|
-
* persists it, so a scheduled run can present it as its own branch).
|
|
520
|
+
* The repository's default branch from a webhook payload:
|
|
521
|
+
* 1. `normalizer.extractDefaultBranch?(payload)` — provider hook (universal-git
|
|
522
|
+
* reads the source's `payloadPaths.defaultBranch` JSONPath);
|
|
523
|
+
* 2. `payload.repository.default_branch` — the GitHub shape most forges mirror;
|
|
524
|
+
* else `null`. The registration write path persists it, so a scheduled run can
|
|
525
|
+
* present it as its own branch.
|
|
656
526
|
*/
|
|
657
527
|
export declare function extractDefaultBranch(payload: Record<string, unknown>, normalizer: WebhookNormalizer): string | null;
|
|
658
|
-
/**
|
|
659
|
-
* Check whether a webhook event is a push to the repository's default branch.
|
|
660
|
-
* Used to trigger registration extraction for workflow event subscriptions.
|
|
661
|
-
*/
|
|
528
|
+
/** A push to the default branch triggers registration extraction for event subscriptions. */
|
|
662
529
|
export declare function isDefaultBranchPush(info: WebhookInfo, event: SimulatedEvent, payload: Record<string, unknown>, normalizer: WebhookNormalizer): boolean;
|
|
663
530
|
/**
|
|
664
|
-
* Cap on the per-decision trace forwarded to the Platform.
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
* summary rides an `execution.event` and lands in a stored row, so an
|
|
668
|
-
* essay-length trace from a workflow with hundreds of triggers must not be able
|
|
669
|
-
* to grow either without limit.
|
|
531
|
+
* Cap on the per-decision trace forwarded to the Platform. Fixed, not tunable: the
|
|
532
|
+
* summary rides an `execution.event` into a stored row, and hundreds of triggers
|
|
533
|
+
* must not grow either without limit.
|
|
670
534
|
*/
|
|
671
535
|
export declare const DECISION_TRACE_MAX_CHECKS = 50;
|
|
672
536
|
/**
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
* this workflow not fire" from the delivery alone. `checksCount` stays the
|
|
677
|
-
* untruncated total, and `checksTruncated` marks a trace the cap shortened.
|
|
537
|
+
* Serializable workflow decision summary for the Platform. Carries the capped
|
|
538
|
+
* checks, so the dashboard answers "why did this not fire" from the delivery
|
|
539
|
+
* alone; `checksCount` is the untruncated total, `checksTruncated` marks a cut.
|
|
678
540
|
*/
|
|
679
541
|
export declare function summarizeDecision(decision: WorkflowDecision): Record<string, unknown>;
|
|
680
542
|
/**
|
|
681
|
-
* Byte budget for the whole forwarded trace, across every workflow on the
|
|
682
|
-
* delivery.
|
|
543
|
+
* Byte budget for the whole forwarded trace, across every workflow on the delivery.
|
|
683
544
|
*
|
|
684
|
-
* The
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
* closes the orchestrator's connection, stalling every delivery for that
|
|
690
|
-
* organization until it reconnects — so the budget sits well under the
|
|
691
|
-
* Platform's own storage guard, which is then a backstop rather than the only
|
|
692
|
-
* limit.
|
|
545
|
+
* The check cap and per-field clamp bound one entry; this bounds the frame, since
|
|
546
|
+
* one event is evaluated against every lock file workflow plus every org-wide
|
|
547
|
+
* registration. A frame past the Platform's WebSocket payload ceiling closes the
|
|
548
|
+
* connection, stalling every delivery for the org until reconnect, so the budget
|
|
549
|
+
* sits well under the Platform's storage guard, which stays a backstop.
|
|
693
550
|
*/
|
|
694
551
|
export declare const DECISION_TRACE_MAX_BYTES = 131072;
|
|
695
552
|
/**
|
|
696
|
-
* Bound the serialized trace, replacing
|
|
697
|
-
*
|
|
698
|
-
* Truncating rather than dropping keeps the delivery's answer to "why did my
|
|
699
|
-
* workflow not fire" partially readable, and says out loud that the rest was
|
|
700
|
-
* dropped.
|
|
553
|
+
* Bound the serialized trace, replacing what did not fit with a marker: the answer
|
|
554
|
+
* stays partially readable and says the rest was dropped.
|
|
701
555
|
*/
|
|
702
556
|
export declare function capDecisionSummaries(summaries: readonly Record<string, unknown>[], maxBytes?: number): Record<string, unknown>[];
|
|
703
557
|
//# sourceMappingURL=processor.d.ts.map
|