@kici-dev/orchestrator 0.7.0 → 0.9.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.
Files changed (75) hide show
  1. package/dist/__test-helpers__/test-db.d.ts +21 -0
  2. package/dist/app.d.ts +6 -5
  3. package/dist/artifacts/artifact-store.d.ts +6 -10
  4. package/dist/cache/legacy-prefixes.d.ts +19 -0
  5. package/dist/cache/pending-precursor-db-watcher.d.ts +79 -0
  6. package/dist/cache/pending-tracker.d.ts +10 -0
  7. package/dist/cache/precursor-result.d.ts +68 -0
  8. package/dist/cache/source-cache.d.ts +2 -1
  9. package/dist/cache/user-cache.d.ts +37 -58
  10. package/dist/cli/api-client.d.ts +3 -6
  11. package/dist/cli/commands/cache.d.ts +51 -0
  12. package/dist/cli/commands/cluster-settings.d.ts +0 -11
  13. package/dist/cli/commands/trust-policy.d.ts +12 -42
  14. package/dist/cli/service/privilege.d.ts +27 -6
  15. package/dist/cli.js +1171 -860
  16. package/dist/cluster/cluster-settings-reader.d.ts +1 -3
  17. package/dist/cluster/coordinator.d.ts +2 -3
  18. package/dist/cluster/join-client.d.ts +1 -39
  19. package/dist/config.d.ts +0 -6
  20. package/dist/contexts/context-store.d.ts +3 -3
  21. package/dist/contexts/held-runs.d.ts +6 -6
  22. package/dist/contexts/protection/aggregate.d.ts +5 -5
  23. package/dist/dashboard/handler.d.ts +1 -1
  24. package/dist/db/migrations/142_sweep_deprecated_columns.d.ts +4 -0
  25. package/dist/db/migrations/143_execution_jobs_precursor_result.d.ts +26 -0
  26. package/dist/db/migrations/144_execution_runs_registration_window.d.ts +32 -0
  27. package/dist/db/types.d.ts +27 -13
  28. package/dist/index.js +115 -156
  29. package/dist/metrics/prometheus.d.ts +2 -2
  30. package/dist/oidc/id-token-claims.d.ts +9 -10
  31. package/dist/oidc/local-mint.d.ts +9 -12
  32. package/dist/oidc/oidc-mint-registration.d.ts +15 -28
  33. package/dist/oidc/orchestrator-mint.d.ts +10 -10
  34. package/dist/oidc/resolve-signer.d.ts +40 -0
  35. package/dist/orchestrator-core.d.ts +11 -0
  36. package/dist/pipeline/dispatch-matched-workflow.d.ts +1 -2
  37. package/dist/pipeline/job-contexts.d.ts +2 -2
  38. package/dist/provenance/attestation-retrier.d.ts +11 -1
  39. package/dist/provenance/retrier-mint.d.ts +35 -0
  40. package/dist/providers/github/normalizer.d.ts +1 -28
  41. package/dist/providers/local/lock-file-fetcher.d.ts +8 -0
  42. package/dist/providers/local/normalizer.d.ts +1 -15
  43. package/dist/queue/job-queue.d.ts +2 -6
  44. package/dist/queue/terminalize-unroutable.d.ts +1 -1
  45. package/dist/reporting/execution-tracker.d.ts +107 -0
  46. package/dist/scaler/claim-store.d.ts +0 -2
  47. package/dist/scaler/event-backend.d.ts +7 -6
  48. package/dist/scaler/label-matcher.d.ts +0 -1
  49. package/dist/scaler/manager.d.ts +20 -26
  50. package/dist/scaler/scaler-state-store.d.ts +9 -2
  51. package/dist/scaler/types.d.ts +10 -0
  52. package/dist/scaler/warm-pool.d.ts +6 -4
  53. package/dist/security/global-workflow-policy.d.ts +3 -28
  54. package/dist/security/identity-link.d.ts +1 -1
  55. package/dist/security/lock-source.d.ts +1 -1
  56. package/dist/security/trust-directory-store.d.ts +1 -1
  57. package/dist/security/trust-policy-gate.d.ts +0 -14
  58. package/dist/security/trust-policy-store.d.ts +2 -3
  59. package/dist/security/trust-resolver.d.ts +1 -2
  60. package/dist/server.js +2810 -2524
  61. package/dist/stale-detector/all-terminal-runs.d.ts +31 -0
  62. package/dist/stale-detector/stale-run-detector.d.ts +20 -0
  63. package/dist/standalone.js +2956 -2610
  64. package/dist/webhook/ingest-overflow-replayer.d.ts +1 -1
  65. package/dist/webhook/relay-reinject.d.ts +1 -1
  66. package/dist/worker/in-memory-job-queue.d.ts +9 -0
  67. package/dist/ws/dashboard-global-workflows-handler.d.ts +3 -4
  68. package/dist/ws/fleet-agent-collector.d.ts +7 -0
  69. package/dist/ws/platform-client.d.ts +0 -15
  70. package/dist/ws/test-relay-handlers.d.ts +2 -0
  71. package/installer-image-digests.json +3 -3
  72. package/package.json +18 -17
  73. package/sbom.spdx.json +1178 -1352
  74. package/dist/ws/oidc-token-relay.d.ts +0 -79
  75. package/dist/ws/orch-rpc.d.ts +0 -9
@@ -15,11 +15,9 @@ interface GlobalWorkflowPermission {
15
15
  * off — or the cluster row is unreadable, which fails closed — no repo may
16
16
  * register or dispatch a global workflow, whatever the per-org lists say.
17
17
  *
18
- * With the switch on, three independent per-org axes apply (each stored as a
18
+ * With the switch on, two independent per-org axes apply (each stored as a
19
19
  * jsonb array of `{routingKey?, pattern}` entries on `org_settings`). A missing
20
- * `org_settings` row means "no per-org restrictions" for the repo and source
21
- * axes, not a denial; elevated access still requires an explicit list, so a
22
- * missing row grants none.
20
+ * `org_settings` row means "no per-org restrictions", not a denial.
23
21
  *
24
22
  * - Workflow-repo allow-list (`global_workflow_allowed_repos`): which repos
25
23
  * may author global workflows. null/empty = any repo. Checked at
@@ -31,9 +29,6 @@ interface GlobalWorkflowPermission {
31
29
  * untrusted contrib repos). Checked at dispatch time against the EVENT's
32
30
  * repo (the repo that emitted the webhook).
33
31
  *
34
- * - Elevated access (`global_workflow_elevated_repos`): which workflow-
35
- * authoring repos can read source-repo secrets during execution.
36
- *
37
32
  * Each entry can optionally pin a `routingKey`, restricting the entry to
38
33
  * one webhook source. An entry without a routing key applies to any source
39
34
  * in the org. An entry whose routing key no longer matches any current
@@ -53,7 +48,7 @@ export declare class GlobalWorkflowPolicy {
53
48
  * The fleet-wide master gate, consulted before any per-org list.
54
49
  *
55
50
  * Returns `undefined` when the gate passes, or the denial to return
56
- * verbatim when it does not — so all three axes share one decision and one
51
+ * verbatim when it does not — so both axes share one decision and one
57
52
  * pair of reasons.
58
53
  *
59
54
  * Fails closed on `{ ok: false }`. That case is a database fault, not an
@@ -86,26 +81,6 @@ export declare class GlobalWorkflowPolicy {
86
81
  * key AND whose pattern matches the source repo → not allowed.
87
82
  */
88
83
  isSourceRepoAllowed(eventRoutingKey: string, sourceRepoIdentifier: string, customerId: string): Promise<GlobalWorkflowPermission>;
89
- /**
90
- * Check whether a workflow-authoring repository is on the elevated-access
91
- * list. The workflow's routing key is matched against each entry's optional
92
- * `routingKey` qualifier. Returns false if no org_settings row or the
93
- * elevated list is null/empty.
94
- *
95
- * @deprecated Not enforced, and not enforceable in this shape. It was meant
96
- * to gate a global workflow's job reading the *source* repository's secrets,
97
- * but the organization-wide dispatch path resolves no secrets at all — it
98
- * binds no secret contexts, and writes no secret material into a job config
99
- * (asserted by `pipeline/process-webhook-globals-secrets.test.ts`). So there
100
- * is no injection for a grant to widen, and this method has no caller.
101
- *
102
- * Granting it would not be a matter of calling this from the dispatch path:
103
- * secrets are stored `(org_id, scope, key)` with no repository dimension, so
104
- * "the source repository's secrets" is not a set the orchestrator can name
105
- * today. The list, its admin route, its CLI mutators and its wire field are
106
- * deprecated pending removal at v1.0.0 (`docs/user/deprecations.md`).
107
- */
108
- isElevatedAccessAllowed(workflowRoutingKey: string, repoIdentifier: string, customerId: string): Promise<boolean>;
109
84
  private getSettings;
110
85
  }
111
86
  export {};
@@ -40,7 +40,7 @@ export interface IdentityLink {
40
40
  * the answer is unambiguous; when they disagree there is no way to tell here
41
41
  * which provider serves the commit, so this answers undefined rather than
42
42
  * naming the wrong account. Undefined is a safe answer at every call site: the
43
- * attribution is simply omitted, never replaced by the raw subject id.
43
+ * attribution is omitted, never replaced by the raw subject id.
44
44
  */
45
45
  export declare function resolveLinkedUsername(identityLinks: IdentityLink[], userId: string): string | undefined;
46
46
  /**
@@ -18,7 +18,7 @@ import type { TrustTier } from '@kici-dev/engine';
18
18
  * Select which branch's lock file to fetch.
19
19
  *
20
20
  * Invariant (customer-isolation): for any pull-request event, an
21
- * untrusted ref (`tier === 'unknown' | 'known' | undefined`) MUST NOT
21
+ * untrusted ref (`tier === 'unknown' | undefined`) MUST NOT
22
22
  * have its HEAD lock file evaluated by the orchestrator. The
23
23
  * base-branch lock — controlled by the project's trusted maintainers —
24
24
  * is the source of truth for trigger evaluation, trust-tier-based
@@ -64,7 +64,7 @@ import type { Database } from '../db/types.js';
64
64
  * What it does not pin: the field *set*. A fourth directory field added to
65
65
  * `trustPolicyUpdateSchema` is not picked up here, and `server.ts` hand-builds
66
66
  * the value it passes to `upsertFromPlatform`, so nothing would fail — the new
67
- * field would simply go unpersisted. Adding one means extending this object and
67
+ * field would go unpersisted. Adding one means extending this object and
68
68
  * that literal together.
69
69
  */
70
70
  export declare const trustDirectorySchema: z.ZodObject<{
@@ -22,20 +22,6 @@ import { ForkPolicy } from '@kici-dev/engine';
22
22
  import type { OrchestratorMode, TrustPolicy, TrustTier } from '@kici-dev/engine';
23
23
  import { SecurityHoldReason } from '../contexts/held-runs.js';
24
24
  import type { StoredTrustPolicy } from './trust-policy-store.js';
25
- /**
26
- * The enforcement vocabulary the admin API reports and `kici-admin
27
- * trust-policy show` renders.
28
- *
29
- * @deprecated The route reports `policy` unconditionally: `resolveEffectivePolicy`
30
- * returns a policy for every input, so there is no state left in which the
31
- * values are absent. The field and this enum stay so an older `kici-admin`
32
- * binary keeps parsing the response. Removed at v1.0.0.
33
- */
34
- export declare const TrustPolicyEnforcement: z.ZodEnum<{
35
- legacy: "legacy";
36
- policy: "policy";
37
- }>;
38
- export type TrustPolicyEnforcement = z.infer<typeof TrustPolicyEnforcement>;
39
25
  /** The per-PR facts the fork switch is evaluated against. */
40
26
  export interface TrustPolicySignals {
41
27
  /** Resolved contributor tier; undefined when no tier was resolved. */
@@ -52,9 +52,8 @@ export declare class TrustPolicyStore {
52
52
  * COMMITTED two concurrent PATCHes both read the pre-existing row, and the
53
53
  * second `ON CONFLICT DO UPDATE` then overwrites every column from its own
54
54
  * stale merge — silently dropping the first operator's change (a tightened
55
- * `unknownContributorPolicy` reverting to whatever the second caller last
56
- * saw). The lock releases on commit or rollback, so there is no unlock to
57
- * leak.
55
+ * `forkPolicy` reverting to whatever the second caller last saw). The lock
56
+ * releases on commit or rollback, so there is no unlock to leak.
58
57
  *
59
58
  * `onWrite` receives the same transaction and the merged result, so an audit
60
59
  * row written there commits or rolls back with the policy itself — a
@@ -7,8 +7,7 @@
7
7
  * provider API call, no identity lookup.
8
8
  *
9
9
  * The stored/wire tier vocabulary keeps 'unknown' as the name for
10
- * "untrusted" and 'trusted' for "trusted"; 'known' is legacy vocabulary
11
- * that is no longer produced.
10
+ * "untrusted" and 'trusted' for "trusted".
12
11
  */
13
12
  import type { TrustTier } from '@kici-dev/engine';
14
13
  /** Result of ref-based trust resolution, with the reason recorded for audit. */