@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
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
* for jobs with dynamic fields, and deferred dynamic-job-fn dispatch for
|
|
9
9
|
* `_type:'dynamic'` lock entries.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* exported function is a narrative orchestrator that threads the typed
|
|
14
|
-
* results through the pipeline.
|
|
11
|
+
* The exported `dispatchMatchedWorkflow` threads typed phase-helper results
|
|
12
|
+
* through the pipeline.
|
|
15
13
|
*/
|
|
16
14
|
import { ExecutionJobStatus, InitFailureCategory, CacheRefScope, HoldScope, TriggerSource } from '@kici-dev/engine';
|
|
17
15
|
import type { LabelMatcher, LockWorkflow, LockJob, ApprovalRequirement, HostTargetSelector, SimulatedEvent, WorkflowDecision, MaterializedJob, ResolvedHostAgent, UpstreamSnapshot, HostFacts } from '@kici-dev/engine';
|
|
@@ -40,44 +38,31 @@ import { type ProcessingDeps } from './processor.js';
|
|
|
40
38
|
*/
|
|
41
39
|
export declare function deriveCacheRefScope(trust: TrustResolution | undefined): CacheRefScope;
|
|
42
40
|
/**
|
|
43
|
-
* Context for dispatching a single matched workflow
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* shell. `crossSource` is the discriminator the helper uses to override the
|
|
48
|
-
* dispatch `deliveryId` so fan-out targets land on their composite dedup
|
|
49
|
-
* slot (`${inbound.deliveryId}:${reg.id}`) instead of the inbound delivery
|
|
50
|
-
* id.
|
|
41
|
+
* Context for dispatching a single matched workflow, from both the same-source
|
|
42
|
+
* path and the cross-source delegation shell. `crossSource` overrides the
|
|
43
|
+
* dispatch `deliveryId` so fan-out targets land on their composite dedup slot
|
|
44
|
+
* (`${inbound.deliveryId}:${reg.id}`).
|
|
51
45
|
*/
|
|
52
46
|
export interface WorkflowDispatchContext {
|
|
53
47
|
info: WebhookInfo;
|
|
54
48
|
deps: ProcessingDeps;
|
|
55
49
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* as a local/`fullRepo` clone). The webhook adapter always passes a defined
|
|
61
|
-
* bundle, so its dispatch behavior is unchanged.
|
|
50
|
+
* Undefined only for local-repo test runs (`kici run` with an inline lock
|
|
51
|
+
* file and no remote provider): no clone-url builder, check poster or
|
|
52
|
+
* clone-token provider, and `repoUrl` is `''`, which the agent treats as a
|
|
53
|
+
* local/`fullRepo` clone. The webhook adapter always passes one.
|
|
62
54
|
*/
|
|
63
55
|
bundle?: ProviderBundle;
|
|
64
56
|
payload: unknown;
|
|
65
57
|
repoIdentifier: string;
|
|
66
58
|
/**
|
|
67
|
-
* The repository that defines the workflow
|
|
68
|
-
* `global` is set.
|
|
69
|
-
*
|
|
70
|
-
* REQUIRED, for the same reason `securityDecision` is: a dispatch path that
|
|
71
|
-
* does not state it must not compile. Left optional, a new caller omits it
|
|
72
|
-
* silently and every row it records claims the workflow lives in the
|
|
73
|
-
* repository the run acted on — a null marker is read as that fact, not as
|
|
59
|
+
* The repository that defines the workflow; equals `repoIdentifier` unless
|
|
60
|
+
* `global` is set. REQUIRED so a dispatch path that omits it does not
|
|
61
|
+
* compile: a null marker is read as "the repository the run acted on", not
|
|
74
62
|
* "unknown" (`registration/registration-run-match.ts`).
|
|
75
63
|
*/
|
|
76
64
|
workflowRepoIdentifier: string;
|
|
77
|
-
/**
|
|
78
|
-
* Set when the workflow is defined in another repository; `repoIdentifier`
|
|
79
|
-
* is then the event's source repository.
|
|
80
|
-
*/
|
|
65
|
+
/** Set when another repository defines the workflow; `repoIdentifier` is then the event's source. */
|
|
81
66
|
global?: GlobalDispatchIdentity;
|
|
82
67
|
credentials: Record<string, unknown>;
|
|
83
68
|
event: SimulatedEvent;
|
|
@@ -94,24 +79,19 @@ export interface WorkflowDispatchContext {
|
|
|
94
79
|
};
|
|
95
80
|
resolvedOrgId: string;
|
|
96
81
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
82
|
+
* NAMES of the jobs this pass admitted against a context concurrency limit,
|
|
83
|
+
* keyed by {@link concurrencyAdmissionKey}. The DB count cannot see a job
|
|
84
|
+
* just admitted, so without it every fan-out child is admitted against one
|
|
85
|
+
* slot.
|
|
99
86
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
87
|
+
* Names, not a counter, so the two terms stay DISJOINT: the count query
|
|
88
|
+
* excludes exactly these names ({@link countOccupyingJobs}). A counter summed
|
|
89
|
+
* with a count that already sees the row double-counts a sibling on the
|
|
90
|
+
* deferred-init path and spuriously holds a job.
|
|
103
91
|
*
|
|
104
|
-
*
|
|
105
|
-
* count
|
|
106
|
-
*
|
|
107
|
-
* contributes its tally entry and nothing else. A counter cannot express that
|
|
108
|
-
* exclusion, and summing it with a count that already sees the row is how the
|
|
109
|
-
* deferred-init path double-counts a sibling and spuriously holds a job.
|
|
110
|
-
*
|
|
111
|
-
* Created lazily on first use and dropped with the ctx. It is per-pass state,
|
|
112
|
-
* never persisted and never shared between passes; two actors arriving in the
|
|
113
|
-
* same millisecond still race between the count and the insert, which is
|
|
114
|
-
* accepted — this is a throughput control, not an isolation boundary.
|
|
92
|
+
* Lazy, per-pass, never persisted or shared. Two actors in the same
|
|
93
|
+
* millisecond still race between count and insert — accepted, as this is a
|
|
94
|
+
* throughput control, not an isolation boundary.
|
|
115
95
|
*/
|
|
116
96
|
concurrencyAdmissions?: Map<string, Set<string>>;
|
|
117
97
|
workflow: LockWorkflow;
|
|
@@ -122,117 +102,83 @@ export interface WorkflowDispatchContext {
|
|
|
122
102
|
/** True when this run executes an uploaded local working tree (CLI remote run). */
|
|
123
103
|
localWorkingTree: boolean;
|
|
124
104
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* it here. Undefined on the webhook path, where the initiator is a provider
|
|
130
|
-
* account rather than a KiCI principal — that attribution is carried by
|
|
131
|
-
* `triggerActorUsername` / `triggerActorUserId` instead.
|
|
105
|
+
* `execution_runs.triggered_by`. Set by the CLI remote-run path from the
|
|
106
|
+
* actor the Platform relays on `test.relay.trigger`. Undefined on the webhook
|
|
107
|
+
* path, whose provider-account initiator is in `triggerActorUsername` /
|
|
108
|
+
* `triggerActorUserId`.
|
|
132
109
|
*/
|
|
133
110
|
triggeredBy?: string | null;
|
|
134
111
|
/** Agent provenance label when the run was initiated through an agent credential. */
|
|
135
112
|
triggeredByAgentLabel?: string | null;
|
|
136
113
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* an organization-wide run; absent for every first run.
|
|
114
|
+
* `execution_runs.parent_run_id` / `original_run_id`. Set by the re-run of an
|
|
115
|
+
* organization-wide run; absent for every first run.
|
|
140
116
|
*/
|
|
141
117
|
rerunLineage?: RerunLineage;
|
|
142
118
|
/**
|
|
143
|
-
* The trigger event the
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* event here to keep the subject a re-run of a fork pull request presents.
|
|
119
|
+
* The trigger event the OIDC subject derives from, when not the run's own.
|
|
120
|
+
* A re-run records `rerun`, which has no pull-request dimension, so it
|
|
121
|
+
* states the original event here to keep a fork pull request's subject.
|
|
147
122
|
*/
|
|
148
123
|
subjectTriggerEvent?: string;
|
|
149
124
|
/** True only when invoked from the cross-source dispatch shell. */
|
|
150
125
|
crossSource: boolean;
|
|
151
126
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* The internal-event adapter needs this because a user `kiciEvent()` renders
|
|
156
|
-
* two different values: `jobConfig.event.type` is the literal `kici_event`,
|
|
157
|
-
* while the run carries the raw event name. `event.type` carries the former,
|
|
158
|
-
* so the latter has to be stated.
|
|
159
|
-
*
|
|
160
|
-
* Absent ⇒ the value derived from the event, unchanged for the webhook,
|
|
161
|
-
* CLI-remote-run and resume callers.
|
|
127
|
+
* The run's `triggerEvent`, stated instead of derived from `event.type`. A
|
|
128
|
+
* user `kiciEvent()` has `event.type` = `kici_event` while the run carries
|
|
129
|
+
* the raw event name. Absent ⇒ derived from the event.
|
|
162
130
|
*/
|
|
163
131
|
triggerEventOverride?: string;
|
|
164
132
|
/**
|
|
165
|
-
* The exact `jobConfig.event` envelope
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* branch gate) rather than a field user code asked for — the envelope becomes
|
|
174
|
-
* `RuleContext.event` on the agent and the `event` half of
|
|
175
|
-
* `buildConcurrencyGroupContext`, so publishing the branch would silently
|
|
176
|
-
* re-key the documented `ctx.event.targetBranch ?? 'default'` concurrency
|
|
177
|
-
* group of every existing internal workflow.
|
|
178
|
-
*
|
|
179
|
-
* Absent ⇒ the envelope derived from the event, unchanged for the webhook,
|
|
180
|
-
* CLI-remote-run and resume callers.
|
|
133
|
+
* The exact `jobConfig.event` envelope, instead of spreading the matched
|
|
134
|
+
* `SimulatedEvent`. The envelope omits `targetBranch` and `changedFiles`: an
|
|
135
|
+
* internal run has no changed files, and its branch is provenance for the
|
|
136
|
+
* trigger matcher and context branch gate. The envelope becomes
|
|
137
|
+
* `RuleContext.event` and the `event` half of `buildConcurrencyGroupContext`,
|
|
138
|
+
* so publishing the branch would silently re-key the documented
|
|
139
|
+
* `ctx.event.targetBranch ?? 'default'` group of every internal workflow.
|
|
140
|
+
* Absent ⇒ derived from the event.
|
|
181
141
|
*/
|
|
182
142
|
eventEnvelopeOverride?: Record<string, unknown>;
|
|
183
143
|
/**
|
|
184
|
-
* Chain depth to stamp
|
|
185
|
-
*
|
|
186
|
-
* circuit breaker. Absent ⇒ 0, the column default (a webhook-triggered run
|
|
187
|
-
* starts a chain).
|
|
144
|
+
* Chain depth to stamp: an invoke-gate summon carries its summoner's depth +
|
|
145
|
+
* 1, which bounds the chain-depth circuit breaker. Absent ⇒ 0.
|
|
188
146
|
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* back at gate-release time — which happens inside this same dispatch.
|
|
147
|
+
* Load-bearing: the breaker fails OPEN if this is lost. Stamped as soon as
|
|
148
|
+
* the run row exists, because `releaseInvokeGate` reads it back inside this
|
|
149
|
+
* same dispatch.
|
|
193
150
|
*/
|
|
194
151
|
chainDepth?: number;
|
|
195
152
|
/**
|
|
196
153
|
* Marks a run dispatched by a failure-lifecycle trigger, so its own
|
|
197
154
|
* completion is excluded from batch accumulation and a broken notifier
|
|
198
|
-
* cannot re-trigger itself (`EventRouter.isFailureLifecycleRun`).
|
|
199
|
-
*
|
|
200
|
-
* Persisted as a field INSIDE the `trigger_decision` JSON blob, merged onto
|
|
201
|
-
* the decision summary rather than replacing it.
|
|
155
|
+
* cannot re-trigger itself (`EventRouter.isFailureLifecycleRun`). Persisted
|
|
156
|
+
* as a field merged INTO the `trigger_decision` JSON blob.
|
|
202
157
|
*/
|
|
203
158
|
dispatchedByFailureLifecycle?: boolean;
|
|
204
159
|
/**
|
|
205
|
-
* Marks a run the orchestrator triggered itself
|
|
206
|
-
*
|
|
207
|
-
*
|
|
160
|
+
* Marks a run the orchestrator triggered itself (schedule fire, workflow/job
|
|
161
|
+
* completion, failure batch, user `kiciEvent()`, invoke-gate summon). Absent
|
|
162
|
+
* ⇒ webhook-triggered.
|
|
208
163
|
*
|
|
209
|
-
* Read by the context branch gate
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* that is gone. The gate rejects those naming that cause, instead of quoting
|
|
217
|
-
* an empty value as though it were a branch name. It does NOT weaken the
|
|
218
|
-
* gate — a run with no branch cannot satisfy a restriction, `*` included.
|
|
219
|
-
*
|
|
220
|
-
* Absent ⇒ webhook-triggered, unchanged for the webhook, CLI-remote-run and
|
|
221
|
-
* resume callers.
|
|
164
|
+
* Read only by the context branch gate. Such a run usually has a real
|
|
165
|
+
* `targetBranch` (a schedule's registration default branch, or the emitting
|
|
166
|
+
* run's branch) and is matched normally. The flag lets the gate name the
|
|
167
|
+
* cause when `targetBranch` is EMPTY (failure batch, scaler event, uncaptured
|
|
168
|
+
* default branch, emitting run gone) instead of quoting an empty branch. It
|
|
169
|
+
* does NOT weaken the gate: a run with no branch satisfies no restriction,
|
|
170
|
+
* `*` included.
|
|
222
171
|
*/
|
|
223
172
|
internallyTriggered?: boolean;
|
|
224
173
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* `holdRunForSecurityPolicy` / `rejectRunForSecurityPolicy`.
|
|
174
|
+
* Org trust-policy gate outcome for this PR event: `pass` dispatches, `hold`
|
|
175
|
+
* parks the run in the security queue, `reject` fails it before any job
|
|
176
|
+
* starts (`holdRunForSecurityPolicy` / `rejectRunForSecurityPolicy`).
|
|
177
|
+
* Computed once per PR event in the webhook pipeline.
|
|
230
178
|
*
|
|
231
|
-
* REQUIRED
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* fail-open by omission inside a fail-closed control. A `pass` is stated
|
|
235
|
-
* explicitly.
|
|
179
|
+
* REQUIRED so a path that omits it does not compile: an optional field read
|
|
180
|
+
* as `if (!decision) return null` passes the gate on omission — fail-open
|
|
181
|
+
* inside a fail-closed control. A `pass` is stated explicitly.
|
|
236
182
|
*/
|
|
237
183
|
securityDecision: TrustPolicyOutcome;
|
|
238
184
|
/**
|
|
@@ -253,139 +199,110 @@ export interface WorkflowDispatchContext {
|
|
|
253
199
|
*/
|
|
254
200
|
runRegisteredBeforeDispatch?: boolean;
|
|
255
201
|
/**
|
|
256
|
-
* Set once `setupDispatchContext`
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* check keys off a run whose jobs never registered, and the stale sweep only
|
|
263
|
-
* touches check runs already `in_progress`. Left alone they stay `queued`
|
|
264
|
-
* forever, which on a pull request is a check that never finishes and a
|
|
265
|
-
* branch-protection blocker.
|
|
202
|
+
* Set once `setupDispatchContext` posted the queued `kici/<workflow>` check
|
|
203
|
+
* and one `kici/<workflow>/job/<name>` per static job. They go up BEFORE the
|
|
204
|
+
* start decision, so every exit owes them a conclusion. Named early exits
|
|
205
|
+
* complete their own; a THROW does not, and nothing else can (the stale
|
|
206
|
+
* sweep only touches `in_progress` checks), so they stay `queued` forever —
|
|
207
|
+
* a branch-protection blocker on a pull request.
|
|
266
208
|
*/
|
|
267
209
|
pendingChecksPosted?: boolean;
|
|
268
210
|
/** Composite dedup key `${info.deliveryId}:${reg.id}` (cross-source only). */
|
|
269
211
|
crossSourceDeliveryId?: string;
|
|
270
212
|
/**
|
|
271
|
-
* Routing key
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* generic routing key).
|
|
213
|
+
* Routing key for dispatched jobs and log / tracker rows: `info.routingKey`
|
|
214
|
+
* same-source; `reg.routingKey` cross-source (the registration's owning
|
|
215
|
+
* source, NOT the inbound generic key).
|
|
275
216
|
*/
|
|
276
217
|
effectiveRoutingKey?: string;
|
|
277
218
|
/**
|
|
278
|
-
* Provider
|
|
279
|
-
*
|
|
280
|
-
* `regBundle.normalizer.provider` (the registration's provider type,
|
|
281
|
-
* e.g. 'github').
|
|
219
|
+
* Provider for dispatched jobs and tracker rows: `info.provider`
|
|
220
|
+
* same-source; `regBundle.normalizer.provider` cross-source.
|
|
282
221
|
*/
|
|
283
222
|
effectiveProvider?: string;
|
|
284
223
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* `
|
|
289
|
-
* `workflowRepoIdentifier`) that downstream agents / dashboards need for
|
|
290
|
-
* correct clone + logging.
|
|
224
|
+
* jobConfig fields merged into every dispatched job. Cross-source callers
|
|
225
|
+
* inject provenance (`crossSource: true`, `inboundRoutingKey`,
|
|
226
|
+
* `inboundEventName`, `workflowRepoUrl`, `workflowRef`, `workflowSha`,
|
|
227
|
+
* `workflowRepoIdentifier`) that agents and dashboards need to clone and log.
|
|
291
228
|
*/
|
|
292
229
|
extraJobConfig?: Record<string, unknown>;
|
|
293
230
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* `fixture_id = testRun.fixtureId` on the `execution_runs` row. Undefined for
|
|
297
|
-
* webhook runs (the stamp block is skipped).
|
|
231
|
+
* Set only for `kici run` / test-trigger dispatches: `recordRunStart` stamps
|
|
232
|
+
* `is_test_run = true` and `fixture_id` on the `execution_runs` row.
|
|
298
233
|
*/
|
|
299
234
|
testRun?: {
|
|
300
235
|
fixtureId: string;
|
|
301
236
|
};
|
|
302
237
|
/**
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* the CLI value wins on a key collision (matching the prior B1-env -> A-CLI
|
|
308
|
-
* precedence). Undefined for webhook runs.
|
|
238
|
+
* `kici run --secret` / `--env` flat secrets, layered onto EVERY job's
|
|
239
|
+
* `jobConfig.secrets` whether or not it declares a `context:`. The CLI value
|
|
240
|
+
* wins on a key collision with per-job context secrets. Undefined for webhook
|
|
241
|
+
* runs.
|
|
309
242
|
*/
|
|
310
243
|
runWideFlatSecrets?: Record<string, string>;
|
|
311
244
|
/**
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* runsOnAll ∩ target. Narrow-only. Undefined for webhook runs (no narrowing).
|
|
245
|
+
* `kici run --target` (Ansible `--limit`): narrow-only post-filter, effective
|
|
246
|
+
* hosts = runsOnAll ∩ target. Undefined for webhook runs.
|
|
315
247
|
*/
|
|
316
248
|
target?: HostTargetSelector;
|
|
317
249
|
/**
|
|
318
|
-
* Resolved (coerced
|
|
319
|
-
*
|
|
320
|
-
* exposes them as `ctx.dispatchInputs`. Undefined for webhook runs.
|
|
250
|
+
* Resolved (coerced, defaulted, validated) `kici run --input` values, exposed
|
|
251
|
+
* to every job as `ctx.dispatchInputs`. Undefined for webhook runs.
|
|
321
252
|
*/
|
|
322
253
|
dispatchInputs?: Record<string, unknown>;
|
|
323
254
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* gates every context the approval did not cover. Unset on any other
|
|
328
|
-
* dispatch.
|
|
255
|
+
* Set only on an install-gate-held dispatch: the contexts that held (covered
|
|
256
|
+
* by the hold's approval) and the ones admitted. Its release gates every
|
|
257
|
+
* context the approval did not cover.
|
|
329
258
|
*/
|
|
330
259
|
installGateRecord?: InstallGateRecord;
|
|
331
260
|
}
|
|
332
261
|
/**
|
|
333
|
-
* The
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
* constructs a full `WorkflowDispatchContext`) can drive the needs scheduler
|
|
337
|
-
* through this narrow shape.
|
|
262
|
+
* The slice the needs catch-up and ready-recompute helpers read, so the
|
|
263
|
+
* global-workflow path (which never builds a full `WorkflowDispatchContext`)
|
|
264
|
+
* can drive the needs scheduler too.
|
|
338
265
|
*/
|
|
339
266
|
export type NeedsSchedulingContext = Pick<WorkflowDispatchContext, 'deps' | 'runId'>;
|
|
340
267
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
* optimization when a path is missed — correctness comes from the agent).
|
|
268
|
+
* The dispatch-envelope event, carrying the already-fetched changed files as a
|
|
269
|
+
* fast path. The agent recomputes from the clone when status !== 'fetched', so
|
|
270
|
+
* correctness comes from the agent.
|
|
345
271
|
*/
|
|
346
272
|
export declare function envelopeEvent(baseEvent: SimulatedEvent, eventWithFiles: SimulatedEvent): SimulatedEvent;
|
|
347
273
|
export interface DispatchMatchedWorkflowResult {
|
|
348
|
-
/**
|
|
274
|
+
/** Non-rejected jobs dispatched. */
|
|
349
275
|
dispatchedJobCount: number;
|
|
350
|
-
/**
|
|
276
|
+
/** Every dispatched/tracked job id (root, gated, synthetic). */
|
|
351
277
|
dispatchedJobIds: string[];
|
|
352
278
|
/**
|
|
353
|
-
* Jobs
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
* so a caller must not treat a run with pending deferred work as "nothing
|
|
357
|
-
* dispatched". Absent/0 on the early-return paths.
|
|
279
|
+
* Jobs deferred to the agent init round, not yet in `dispatchedJobIds`. They
|
|
280
|
+
* still run (`startDeferredPhases`), so a run with deferred work is not
|
|
281
|
+
* "nothing dispatched". Absent/0 on early returns.
|
|
358
282
|
*/
|
|
359
283
|
deferredJobCount?: number;
|
|
360
|
-
/** True when the workflow install gate
|
|
284
|
+
/** True when the workflow install gate held the run. */
|
|
361
285
|
held?: boolean;
|
|
362
286
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* on the accepted trigger response so the CLI can print them.
|
|
287
|
+
* One warning per job whose bound test-run contexts were skipped, surfaced
|
|
288
|
+
* on the trigger response for the CLI to print.
|
|
366
289
|
*/
|
|
367
290
|
envWarnings?: string[];
|
|
368
291
|
}
|
|
369
292
|
/** Options controlling a (re-)dispatch of a matched workflow. */
|
|
370
293
|
export interface DispatchMatchedWorkflowOptions {
|
|
371
|
-
/**
|
|
372
|
-
* Resume path: skip the workflow install protection gate (already satisfied)
|
|
373
|
-
* so secrets resolve directly and the dispatch flows into job dispatch.
|
|
374
|
-
*/
|
|
294
|
+
/** Resume path: the install protection gate is already satisfied. */
|
|
375
295
|
skipInstallProtectionGate?: boolean;
|
|
376
|
-
/**
|
|
377
|
-
* The run id whose `held` execution_runs row should be reused (flipped to
|
|
378
|
-
* pending) instead of inserting a fresh row.
|
|
379
|
-
*/
|
|
296
|
+
/** Run id whose `held` row is flipped to pending instead of inserting a new one. */
|
|
380
297
|
reuseRunId?: string;
|
|
381
298
|
}
|
|
382
299
|
type DispatchFn = (input: QueuedJobInput) => ReturnType<Dispatcher['dispatch']>;
|
|
383
300
|
interface DispatchSetup {
|
|
384
|
-
/**
|
|
301
|
+
/** Injects ctx.extraJobConfig into every dispatch. */
|
|
385
302
|
dispatcher: {
|
|
386
303
|
dispatch: DispatchFn;
|
|
387
304
|
};
|
|
388
|
-
/**
|
|
305
|
+
/** Overlaid with the effective routing key and provider. */
|
|
389
306
|
info: WebhookInfo;
|
|
390
307
|
/** Composite delivery id on cross-source, otherwise info.deliveryId. */
|
|
391
308
|
effectiveDeliveryId: string;
|
|
@@ -395,11 +312,9 @@ interface DispatchSetup {
|
|
|
395
312
|
} | undefined;
|
|
396
313
|
workflowTimeoutMs: number | undefined;
|
|
397
314
|
/**
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
* fail a `check-fail-on-drift` run that detected drift. Undefined for the
|
|
402
|
-
* default apply-mode webhook path.
|
|
315
|
+
* Idempotent-step mode (`apply` | `check` | `check-fail-on-drift`) from the
|
|
316
|
+
* `kici run --check` path; persisted so `computeRunStatus` fails a
|
|
317
|
+
* `check-fail-on-drift` run with drift. Undefined for apply-mode webhooks.
|
|
403
318
|
*/
|
|
404
319
|
checkMode: string | undefined;
|
|
405
320
|
}
|
|
@@ -417,9 +332,9 @@ interface BuildPrepResult {
|
|
|
417
332
|
}>>;
|
|
418
333
|
staticJobs: readonly LockJob[];
|
|
419
334
|
/**
|
|
420
|
-
* Static jobs
|
|
421
|
-
*
|
|
422
|
-
* `
|
|
335
|
+
* Static jobs after matrix fan-out (non-matrix 1:1), keyed by
|
|
336
|
+
* `expandedName` in every phase. Dynamic-matrix jobs carry
|
|
337
|
+
* `pendingDynamicMatrix`.
|
|
423
338
|
*/
|
|
424
339
|
materializedJobs: readonly MaterializedJob[];
|
|
425
340
|
/** baseName -> expanded child names; drives needs-edge expansion. */
|
|
@@ -432,12 +347,11 @@ interface BuildPrepResult {
|
|
|
432
347
|
buildJobName: string | undefined;
|
|
433
348
|
buildJobLabels: string[] | undefined;
|
|
434
349
|
buildJobTrackedEarly: boolean;
|
|
435
|
-
/**
|
|
350
|
+
/** The build failed but dynamic entries can still proceed. */
|
|
436
351
|
buildFailed: boolean;
|
|
437
352
|
/**
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* MUST early-return with `dispatchedJobCount: 0`.
|
|
353
|
+
* Dispatch short-circuited (build failed with no dynamic entries, or build
|
|
354
|
+
* job rejected). Caller MUST return `dispatchedJobCount: 0`.
|
|
441
355
|
*/
|
|
442
356
|
abort: boolean;
|
|
443
357
|
}
|
|
@@ -446,9 +360,8 @@ interface JobEnvData {
|
|
|
446
360
|
/** Configured env id matched for the first declared context name. */
|
|
447
361
|
contextId?: string;
|
|
448
362
|
/**
|
|
449
|
-
* Ordered bound-context names
|
|
450
|
-
*
|
|
451
|
-
* agent-resolved list for dynamic contexts). Empty/undefined = no binding.
|
|
363
|
+
* Ordered bound-context names for the job row; `(dynamic)` marks an element
|
|
364
|
+
* the agent resolves later, which then overwrites the list.
|
|
452
365
|
*/
|
|
453
366
|
contextNames?: string[];
|
|
454
367
|
contextVars?: Record<string, string>;
|
|
@@ -456,9 +369,9 @@ interface JobEnvData {
|
|
|
456
369
|
jobSecrets?: Record<string, string>;
|
|
457
370
|
jobNamespacedSecrets?: Record<string, Record<string, string>>;
|
|
458
371
|
/**
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
372
|
+
* Container registry credentials resolved from the lock's secret NAMES;
|
|
373
|
+
* lifted to a top-level dispatch field (stripped from jobConfig) before the
|
|
374
|
+
* agent sees it.
|
|
462
375
|
*/
|
|
463
376
|
containerRegistryAuth?: {
|
|
464
377
|
username: string;
|
|
@@ -467,24 +380,21 @@ interface JobEnvData {
|
|
|
467
380
|
};
|
|
468
381
|
held?: boolean;
|
|
469
382
|
/**
|
|
470
|
-
* Set when the
|
|
471
|
-
* dispatch resolves
|
|
472
|
-
*
|
|
473
|
-
* wave window) instead of dispatching now. Carries no secret value.
|
|
383
|
+
* Set when the bound contexts admitted the job's reject rules: what a later
|
|
384
|
+
* dispatch resolves context data from when the job is stored pending (held,
|
|
385
|
+
* awaiting upstream, outside its wave). Carries no secret value.
|
|
474
386
|
*/
|
|
475
387
|
contextResolution?: DeferredContextResolution;
|
|
476
388
|
/**
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
* can re-dispatch after approval.
|
|
389
|
+
* Set when a context policy or lock `approval` needs sign-off; the dispatch
|
|
390
|
+
* loop turns it into a `held_runs` row plus a stored pending job context so
|
|
391
|
+
* `release()` can re-dispatch.
|
|
481
392
|
*/
|
|
482
393
|
approvalHold?: PendingApprovalHold;
|
|
483
394
|
/**
|
|
484
|
-
* A non-reviewer hold (security / wait-timer / concurrency-queue)
|
|
485
|
-
*
|
|
486
|
-
* `holdJobForApproval`
|
|
487
|
-
* transaction — the reviewer branch uses `approvalHold` for the same purpose.
|
|
395
|
+
* A non-reviewer hold (security / wait-timer / concurrency-queue) from
|
|
396
|
+
* protection rules. Carried, not written on the spot, so
|
|
397
|
+
* `holdJobForApproval` creates the row and resume path in ONE transaction.
|
|
488
398
|
*/
|
|
489
399
|
nonApprovalHold?: CreateHeldRunData;
|
|
490
400
|
rejected?: boolean;
|
|
@@ -492,11 +402,7 @@ interface JobEnvData {
|
|
|
492
402
|
pendingInit?: boolean;
|
|
493
403
|
/** Bound contexts skipped on a test/local run because they disallow local execution. */
|
|
494
404
|
skippedEnvs?: string[];
|
|
495
|
-
/**
|
|
496
|
-
* User-visible warning set whenever any bound context was unavailable for
|
|
497
|
-
* a test run (non-test or unconfigured) and skipped — surfaced on the CLI run
|
|
498
|
-
* output and the dashboard run view.
|
|
499
|
-
*/
|
|
405
|
+
/** Warning naming test-run contexts skipped as non-test or unconfigured; shown in CLI and dashboard. */
|
|
500
406
|
envWarning?: string;
|
|
501
407
|
}
|
|
502
408
|
/** A resolved approval requirement awaiting hold creation in the dispatch loop. */
|
|
@@ -518,14 +424,11 @@ interface JobEnvEvalResult {
|
|
|
518
424
|
runContextId: string | undefined;
|
|
519
425
|
}
|
|
520
426
|
/**
|
|
521
|
-
* Synthetic job-id prefix every needs-gate site stamps on a job
|
|
522
|
-
*
|
|
523
|
-
* keys on it, so it
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
* Re-exported from `db/synthetic-job-ids.ts`, which owns it so the concurrency
|
|
528
|
-
* sweep in `contexts/` can exclude these rows without importing this module.
|
|
427
|
+
* Synthetic job-id prefix every needs-gate site stamps on a held-back job. The
|
|
428
|
+
* release path (`dispatchReadyJob` → `findSyntheticJobId` → `addJobsToRun`)
|
|
429
|
+
* keys on it, so it soundly recovers the gated set without threading a parallel
|
|
430
|
+
* list through both the single-orch and cluster paths. Owned by `db/synthetic-job-ids.ts` so the `contexts/`
|
|
431
|
+
* concurrency sweep need not import this module.
|
|
529
432
|
*/
|
|
530
433
|
export { NEEDS_PENDING_JOB_ID_PREFIX };
|
|
531
434
|
interface RejectedJob {
|
|
@@ -535,29 +438,19 @@ interface RejectedJob {
|
|
|
535
438
|
/** Explicit init-failure category override; inferred from reason when absent. */
|
|
536
439
|
category?: InitFailureCategory;
|
|
537
440
|
/**
|
|
538
|
-
*
|
|
539
|
-
* `
|
|
540
|
-
* (no init-failure) so its downstreams' `when` sets govern propagation.
|
|
441
|
+
* Default `failed`. A `runsOnAll` deliberately narrowed to no hosts records
|
|
442
|
+
* `skipped` (no init-failure) so downstream `when` sets govern propagation.
|
|
541
443
|
*/
|
|
542
444
|
terminalStatus?: ExecutionJobStatus;
|
|
543
445
|
}
|
|
544
446
|
/**
|
|
545
|
-
* Whether
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
* exactly the case that leaves the source warm and the deps cold. Gating only on
|
|
551
|
-
* the source miss made that state permanent: no build job ran, so nothing ever
|
|
552
|
-
* uploaded the dep tarball, so every agent fell back to installing from the
|
|
553
|
-
* registry on every job — and an agent with no route to that registry (a
|
|
554
|
-
* cloud-hosted one-shot agent, an air-gapped runner) could not run the job at
|
|
555
|
-
* all. The `__build__` job already carries `buildSourceNeeded` /
|
|
556
|
-
* `buildDepsNeeded` separately and the agent already honors both, so a
|
|
557
|
-
* deps-only build was implemented and unreachable.
|
|
447
|
+
* Whether a `__build__` job must run first. Either cache missing is a reason:
|
|
448
|
+
* source (keyed on contentHash) and deps (keyed on lockfile hash) miss
|
|
449
|
+
* independently, and a dependency bump leaves source warm and deps cold.
|
|
450
|
+
* Gating on the source miss alone never uploads the dep tarball, so agents
|
|
451
|
+
* with no registry route (cloud one-shot, air-gapped) cannot run at all.
|
|
558
452
|
*
|
|
559
|
-
* A
|
|
560
|
-
* write, so building would produce an artifact nothing could ever look up.
|
|
453
|
+
* A miss counts only with its hash: no hash means no cache key to write.
|
|
561
454
|
*/
|
|
562
455
|
export declare function buildIsNeeded(args: {
|
|
563
456
|
/** False when there is nothing to cache into (no bundle, no coordinator, …). */
|
|
@@ -568,13 +461,11 @@ export declare function buildIsNeeded(args: {
|
|
|
568
461
|
lockfileHash: string | undefined;
|
|
569
462
|
}): boolean;
|
|
570
463
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
* `
|
|
575
|
-
*
|
|
576
|
-
* pin) drains its bootstrap steps onto it. The bring-up job clones nothing and
|
|
577
|
-
* runs no sandbox (`bringupOnly`).
|
|
464
|
+
* A synthetic `__bringup__` job, one per un-agented `includeUninitialized`
|
|
465
|
+
* child, sent to a `kici:capability:ssh-transport` agent that runs
|
|
466
|
+
* `ensureInitRunner(targetAgentId)` over SSH. The init-runner connects under
|
|
467
|
+
* `targetAgentId` and the child's pinned hold drains onto it. Clones nothing,
|
|
468
|
+
* no sandbox (`bringupOnly`).
|
|
578
469
|
*/
|
|
579
470
|
export declare function buildBringupJobInput(args: {
|
|
580
471
|
ctx: WorkflowDispatchContext;
|
|
@@ -582,23 +473,10 @@ export declare function buildBringupJobInput(args: {
|
|
|
582
473
|
targetAgentId: string;
|
|
583
474
|
}): QueuedJobInput;
|
|
584
475
|
/**
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* Materialize each static job's matrix into dispatchable children. A job whose
|
|
591
|
-
* matrix is invalid (zero combinations / over the cap) is dropped from the
|
|
592
|
-
* dispatch list and recorded as a `matrix_expansion` matrix failure so the run's
|
|
593
|
-
* other jobs still proceed. Dynamic-matrix jobs pass through with a
|
|
594
|
-
* `pendingDynamicMatrix` marker for the eval flow.
|
|
595
|
-
*/
|
|
596
|
-
/**
|
|
597
|
-
* Resolve a `runsOnAll` lock job against the declared host roster and partition
|
|
598
|
-
* the matched hosts into the target set per the `onUnreachable` policy (R2):
|
|
599
|
-
* `ready` hosts always run; unreachable durable (`static`) hosts hold / fail /
|
|
600
|
-
* skip; stale ephemeral hosts are always skipped. Throws {@link FanoutError}
|
|
601
|
-
* when the run can't proceed (fail policy with an absent host, or zero targets).
|
|
476
|
+
* Resolve a `runsOnAll` job against the host roster and apply `onUnreachable`:
|
|
477
|
+
* `ready` hosts run; unreachable `static` hosts hold / fail / skip; stale
|
|
478
|
+
* ephemeral hosts are skipped. Throws {@link FanoutError} when the run cannot
|
|
479
|
+
* proceed (fail policy with an absent host, or zero targets).
|
|
602
480
|
*/
|
|
603
481
|
export declare function resolveHostFanoutTargets(lockJob: LockJob, deps: ProcessingDeps, target?: HostTargetSelector): Promise<ResolvedHostAgent[]>;
|
|
604
482
|
/** Exact labels + regex patterns partitioned from a lock job's selectors. */
|
|
@@ -608,64 +486,44 @@ interface JobRoutingSelectors {
|
|
|
608
486
|
excludeLabels: string[];
|
|
609
487
|
excludePatterns: LabelMatcher[];
|
|
610
488
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
* Only {@link resolveRosterAgentPin} reads this. A bare agent id in `runsOn`
|
|
615
|
-
* is the documented inventory fan-out pattern (`runsOn: [h.agentId]`), and an
|
|
616
|
-
* agent id is not a label: `host_roster.agent_id` is case-sensitive, so the
|
|
617
|
-
* folded form misses every host whose id carries a capital.
|
|
489
|
+
* `runsOn` exact values as spelled, before `partitionMatchers` folds them.
|
|
490
|
+
* For {@link resolveRosterAgentPin} only: `host_roster.agent_id` is
|
|
491
|
+
* case-sensitive, so the folded form misses ids with a capital.
|
|
618
492
|
*/
|
|
619
493
|
runsOnExactRaw: string[];
|
|
620
494
|
}
|
|
621
495
|
/**
|
|
622
|
-
* Partition
|
|
623
|
-
*
|
|
624
|
-
*
|
|
625
|
-
* routing (the pin targets the resolved agent directly).
|
|
496
|
+
* Partition runsOn / excludeLabels into exact labels (SQL `@>` prefilter +
|
|
497
|
+
* registry index) and regex patterns (JS post-filter). A `runsOnAll` job has
|
|
498
|
+
* no `runsOn`; its children route by pin.
|
|
626
499
|
*/
|
|
627
500
|
export declare function runsOnSelectorsForLockJob(lockJob: {
|
|
628
501
|
runsOn?: readonly LabelMatcher[];
|
|
629
502
|
excludeLabels?: readonly LabelMatcher[];
|
|
630
503
|
}): JobRoutingSelectors;
|
|
631
504
|
/**
|
|
632
|
-
* Runtime
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
* `docker` / `podman` CLI, so a host without one cannot run the job at all, and
|
|
636
|
-
* the agent self-reports `kici:runtime:container-build` when it has one.
|
|
505
|
+
* Runtime labels a job's shape demands of its host. Only a
|
|
506
|
+
* `container.dockerfile` job gets one: building needs a `docker` / `podman`
|
|
507
|
+
* CLI, which the agent self-reports as `kici:runtime:container-build`.
|
|
637
508
|
*
|
|
638
|
-
* A
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
* orchestrator could not actually evaluate made them match nothing. A dockerfile
|
|
642
|
-
* job is new, so requiring the fact strands no existing workflow — and an agent
|
|
643
|
-
* old enough not to report the fact is an agent that cannot build anyway.
|
|
509
|
+
* A finalized `image` job deliberately gets NOTHING: an implicit requirement
|
|
510
|
+
* on working jobs strands them. An agent too old to report the label cannot
|
|
511
|
+
* build anyway.
|
|
644
512
|
*
|
|
645
|
-
* Applied
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
* set matches no backend at all — the job would be stranded `queued-no-backend`
|
|
649
|
-
* rather than spawned. The pool's hosts are the operator's to describe; what an
|
|
650
|
-
* agent can actually do is known only once it registers and says so.
|
|
513
|
+
* Applied to REGISTERED agents only, NOT the scaler: backends match by exact
|
|
514
|
+
* label-set containment, so a label absent from the pool's set strands the job
|
|
515
|
+
* `queued-no-backend`. What an agent can do is known once it registers.
|
|
651
516
|
*/
|
|
652
517
|
export declare function requiredRuntimeLabelsFor(container: unknown): string[];
|
|
653
518
|
/**
|
|
654
|
-
* Resolve
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
* store) returns null and the caller keeps normal label routing.
|
|
663
|
-
*
|
|
664
|
-
* `runsOnExact` takes the values the lock file spells, NOT the canonical labels
|
|
665
|
-
* every other routing path uses: this looks the value up as an agent id, and
|
|
666
|
-
* agent ids are case-sensitive. Handing it folded labels strands every host
|
|
667
|
-
* whose id carries a capital on the normal label path, where a bare agent id
|
|
668
|
-
* matches nothing.
|
|
519
|
+
* Resolve the documented inventory pattern `runsOn: [h.agentId]` into a host
|
|
520
|
+
* pin. A bare agentId is no advertised label, so label routing leaves it
|
|
521
|
+
* `queued-no-backend`. When the single exact label names a roster host, pin it
|
|
522
|
+
* (plus its coordinator for reroute), as `runsOnAll` children pin. Any other
|
|
523
|
+
* shape returns null and keeps label routing.
|
|
524
|
+
*
|
|
525
|
+
* `runsOnExact` takes the lock's spelling, NOT folded labels: agent ids are
|
|
526
|
+
* case-sensitive.
|
|
669
527
|
*/
|
|
670
528
|
export declare function resolveRosterAgentPin(args: {
|
|
671
529
|
runsOnExact: string[];
|
|
@@ -686,19 +544,18 @@ export interface WavePlan {
|
|
|
686
544
|
}>;
|
|
687
545
|
}
|
|
688
546
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
* `expandedName` for children with no index) and every child at index `>=
|
|
695
|
-
* maxParallel` is held (`wave_gated=true`). The first `maxParallel` dispatch
|
|
696
|
-
* immediately; held children release one-per-terminal via the wave-scheduler.
|
|
697
|
-
* Every child of a bounded-wave base — held or not — gets a `policy` entry so
|
|
698
|
-
* the wave-scheduler can read the width/failFast at terminal time. A non-fan-out
|
|
699
|
-
* job (single child) or one without `maxParallel` contributes nothing.
|
|
547
|
+
* Rolling-wave plan. For a `maxParallel` base with more than one child,
|
|
548
|
+
* children sort by `fanoutIndex` (else `expandedName`) and index `>=
|
|
549
|
+
* maxParallel` is held (`wave_gated=true`); held children release
|
|
550
|
+
* one-per-terminal via the wave-scheduler. Every child of a bounded base gets
|
|
551
|
+
* a `policy` entry for the scheduler to read at terminal time.
|
|
700
552
|
*/
|
|
701
553
|
export declare function computeWavePlan(materializedJobs: readonly MaterializedJob[]): WavePlan;
|
|
554
|
+
/**
|
|
555
|
+
* Materialize each static job's fan-out. An invalid fan-out (zero combinations,
|
|
556
|
+
* over the cap) is recorded as a failure so the run's other jobs proceed.
|
|
557
|
+
* Dynamic-matrix jobs pass through marked `pendingDynamicMatrix`.
|
|
558
|
+
*/
|
|
702
559
|
export declare function materializeStaticJobsSafe(staticJobs: readonly LockJob[], deps: ProcessingDeps, target?: HostTargetSelector): Promise<{
|
|
703
560
|
materializedJobs: MaterializedJob[];
|
|
704
561
|
expansionMap: Map<string, readonly string[]>;
|
|
@@ -707,10 +564,9 @@ export declare function materializeStaticJobsSafe(staticJobs: readonly LockJob[]
|
|
|
707
564
|
/** The `paths` lists this workflow's matching left to the agent, or undefined. */
|
|
708
565
|
export declare function deferredPathsOf(ctx: Pick<WorkflowDispatchContext, 'decision'>): string[][] | undefined;
|
|
709
566
|
/**
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* `step.approval-request` wire schema and are not checked here.
|
|
567
|
+
* First workflow- or job-level approval with an invalid `timeoutSeconds`, or
|
|
568
|
+
* null. Step-scope approvals are validated by the `step.approval-request`
|
|
569
|
+
* wire schema instead.
|
|
714
570
|
*/
|
|
715
571
|
export declare function findInvalidApprovalTimeout(workflow: LockWorkflow): {
|
|
716
572
|
scope: 'workflow' | 'job';
|
|
@@ -718,30 +574,21 @@ export declare function findInvalidApprovalTimeout(workflow: LockWorkflow): {
|
|
|
718
574
|
value: number;
|
|
719
575
|
} | null;
|
|
720
576
|
/**
|
|
721
|
-
*
|
|
722
|
-
* `
|
|
723
|
-
*
|
|
724
|
-
* resolution stays fleet-wide (`'**'`-only). Returns `undefined` when there are
|
|
725
|
-
* no host facts to scope by.
|
|
577
|
+
* Per-host secret-resolution facts for a host child (`mat.agent` preferred,
|
|
578
|
+
* else `pinnedAgentId`/`host`). Undefined for a non-host child, whose
|
|
579
|
+
* resolution stays fleet-wide (`'**'`-only).
|
|
726
580
|
*/
|
|
727
581
|
export declare function hostCtxFromMat(mat: MaterializedJob): HostFacts | undefined;
|
|
728
582
|
/**
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
* context name shared across tenants must not leak concurrency between them.
|
|
734
|
-
* One dispatch pass carries a single `resolvedOrgId`, so the org component is a
|
|
735
|
-
* standing invariant rather than a live discriminator — it is here so a future
|
|
736
|
-
* pass dispatching for more than one org cannot silently merge two orgs'
|
|
737
|
-
* tallies. `JSON.stringify` over the pair is used rather than string
|
|
738
|
-
* concatenation so no separator character can make two different pairs collide.
|
|
583
|
+
* In-pass admission tally key. The org id mirrors the count query's
|
|
584
|
+
* `customer_id` scoping so a shared context name never leaks concurrency
|
|
585
|
+
* across tenants — a standing invariant, since one pass has one org.
|
|
586
|
+
* `JSON.stringify`, not concatenation, so no separator makes pairs collide.
|
|
739
587
|
*/
|
|
740
588
|
export declare function concurrencyAdmissionKey(orgId: string, concurrencyGroup: string): string;
|
|
741
589
|
/**
|
|
742
|
-
* Phase D — evaluate static jobs' context data, queue deferred-init jobs
|
|
743
|
-
*
|
|
744
|
-
* the run.
|
|
590
|
+
* Phase D — evaluate static jobs' context data, queue deferred-init jobs for
|
|
591
|
+
* dynamic fields, and pick the run's `runContextName`.
|
|
745
592
|
*/
|
|
746
593
|
export declare function evaluateJobContexts(args: {
|
|
747
594
|
ctx: WorkflowDispatchContext;
|
|
@@ -749,24 +596,15 @@ export declare function evaluateJobContexts(args: {
|
|
|
749
596
|
buildPrep: BuildPrepResult;
|
|
750
597
|
}): Promise<JobEnvEvalResult>;
|
|
751
598
|
/**
|
|
752
|
-
* Refuse a Dockerfile build on an untrusted ref
|
|
753
|
-
*
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
* "Without a trusted emitter" covers both halves of the internal case: a
|
|
763
|
-
* `kiciEvent()` subscriber that inherited an `unknown` tier, and one
|
|
764
|
-
* that inherited nothing at all (no emitting run, no persisted tier, a lookup
|
|
765
|
-
* that failed) — the strict fallback, which is not an "untrusted emitter".
|
|
766
|
-
*
|
|
767
|
-
* Enforced here, at dispatch, and nowhere else: the agent applies only what
|
|
768
|
-
* dispatch authorized, exactly as it does for the sandbox capability grant. Deny
|
|
769
|
-
* is loud and total — the build never starts.
|
|
599
|
+
* Refuse a Dockerfile build on an untrusted ref unless the org opted in. The
|
|
600
|
+
* build runs arbitrary `RUN` commands on the host daemon, OUTSIDE the hardened
|
|
601
|
+
* posture (`docker build` cannot be capability-restricted). Untrusted = fork
|
|
602
|
+
* PR, unresolved contributor, or internal run without a trusted emitter (the
|
|
603
|
+
* user-cache write-scope classification) — including a `kiciEvent()`
|
|
604
|
+
* subscriber that inherited an `unknown` tier or nothing at all.
|
|
605
|
+
*
|
|
606
|
+
* Enforced only here, at dispatch; the agent applies what dispatch authorized,
|
|
607
|
+
* as for sandbox grants. Deny is loud and total.
|
|
770
608
|
*/
|
|
771
609
|
export declare function resolveWorkflowDockerfileBuilds(workflow: LockWorkflow, opts: {
|
|
772
610
|
scope: CacheRefScope;
|
|
@@ -778,55 +616,37 @@ export declare function resolveWorkflowDockerfileBuilds(workflow: LockWorkflow,
|
|
|
778
616
|
reason: string;
|
|
779
617
|
};
|
|
780
618
|
};
|
|
781
|
-
/**
|
|
782
|
-
* Post the pending `KiCI Security` status, and record on every hold that gates
|
|
783
|
-
* this commit's check that the commit now carries it.
|
|
784
|
-
*
|
|
785
|
-
* The record is what a settle reads to decide whether a hold has a check to
|
|
786
|
-
* terminalize. Deriving that from the row's shape instead answers what the code
|
|
787
|
-
* INTENDED, and `postCheckStatus` CREATES the named run when it finds none — so
|
|
788
|
-
* a post the provider refused left a shape saying "posted" and a settle that
|
|
789
|
-
* put a completed `KiCI Security` run on a commit which never had one.
|
|
790
|
-
*
|
|
791
|
-
* `heldRunIds` is plural because the commit carries ONE check run: a job held on
|
|
792
|
-
* two independent requirements has both of them gating it, and marking only the
|
|
793
|
-
* one whose summary was rendered would let the first to end resolve a check the
|
|
794
|
-
* other is still gating.
|
|
795
|
-
*
|
|
796
|
-
* Awaited, where the post used to be fire-and-forget: the record can only be
|
|
797
|
-
* written once the provider has accepted, and a record racing the settle is a
|
|
798
|
-
* record the settle may not see. A failed post is still swallowed — the dispatch
|
|
799
|
-
* loop is never blocked by a provider error — but the round-trip is now
|
|
800
|
-
* serial and inside the per-job loop, so N held jobs cost N of them.
|
|
801
|
-
*
|
|
802
|
-
* On success and then a failed record the commit keeps a pending check the
|
|
803
|
-
* settle will decline to close. That is the residue the fire-and-forget post
|
|
804
|
-
* could already leave, now narrowed to whatever can fail between the accepted
|
|
805
|
-
* post and ONE statement. The record is therefore retried
|
|
806
|
-
* {@link PENDING_CHECK_MARK_ATTEMPTS} times before it is given up on, which
|
|
807
|
-
* closes the half of that window the doc above names as reachable without a
|
|
808
|
-
* process dying — a lost connection, a statement timeout, a deadlock. What is
|
|
809
|
-
* left is a process death inside the retry window, and nothing in reach closes
|
|
810
|
-
* that: a sweeper would have to ask the provider whether the check exists, and
|
|
811
|
-
* `CheckStatusPoster` has no read method. Adding one means a new method on a
|
|
812
|
-
* compat-protected engine interface, every implementation and every hand-built
|
|
813
|
-
* bundle, to recover a window measured in milliseconds — against a recovery
|
|
814
|
-
* that already exists, since pushing a new commit re-posts. A sweeper without
|
|
815
|
-
* that read could only guess, and a wrong guess FABRICATES a check, which is
|
|
816
|
-
* the worse direction either way: a fabricated failing check on a pull request
|
|
817
|
-
* is worse than a stuck one.
|
|
818
|
-
*
|
|
819
|
-
* The record is one statement over every id, never one per id. A partial mark
|
|
820
|
-
* would leave an unmarked hold uncounted by the contention query, so the first
|
|
821
|
-
* hold to end would terminalize the shared check while the other still gates
|
|
822
|
-
* the job — a fabricated PASSING check, the worse direction, and reachable
|
|
823
|
-
* without any process dying. See `markPendingCheckPosted`.
|
|
824
|
-
*/
|
|
825
619
|
/**
|
|
826
620
|
* How many times {@link postPendingHoldCheck} tries to record an accepted post
|
|
827
621
|
* on the hold rows before giving up and leaving the check unclosable.
|
|
828
622
|
*/
|
|
829
623
|
export declare const PENDING_CHECK_MARK_ATTEMPTS = 3;
|
|
624
|
+
/**
|
|
625
|
+
* Post the pending `KiCI Security` status, then record on every hold gating
|
|
626
|
+
* this commit's check that the commit carries it.
|
|
627
|
+
*
|
|
628
|
+
* A settle reads the record, not the row's shape, to decide whether there is a
|
|
629
|
+
* check to terminalize: `postCheckStatus` CREATES a missing run, so a shape
|
|
630
|
+
* saying "posted" after a refused post put a completed check on a commit that
|
|
631
|
+
* never had one.
|
|
632
|
+
*
|
|
633
|
+
* `heldRunIds` is plural because the commit carries ONE check run: with two
|
|
634
|
+
* requirements gating a job, marking one lets the first to end resolve a check
|
|
635
|
+
* the other still gates. Marked in one statement, never per id — a partial
|
|
636
|
+
* mark lets the contention query miss a hold and fabricate a PASSING check
|
|
637
|
+
* (`markPendingCheckPosted`).
|
|
638
|
+
*
|
|
639
|
+
* Awaited so the record lands before a settle can race it; a failed post is
|
|
640
|
+
* swallowed so the dispatch loop never blocks, at one serial round-trip per
|
|
641
|
+
* held job.
|
|
642
|
+
*
|
|
643
|
+
* A failed record after a successful post leaves a pending check no settle
|
|
644
|
+
* closes; retried {@link PENDING_CHECK_MARK_ATTEMPTS} times to cover a lost
|
|
645
|
+
* connection, statement timeout or deadlock. A process death mid-retry stays
|
|
646
|
+
* open: a sweeper would need a read on `CheckStatusPoster`, a compat-protected
|
|
647
|
+
* engine interface, to recover milliseconds that a new commit already
|
|
648
|
+
* recovers — and guessing FABRICATES checks, worse than a stuck one.
|
|
649
|
+
*/
|
|
830
650
|
export declare function postPendingHoldCheck(args: {
|
|
831
651
|
poster: NonNullable<NonNullable<WorkflowDispatchContext['bundle']>['checkStatusPoster']>;
|
|
832
652
|
store: NonNullable<ProcessingDeps['heldRunStore']>;
|
|
@@ -842,34 +662,15 @@ export declare function postPendingHoldCheck(args: {
|
|
|
842
662
|
postFailureMessage: string;
|
|
843
663
|
}): Promise<void>;
|
|
844
664
|
/**
|
|
845
|
-
* Open the needs gate for
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
* scheduler is purely event-driven off job completion, and that event has
|
|
855
|
-
* already been consumed.
|
|
856
|
-
*
|
|
857
|
-
* The window is small (single-digit milliseconds) but entirely reachable: a job
|
|
858
|
-
* that fails immediately on arrival — a rejected dispatch, an init failure, a
|
|
859
|
-
* capability mismatch — reports terminal in about the time one DB write takes.
|
|
860
|
-
* It was invisible for as long as the webhook route answered only after the
|
|
861
|
-
* whole pipeline had run, because the caller could not learn a job had been
|
|
862
|
-
* dispatched until every edge was already committed.
|
|
863
|
-
*
|
|
864
|
-
* Recomputing here is the same guard the deferred result-aware eval registration
|
|
865
|
-
* already applies for its own edges, and it is safe to run unconditionally: the
|
|
866
|
-
* claim inside `recomputeNeedsSatisfied` is a conditional UPDATE, so a job the
|
|
867
|
-
* normal completion path already claimed is skipped rather than dispatched
|
|
868
|
-
* twice.
|
|
869
|
-
*
|
|
870
|
-
* Wave-held jobs share the synthetic-id prefix but are gated by the rolling-wave
|
|
871
|
-
* scheduler, not by needs, so they are excluded — opening their gate here would
|
|
872
|
-
* bypass the `maxParallel` window.
|
|
665
|
+
* Open the needs gate for jobs whose upstreams went terminal before the edges
|
|
666
|
+
* existed. Edges are written after the loop; a root job terminal on arrival
|
|
667
|
+
* drives `evaluateDownstreams` against zero edges, and the event-driven
|
|
668
|
+
* scheduler never re-fires, so the downstream stays `pending` forever.
|
|
669
|
+
*
|
|
670
|
+
* The same guard the deferred result-aware eval registration applies for its own
|
|
671
|
+
* edges. Safe unconditionally: `recomputeNeedsSatisfied` claims with a conditional
|
|
672
|
+
* UPDATE, so an already-claimed job is not dispatched twice. Wave-held jobs
|
|
673
|
+
* share the prefix but are excluded, or the `maxParallel` window is bypassed.
|
|
873
674
|
*/
|
|
874
675
|
export declare function catchUpNeedsGatedJobs(args: {
|
|
875
676
|
ctx: NeedsSchedulingContext;
|
|
@@ -889,40 +690,25 @@ export declare enum InitDispatchSuppression {
|
|
|
889
690
|
Gated = "gated"
|
|
890
691
|
}
|
|
891
692
|
/**
|
|
892
|
-
*
|
|
693
|
+
* Whether an arrived init result may dispatch its job.
|
|
893
694
|
*
|
|
894
|
-
* `Paths`
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* that absence dispatches.
|
|
695
|
+
* `Paths` first: unmatched deferred `paths` never triggered, whatever the
|
|
696
|
+
* filter says. Only an explicit `false` suppresses; an older agent's missing
|
|
697
|
+
* verdict dispatches.
|
|
898
698
|
*
|
|
899
|
-
* `Filter`
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
* predates the filter reports no verdict at all — reading that absence as
|
|
903
|
-
* "suppress" would silently stop every dispatch it handles.
|
|
699
|
+
* `Filter` needs both a declared filter and a reported `false`: a rogue agent
|
|
700
|
+
* cannot suppress a filter-less workflow, and an older agent's missing verdict
|
|
701
|
+
* must not stop every dispatch.
|
|
904
702
|
*
|
|
905
|
-
* `Gated
|
|
906
|
-
*
|
|
703
|
+
* `Gated`: **rejected** is load-bearing — the flow-back's
|
|
704
|
+
* `suppression === Gated && jobEnvData.rejected` branch stops it. **held** is
|
|
705
|
+
* NOT consumed here: a held job gets its init round (only it resolves dynamic
|
|
706
|
+
* values) and the flow-back routes it to `holdExecutionAfterInit`. The no-
|
|
707
|
+
* dispatch guarantee for a held job lives at the call site's `held` branch,
|
|
708
|
+
* `dispatchReadyJob`'s pending-hold check, and the cluster path's
|
|
709
|
+
* `holdJobForApproval`.
|
|
907
710
|
*
|
|
908
|
-
*
|
|
909
|
-
* the `suppression === Gated && jobEnvData.rejected` branch) to stop a job its
|
|
910
|
-
* context rules rejected from dispatching.
|
|
911
|
-
* - **held** is NOT consumed here any more. A held job deliberately DOES get an
|
|
912
|
-
* init job — nothing else can resolve a dynamic value, so suppressing the
|
|
913
|
-
* round would make the job undispatchable rather than merely gated. The
|
|
914
|
-
* flow-back handles it after resolution instead, routing it to
|
|
915
|
-
* `holdExecutionAfterInit` so the hold and its resolved dispatch context are
|
|
916
|
-
* stored together.
|
|
917
|
-
*
|
|
918
|
-
* So do not read this as a guarantee that a held job cannot dispatch: that
|
|
919
|
-
* guarantee lives at the call site's `jobEnvData.held` branch, and — for the
|
|
920
|
-
* needs-scheduler and cluster paths, which reach a job by other routes — in
|
|
921
|
-
* `dispatchReadyJob`'s pending-hold check and the cluster path's own
|
|
922
|
-
* `holdJobForApproval` call.
|
|
923
|
-
*
|
|
924
|
-
* Exported for its own test: inline, the second branch could not be exercised at
|
|
925
|
-
* all, and an untestable security check is one nobody can prove still works.
|
|
711
|
+
* Exported so the security check is testable.
|
|
926
712
|
*/
|
|
927
713
|
export declare function initDispatchSuppression(workflow: Pick<LockWorkflow, 'hasFilter'>, initResult: {
|
|
928
714
|
filterPassed?: boolean;
|
|
@@ -930,43 +716,34 @@ export declare function initDispatchSuppression(workflow: Pick<LockWorkflow, 'ha
|
|
|
930
716
|
}, jobEnvData: Pick<JobEnvData, 'rejected' | 'held'>): InitDispatchSuppression | null;
|
|
931
717
|
export interface GeneratedJobConfig {
|
|
932
718
|
/**
|
|
933
|
-
*
|
|
934
|
-
*
|
|
935
|
-
* jobs). Downstream dispatch / needs-edge / tracking code keys on this name.
|
|
719
|
+
* `name` and `needs` rewritten to expanded matrix-child names; dispatch,
|
|
720
|
+
* needs edges and tracking key on this name.
|
|
936
721
|
*/
|
|
937
722
|
genJob: LockJob;
|
|
938
723
|
genJobConfig: Record<string, unknown>;
|
|
939
724
|
runsOnLabels: string[];
|
|
940
|
-
/**
|
|
725
|
+
/** JS post-filter. */
|
|
941
726
|
runsOnPatterns: LabelMatcher[];
|
|
942
|
-
/** Exact labels the dispatched agent must NOT have. */
|
|
943
727
|
excludeLabels: string[];
|
|
944
|
-
/**
|
|
728
|
+
/** JS post-filter. */
|
|
945
729
|
excludePatterns: LabelMatcher[];
|
|
946
|
-
/**
|
|
730
|
+
/** Set when runsOn resolved to a roster host. */
|
|
947
731
|
pinnedAgentId?: string;
|
|
948
|
-
/**
|
|
732
|
+
/** Cross-cluster reroute hint; null = not connected. */
|
|
949
733
|
connectedInstanceId?: string | null;
|
|
950
|
-
/** The matrix combination for this child; absent for non-matrix generated jobs. */
|
|
951
734
|
matrixValues?: Record<string, unknown>;
|
|
952
735
|
/**
|
|
953
|
-
*
|
|
954
|
-
*
|
|
955
|
-
* site below, which is what the credential relay authorizes a request against.
|
|
736
|
+
* Inherited from the generator's LOCK entry; persisted to
|
|
737
|
+
* `execution_jobs.git_credentials` at every dispatch site for the relay.
|
|
956
738
|
*/
|
|
957
739
|
gitCredentials?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
958
|
-
/**
|
|
959
|
-
* What a later dispatch resolves the job's context data from, when the job
|
|
960
|
-
* binds a context. A generated job stored as a pending dispatch context
|
|
961
|
-
* carries no context data at rest.
|
|
962
|
-
*/
|
|
740
|
+
/** Context-data source for a later dispatch; no context data rests in storage. */
|
|
963
741
|
contextResolution?: DeferredContextResolution;
|
|
964
742
|
}
|
|
965
743
|
/**
|
|
966
|
-
* Split generated configs into pinned
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
* coordinator would silently drop the pin.
|
|
744
|
+
* Split generated configs into pinned and unpinned. Pinned always use the
|
|
745
|
+
* dispatcher pin path: `JobToRoute` has no pin field, so the coordinator would
|
|
746
|
+
* silently drop it.
|
|
970
747
|
*/
|
|
971
748
|
export declare function partitionGeneratedConfigsByPin(configs: readonly GeneratedJobConfig[]): {
|
|
972
749
|
pinnedConfigs: GeneratedJobConfig[];
|
|
@@ -982,42 +759,33 @@ interface ResolveGeneratedJobConfigsArgs {
|
|
|
982
759
|
installEnvSecrets: Record<string, string> | undefined;
|
|
983
760
|
generatedJobs: LockJob[];
|
|
984
761
|
dynamicEntry: BuildPrepResult['dynamicEntries'][number];
|
|
985
|
-
/**
|
|
762
|
+
/** Threaded into each job's dynamicSource for re-eval. */
|
|
986
763
|
upstreamSnapshot?: UpstreamSnapshot;
|
|
987
764
|
}
|
|
988
|
-
/** A generated job its contexts'
|
|
765
|
+
/** A generated job its contexts' gates held. */
|
|
989
766
|
export interface HeldGeneratedJob {
|
|
990
767
|
config: GeneratedJobConfig;
|
|
991
768
|
envData: JobEnvData;
|
|
992
769
|
}
|
|
993
770
|
/**
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
* on the run as failed.
|
|
771
|
+
* Generated jobs by gate verdict. Rejected or thrown jobs are in neither list;
|
|
772
|
+
* they are recorded on the run as failed.
|
|
997
773
|
*/
|
|
998
774
|
export interface GeneratedJobResolution {
|
|
999
|
-
/**
|
|
775
|
+
/** Carrying their resolved context data. */
|
|
1000
776
|
dispatchable: GeneratedJobConfig[];
|
|
1001
|
-
/**
|
|
777
|
+
/** Context secrets not resolved. */
|
|
1002
778
|
held: HeldGeneratedJob[];
|
|
1003
779
|
}
|
|
1004
780
|
/**
|
|
1005
|
-
* Gate each generated job
|
|
1006
|
-
*
|
|
1007
|
-
* A job the context rules reject is recorded on the run as failed and returned
|
|
1008
|
-
* in neither list. A job whose resolution throws is recorded on the run as
|
|
1009
|
-
* failed too, and dropped from both lists.
|
|
781
|
+
* Gate each generated job and build its config. Rejected or thrown jobs are
|
|
782
|
+
* recorded on the run as failed and returned in neither list.
|
|
1010
783
|
*/
|
|
1011
784
|
export declare function resolveGeneratedJobConfigs(args: ResolveGeneratedJobConfigsArgs): Promise<GeneratedJobResolution>;
|
|
1012
785
|
/**
|
|
1013
|
-
* Recompute the needs gate for `jobNames
|
|
1014
|
-
*
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1017
|
-
* `recomputeNeedsSatisfied` claims each job with a conditional
|
|
1018
|
-
* `needs_satisfied = false → true` UPDATE, so a job a concurrent
|
|
1019
|
-
* `evaluateDownstreams` already claimed is not returned here and cannot be
|
|
1020
|
-
* dispatched twice.
|
|
786
|
+
* Recompute the needs gate for `jobNames`: open satisfied jobs, terminalize
|
|
787
|
+
* excluded ones. The conditional `needs_satisfied = false → true` claim means
|
|
788
|
+
* a job a concurrent `evaluateDownstreams` claimed is never dispatched twice.
|
|
1021
789
|
*/
|
|
1022
790
|
export declare function recomputeAndApplyReady(ctx: NeedsSchedulingContext, jobNames: readonly string[]): Promise<void>;
|
|
1023
791
|
export { gatherInvokeResults };
|
|
@@ -1041,11 +809,7 @@ export declare function buildSecurityHoldData(runId: string, decision: Extract<T
|
|
|
1041
809
|
triggerSource: "context";
|
|
1042
810
|
};
|
|
1043
811
|
/**
|
|
1044
|
-
* Dispatch a single matched workflow
|
|
1045
|
-
*
|
|
1046
|
-
* Narrative orchestrator: each phase is a typed helper that returns a typed
|
|
1047
|
-
* result the next phase consumes. The function reads top-to-bottom as the
|
|
1048
|
-
* pipeline:
|
|
812
|
+
* Dispatch a single matched workflow, phase by phase:
|
|
1049
813
|
* A. setup → wrapped dispatcher + overlaid info
|
|
1050
814
|
* B. cache + build → buildPrep with cache URLs and build-job state
|
|
1051
815
|
* C. workflow secrets + ephemeral key → secret bundle
|