@kici-dev/orchestrator 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__test-helpers__/fake-scaler-state-store.d.ts +24 -0
- package/dist/__test-helpers__/mock-db-query.d.ts +130 -0
- package/dist/__test-helpers__/mock-db.d.ts +27 -0
- package/dist/agent/agent-version.d.ts +34 -0
- package/dist/agent/dispatcher.d.ts +151 -13
- package/dist/agent/host-roster.d.ts +37 -5
- package/dist/agent/registry.d.ts +2 -0
- package/dist/app.d.ts +56 -7
- package/dist/approvals/apply-decision.d.ts +67 -19
- package/dist/approvals/held-run-release-wiring.d.ts +45 -0
- package/dist/approvals/independent-wiring.d.ts +55 -0
- package/dist/approvals/resume-router.d.ts +9 -0
- package/dist/approvals/triggerer-subject.d.ts +37 -0
- package/dist/cache/dep-cache.d.ts +54 -10
- package/dist/cache/global-eval-round-cache.d.ts +95 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/pending-global-evals.d.ts +42 -0
- package/dist/cache/pending-inits.d.ts +10 -0
- package/dist/cli/api-client.d.ts +18 -0
- package/dist/cli/commands/cluster-settings.d.ts +52 -3
- package/dist/cli/commands/diagnose.d.ts +6 -0
- package/dist/cli/commands/held-run.d.ts +58 -0
- package/dist/cli/commands/runs.d.ts +1 -0
- package/dist/cli/commands/trust-policy.d.ts +117 -12
- package/dist/cli/kici-admin.d.ts +10 -0
- package/dist/cli.js +2770 -938
- package/dist/cluster/cluster-identity.d.ts +3 -3
- package/dist/cluster/cluster-settings-reader.d.ts +59 -1
- package/dist/cluster/coordinator.d.ts +44 -0
- package/dist/cluster/index.d.ts +4 -0
- package/dist/cluster/peer-handler.d.ts +19 -0
- package/dist/cluster/peer-registry.d.ts +17 -0
- package/dist/cluster/plan-headroom-store.d.ts +26 -0
- package/dist/cluster/worker-eviction.d.ts +69 -0
- package/dist/cold-store/load-event-log-range.d.ts +10 -3
- package/dist/cold-store/load-secret-audit-log-range.d.ts +4 -3
- package/dist/cold-store/tables/secret-audit-log.d.ts +4 -3
- package/dist/config.d.ts +48 -21
- package/dist/content-requirements-cache.d.ts +55 -0
- package/dist/contexts/held-runs.d.ts +123 -16
- package/dist/contexts/protection/aggregate.d.ts +3 -2
- package/dist/contexts/protection/branch-gate.d.ts +15 -0
- package/dist/contexts/protection/concurrency-gate.d.ts +8 -2
- package/dist/contexts/protection/pipeline.d.ts +18 -0
- package/dist/contexts/release-queued-holds.d.ts +35 -0
- package/dist/dashboard/attestation-filters.d.ts +8 -0
- package/dist/dashboard/handler.d.ts +6 -24
- package/dist/db/migrations/109_cluster_settings_cache_knobs.d.ts +4 -0
- package/dist/db/migrations/110_cluster_settings_global_eval_knobs.d.ts +4 -0
- package/dist/db/migrations/111_cluster_settings_global_eval_wait.d.ts +4 -0
- package/dist/db/migrations/112_execution_runs_workflow_repo.d.ts +4 -0
- package/dist/db/migrations/113_execution_runs_workflow_repo_index.d.ts +30 -0
- package/dist/db/migrations/114_ingest_queue_claim.d.ts +4 -0
- package/dist/db/migrations/115_global_workflows_cluster_switch.d.ts +9 -0
- package/dist/db/migrations/116_org_plan_headroom.d.ts +4 -0
- package/dist/db/migrations/117_invoke_gate_proxy_jobs.d.ts +4 -0
- package/dist/db/migrations/118_invoke_gate_scheduling.d.ts +4 -0
- package/dist/db/migrations/119_scaler_ha_ownership.d.ts +4 -0
- package/dist/db/migrations/120_cluster_settings_scaler_reaper.d.ts +4 -0
- package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +19 -0
- package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +25 -0
- package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +24 -0
- package/dist/db/migrations/124_cluster_settings_provision_backoff.d.ts +4 -0
- package/dist/db/migrations/125_org_trust_directory.d.ts +30 -0
- package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +28 -0
- package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +26 -0
- package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +23 -0
- package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +24 -0
- package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +32 -0
- package/dist/db/types.d.ts +428 -12
- package/dist/entry-helpers.d.ts +28 -0
- package/dist/events/event-emitter.d.ts +22 -0
- package/dist/events/event-router.d.ts +87 -1
- package/dist/events/types.d.ts +2 -23
- package/dist/git/credential-broker.d.ts +94 -0
- package/dist/git/inherited-secret.d.ts +24 -0
- package/dist/git/installation-token.d.ts +38 -0
- package/dist/git/job-context.d.ts +13 -0
- package/dist/index.js +324 -84
- package/dist/metrics/agent-metrics-aggregator.d.ts +4 -4
- package/dist/metrics/prometheus.d.ts +170 -3
- package/dist/oidc/oidc-mint-registration.d.ts +7 -3
- package/dist/orchestrator-core.d.ts +91 -24
- package/dist/pipeline/content-filter.d.ts +71 -0
- package/dist/pipeline/direct-ingress-deps.d.ts +100 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +521 -11
- package/dist/pipeline/global-eval-round.d.ts +307 -0
- package/dist/pipeline/internal-event-pipeline.d.ts +140 -0
- package/dist/pipeline/invoke-gate.d.ts +164 -0
- package/dist/pipeline/job-contexts.d.ts +16 -17
- package/dist/pipeline/needs-scheduler.d.ts +13 -0
- package/dist/pipeline/process-webhook.d.ts +126 -31
- package/dist/pipeline/processor.d.ts +282 -23
- package/dist/pipeline/rerun.d.ts +21 -0
- package/dist/pipeline/resume-workflow.d.ts +40 -7
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +15 -0
- package/dist/pipeline/security-hold-check.d.ts +217 -0
- package/dist/pipeline/test-pipeline.d.ts +12 -0
- package/dist/pipeline/undispatched-hold-checks.d.ts +23 -0
- package/dist/pipeline/webhook-payload-store.d.ts +20 -0
- package/dist/policy/dashboard-write-policy-listener.d.ts +62 -0
- package/dist/policy/dashboard-write-policy.d.ts +14 -0
- package/dist/provenance/backfill-run.d.ts +10 -1
- package/dist/provider-registry.d.ts +47 -4
- package/dist/providers/github/check-status-poster.d.ts +33 -3
- package/dist/providers/github/commit-message.d.ts +20 -0
- package/dist/providers/github/file-contents.d.ts +40 -0
- package/dist/providers/github/index.d.ts +2 -2
- package/dist/providers/github/normalizer.d.ts +3 -2
- package/dist/providers/local/normalizer.d.ts +3 -5
- package/dist/providers/universal-git/config.d.ts +2 -0
- package/dist/providers/universal-git/index.d.ts +11 -2
- package/dist/providers/universal-git/normalizer.d.ts +10 -0
- package/dist/queue/cleanup.d.ts +7 -1
- package/dist/queue/job-queue.d.ts +112 -7
- package/dist/queue/terminalize-unroutable.d.ts +13 -0
- package/dist/registration/extractor.d.ts +3 -3
- package/dist/registration/registration-index.d.ts +7 -0
- package/dist/registration/registration-run-match.d.ts +47 -0
- package/dist/registration/registration-store.d.ts +22 -0
- package/dist/reporting/check-run-reporter.d.ts +146 -2
- package/dist/reporting/check-run-summary.d.ts +25 -1
- package/dist/reporting/execution-tracker.d.ts +324 -9
- package/dist/reporting/log-chunk-sink.d.ts +8 -5
- package/dist/reporting/run-aggregator.d.ts +4 -14
- package/dist/reporting/step-display-order.d.ts +43 -0
- package/dist/routes/admin-held-runs.d.ts +142 -0
- package/dist/routes/admin-org-settings.d.ts +5 -0
- package/dist/routes/admin-trust-policy.d.ts +34 -6
- package/dist/routes/admin.d.ts +15 -0
- package/dist/scaler/backend-factory.d.ts +55 -0
- package/dist/scaler/bare-metal-backend.d.ts +43 -5
- package/dist/scaler/claim-store.d.ts +119 -0
- package/dist/scaler/config.d.ts +4 -0
- package/dist/scaler/container-backend.d.ts +18 -4
- package/dist/scaler/container-routing.d.ts +23 -0
- package/dist/scaler/container-spawn.d.ts +28 -0
- package/dist/scaler/event-backend.d.ts +124 -0
- package/dist/scaler/event-provision-reaper.d.ts +350 -0
- package/dist/scaler/failure-tracker.d.ts +1 -1
- package/dist/scaler/firecracker-backend.d.ts +33 -6
- package/dist/scaler/index.d.ts +11 -1
- package/dist/scaler/label-matcher.d.ts +4 -3
- package/dist/scaler/manager.d.ts +905 -76
- package/dist/scaler/resolve-container-auth.d.ts +45 -0
- package/dist/scaler/scaler-events.d.ts +11 -0
- package/dist/scaler/scaler-state-store.d.ts +294 -10
- package/dist/scaler/types.d.ts +131 -13
- package/dist/scaler/warm-pool.d.ts +132 -29
- package/dist/security/comment-handler.d.ts +50 -11
- package/dist/security/global-workflow-policy.d.ts +52 -12
- package/dist/security/identity-link.d.ts +60 -0
- package/dist/security/lock-source.d.ts +11 -13
- package/dist/security/reduced-privilege-note.d.ts +59 -0
- package/dist/security/trust-directory-store.d.ts +233 -0
- package/dist/security/trust-policy-gate.d.ts +94 -59
- package/dist/security/trust-policy-store.d.ts +3 -0
- package/dist/security/trust-resolver.d.ts +14 -98
- package/dist/server.d.ts +11 -1
- package/dist/server.js +56329 -42234
- package/dist/stale-detector/gate-deadline-detector.d.ts +52 -0
- package/dist/stale-detector/stale-run-detector.d.ts +61 -3
- package/dist/standalone.js +37619 -23570
- package/dist/webhook/ingest-accept.d.ts +70 -0
- package/dist/webhook/ingest-overflow-buffer.d.ts +35 -4
- package/dist/webhook/ingest-overflow-replayer.d.ts +50 -6
- package/dist/worker/in-memory-job-queue.d.ts +1 -1
- package/dist/ws/agent-handler.d.ts +31 -4
- package/dist/ws/dashboard-context-handler.d.ts +28 -4
- package/dist/ws/dashboard-global-workflows-handler.d.ts +36 -9
- package/dist/ws/execution-status-frame.d.ts +32 -0
- package/dist/ws/failure-messages.d.ts +2 -0
- package/dist/ws/git-credential-relay.d.ts +39 -0
- package/dist/ws/oidc-token-relay.d.ts +6 -11
- package/dist/ws/platform-client.d.ts +68 -9
- package/dist/ws/test-relay-handlers.d.ts +35 -10
- package/installer-image-digests.json +3 -3
- package/package.json +24 -19
- package/sbom.spdx.json +868 -821
- package/dist/approvals/team-membership-lookup.d.ts +0 -13
- package/dist/pipeline/inline-eval.d.ts +0 -44
- package/dist/providers/github/contributor-resolver.d.ts +0 -30
- package/dist/security/contributor-cache.d.ts +0 -83
|
@@ -31,6 +31,19 @@ export interface SchedulerResult {
|
|
|
31
31
|
action: 'dispatch' | 'skip';
|
|
32
32
|
reason?: string;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if ALL upstreams of a job are satisfied.
|
|
36
|
+
* Returns { satisfied: true, action: 'dispatch' } when every upstream is
|
|
37
|
+
* terminal and its status is a member of the edge's run_on set. Returns
|
|
38
|
+
* { satisfied: true, action: 'skip', reason } when an upstream is terminal but
|
|
39
|
+
* its status is not in the edge's run_on set. Returns { satisfied: false } when
|
|
40
|
+
* any upstream is not yet terminal.
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkAllUpstreamsSatisfied(db: Kysely<Database>, runId: string, jobName: string): Promise<{
|
|
43
|
+
satisfied: boolean;
|
|
44
|
+
action?: 'dispatch' | 'skip';
|
|
45
|
+
reason?: string;
|
|
46
|
+
}>;
|
|
34
47
|
/**
|
|
35
48
|
* Insert dependency edges at run start for static-to-static needs.
|
|
36
49
|
*
|
|
@@ -21,44 +21,101 @@ import type { LockFile as FullLockFile, SimulatedEvent } from '@kici-dev/engine'
|
|
|
21
21
|
import type { OrchestratorMode } from '@kici-dev/engine';
|
|
22
22
|
import type { WebhookInfo } from '../webhook/handler.js';
|
|
23
23
|
import type { ProviderBundle } from '../provider-registry.js';
|
|
24
|
-
import type
|
|
24
|
+
import { type TrustResolution } from '../security/trust-resolver.js';
|
|
25
25
|
import { type TrustPolicyOutcome } from '../security/trust-policy-gate.js';
|
|
26
26
|
import { type WorkflowModification } from '../security/workflow-diff.js';
|
|
27
|
+
import type { IdentityLink, PermissionLevel } from '../security/identity-link.js';
|
|
27
28
|
import { type ProcessingDeps } from './processor.js';
|
|
28
29
|
/**
|
|
29
30
|
* Outcome of a single inbound-webhook ingestion. `duplicate` lets a direct-
|
|
30
31
|
* ingress route return `{ duplicate: true }` to GitHub's Recent Deliveries
|
|
31
32
|
* panel; `skipped` covers unknown provider / unknown event / no-repo paths;
|
|
32
33
|
* `processed` means the pipeline matched and dispatched (or recorded a run).
|
|
34
|
+
*
|
|
35
|
+
* `queued` means the delivery is durably stored and its pipeline will run after
|
|
36
|
+
* the response — the direct-ingress accept path's success outcome. It maps to
|
|
37
|
+
* the same 202 `processed` always did, because from the sender's side both mean
|
|
38
|
+
* "accepted, nothing more to do"; the distinction exists so the accept path can
|
|
39
|
+
* be asserted on directly rather than through the HTTP status.
|
|
33
40
|
*/
|
|
34
41
|
export declare const WebhookIngestOutcome: z.ZodEnum<{
|
|
35
42
|
duplicate: "duplicate";
|
|
36
43
|
processed: "processed";
|
|
44
|
+
queued: "queued";
|
|
37
45
|
shed: "shed";
|
|
38
46
|
skipped: "skipped";
|
|
39
47
|
}>;
|
|
40
48
|
export type WebhookIngestOutcome = z.infer<typeof WebhookIngestOutcome>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the directory a `/kici approve` comment is authorized against.
|
|
51
|
+
*
|
|
52
|
+
* Two sources, and which one applies is decided by the caller that assembled
|
|
53
|
+
* these deps rather than by the orchestrator's mode:
|
|
54
|
+
*
|
|
55
|
+
* - `server.ts` holds the Platform-pushed directory in memory and refreshes it
|
|
56
|
+
* on every `trust_policy.update`, so it always supplies both fields. An
|
|
57
|
+
* in-memory directory therefore wins outright — reading the row instead
|
|
58
|
+
* would answer from a cache the push has already superseded.
|
|
59
|
+
* - Every other assembly supplies neither. That includes the direct-ingress
|
|
60
|
+
* pipeline in `app.ts`, which is the only path an independent orchestrator
|
|
61
|
+
* has, and where the operator's own `kici-admin trust-policy directory-set`
|
|
62
|
+
* registrations live only in the row. Reading it per command is also what
|
|
63
|
+
* makes a registration take effect immediately rather than at the next
|
|
64
|
+
* restart.
|
|
65
|
+
*
|
|
66
|
+
* A failed read degrades to an empty directory: the commenter is not resolved
|
|
67
|
+
* and the command is refused, which is the same fail-closed answer an absent
|
|
68
|
+
* directory already gives.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveApprovalDirectory(deps: ProcessingDeps, orgId: string): Promise<{
|
|
71
|
+
identityLinks: IdentityLink[];
|
|
72
|
+
orgMemberPermissions: Map<string, PermissionLevel>;
|
|
73
|
+
}>;
|
|
41
74
|
interface TrustOutcome {
|
|
42
75
|
trustResolution: TrustResolution | undefined;
|
|
43
76
|
/** Default 'base' for PR events; trust resolution may override to 'head'. */
|
|
44
77
|
lockFileSource: 'head' | 'base';
|
|
45
78
|
}
|
|
79
|
+
/** Whether an inbound event name is one of the pull-request events. */
|
|
80
|
+
export declare function isPullRequestEvent(eventName: string): boolean;
|
|
46
81
|
export declare function resolveTrustForPR(args: {
|
|
47
82
|
info: WebhookInfo;
|
|
48
|
-
deps: ProcessingDeps;
|
|
49
83
|
bundle: ProviderBundle;
|
|
50
84
|
event: SimulatedEvent;
|
|
85
|
+
/** Raw webhook payload — read only to decide whether a push targets the default branch. */
|
|
51
86
|
payload: Record<string, unknown>;
|
|
52
|
-
resolvedOrgId: string;
|
|
53
|
-
repoIdentifier: string;
|
|
54
|
-
credentials: Record<string, unknown>;
|
|
55
87
|
}): Promise<TrustOutcome>;
|
|
88
|
+
/** What one organization-wide dispatch pass produced. */
|
|
89
|
+
interface GlobalDispatchOutcome {
|
|
90
|
+
matchedCount: number;
|
|
91
|
+
matchedRunIds: string[];
|
|
92
|
+
/** One summary per global decision this pass reached, dispatched or excluded. */
|
|
93
|
+
decisionSummaries: Record<string, unknown>[];
|
|
94
|
+
/**
|
|
95
|
+
* The workflow repository of every evaluation round this pass could not
|
|
96
|
+
* decide. Empty means every round the pass ran reached a verdict.
|
|
97
|
+
*/
|
|
98
|
+
roundFailureWorkflowRepos: string[];
|
|
99
|
+
/**
|
|
100
|
+
* Every workflow repository this pass actually evaluated: it examined that
|
|
101
|
+
* repository's registrations and reached a real outcome for each of them —
|
|
102
|
+
* dispatched, filtered out, or excluded by a verdict.
|
|
103
|
+
*
|
|
104
|
+
* The pass's POSITIVE signal, and the one a re-run gates its success check
|
|
105
|
+
* on. An empty `roundFailureWorkflowRepos` cannot carry that meaning: a pass
|
|
106
|
+
* with no registration index, no pending-eval tracker, or an event the trust
|
|
107
|
+
* policy held evaluates nothing and reports no failure either, so reading its
|
|
108
|
+
* silence as a clean verdict is the false assurance the round exists to
|
|
109
|
+
* remove.
|
|
110
|
+
*/
|
|
111
|
+
decidedWorkflowRepos: string[];
|
|
112
|
+
}
|
|
56
113
|
interface SecurityState {
|
|
57
114
|
workflowModifications: WorkflowModification[];
|
|
58
115
|
/**
|
|
59
|
-
* True when this PR changes `.kici/` workflow definitions.
|
|
60
|
-
*
|
|
61
|
-
*
|
|
116
|
+
* True when this PR changes `.kici/` workflow definitions. Reported, not
|
|
117
|
+
* enforced: the org trust policy is the fork switch, and it reads the fork
|
|
118
|
+
* signal and the tier — never this one.
|
|
62
119
|
*/
|
|
63
120
|
hasWorkflowModifications: boolean;
|
|
64
121
|
}
|
|
@@ -67,10 +124,11 @@ interface SecurityState {
|
|
|
67
124
|
* modifications by diffing base vs. head and post a neutral informational check
|
|
68
125
|
* (on its own dedicated check name).
|
|
69
126
|
*
|
|
70
|
-
* Detection
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
127
|
+
* Detection and legibility only: the check tells a reviewer that this PR edits
|
|
128
|
+
* the workflows it would run under. It feeds no policy decision — a PR that
|
|
129
|
+
* edits `.kici/` from the base repo is written by a contributor who could
|
|
130
|
+
* already push to it, and one from a fork is governed by the fork switch
|
|
131
|
+
* whether or not it touches `.kici/`.
|
|
74
132
|
*/
|
|
75
133
|
export declare function applyWorkflowModificationsAndSecurityHold(args: {
|
|
76
134
|
info: WebhookInfo;
|
|
@@ -88,11 +146,17 @@ export declare function applyWorkflowModificationsAndSecurityHold(args: {
|
|
|
88
146
|
/**
|
|
89
147
|
* Evaluate the org trust policy for a PR event.
|
|
90
148
|
*
|
|
91
|
-
* Scoped to providers with a
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
149
|
+
* Scoped to providers with a fork model (`bundle.hasForkModel`): a source
|
|
150
|
+
* without one passes regardless of policy. That is not a trust claim about such
|
|
151
|
+
* a source — a PR from a fork-less provider resolves no tier at all. It is that
|
|
152
|
+
* the policy's one condition cannot be established for it: universal-git does
|
|
153
|
+
* compute an `isForkPR`, but from payload keys many forges omit, and it reads
|
|
154
|
+
* `false` when they are absent. Gating on a signal that fails toward trust
|
|
155
|
+
* would be worse than not gating.
|
|
156
|
+
*
|
|
157
|
+
* The policy read has two distinct failure shapes, and they get distinct
|
|
158
|
+
* answers: no stored row is the unconfigured default (`FAIL_CLOSED_POLICY`),
|
|
159
|
+
* while a read that THREW gets `READ_FAILURE_POLICY` — see there for why.
|
|
96
160
|
*/
|
|
97
161
|
export declare function evaluateSecurityPolicy(args: {
|
|
98
162
|
deps: ProcessingDeps;
|
|
@@ -102,23 +166,54 @@ export declare function evaluateSecurityPolicy(args: {
|
|
|
102
166
|
mode: OrchestratorMode;
|
|
103
167
|
trustResolution: TrustResolution | undefined;
|
|
104
168
|
isForkPR: boolean;
|
|
105
|
-
hasWorkflowModifications: boolean;
|
|
106
169
|
}): Promise<TrustPolicyOutcome>;
|
|
107
170
|
/**
|
|
108
|
-
*
|
|
171
|
+
* Phase J — After per-repo workflows are dispatched, query the global index
|
|
172
|
+
* for workflows authored in OTHER repos that target this event type via
|
|
173
|
+
* cross-repo `repos` patterns. Same-org scope picks up both same-source and
|
|
174
|
+
* cross-source globals (cross-provider global workflows).
|
|
175
|
+
*/
|
|
176
|
+
export declare function dispatchGlobalWorkflowsForOtherRepos(args: {
|
|
177
|
+
info: WebhookInfo;
|
|
178
|
+
deps: ProcessingDeps;
|
|
179
|
+
eventWithFiles: SimulatedEvent;
|
|
180
|
+
resolvedOrgId: string;
|
|
181
|
+
repoIdentifier: string;
|
|
182
|
+
ref: string;
|
|
183
|
+
dispatchBundle: ProviderBundle;
|
|
184
|
+
dispatchCredentials: Record<string, unknown>;
|
|
185
|
+
/** The inbound event's own bundle, used to post the globals-skipped check. */
|
|
186
|
+
bundle: ProviderBundle;
|
|
187
|
+
credentials: Record<string, unknown>;
|
|
188
|
+
securityDecision: TrustPolicyOutcome;
|
|
189
|
+
/**
|
|
190
|
+
* The source `dispatchCredentials` belongs to, when a cross-provider lock-file
|
|
191
|
+
* fallback made it a different source from `info.routingKey`. Persisted on a
|
|
192
|
+
* failed round's run row so its re-run can rebuild the same dispatch pair
|
|
193
|
+
* instead of handing this source's credentials to the inbound source's client.
|
|
194
|
+
*/
|
|
195
|
+
dispatchRoutingKey?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Restrict the pass to global workflows authored in this repository. Set by
|
|
198
|
+
* the re-run of a failed evaluation round, which re-decides that round alone.
|
|
199
|
+
*/
|
|
200
|
+
onlyWorkflowRepo?: string;
|
|
201
|
+
}): Promise<GlobalDispatchOutcome>;
|
|
202
|
+
/**
|
|
203
|
+
* Process a webhook through the complete pipeline, recording a `failed` event-log
|
|
204
|
+
* row for a delivery the pipeline could not finish.
|
|
205
|
+
*
|
|
206
|
+
* The row is the only per-delivery record of such a failure. Nothing the pipeline
|
|
207
|
+
* decides after acknowledgement can reach the sender — `acceptWebhookDelivery`
|
|
208
|
+
* answers 202 and runs this detached — and the dashboard's webhook-activity view
|
|
209
|
+
* counts `event_log.status = 'failed'` for exactly this. Without the write that
|
|
210
|
+
* count is structurally always zero, and a post-acknowledgement failure appears
|
|
211
|
+
* in the orchestrator's own logs and nowhere a customer can see.
|
|
109
212
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* 4. Trust resolution for PR events
|
|
115
|
-
* 5. Lock file fetch (with multi-provider fallback)
|
|
116
|
-
* - No lock file: dispatch global workflows for this event (same org) and return
|
|
117
|
-
* 6. Workflow modification detection + security hold check status
|
|
118
|
-
* 7. Default-branch registration
|
|
119
|
-
* 8. Match triggers + dispatch matched same-source workflows
|
|
120
|
-
* 9. Match + dispatch global workflows for OTHER repos
|
|
121
|
-
* 10. Forward Platform trace + record event log
|
|
213
|
+
* Best-effort and non-masking: the write is wrapped, and the original error is
|
|
214
|
+
* rethrown either way. The delivery still reverts to `buffered` for the drain
|
|
215
|
+
* pass to retry, so a redelivery that succeeds writes its own `processed` row
|
|
216
|
+
* beside this one — the two are distinct rows, not a mutation.
|
|
122
217
|
*/
|
|
123
218
|
export declare function processWebhook(info: WebhookInfo, deps: ProcessingDeps): Promise<WebhookIngestOutcome>;
|
|
124
219
|
export {};
|