@intentius/chant 0.124.96 → 0.124.98

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 (237) hide show
  1. package/dist/audit/core.d.ts +29 -0
  2. package/dist/audit/core.d.ts.map +1 -1
  3. package/dist/audit/core.js +48 -11
  4. package/dist/audit/identity.d.ts +27 -0
  5. package/dist/audit/identity.d.ts.map +1 -0
  6. package/dist/audit/identity.js +36 -0
  7. package/dist/audit/report-html.d.ts +3 -1
  8. package/dist/audit/report-html.d.ts.map +1 -1
  9. package/dist/audit/report-html.js +1 -1
  10. package/dist/audit/report-model.d.ts +16 -0
  11. package/dist/audit/report-model.d.ts.map +1 -1
  12. package/dist/audit/report-model.js +5 -1
  13. package/dist/change-set-graph.d.ts +3 -1
  14. package/dist/change-set-graph.d.ts.map +1 -1
  15. package/dist/change-set-graph.js +7 -1
  16. package/dist/change-set.d.ts +5 -2
  17. package/dist/change-set.d.ts.map +1 -1
  18. package/dist/change-set.js +6 -3
  19. package/dist/ci-agent.d.ts +17 -0
  20. package/dist/ci-agent.d.ts.map +1 -1
  21. package/dist/ci-agent.js +32 -0
  22. package/dist/ci-comment-allow.d.ts +88 -0
  23. package/dist/ci-comment-allow.d.ts.map +1 -0
  24. package/dist/ci-comment-allow.js +178 -0
  25. package/dist/ci-comment-commands.d.ts +12 -0
  26. package/dist/ci-comment-commands.d.ts.map +1 -1
  27. package/dist/ci-comment-commands.js +22 -0
  28. package/dist/ci-control.d.ts +6 -1
  29. package/dist/ci-control.d.ts.map +1 -1
  30. package/dist/ci-control.js +6 -1
  31. package/dist/ci-product.d.ts +3 -0
  32. package/dist/ci-product.d.ts.map +1 -1
  33. package/dist/ci-product.js +3 -0
  34. package/dist/cli/commands/audit.d.ts +3 -1
  35. package/dist/cli/commands/audit.d.ts.map +1 -1
  36. package/dist/cli/commands/audit.js +23 -6
  37. package/dist/cli/commands/import.d.ts +8 -1
  38. package/dist/cli/commands/import.d.ts.map +1 -1
  39. package/dist/cli/commands/import.js +31 -6
  40. package/dist/cli/handlers/agent.d.ts.map +1 -1
  41. package/dist/cli/handlers/agent.js +12 -2
  42. package/dist/cli/handlers/pr-comment.d.ts +6 -0
  43. package/dist/cli/handlers/pr-comment.d.ts.map +1 -1
  44. package/dist/cli/handlers/pr-comment.js +12 -0
  45. package/dist/cli/handlers/promote.d.ts.map +1 -1
  46. package/dist/cli/handlers/promote.js +53 -6
  47. package/dist/cli/main.d.ts.map +1 -1
  48. package/dist/cli/main.js +29 -6
  49. package/dist/cli/parse-args.d.ts.map +1 -1
  50. package/dist/cli/parse-args.js +23 -0
  51. package/dist/cli/registry.d.ts +8 -0
  52. package/dist/cli/registry.d.ts.map +1 -1
  53. package/dist/cloud-lister/mask.d.ts +30 -1
  54. package/dist/cloud-lister/mask.d.ts.map +1 -1
  55. package/dist/cloud-lister/mask.js +66 -3
  56. package/dist/components/driver.d.ts +8 -1
  57. package/dist/components/driver.d.ts.map +1 -1
  58. package/dist/components/driver.js +1 -0
  59. package/dist/components/product-pipeline.d.ts +23 -1
  60. package/dist/components/product-pipeline.d.ts.map +1 -1
  61. package/dist/components/product-pipeline.js +40 -7
  62. package/dist/components/product-plan.d.ts +20 -0
  63. package/dist/components/product-plan.d.ts.map +1 -1
  64. package/dist/components/product-plan.js +11 -1
  65. package/dist/control/applied.d.ts +8 -1
  66. package/dist/control/applied.d.ts.map +1 -1
  67. package/dist/control/applied.js +18 -2
  68. package/dist/control/dispatch.d.ts +52 -0
  69. package/dist/control/dispatch.d.ts.map +1 -1
  70. package/dist/control/dispatch.js +140 -4
  71. package/dist/control/train.d.ts +198 -0
  72. package/dist/control/train.d.ts.map +1 -0
  73. package/dist/control/train.js +294 -0
  74. package/dist/deep-observation.js +2 -2
  75. package/dist/floor-table.data.d.ts.map +1 -1
  76. package/dist/floor-table.data.js +7 -1
  77. package/dist/graph-detail.d.ts +9 -0
  78. package/dist/graph-detail.d.ts.map +1 -1
  79. package/dist/graph-detail.js +38 -13
  80. package/dist/graph-refs.d.ts +233 -3
  81. package/dist/graph-refs.d.ts.map +1 -1
  82. package/dist/graph-refs.js +106 -15
  83. package/dist/lint/post-synth.d.ts +22 -0
  84. package/dist/lint/post-synth.d.ts.map +1 -1
  85. package/dist/lint/rules/declarable-naming-convention.d.ts +12 -0
  86. package/dist/lint/rules/declarable-naming-convention.d.ts.map +1 -1
  87. package/dist/lint/rules/declarable-naming-convention.js +38 -8
  88. package/dist/lint/rules/imported-source.d.ts +20 -0
  89. package/dist/lint/rules/imported-source.d.ts.map +1 -0
  90. package/dist/lint/rules/imported-source.js +27 -0
  91. package/dist/lint/rules/no-unused-declarable.d.ts.map +1 -1
  92. package/dist/lint/rules/no-unused-declarable.js +3 -0
  93. package/dist/op/gate.d.ts +2 -0
  94. package/dist/op/gate.d.ts.map +1 -1
  95. package/dist/op/gate.js +8 -1
  96. package/dist/pr-forge-reads.d.ts +17 -0
  97. package/dist/pr-forge-reads.d.ts.map +1 -1
  98. package/dist/pr-forge-reads.js +55 -0
  99. package/dist/reconcile.d.ts +9 -0
  100. package/dist/reconcile.d.ts.map +1 -1
  101. package/dist/release-floors.d.ts +9 -1
  102. package/dist/release-floors.d.ts.map +1 -1
  103. package/dist/release-floors.js +10 -2
  104. package/dist/repo-path.d.ts +29 -0
  105. package/dist/repo-path.d.ts.map +1 -0
  106. package/dist/repo-path.js +81 -0
  107. package/dist/sensitive-key.d.ts +23 -0
  108. package/dist/sensitive-key.d.ts.map +1 -1
  109. package/dist/sensitive-key.js +37 -0
  110. package/dist/terraform/hcl2json.d.ts +7 -0
  111. package/dist/terraform/hcl2json.d.ts.map +1 -1
  112. package/dist/terraform/hcl2json.js +7 -0
  113. package/dist/wave-runtime.mjs +352 -345
  114. package/dist/workspace/catalog-edges.d.ts +147 -0
  115. package/dist/workspace/catalog-edges.d.ts.map +1 -0
  116. package/dist/workspace/catalog-edges.js +461 -0
  117. package/dist/workspace/compose-graph.d.ts +73 -3
  118. package/dist/workspace/compose-graph.d.ts.map +1 -1
  119. package/dist/workspace/declaration.d.ts +2 -0
  120. package/dist/workspace/declaration.d.ts.map +1 -1
  121. package/dist/workspace/declaration.js +1 -0
  122. package/dist/workspace/declaration.schema.json +6 -0
  123. package/dist/workspace/discover.d.ts +134 -0
  124. package/dist/workspace/discover.d.ts.map +1 -0
  125. package/dist/workspace/discover.js +372 -0
  126. package/dist/workspace/graph-cli.d.ts +20 -0
  127. package/dist/workspace/graph-cli.d.ts.map +1 -1
  128. package/dist/workspace/graph-cli.js +178 -20
  129. package/dist/workspace/graph.schema.json +195 -2
  130. package/dist/workspace/release-train.d.ts +214 -3
  131. package/dist/workspace/release-train.d.ts.map +1 -1
  132. package/dist/workspace/release-train.js +552 -16
  133. package/dist/workspace/repo-ref.d.ts +14 -0
  134. package/dist/workspace/repo-ref.d.ts.map +1 -1
  135. package/dist/workspace/repo-ref.js +26 -1
  136. package/dist/workspace/workspace-gates.d.ts +24 -0
  137. package/dist/workspace/workspace-gates.d.ts.map +1 -1
  138. package/dist/workspace/workspace-gates.js +29 -5
  139. package/dist/workspace/workspace-ledger.d.ts +31 -5
  140. package/dist/workspace/workspace-ledger.d.ts.map +1 -1
  141. package/dist/workspace/workspace-ledger.js +2 -1
  142. package/dist/workspace/workspace-run.d.ts +14 -0
  143. package/dist/workspace/workspace-run.d.ts.map +1 -1
  144. package/dist/workspace/workspace-run.js +2 -2
  145. package/dist/yaml.d.ts.map +1 -1
  146. package/dist/yaml.js +33 -8
  147. package/package.json +1 -1
  148. package/src/audit/core.test.ts +64 -1
  149. package/src/audit/core.ts +75 -10
  150. package/src/audit/identity.test.ts +31 -0
  151. package/src/audit/identity.ts +43 -0
  152. package/src/audit/report-html.ts +4 -2
  153. package/src/audit/report-model.ts +21 -1
  154. package/src/change-set-graph.test.ts +33 -1
  155. package/src/change-set-graph.ts +7 -1
  156. package/src/change-set.ts +6 -3
  157. package/src/ci-agent.test.ts +32 -0
  158. package/src/ci-agent.ts +42 -0
  159. package/src/ci-comment-allow.test.ts +380 -0
  160. package/src/ci-comment-allow.ts +184 -0
  161. package/src/ci-comment-commands.ts +25 -0
  162. package/src/ci-control.ts +42 -0
  163. package/src/ci-product.ts +3 -0
  164. package/src/cli/commands/audit-parser-notice.test.ts +74 -0
  165. package/src/cli/commands/audit.test.ts +12 -0
  166. package/src/cli/commands/audit.ts +25 -7
  167. package/src/cli/commands/import-layout.test.ts +2 -1
  168. package/src/cli/commands/import.ts +29 -6
  169. package/src/cli/handlers/agent.ts +13 -2
  170. package/src/cli/handlers/pr-before-merge.test.ts +18 -0
  171. package/src/cli/handlers/pr-comment.ts +12 -0
  172. package/src/cli/handlers/promote.test.ts +68 -0
  173. package/src/cli/handlers/promote.ts +52 -6
  174. package/src/cli/main.test.ts +5 -0
  175. package/src/cli/main.ts +29 -6
  176. package/src/cli/parse-args.ts +18 -0
  177. package/src/cli/registry.ts +8 -0
  178. package/src/cloud-lister/kubernetes.k3d.e2e.test.ts +104 -0
  179. package/src/cloud-lister/mask-references.test.ts +132 -0
  180. package/src/cloud-lister/mask.ts +68 -3
  181. package/src/components/driver.ts +9 -1
  182. package/src/components/product-pipeline.ts +57 -7
  183. package/src/components/product-plan.ts +27 -2
  184. package/src/control/applied.ts +33 -3
  185. package/src/control/dispatch.ts +156 -5
  186. package/src/control/train.test.ts +215 -0
  187. package/src/control/train.ts +413 -0
  188. package/src/deep-observation.ts +2 -2
  189. package/src/floor-table.data.ts +7 -1
  190. package/src/graph-detail.ts +37 -12
  191. package/src/graph-refs.test.ts +45 -1
  192. package/src/graph-refs.ts +321 -14
  193. package/src/lint/post-synth.ts +20 -0
  194. package/src/lint/rules/declarable-naming-convention.test.ts +35 -1
  195. package/src/lint/rules/declarable-naming-convention.ts +35 -8
  196. package/src/lint/rules/imported-source.test.ts +22 -0
  197. package/src/lint/rules/imported-source.ts +31 -0
  198. package/src/lint/rules/no-unused-declarable.test.ts +16 -0
  199. package/src/lint/rules/no-unused-declarable.ts +7 -0
  200. package/src/op/gate.ts +10 -2
  201. package/src/pr-forge-reads.ts +62 -0
  202. package/src/reconcile.ts +9 -0
  203. package/src/release-floors.ts +14 -2
  204. package/src/repo-path.test.ts +72 -0
  205. package/src/repo-path.ts +103 -0
  206. package/src/sensitive-key.ts +38 -0
  207. package/src/terraform/hcl2json.ts +8 -0
  208. package/src/workspace/application-set.e2e.test.ts +405 -0
  209. package/src/workspace/catalog-edges.ts +507 -0
  210. package/src/workspace/ci-green-workflow.test.ts +2 -2
  211. package/src/workspace/cluster-join.e2e.test.ts +150 -0
  212. package/src/workspace/compose-graph.ts +74 -5
  213. package/src/workspace/declaration.schema.json +6 -0
  214. package/src/workspace/declaration.ts +3 -0
  215. package/src/workspace/discover.e2e.test.ts +122 -0
  216. package/src/workspace/discover.test.ts +225 -0
  217. package/src/workspace/discover.ts +406 -0
  218. package/src/workspace/drift-reader.test.ts +3 -3
  219. package/src/workspace/external-secret-catalog.e2e.test.ts +98 -0
  220. package/src/workspace/external-secret-catalog.test.ts +142 -0
  221. package/src/workspace/graph-cli.ts +207 -21
  222. package/src/workspace/graph-contract.test.ts +92 -0
  223. package/src/workspace/graph.schema.json +195 -2
  224. package/src/workspace/helm-references.e2e.test.ts +135 -0
  225. package/src/workspace/identity-annotation-catalog.e2e.test.ts +91 -0
  226. package/src/workspace/identity-annotation-catalog.test.ts +139 -0
  227. package/src/workspace/release-train-repos.test.ts +304 -0
  228. package/src/workspace/release-train.test.ts +296 -0
  229. package/src/workspace/release-train.ts +631 -16
  230. package/src/workspace/repo-ref.ts +26 -1
  231. package/src/workspace/runs-on.test.ts +45 -0
  232. package/src/workspace/workspace-gates.ts +48 -5
  233. package/src/workspace/workspace-ledger.ts +28 -5
  234. package/src/workspace/workspace-run.test.ts +1 -1
  235. package/src/workspace/workspace-run.ts +2 -2
  236. package/src/yaml.test.ts +96 -8
  237. package/src/yaml.ts +36 -8
@@ -8,8 +8,35 @@
8
8
  * the one `--pin <member>=<label|digest>` picks. It refuses unless every
9
9
  * `chant` member of the declaration has a release, so a train never leaves a
10
10
  * member out. It is written to `_members/_workspace/<env>/trains.jsonl`.
11
+ *
12
+ * A train's digest (#4037) is over the member release digests and nothing
13
+ * else, so the same picks always give the same train digest, whatever the
14
+ * environment, actor or time. The member releases are named, never copied
15
+ * or changed.
16
+ *
17
+ * `chant workspace train promote <env>` (#4037) promotes a train: each
18
+ * member's `chant components promote --to <env> --release <its digest>`,
19
+ * under the member's own chant, producers first. With `--gate <name>`,
20
+ * every member plans first (`--plan-only`), one workspace gate fact covers
21
+ * each member's release gates with its change set and release, and nothing
22
+ * deploys until `chant workspace run approve <name>` approves it. The
23
+ * promote is a workspace run record that names the train.
24
+ *
25
+ * A train can pin `repo` members too (#5119): each one's releases are read
26
+ * at its pinned revision through that repository's own `chant release list
27
+ * --json`. A train of `repo` members is promoted from the control repo, one
28
+ * member repository at a time: each call dispatches a member, or moves on
29
+ * from its answer in `_control/applied.jsonl` (`--continue`). Each member
30
+ * keeps its own gate (../control/train.ts has the jobs on both sides).
11
31
  */
12
32
  import type { CommandContext } from "../cli/registry.js";
33
+ import type { WorkspaceGraph } from "./compose-graph.js";
34
+ import { type RepoRef } from "./declaration.js";
35
+ import { type WorkspaceRunRecord, type WorkspaceRunStep } from "./workspace-ledger.js";
36
+ import { type WorkspaceGateCover, type WorkspaceGatePending } from "./workspace-gates.js";
37
+ import type { MemberOpResult } from "./workspace-run.js";
38
+ import type { ControlAppliedRecord } from "../control/applied.js";
39
+ import type { TrainDispatch } from "../control/train.js";
13
40
  export interface TrainMember {
14
41
  member: string;
15
42
  releaseDigest: string;
@@ -17,6 +44,15 @@ export interface TrainMember {
17
44
  commit: string;
18
45
  /** The label its newest cut gave it, or null. */
19
46
  label: string | null;
47
+ /**
48
+ * For a member of kind `repo` (#5119): the other repository, its URL with
49
+ * any credential removed, and the revision its releases were read at.
50
+ * Absent for a `chant` member.
51
+ */
52
+ repo?: {
53
+ url: string;
54
+ rev: string;
55
+ };
20
56
  }
21
57
  export interface ReleaseTrainRecord {
22
58
  version: 1;
@@ -26,11 +62,31 @@ export interface ReleaseTrainRecord {
26
62
  actor: string;
27
63
  /** Every `chant` member, by name. */
28
64
  members: TrainMember[];
65
+ /**
66
+ * {@link trainDigest} over `members` (#4037). Absent on a line written
67
+ * before {@link TRAIN_PROMOTE_FLOOR}; {@link readReleaseTrains} computes it then.
68
+ */
69
+ trainDigest?: string;
29
70
  }
71
+ /** A train as read back: its digest is always there. */
72
+ export type ReadTrain = ReleaseTrainRecord & {
73
+ trainDigest: string;
74
+ };
75
+ /**
76
+ * The digest of a train (#4037): over each member's name and release digest,
77
+ * sorted by member. The commit and the label are the release's own, and the
78
+ * release digest already covers the commit, so they stay out, as do the
79
+ * environment, the id, the actor and the time.
80
+ */
81
+ export declare function trainDigest(members: readonly Pick<TrainMember, "member" | "releaseDigest">[]): string;
30
82
  /** What one member offers a train: its releases, newest cut first. */
31
83
  export interface MemberReleases {
32
84
  member: string;
33
85
  releases: TrainMember[];
86
+ /** Why the member's releases could not be read (#5119), which stops the train. */
87
+ problem?: string;
88
+ /** For a `repo` member: where its releases are cut, for the message when it has none. */
89
+ repo?: string;
34
90
  }
35
91
  /**
36
92
  * Pick each member's release, pure. `pins` maps a member to a label or a
@@ -42,12 +98,167 @@ export declare function pickTrain(members: readonly MemberReleases[], pins?: Rea
42
98
  } | {
43
99
  problems: string[];
44
100
  };
45
- /** Every `chant` member's releases, newest cut first, read from its ledger. */
46
- export declare function readMemberReleases(cwd: string): Promise<MemberReleases[]>;
101
+ /** Reads one `repo` member's releases (#5119); {@link readRepoReleases} unless a test passes its own. */
102
+ export type RepoReleasesReader = (member: string, ref: RepoRef, workspaceRoot: string) => Promise<MemberReleases>;
103
+ /**
104
+ * Every `chant` member's releases, newest cut first, read from its ledger,
105
+ * and every `repo` member's, read through that repository's own
106
+ * `chant release list --json` at its pinned revision (#5119).
107
+ */
108
+ export declare function readMemberReleases(cwd: string, opts?: {
109
+ readRepo?: RepoReleasesReader;
110
+ }): Promise<MemberReleases[]>;
111
+ /**
112
+ * The releases of a `repo` member (#5119), read the way its graph is read
113
+ * (#3168): chant fetches the pinned revision into the user's cache, brings
114
+ * that repository's `chant/lifecycle` into the cache clone, and runs
115
+ * `chant release list --json` in the workspace root at the revision, under
116
+ * the chant that resolves there. Nothing is written in the other
117
+ * repository. A read that fails says why, and stops the train.
118
+ */
119
+ export declare function readRepoReleases(member: string, ref: RepoRef, workspaceRoot: string, opts?: {
120
+ env?: NodeJS.ProcessEnv;
121
+ command?: readonly string[];
122
+ }): Promise<MemberReleases>;
47
123
  export declare function readReleaseTrains(cwd: string, env: string): Promise<{
48
- records: ReleaseTrainRecord[];
124
+ records: ReadTrain[];
49
125
  malformed: number;
50
126
  }>;
127
+ /** The train `ref` names, by id or digest, else the newest. Null when there is none. */
128
+ export declare function findTrain(trains: readonly ReadTrain[], ref?: string): ReadTrain | null;
51
129
  export declare function appendReleaseTrain(cwd: string, record: ReleaseTrainRecord): Promise<string>;
130
+ /** The first chant that writes {@link ReleaseTrainRecord.trainDigest} and has `chant workspace train promote` (#4037). */
131
+ export declare const TRAIN_PROMOTE_FLOOR = "0.124.98";
132
+ /** What a step of a train's promote runs in each member: `chant components promote`. */
133
+ export declare const TRAIN_STEP_OP = "components promote";
134
+ /** What `components promote --plan-only --json` prints (#4037). */
135
+ export interface MemberReleasePlan {
136
+ env: string;
137
+ releaseDigest: string;
138
+ label: string | null;
139
+ /** The ledger the member's release gates are recorded in. */
140
+ op: string;
141
+ /** The release gates the promoted compositions declare; empty when none does. */
142
+ gates: string[];
143
+ /** The change-set document's digest, or null when there is no gate to bind it. */
144
+ changeSet: string | null;
145
+ empty: boolean | null;
146
+ components: string[];
147
+ }
148
+ /**
149
+ * The covers a workspace gate needs for one member's release (#4037): one
150
+ * per release gate, bound to the member's change set, the environment and
151
+ * the release. None for an empty change set, which passes without an
152
+ * approval, nor for a promote that declares no gate.
153
+ */
154
+ export declare function releaseCovers(member: string, env: string, plan: MemberReleasePlan): WorkspaceGateCover[];
155
+ export interface TrainPromoteQuery {
156
+ /** The workspace root. */
157
+ cwd: string;
158
+ env: string;
159
+ /** The train, by id or digest; the newest for `env` when absent. */
160
+ train?: string;
161
+ /** The workspace gate every member's release gates wait on together. */
162
+ gate?: string;
163
+ dryRun?: boolean;
164
+ /** Overrides, for tests. */
165
+ readGraph?: (cwd: string) => Promise<{
166
+ graph: WorkspaceGraph;
167
+ failed: boolean;
168
+ } | {
169
+ error: string;
170
+ }>;
171
+ runMember?: (member: {
172
+ name: string;
173
+ dir: string;
174
+ }, argv: string[], env: Record<string, string>) => Promise<MemberOpResult>;
175
+ now?: () => string;
176
+ onOutput?: (target: string, result: MemberOpResult) => void;
177
+ /**
178
+ * A train of `repo` members (#5119): advance the promote in flight from
179
+ * the answers the control repo recorded, and start nothing new.
180
+ */
181
+ continue?: boolean;
182
+ /** Sends one dispatch into a member repository (#5119); {@link defaultTrainDispatcher} unless a test passes its own. */
183
+ dispatch?: TrainDispatcher;
184
+ /** The control repo's apply records (#5119), read from `_control/applied.jsonl` unless a test passes its own. */
185
+ readAnswers?: (cwd: string) => Promise<ControlAppliedRecord[]>;
186
+ /** The member links a train across repositories orders by (#5119), from the declaration unless a test passes its own. */
187
+ readLinks?: (cwd: string) => Promise<WorkspaceGraph["links"]>;
188
+ }
189
+ /** Sends one dispatch into a member repository: the member, its repository's URL, and what the dispatch carries. Throws when it was not taken. */
190
+ export type TrainDispatcher = (member: {
191
+ name: string;
192
+ repo: string;
193
+ }, d: TrainDispatch) => Promise<void>;
194
+ export type TrainPromoteOutcome = {
195
+ kind: "refused";
196
+ message: string;
197
+ } | {
198
+ kind: "planned";
199
+ train: ReadTrain;
200
+ order: string[];
201
+ } | {
202
+ kind: "ran";
203
+ train: ReadTrain;
204
+ record: WorkspaceRunRecord;
205
+ pending: WorkspaceGatePending | null;
206
+ approved: string | null;
207
+ ledgerError: string | null;
208
+ }
209
+ /** #5119: the promote in flight waits on `member`'s answer, and nothing was written. */
210
+ | {
211
+ kind: "waiting";
212
+ train: ReadTrain;
213
+ record: WorkspaceRunRecord;
214
+ member: string;
215
+ }
216
+ /** #5119: `--continue` found no promote of the train in flight. */
217
+ | {
218
+ kind: "idle";
219
+ train: ReadTrain;
220
+ message: string;
221
+ };
222
+ /**
223
+ * Promote a release train (#4037). Each member's release is promoted with
224
+ * `chant components promote --to <env> --release <digest>` under its own
225
+ * chant, producers first, stopping at the first member that does not pass.
226
+ *
227
+ * With a workspace gate, each member plans first and deploys nothing; the
228
+ * covers of every member's release gates are recorded as one pending fact
229
+ * naming the train, and the run ends gated. Once an approval of exactly
230
+ * those covers stands, the same call promotes every member under the gate,
231
+ * so each release gate takes the approval in place of its own where the
232
+ * member opts in at base. A member whose plan moved since then plans a
233
+ * change set the approval does not cover, and stops at its own gate.
234
+ */
235
+ export declare function promoteTrain(query: TrainPromoteQuery): Promise<TrainPromoteOutcome>;
236
+ /** What a step of a train's promote across repositories runs in the member repository: its train job's `chant run --release`. */
237
+ export declare const TRAIN_REPO_STEP_OP = "run --release";
238
+ /** Dispatches with the forge's API and the member's token from the environment ({@link trainTokenEnv}). */
239
+ export declare const defaultTrainDispatcher: TrainDispatcher;
240
+ /** Each run's newest line: a promote across repositories appends its run again as each member answers. */
241
+ export declare function latestRuns(runs: readonly WorkspaceRunRecord[]): WorkspaceRunRecord[];
242
+ /** The workspace runs that promoted each train, as `train list --json` gives them (#4037). */
243
+ export interface TrainPromotion {
244
+ run: string;
245
+ started: string;
246
+ ended: string;
247
+ status: WorkspaceRunRecord["status"];
248
+ gate: string | null;
249
+ /** Each member's step; a step in another repository (#5119) names it, with the member's answer and why a step did not pass. */
250
+ members: Array<{
251
+ member: string;
252
+ status: WorkspaceRunStep["status"];
253
+ memberRun: string | null;
254
+ repo?: string;
255
+ outcome?: string;
256
+ reason?: string;
257
+ }>;
258
+ }
259
+ /** Each train with the runs that promoted it, oldest first. */
260
+ export declare function trainsWithPromotions(trains: readonly ReadTrain[], runs: readonly WorkspaceRunRecord[]): Array<ReadTrain & {
261
+ promotions: TrainPromotion[];
262
+ }>;
52
263
  export declare function runWorkspaceTrain(ctx: CommandContext): Promise<number>;
53
264
  //# sourceMappingURL=release-train.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release-train.d.ts","sourceRoot":"","sources":["../../src/workspace/release-train.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAID,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBhK;AAED,+EAA+E;AAC/E,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAkB/E;AAOD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,C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