@kici-dev/orchestrator 0.5.0 → 0.6.1

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 (149) hide show
  1. package/dist/__test-helpers__/fake-scaler-state-store.d.ts +24 -0
  2. package/dist/__test-helpers__/mock-db-query.d.ts +130 -0
  3. package/dist/__test-helpers__/mock-db.d.ts +23 -0
  4. package/dist/agent/dispatcher.d.ts +81 -13
  5. package/dist/agent/host-roster.d.ts +37 -5
  6. package/dist/agent/registry.d.ts +2 -0
  7. package/dist/app.d.ts +33 -6
  8. package/dist/approvals/apply-decision.d.ts +67 -19
  9. package/dist/approvals/held-run-release-wiring.d.ts +45 -0
  10. package/dist/approvals/independent-wiring.d.ts +55 -0
  11. package/dist/approvals/resume-router.d.ts +9 -0
  12. package/dist/approvals/triggerer-subject.d.ts +37 -0
  13. package/dist/cache/dep-cache.d.ts +54 -10
  14. package/dist/cache/global-eval-round-cache.d.ts +7 -0
  15. package/dist/cli/api-client.d.ts +18 -0
  16. package/dist/cli/commands/cluster-settings.d.ts +11 -0
  17. package/dist/cli/commands/diagnose.d.ts +6 -0
  18. package/dist/cli/commands/held-run.d.ts +58 -0
  19. package/dist/cli/commands/trust-policy.d.ts +117 -12
  20. package/dist/cli/kici-admin.d.ts +10 -0
  21. package/dist/cli.js +2272 -1025
  22. package/dist/cluster/cluster-identity.d.ts +3 -3
  23. package/dist/cluster/cluster-settings-reader.d.ts +7 -1
  24. package/dist/cluster/coordinator.d.ts +44 -0
  25. package/dist/cluster/index.d.ts +4 -0
  26. package/dist/cluster/peer-handler.d.ts +19 -0
  27. package/dist/cluster/peer-registry.d.ts +17 -0
  28. package/dist/cluster/plan-headroom-store.d.ts +26 -0
  29. package/dist/cluster/worker-eviction.d.ts +69 -0
  30. package/dist/cold-store/load-event-log-range.d.ts +10 -3
  31. package/dist/cold-store/load-secret-audit-log-range.d.ts +4 -3
  32. package/dist/cold-store/tables/secret-audit-log.d.ts +4 -3
  33. package/dist/config.d.ts +21 -21
  34. package/dist/contexts/held-runs.d.ts +123 -16
  35. package/dist/contexts/protection/aggregate.d.ts +3 -2
  36. package/dist/contexts/protection/branch-gate.d.ts +15 -0
  37. package/dist/contexts/protection/concurrency-gate.d.ts +8 -2
  38. package/dist/contexts/protection/pipeline.d.ts +18 -0
  39. package/dist/contexts/release-queued-holds.d.ts +35 -0
  40. package/dist/dashboard/attestation-filters.d.ts +8 -0
  41. package/dist/dashboard/handler.d.ts +6 -24
  42. package/dist/db/migrations/116_org_plan_headroom.d.ts +4 -0
  43. package/dist/db/migrations/117_invoke_gate_proxy_jobs.d.ts +4 -0
  44. package/dist/db/migrations/118_invoke_gate_scheduling.d.ts +4 -0
  45. package/dist/db/migrations/119_scaler_ha_ownership.d.ts +4 -0
  46. package/dist/db/migrations/120_cluster_settings_scaler_reaper.d.ts +4 -0
  47. package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +19 -0
  48. package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +25 -0
  49. package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +24 -0
  50. package/dist/db/migrations/124_cluster_settings_provision_backoff.d.ts +4 -0
  51. package/dist/db/migrations/125_org_trust_directory.d.ts +30 -0
  52. package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +28 -0
  53. package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +26 -0
  54. package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +23 -0
  55. package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +24 -0
  56. package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +32 -0
  57. package/dist/db/types.d.ts +368 -10
  58. package/dist/entry-helpers.d.ts +28 -0
  59. package/dist/events/event-emitter.d.ts +22 -0
  60. package/dist/events/event-router.d.ts +87 -1
  61. package/dist/events/types.d.ts +2 -23
  62. package/dist/git/credential-broker.d.ts +94 -0
  63. package/dist/git/inherited-secret.d.ts +24 -0
  64. package/dist/git/installation-token.d.ts +38 -0
  65. package/dist/git/job-context.d.ts +13 -0
  66. package/dist/index.js +324 -84
  67. package/dist/metrics/agent-metrics-aggregator.d.ts +2 -2
  68. package/dist/metrics/prometheus.d.ts +111 -3
  69. package/dist/oidc/oidc-mint-registration.d.ts +7 -3
  70. package/dist/orchestrator-core.d.ts +79 -23
  71. package/dist/pipeline/direct-ingress-deps.d.ts +100 -0
  72. package/dist/pipeline/dispatch-matched-workflow.d.ts +302 -31
  73. package/dist/pipeline/global-eval-round.d.ts +14 -0
  74. package/dist/pipeline/internal-event-pipeline.d.ts +140 -0
  75. package/dist/pipeline/invoke-gate.d.ts +164 -0
  76. package/dist/pipeline/needs-scheduler.d.ts +13 -0
  77. package/dist/pipeline/process-webhook.d.ts +119 -31
  78. package/dist/pipeline/processor.d.ts +226 -21
  79. package/dist/pipeline/rerun.d.ts +21 -0
  80. package/dist/pipeline/resume-workflow.d.ts +40 -7
  81. package/dist/pipeline/route-or-dispatch-jobs.d.ts +9 -0
  82. package/dist/pipeline/security-hold-check.d.ts +217 -0
  83. package/dist/pipeline/undispatched-hold-checks.d.ts +23 -0
  84. package/dist/policy/dashboard-write-policy-listener.d.ts +62 -0
  85. package/dist/policy/dashboard-write-policy.d.ts +14 -0
  86. package/dist/provider-registry.d.ts +10 -2
  87. package/dist/providers/github/check-status-poster.d.ts +11 -0
  88. package/dist/providers/github/index.d.ts +0 -2
  89. package/dist/providers/github/normalizer.d.ts +3 -2
  90. package/dist/providers/local/normalizer.d.ts +3 -5
  91. package/dist/providers/universal-git/index.d.ts +11 -2
  92. package/dist/queue/job-queue.d.ts +43 -1
  93. package/dist/registration/extractor.d.ts +3 -3
  94. package/dist/registration/registration-index.d.ts +7 -0
  95. package/dist/registration/registration-store.d.ts +22 -0
  96. package/dist/reporting/check-run-reporter.d.ts +94 -1
  97. package/dist/reporting/check-run-summary.d.ts +25 -1
  98. package/dist/reporting/execution-tracker.d.ts +207 -2
  99. package/dist/reporting/run-aggregator.d.ts +4 -14
  100. package/dist/reporting/step-display-order.d.ts +43 -0
  101. package/dist/routes/admin-held-runs.d.ts +142 -0
  102. package/dist/routes/admin-trust-policy.d.ts +34 -6
  103. package/dist/routes/admin.d.ts +9 -0
  104. package/dist/scaler/backend-factory.d.ts +55 -0
  105. package/dist/scaler/bare-metal-backend.d.ts +43 -5
  106. package/dist/scaler/claim-store.d.ts +119 -0
  107. package/dist/scaler/config.d.ts +4 -0
  108. package/dist/scaler/container-backend.d.ts +18 -4
  109. package/dist/scaler/container-routing.d.ts +23 -0
  110. package/dist/scaler/container-spawn.d.ts +28 -0
  111. package/dist/scaler/event-backend.d.ts +124 -0
  112. package/dist/scaler/event-provision-reaper.d.ts +350 -0
  113. package/dist/scaler/failure-tracker.d.ts +1 -1
  114. package/dist/scaler/firecracker-backend.d.ts +33 -6
  115. package/dist/scaler/index.d.ts +11 -1
  116. package/dist/scaler/label-matcher.d.ts +4 -3
  117. package/dist/scaler/manager.d.ts +899 -72
  118. package/dist/scaler/resolve-container-auth.d.ts +45 -0
  119. package/dist/scaler/scaler-events.d.ts +11 -0
  120. package/dist/scaler/scaler-state-store.d.ts +294 -10
  121. package/dist/scaler/types.d.ts +131 -13
  122. package/dist/scaler/warm-pool.d.ts +132 -29
  123. package/dist/security/comment-handler.d.ts +50 -11
  124. package/dist/security/identity-link.d.ts +60 -0
  125. package/dist/security/lock-source.d.ts +11 -13
  126. package/dist/security/reduced-privilege-note.d.ts +59 -0
  127. package/dist/security/trust-directory-store.d.ts +233 -0
  128. package/dist/security/trust-policy-gate.d.ts +94 -59
  129. package/dist/security/trust-policy-store.d.ts +3 -0
  130. package/dist/security/trust-resolver.d.ts +14 -98
  131. package/dist/server.d.ts +11 -1
  132. package/dist/server.js +17684 -7351
  133. package/dist/stale-detector/gate-deadline-detector.d.ts +52 -0
  134. package/dist/stale-detector/stale-run-detector.d.ts +61 -3
  135. package/dist/standalone.js +24238 -13822
  136. package/dist/worker/in-memory-job-queue.d.ts +1 -1
  137. package/dist/ws/agent-handler.d.ts +28 -4
  138. package/dist/ws/dashboard-context-handler.d.ts +28 -4
  139. package/dist/ws/dashboard-global-workflows-handler.d.ts +6 -0
  140. package/dist/ws/failure-messages.d.ts +2 -0
  141. package/dist/ws/git-credential-relay.d.ts +39 -0
  142. package/dist/ws/oidc-token-relay.d.ts +6 -11
  143. package/dist/ws/platform-client.d.ts +54 -9
  144. package/installer-image-digests.json +3 -3
  145. package/package.json +24 -19
  146. package/sbom.spdx.json +864 -822
  147. package/dist/approvals/team-membership-lookup.d.ts +0 -13
  148. package/dist/providers/github/contributor-resolver.d.ts +0 -30
  149. package/dist/security/contributor-cache.d.ts +0 -83
@@ -1,13 +0,0 @@
1
- /**
2
- * Read-only lookup over the team memberships pushed from the Platform via
3
- * `trust_policy.update`. The orchestrator has no identity store, so this is the
4
- * only source of "who is in team X" — the approval resolver uses it to satisfy
5
- * `{team}` approver clauses.
6
- */
7
- export interface TeamMembershipLookup {
8
- /** Returns the set of member user ids for a team name (empty if unknown). */
9
- getTeamMembers(name: string): Set<string>;
10
- }
11
- /** A lookup backed by no teams — the default before any push arrives. */
12
- export declare const EMPTY_TEAM_MEMBERSHIP_LOOKUP: TeamMembershipLookup;
13
- //# sourceMappingURL=team-membership-lookup.d.ts.map
@@ -1,30 +0,0 @@
1
- /**
2
- * GitHub ContributorResolver implementation.
3
- *
4
- * Resolves contributor permissions by querying the GitHub API for
5
- * collaborator permission levels on a repository.
6
- */
7
- import type { ContributorResolver, ContributorInfo } from '@kici-dev/engine';
8
- import { type GitHubAppConfig } from './auth.js';
9
- /**
10
- * GitHub-specific implementation of ContributorResolver.
11
- *
12
- * Uses the GitHub API to check a user's permission level on a repository.
13
- * Handles 403 (insufficient app permissions) and 404 (not a collaborator)
14
- * gracefully by returning 'none' permission.
15
- */
16
- export declare class GitHubContributorResolver implements ContributorResolver {
17
- private readonly config;
18
- readonly provider: 'github';
19
- constructor(config: GitHubAppConfig);
20
- /**
21
- * Resolve a contributor's permission level on a GitHub repository.
22
- *
23
- * @param repoIdentifier - "owner/repo" format
24
- * @param username - GitHub username
25
- * @param credentials - GitHubCredentials with installationId
26
- * @returns ContributorInfo with mapped permission level
27
- */
28
- resolveContributor(repoIdentifier: string, username: string, credentials: unknown): Promise<ContributorInfo>;
29
- }
30
- //# sourceMappingURL=contributor-resolver.d.ts.map
@@ -1,83 +0,0 @@
1
- /**
2
- * LRU cache wrapper for ContributorResolver.
3
- *
4
- * Caches contributor permission lookups to prevent redundant API calls.
5
- * Uses a 15-minute TTL and 10,000 max entries.
6
- */
7
- import type { ContributorResolver, ContributorInfo } from '@kici-dev/engine';
8
- import type { ClusterSettingsReader } from '../cluster/cluster-settings-reader.js';
9
- /**
10
- * Caches ContributorResolver results in an LRU cache.
11
- *
12
- * Cache key format: `{provider}:{repoFullName}:{username}`
13
- * TTL: cluster-configurable (`cluster_settings.contributor_cache_ttl_ms`,
14
- * default 15 minutes). The TTL is resolved at each `set()` and applied
15
- * per-entry, so a live override affects newly-cached entries without a restart.
16
- */
17
- export declare class ContributorCache {
18
- private readonly cache;
19
- private readonly clusterSettings?;
20
- private readonly defaultTtlMs;
21
- constructor(options?: {
22
- ttlMs?: number;
23
- maxEntries?: number;
24
- clusterSettings?: ClusterSettingsReader;
25
- });
26
- /** Resolve the fleet-wide contributor-cache TTL (ms), falling back to the config default. */
27
- private ttlMs;
28
- /**
29
- * Build the cache key from provider, repo, and username.
30
- */
31
- private buildKey;
32
- /**
33
- * Resolve contributor info, using cache when available.
34
- *
35
- * @param provider - Provider identifier (e.g. 'github')
36
- * @param repoFullName - Full repo identifier (e.g. 'owner/repo')
37
- * @param username - Contributor username
38
- * @param resolver - ContributorResolver to call on cache miss
39
- * @param credentials - Provider credentials for API calls
40
- * @returns Cached or freshly resolved ContributorInfo
41
- */
42
- resolve(provider: string, repoFullName: string, username: string, resolver: ContributorResolver, credentials: unknown): Promise<ContributorInfo>;
43
- /**
44
- * Explicitly invalidate a cached entry.
45
- *
46
- * @returns 1 if an entry was present and deleted, 0 otherwise. Symmetric
47
- * with the bulk invalidators so callers can accumulate a total.
48
- */
49
- invalidate(provider: string, repoFullName: string, username: string): number;
50
- /**
51
- * Invalidate every cached entry for a specific repository.
52
- *
53
- * Scans the LRU (bounded to `maxEntries`) and deletes entries whose key
54
- * prefix matches `{provider}:{repoFullName}:`. Used when a webhook event
55
- * signals a repo-wide permission change (e.g. GitHub `team.added_to_repository`
56
- * / `team.removed_from_repository`) where every contributor's effective
57
- * permission on that repo may have shifted.
58
- *
59
- * @returns Number of entries deleted.
60
- */
61
- invalidateByRepo(provider: string, repoFullName: string): number;
62
- /**
63
- * Invalidate every cached entry for a user across all repositories in an org.
64
- *
65
- * Scans the LRU and deletes entries whose key matches
66
- * `{provider}:{orgLogin}/*:{username}`. Used when a webhook event signals
67
- * that a user's membership in an org changed (e.g. GitHub `organization`,
68
- * `membership` events), since any repo under that org could now return a
69
- * different permission for the user.
70
- *
71
- * @returns Number of entries deleted.
72
- */
73
- invalidateByUserInOrg(provider: string, orgLogin: string, username: string): number;
74
- /**
75
- * Clear all cached entries. Useful for testing.
76
- */
77
- clear(): void;
78
- /**
79
- * Get the current number of cached entries.
80
- */
81
- get size(): number;
82
- }
83
- //# sourceMappingURL=contributor-cache.d.ts.map