@intentius/chant 0.124.100 → 0.124.102

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 (270) hide show
  1. package/dist/action-pins.d.ts +2 -0
  2. package/dist/action-pins.js +3 -0
  3. package/dist/ci-detect.d.ts +13 -0
  4. package/dist/ci-detect.js +12 -0
  5. package/dist/ci-evidence-claims.d.ts +12 -0
  6. package/dist/ci-evidence-claims.js +12 -0
  7. package/dist/ci-system.d.ts +66 -0
  8. package/dist/ci-system.js +61 -0
  9. package/dist/cli/handlers/build.js +27 -0
  10. package/dist/cli/handlers/release-doctor.d.ts +12 -0
  11. package/dist/cli/handlers/release-doctor.js +118 -0
  12. package/dist/cli/handlers/release-init.d.ts +10 -0
  13. package/dist/cli/handlers/release-init.js +374 -0
  14. package/dist/cli/handlers/release.d.ts +43 -2
  15. package/dist/cli/handlers/release.js +667 -39
  16. package/dist/cli/handlers/run-generate.js +11 -0
  17. package/dist/cli/main.d.ts +2 -0
  18. package/dist/cli/main.js +44 -101
  19. package/dist/cli/parse-args.js +48 -0
  20. package/dist/cli/registry.d.ts +16 -0
  21. package/dist/cli/release-commands/artifacts.d.ts +3 -0
  22. package/dist/cli/release-commands/artifacts.js +14 -0
  23. package/dist/cli/release-commands/candidates.d.ts +3 -0
  24. package/dist/cli/release-commands/candidates.js +16 -0
  25. package/dist/cli/release-commands/changed.d.ts +3 -0
  26. package/dist/cli/release-commands/changed.js +14 -0
  27. package/dist/cli/release-commands/compose.d.ts +3 -0
  28. package/dist/cli/release-commands/compose.js +16 -0
  29. package/dist/cli/release-commands/cut.d.ts +3 -0
  30. package/dist/cli/release-commands/cut.js +50 -0
  31. package/dist/cli/release-commands/doctor.d.ts +3 -0
  32. package/dist/cli/release-commands/doctor.js +14 -0
  33. package/dist/cli/release-commands/export.d.ts +3 -0
  34. package/dist/cli/release-commands/export.js +12 -0
  35. package/dist/cli/release-commands/images.d.ts +3 -0
  36. package/dist/cli/release-commands/images.js +13 -0
  37. package/dist/cli/release-commands/index.d.ts +8 -0
  38. package/dist/cli/release-commands/index.js +52 -0
  39. package/dist/cli/release-commands/init.d.ts +3 -0
  40. package/dist/cli/release-commands/init.js +19 -0
  41. package/dist/cli/release-commands/list.d.ts +3 -0
  42. package/dist/cli/release-commands/list.js +10 -0
  43. package/dist/cli/release-commands/next.d.ts +3 -0
  44. package/dist/cli/release-commands/next.js +13 -0
  45. package/dist/cli/release-commands/publish.d.ts +3 -0
  46. package/dist/cli/release-commands/publish.js +22 -0
  47. package/dist/cli/release-commands/stamp.d.ts +3 -0
  48. package/dist/cli/release-commands/stamp.js +15 -0
  49. package/dist/cli/release-commands/status.d.ts +3 -0
  50. package/dist/cli/release-commands/status.js +17 -0
  51. package/dist/cli/release-commands/tag.d.ts +3 -0
  52. package/dist/cli/release-commands/tag.js +12 -0
  53. package/dist/cli/release-commands/types.d.ts +20 -0
  54. package/dist/cli/release-commands/types.js +1 -0
  55. package/dist/cli/release-commands/verify.d.ts +3 -0
  56. package/dist/cli/release-commands/verify.js +15 -0
  57. package/dist/cli/release-commands/workflow.d.ts +3 -0
  58. package/dist/cli/release-commands/workflow.js +15 -0
  59. package/dist/cloud-lister/index.d.ts +4 -1
  60. package/dist/cloud-lister/index.js +2 -1
  61. package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
  62. package/dist/cloud-lister/kubernetes-components.js +642 -0
  63. package/dist/cloud-lister/kubernetes.d.ts +18 -0
  64. package/dist/cloud-lister/kubernetes.js +26 -1
  65. package/dist/cloud-lister/mask.d.ts +5 -1
  66. package/dist/cloud-lister/mask.js +14 -5
  67. package/dist/components/cli-support.d.ts +1 -1
  68. package/dist/components/cli-support.js +1 -1
  69. package/dist/config-environments.d.ts +8 -1
  70. package/dist/config-environments.js +2 -0
  71. package/dist/config-import.d.ts +1 -1
  72. package/dist/config-import.js +6 -2
  73. package/dist/config-sandbox.d.ts +1 -1
  74. package/dist/config-sandbox.js +3 -3
  75. package/dist/config.d.ts +369 -10
  76. package/dist/config.js +127 -7
  77. package/dist/deep-observation.js +9 -3
  78. package/dist/floor-table.data.js +21 -1
  79. package/dist/forge-remote.d.ts +13 -0
  80. package/dist/forge-remote.js +15 -0
  81. package/dist/lexicon.d.ts +45 -4
  82. package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
  83. package/dist/lifecycle/__fixtures__/package-files.js +72 -0
  84. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
  85. package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
  86. package/dist/lifecycle/publish-attachments.d.ts +2 -1
  87. package/dist/lifecycle/publish-attachments.js +19 -2
  88. package/dist/lifecycle/publish-cargo.d.ts +99 -0
  89. package/dist/lifecycle/publish-cargo.js +412 -0
  90. package/dist/lifecycle/publish-credentials.d.ts +1 -1
  91. package/dist/lifecycle/publish-credentials.js +13 -0
  92. package/dist/lifecycle/publish-declaration.d.ts +322 -4
  93. package/dist/lifecycle/publish-declaration.js +340 -9
  94. package/dist/lifecycle/publish-forge.d.ts +45 -2
  95. package/dist/lifecycle/publish-forge.js +434 -34
  96. package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
  97. package/dist/lifecycle/publish-git-ssh.js +30 -4
  98. package/dist/lifecycle/publish-github.d.ts +40 -2
  99. package/dist/lifecycle/publish-github.js +100 -3
  100. package/dist/lifecycle/publish-helm.d.ts +83 -0
  101. package/dist/lifecycle/publish-helm.js +452 -0
  102. package/dist/lifecycle/publish-homebrew.d.ts +7 -9
  103. package/dist/lifecycle/publish-homebrew.js +34 -197
  104. package/dist/lifecycle/publish-index.d.ts +141 -0
  105. package/dist/lifecycle/publish-index.js +719 -0
  106. package/dist/lifecycle/publish-marketplace.js +77 -0
  107. package/dist/lifecycle/publish-maven.d.ts +79 -0
  108. package/dist/lifecycle/publish-maven.js +364 -0
  109. package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
  110. package/dist/lifecycle/publish-mcp-registry.js +305 -0
  111. package/dist/lifecycle/publish-npm.d.ts +27 -1
  112. package/dist/lifecycle/publish-npm.js +216 -3
  113. package/dist/lifecycle/publish-nuget.d.ts +93 -0
  114. package/dist/lifecycle/publish-nuget.js +377 -0
  115. package/dist/lifecycle/publish-oci.d.ts +91 -2
  116. package/dist/lifecycle/publish-oci.js +247 -8
  117. package/dist/lifecycle/publish-package-files.d.ts +16 -0
  118. package/dist/lifecycle/publish-package-files.js +39 -0
  119. package/dist/lifecycle/publish-pypi.d.ts +138 -0
  120. package/dist/lifecycle/publish-pypi.js +657 -0
  121. package/dist/lifecycle/publish-record.d.ts +6 -3
  122. package/dist/lifecycle/publish-record.js +6 -3
  123. package/dist/lifecycle/publish-rubygems.d.ts +84 -0
  124. package/dist/lifecycle/publish-rubygems.js +366 -0
  125. package/dist/lifecycle/publish-signing.d.ts +147 -0
  126. package/dist/lifecycle/publish-signing.js +257 -0
  127. package/dist/lifecycle/publish-targets.d.ts +37 -1
  128. package/dist/lifecycle/publish-targets.js +102 -0
  129. package/dist/lifecycle/publish-tauri.js +43 -0
  130. package/dist/lifecycle/publish-train-names.d.ts +57 -0
  131. package/dist/lifecycle/publish-train-names.js +123 -0
  132. package/dist/lifecycle/publish-verify.d.ts +121 -0
  133. package/dist/lifecycle/publish-verify.js +130 -0
  134. package/dist/lifecycle/query.js +8 -0
  135. package/dist/lifecycle/release-artifacts.d.ts +290 -0
  136. package/dist/lifecycle/release-artifacts.js +808 -0
  137. package/dist/lifecycle/release-changelog.d.ts +13 -1
  138. package/dist/lifecycle/release-changelog.js +35 -2
  139. package/dist/lifecycle/release-cut.d.ts +64 -4
  140. package/dist/lifecycle/release-cut.js +147 -34
  141. package/dist/lifecycle/release-doctor.d.ts +113 -0
  142. package/dist/lifecycle/release-doctor.js +1198 -0
  143. package/dist/lifecycle/release-green.d.ts +86 -0
  144. package/dist/lifecycle/release-green.js +286 -0
  145. package/dist/lifecycle/release-init-registries.d.ts +48 -0
  146. package/dist/lifecycle/release-init-registries.js +97 -0
  147. package/dist/lifecycle/release-init.d.ts +275 -0
  148. package/dist/lifecycle/release-init.js +984 -0
  149. package/dist/lifecycle/release-intents.d.ts +73 -0
  150. package/dist/lifecycle/release-intents.js +128 -0
  151. package/dist/lifecycle/release-next.d.ts +111 -0
  152. package/dist/lifecycle/release-next.js +251 -0
  153. package/dist/lifecycle/release-prerelease.d.ts +19 -0
  154. package/dist/lifecycle/release-prerelease.js +30 -0
  155. package/dist/lifecycle/release-publish.d.ts +256 -10
  156. package/dist/lifecycle/release-publish.js +247 -35
  157. package/dist/lifecycle/release-status-change.d.ts +226 -0
  158. package/dist/lifecycle/release-status-change.js +478 -0
  159. package/dist/lifecycle/release-status.d.ts +11 -0
  160. package/dist/lifecycle/release-status.js +1 -1
  161. package/dist/lifecycle/release-store.d.ts +73 -2
  162. package/dist/lifecycle/release-store.js +32 -1
  163. package/dist/lifecycle/release-tag.d.ts +142 -0
  164. package/dist/lifecycle/release-tag.js +322 -0
  165. package/dist/lifecycle/release-verify.d.ts +73 -1
  166. package/dist/lifecycle/release-verify.js +117 -2
  167. package/dist/lifecycle/release-version-formats.d.ts +73 -0
  168. package/dist/lifecycle/release-version-formats.js +570 -0
  169. package/dist/lifecycle/release-version.d.ts +58 -10
  170. package/dist/lifecycle/release-version.js +164 -36
  171. package/dist/lifecycle/release-workstation.d.ts +3 -2
  172. package/dist/lifecycle/release-workstation.js +3 -2
  173. package/dist/op/generate-pipeline.js +1 -1
  174. package/dist/op/local-executor.d.ts +1 -1
  175. package/dist/op/local-executor.js +2 -2
  176. package/dist/op/op-waves-evidence.js +9 -2
  177. package/dist/pr-forge-base.js +4 -2
  178. package/dist/pr-forge.d.ts +20 -2
  179. package/dist/pr-forge.js +46 -10
  180. package/dist/release-floors.d.ts +8 -1
  181. package/dist/release-floors.js +9 -2
  182. package/dist/sensitive-key.d.ts +12 -0
  183. package/dist/sensitive-key.js +52 -0
  184. package/dist/tool-pins.d.ts +40 -0
  185. package/dist/tool-pins.js +66 -0
  186. package/dist/ts-loader.d.ts +8 -0
  187. package/dist/ts-loader.js +19 -0
  188. package/dist/wave-runtime.mjs +345 -342
  189. package/dist/workspace/ci-forge.d.ts +17 -0
  190. package/dist/workspace/ci-forge.js +17 -0
  191. package/dist/workspace/ci-init.js +1 -1
  192. package/dist/workspace/composites.schema.json +1 -0
  193. package/dist/workspace/declaration.d.ts +8 -0
  194. package/dist/workspace/declaration.js +12 -0
  195. package/dist/workspace/declaration.schema.json +8 -0
  196. package/dist/workspace/environments.d.ts +2 -0
  197. package/dist/workspace/environments.js +1 -1
  198. package/dist/workspace/identity-gate-rule.d.ts +61 -5
  199. package/dist/workspace/identity-gate-rule.js +81 -12
  200. package/dist/workspace/lexicon-outputs.d.ts +1 -1
  201. package/dist/workspace/lexicon-outputs.js +1 -1
  202. package/dist/workspace/member-pipeline.d.ts +2 -1
  203. package/dist/workspace/member-pipeline.js +5 -2
  204. package/dist/workspace/reason-codes.d.ts +2 -0
  205. package/dist/workspace/reason-codes.js +3 -1
  206. package/dist/workspace/release-changed.d.ts +75 -4
  207. package/dist/workspace/release-changed.js +205 -34
  208. package/dist/workspace/release-changed.schema.json +20 -2
  209. package/dist/workspace/release-steps/artifacts.d.ts +7 -0
  210. package/dist/workspace/release-steps/artifacts.js +45 -0
  211. package/dist/workspace/release-steps/builds.d.ts +12 -0
  212. package/dist/workspace/release-steps/builds.js +38 -0
  213. package/dist/workspace/release-steps/doctor.d.ts +8 -0
  214. package/dist/workspace/release-steps/doctor.js +14 -0
  215. package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
  216. package/dist/workspace/release-steps/goreleaser.js +36 -0
  217. package/dist/workspace/release-steps/green.d.ts +3 -0
  218. package/dist/workspace/release-steps/green.js +6 -0
  219. package/dist/workspace/release-steps/images.d.ts +22 -0
  220. package/dist/workspace/release-steps/images.js +59 -0
  221. package/dist/workspace/release-steps/index.d.ts +9 -0
  222. package/dist/workspace/release-steps/index.js +50 -0
  223. package/dist/workspace/release-steps/nfpm.d.ts +13 -0
  224. package/dist/workspace/release-steps/nfpm.js +29 -0
  225. package/dist/workspace/release-steps/nuget.d.ts +14 -0
  226. package/dist/workspace/release-steps/nuget.js +16 -0
  227. package/dist/workspace/release-steps/pypi.d.ts +15 -0
  228. package/dist/workspace/release-steps/pypi.js +21 -0
  229. package/dist/workspace/release-steps/qemu.d.ts +21 -0
  230. package/dist/workspace/release-steps/qemu.js +35 -0
  231. package/dist/workspace/release-steps/signing.d.ts +18 -0
  232. package/dist/workspace/release-steps/signing.js +30 -0
  233. package/dist/workspace/release-steps/stamp.d.ts +3 -0
  234. package/dist/workspace/release-steps/stamp.js +4 -0
  235. package/dist/workspace/release-steps/targets.d.ts +31 -0
  236. package/dist/workspace/release-steps/targets.js +40 -0
  237. package/dist/workspace/release-steps/types.d.ts +104 -0
  238. package/dist/workspace/release-steps/types.js +2 -0
  239. package/dist/workspace/release-steps/verify.d.ts +3 -0
  240. package/dist/workspace/release-steps/verify.js +4 -0
  241. package/dist/workspace/release-toolchains.d.ts +59 -0
  242. package/dist/workspace/release-toolchains.js +133 -0
  243. package/dist/workspace/release-train-workflow.d.ts +36 -0
  244. package/dist/workspace/release-train-workflow.js +121 -0
  245. package/dist/workspace/release-train.d.ts +3 -1
  246. package/dist/workspace/release-train.js +20 -3
  247. package/dist/workspace/release-workflow.d.ts +183 -59
  248. package/dist/workspace/release-workflow.js +570 -201
  249. package/dist/workspace/releases.schema.json +70 -1
  250. package/dist/workspace/search-contract.d.ts +1 -1
  251. package/dist/workspace/security.js +9 -2
  252. package/dist/workspace/train-cut.d.ts +182 -0
  253. package/dist/workspace/train-cut.js +504 -0
  254. package/dist/workspace/train-prepare.d.ts +64 -0
  255. package/dist/workspace/train-prepare.js +313 -0
  256. package/dist/workspace/train-publish.d.ts +177 -0
  257. package/dist/workspace/train-publish.js +574 -0
  258. package/dist/workspace/train-range-labels.d.ts +33 -0
  259. package/dist/workspace/train-range-labels.js +109 -0
  260. package/dist/workspace/train-shell.d.ts +5 -0
  261. package/dist/workspace/train-shell.js +17 -0
  262. package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
  263. package/dist/workspace/trust/check-evidence-report.js +3 -7
  264. package/dist/workspace/trust/seal.d.ts +13 -3
  265. package/dist/workspace/trust/seal.js +14 -4
  266. package/dist/workspace/work-cli.d.ts +3 -2
  267. package/dist/workspace/work-cli.js +3 -2
  268. package/dist/workspace/workspace-ledger.d.ts +14 -1
  269. package/dist/workspace/workspace-ledger.js +33 -7
  270. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `ci.forge` and `ci.system` (#5170): the forge the repository is on and the
3
+ * CI system that runs its jobs, read from the declaration at base, as
4
+ * `ci.locks` is (./ci-locks.ts). Null outside a workspace and when the
5
+ * declaration names neither, and then each command takes the forge from its
6
+ * job or its flags, and the CI system is the forge's own.
7
+ */
8
+ import type { ForgeCi } from "../ci-system.js";
9
+ /** The `ci.forge` and `ci.system` of the workspace holding `cwd`, read at `at` when given, else at base, else from the working tree. */
10
+ export declare function ciForgeAt(cwd: string, at?: string): ForgeCi | null;
11
+ /**
12
+ * Why `chant build --components --generate <lexicon>` would write the wrong
13
+ * CI system's files for the declaration's `ci.system`, or undefined when it
14
+ * writes the right one. A lexicon that names no CI system is left to the
15
+ * generator, which refuses one with no pipeline generator.
16
+ */
17
+ export declare function generateTargetProblem(lexicon: string, declared: ForgeCi | null): string | undefined;
@@ -0,0 +1,17 @@
1
+ import { CI_SYSTEMS, isCiSystem } from "../ci-system.js";
2
+ import { scopeSource } from "./write-scope.js";
3
+ /** The `ci.forge` and `ci.system` of the workspace holding `cwd`, read at `at` when given, else at base, else from the working tree. */
4
+ export function ciForgeAt(cwd, at) {
5
+ return scopeSource(cwd, at).declaration?.ci?.forgeCi ?? null;
6
+ }
7
+ /**
8
+ * Why `chant build --components --generate <lexicon>` would write the wrong
9
+ * CI system's files for the declaration's `ci.system`, or undefined when it
10
+ * writes the right one. A lexicon that names no CI system is left to the
11
+ * generator, which refuses one with no pipeline generator.
12
+ */
13
+ export function generateTargetProblem(lexicon, declared) {
14
+ if (!declared || !isCiSystem(lexicon) || lexicon === declared.ci)
15
+ return undefined;
16
+ return `chant.workspace.json names ci.system ${declared.ci} for the ${declared.forge} forge, and --generate ${lexicon} writes ${lexicon}'s pipeline files; generate ${declared.ci}, or change ci.system (one of ${CI_SYSTEMS.join(", ")})`;
17
+ }
@@ -274,7 +274,7 @@ export function proposeCiInit(root, options) {
274
274
  notes.push(`${forge} has no check runs for ci tick to read; set ci.green.source to runs and run chant ci tick from a scheduled job (see the green-commits guide).`);
275
275
  }
276
276
  if (reported("ci-workflow-publish-missing"))
277
- commands.push({ cwd: ".", args: ["release", "workflow", "--forge", forge], why: "the publish job for release/** tags" });
277
+ commands.push({ cwd: ".", args: ["release", "workflow", "--forge", forge], why: "the publish job for release tags" });
278
278
  }
279
279
  return { files, commands, notes, findings };
280
280
  }
@@ -613,6 +613,7 @@
613
613
  "required": ["forge", "workflow", "reason"],
614
614
  "properties": {
615
615
  "forge": { "enum": ["github", "gitlab", "forgejo", null] },
616
+ "ci": { "enum": ["github", "gitlab", "forgejo", "prow"], "description": "The CI system that runs the workflow, present only when chant.config.ts names one on the executor; absent, the forge's own (GitHub Actions, GitLab CI or Forgejo Actions). prow runs a GitHub repository's jobs, and workflow is then the job config file Prow loads (#5170). Added by chant 0.124.101." },
616
617
  "workflow": { "type": ["string", "null"], "description": "The workflow file the forge runs, such as deploy-prod.yml under .github/workflows/, or .gitlab-ci.yml." },
617
618
  "reason": {
618
619
  "oneOf": [
@@ -16,6 +16,7 @@
16
16
  * runs. The level-0 goldens (#2526) fail if a level-0 command loads it.
17
17
  */
18
18
  import { type RetentionOverride } from "../lifecycle/retention-policy.js";
19
+ import { type ForgeCi } from "../ci-system.js";
19
20
  import { type NotifyConfig } from "../notify.js";
20
21
  import { type CloudIdentityDeclaration } from "../ci-identity.js";
21
22
  import { EXAMPLES_KIND } from "./kinds.js";
@@ -331,6 +332,13 @@ export type CiLocks = "apply" | "plan";
331
332
  export type CiLockGrain = "target" | "resource" | "repo";
332
333
  /** The declaration's `ci` block (#3573). */
333
334
  export interface CiDeclaration {
335
+ /**
336
+ * `ci.forge` and `ci.system` (#5170): the forge the repository is on and
337
+ * the CI system that runs its jobs, with the system defaulting to the
338
+ * forge's own and the forge to the one the system serves. Absent when the
339
+ * declaration names neither.
340
+ */
341
+ forgeCi?: ForgeCi;
334
342
  green: CiGreen | null;
335
343
  /** `ci.workflow` (#4168 step 6): the workflow every member follows unless it names its own; absent when the declaration sets none. */
336
344
  workflow?: CiWorkflow;
@@ -17,6 +17,7 @@
17
17
  */
18
18
  import { RETENTION_KINDS } from "../lifecycle/retention-policy.js";
19
19
  import { parseReportUrl } from "../pr-report-url.js";
20
+ import { defaultCiOf, defaultForgeOf, forgeCiProblem } from "../ci-system.js";
20
21
  import { notifyConfigProblem } from "../notify.js";
21
22
  import schema from "./declaration.schema.json" with { type: "json" };
22
23
  import { routeConflicts } from "./ci-branches.js";
@@ -632,7 +633,18 @@ function ciOf(raw, at) {
632
633
  const block = raw;
633
634
  const hooks = ciHooksOf(block.hooks, "/ci/hooks", at);
634
635
  const policy = ciPolicyOf(block.policy, at);
636
+ // #5170: the forge and its CI system, each defaulting from the other.
637
+ let forgeCi;
638
+ if (block.forge !== undefined || block.system !== undefined) {
639
+ const forge = block.forge ?? defaultForgeOf(block.system);
640
+ const ci = block.system ?? defaultCiOf(forge);
641
+ const problem = forgeCiProblem(forge, ci);
642
+ if (problem)
643
+ throw new WorkspaceReadError("declaration-invalid", `ci.system: ${problem.replace(/^ci: /, "")}`, at("/ci/system"));
644
+ forgeCi = { forge, ci };
645
+ }
635
646
  const workflow = {
647
+ ...(forgeCi ? { forgeCi } : {}),
636
648
  ...(block.workflow !== undefined ? { workflow: block.workflow } : {}),
637
649
  ...(hooks ? { hooks } : {}),
638
650
  ...(block.branches !== undefined ? { branches: globMap(block.branches) } : {}),
@@ -209,6 +209,14 @@
209
209
  },
210
210
  "description": "What the workspace's CI decides about its commits (#3573, ws-103). Added in schema 1 by chant 0.108.0, so a declaration that uses it sets minReader to 0.108.0 or newer.",
211
211
  "properties": {
212
+ "forge": {
213
+ "enum": ["github", "gitlab", "forgejo"],
214
+ "description": "The forge the repository is on (#5170): where its pull requests, comments and commit statuses live, and whose API chant reads. Absent: the forge system names, else the forge each command reads from its job or its flags. Added in schema 1 by chant 0.124.101, so a declaration that uses it sets minReader to 0.124.101 or newer."
215
+ },
216
+ "system": {
217
+ "enum": ["github", "gitlab", "forgejo", "prow"],
218
+ "description": "The CI system that runs the repository's jobs and reads the pipeline files chant writes (#5170): github (GitHub Actions), gitlab (GitLab CI), forgejo (Forgejo Actions) or prow. Absent: the forge's own. prow runs jobs for a repository on github only, and a pair that cannot run is refused. Added in schema 1 by chant 0.124.101, so a declaration that uses it sets minReader to 0.124.101 or newer."
219
+ },
212
220
  "green": {
213
221
  "$ref": "#/$defs/ciGreen"
214
222
  },
@@ -55,6 +55,8 @@ export type ExecutorReasonCode = (typeof EXECUTOR_REASON_CODES)[number];
55
55
  /** The forge workflow that deploys an environment (#4402), or why none is named. */
56
56
  export interface ComponentExecutor {
57
57
  forge: EnvironmentExecutor["forge"] | null;
58
+ /** The CI system that runs the workflow (#5170), present only when the config names one; absent, the forge's own. */
59
+ ci?: NonNullable<EnvironmentExecutor["ci"]>;
58
60
  workflow: string | null;
59
61
  /** Null when `forge` and `workflow` are set. */
60
62
  reason: {
@@ -150,7 +150,7 @@ export function executorFor(env, member) {
150
150
  }
151
151
  const found = environmentExecutor(member?.declared ?? undefined, env);
152
152
  if (found)
153
- return { forge: found.forge, workflow: found.workflow, reason: null };
153
+ return { forge: found.forge, ...(found.ci ? { ci: found.ci } : {}), workflow: found.workflow, reason: null };
154
154
  return { forge: null, workflow: null, reason: { code: "executor-none-declared", message: `chant.config.ts declares no executor for ${env}` } };
155
155
  }
156
156
  /**
@@ -67,7 +67,14 @@ export declare function admitApprover(rule: GateAdmissionRule, a: SealedGateAppr
67
67
  export declare const RELEASE_GATE = "release";
68
68
  /** The ssh signature namespace of a release cut's signature (#4031), so no other signature can stand in for one. */
69
69
  export declare const RELEASE_SEAL_NAMESPACE = "chant-release";
70
- /** A cut line's fields its signature covers (#4031), and the signature. */
70
+ /**
71
+ * The version of the payload a new cut's signature signs (#5177). Version 1
72
+ * (#4031) is four lines; version 2 adds the green-gate record. A cut line
73
+ * written with version 2 says so in `sealVersion`; a line without it was
74
+ * signed over version 1.
75
+ */
76
+ export declare const RELEASE_CUT_SEAL_VERSION = 2;
77
+ /** A cut line's fields its signature covers (#4031, #5177), and the signature. */
71
78
  export interface SignedReleaseCut {
72
79
  releaseDigest: string;
73
80
  label: string | null;
@@ -75,13 +82,55 @@ export interface SignedReleaseCut {
75
82
  timestamp: string;
76
83
  /** The armored ssh signature, or null for an unsigned cut. */
77
84
  signature: string | null;
85
+ /** The payload version the signature signs (#5177): 2 covers the gate record; absent, version 1, which does not. */
86
+ sealVersion?: number;
87
+ /** The green gate the cut passed (#5149), as the cut line records it. */
88
+ green?: unknown;
89
+ /** The override the cut ran under (#4693), as the cut line records it. */
90
+ override?: unknown;
91
+ /** The green lane the cut checked (#4692). */
92
+ lane?: string;
78
93
  }
79
94
  /**
80
- * The bytes a release cut's signature signs (#4031): the release digest,
81
- * the label (empty for none), the actor who cut it and the cut's time,
82
- * joined by LF with no final newline.
95
+ * The bytes a release cut's signature signs under version 1 (#4031): the
96
+ * release digest, the label (empty for none), the actor who cut it and the
97
+ * cut's time, joined by LF with no final newline.
98
+ */
99
+ export declare function releaseSealPayload(cut: Pick<SignedReleaseCut, "releaseDigest" | "label" | "actor" | "timestamp">): Buffer;
100
+ /**
101
+ * The green-gate record a version 2 cut signature covers (#5177): the cut
102
+ * line's `green`, `override` and `lane`, those it holds, as sorted JSON.
103
+ * `{}` for a cut that records none of them.
83
104
  */
84
- export declare function releaseSealPayload(cut: Omit<SignedReleaseCut, "signature">): Buffer;
105
+ export declare function releaseCutGateRecord(cut: Pick<SignedReleaseCut, "green" | "override" | "lane">): string;
106
+ /**
107
+ * The bytes a version 2 cut signature signs (#5177): the four lines of
108
+ * version 1, then `seal:2` and `gate:<record>`. The release digest stays the
109
+ * digest of the release file, so two cuts of one commit still share it, and
110
+ * the gate each cut claims is under its own signature. The `seal:2` line keeps
111
+ * the bytes apart from a version 1 cut's and from a status change's
112
+ * (`status:<status>`) in the shared `chant-release` namespace.
113
+ */
114
+ export declare function releaseGateSealPayload(cut: Omit<SignedReleaseCut, "signature" | "sealVersion">): Buffer;
115
+ /** The bytes the cut's signature signs, by the version its line names: version 2 with `sealVersion: 2`, else version 1. */
116
+ export declare function releaseCutSealPayload(cut: Omit<SignedReleaseCut, "signature">): Buffer;
117
+ /** A release status change's fields its signature covers (#5163), and the signature. */
118
+ export interface SignedReleaseStatus extends SignedReleaseCut {
119
+ /** The status set: `deprecated`, `yanked` or `active`. */
120
+ status: string;
121
+ }
122
+ /**
123
+ * The bytes a release status change's signature signs (#5163): the cut's
124
+ * four lines, then `status:<status>`, so it is never the bytes of a cut and
125
+ * one can't stand in for the other in the shared `chant-release` namespace.
126
+ */
127
+ export declare function releaseStatusSealPayload(s: Omit<SignedReleaseStatus, "signature">): Buffer;
128
+ /**
129
+ * Why a status change of a release may not be made under the `release`
130
+ * gate's rule, or null when it may (#5163): the same rule as a cut, so whoever
131
+ * may cut may deprecate, yank or restore, and no one else.
132
+ */
133
+ export declare function admitReleaseStatus(rule: GateAdmissionRule, s: SignedReleaseStatus): string | null;
85
134
  /**
86
135
  * Why `cut` may not be made under the `release` gate's rule, or null when
87
136
  * it may (#4031): its signature verifies for its actor against the signers
@@ -97,6 +146,13 @@ export interface ReleaseSignatureCheck {
97
146
  /** The fingerprint of the key in the signature, or null for an unsigned cut or one that can't be read. */
98
147
  key: string | null;
99
148
  reason: string;
149
+ /**
150
+ * Whether the green-gate record on the cut line is covered by a signature
151
+ * that verifies (#5177): `signed` for a verified version 2 signature,
152
+ * `unsigned` otherwise, including a verified version 1 signature, made
153
+ * before chant signed the gate.
154
+ */
155
+ gate: "signed" | "unsigned";
100
156
  }
101
157
  /** Judge a stored cut's signature against `rule`, read at base. A rule with no class checks the signature alone. */
102
158
  export declare function checkReleaseSignature(rule: GateAdmissionRule, cut: SignedReleaseCut): ReleaseSignatureCheck;
@@ -71,26 +71,95 @@ export const RELEASE_GATE = "release";
71
71
  /** The ssh signature namespace of a release cut's signature (#4031), so no other signature can stand in for one. */
72
72
  export const RELEASE_SEAL_NAMESPACE = "chant-release";
73
73
  /**
74
- * The bytes a release cut's signature signs (#4031): the release digest,
75
- * the label (empty for none), the actor who cut it and the cut's time,
76
- * joined by LF with no final newline.
74
+ * The version of the payload a new cut's signature signs (#5177). Version 1
75
+ * (#4031) is four lines; version 2 adds the green-gate record. A cut line
76
+ * written with version 2 says so in `sealVersion`; a line without it was
77
+ * signed over version 1.
78
+ */
79
+ export const RELEASE_CUT_SEAL_VERSION = 2;
80
+ /**
81
+ * The bytes a release cut's signature signs under version 1 (#4031): the
82
+ * release digest, the label (empty for none), the actor who cut it and the
83
+ * cut's time, joined by LF with no final newline.
77
84
  */
78
85
  export function releaseSealPayload(cut) {
79
86
  return Buffer.from(`${cut.releaseDigest}\n${cut.label ?? ""}\n${cut.actor}\n${cut.timestamp}`, "utf-8");
80
87
  }
88
+ /** `v` as JSON with every object's keys sorted, so the same record gives the same bytes. */
89
+ function canonicalJson(v) {
90
+ if (Array.isArray(v))
91
+ return `[${v.map(canonicalJson).join(",")}]`;
92
+ if (v !== null && typeof v === "object") {
93
+ const o = v;
94
+ return `{${Object.keys(o)
95
+ .filter((k) => o[k] !== undefined)
96
+ .sort()
97
+ .map((k) => `${JSON.stringify(k)}:${canonicalJson(o[k])}`)
98
+ .join(",")}}`;
99
+ }
100
+ return JSON.stringify(v);
101
+ }
102
+ /**
103
+ * The green-gate record a version 2 cut signature covers (#5177): the cut
104
+ * line's `green`, `override` and `lane`, those it holds, as sorted JSON.
105
+ * `{}` for a cut that records none of them.
106
+ */
107
+ export function releaseCutGateRecord(cut) {
108
+ return canonicalJson({ green: cut.green, override: cut.override, lane: cut.lane });
109
+ }
110
+ /**
111
+ * The bytes a version 2 cut signature signs (#5177): the four lines of
112
+ * version 1, then `seal:2` and `gate:<record>`. The release digest stays the
113
+ * digest of the release file, so two cuts of one commit still share it, and
114
+ * the gate each cut claims is under its own signature. The `seal:2` line keeps
115
+ * the bytes apart from a version 1 cut's and from a status change's
116
+ * (`status:<status>`) in the shared `chant-release` namespace.
117
+ */
118
+ export function releaseGateSealPayload(cut) {
119
+ return Buffer.concat([releaseSealPayload(cut), Buffer.from(`\nseal:2\ngate:${releaseCutGateRecord(cut)}`, "utf-8")]);
120
+ }
121
+ /** The bytes the cut's signature signs, by the version its line names: version 2 with `sealVersion: 2`, else version 1. */
122
+ export function releaseCutSealPayload(cut) {
123
+ return cut.sealVersion === 2 ? releaseGateSealPayload(cut) : releaseSealPayload(cut);
124
+ }
81
125
  /** Why the cut's signature does not verify for its actor against the signers at base, or null when it does. */
82
- function releaseSignatureRefusal(signers, cut) {
126
+ function releaseSignatureRefusal(signers, cut, payload = releaseCutSealPayload(cut), what = "cut") {
83
127
  if (cut.signature === null)
84
- return `the cut by ${cut.actor} is not signed`;
128
+ return `the ${what} by ${cut.actor} is not signed`;
129
+ // The payloads are LF-joined lines; a field holding a newline could make one kind's bytes another's.
130
+ if ([cut.releaseDigest, cut.label ?? "", cut.actor, cut.timestamp].some((f) => f.includes("\n")))
131
+ return `the ${what} by ${cut.actor} has a signed field with a line break, so its signature can't count`;
85
132
  if (!signers.active)
86
- return `there is no signers file (${signers.signersPath}) at base to check the cut's signature against`;
133
+ return `there is no signers file (${signers.signersPath}) at base to check the ${what}'s signature against`;
87
134
  const where = `${signers.signersPath} at base`;
88
135
  const listed = signers.signers.filter((s) => normalise(s.principal) === normalise(cut.actor));
89
136
  if (listed.length === 0)
90
- return `${cut.actor} has no key in ${where}, so the cut's signature can't count`;
137
+ return `${cut.actor} has no key in ${where}, so the ${what}'s signature can't count`;
91
138
  const keys = listed.filter((s) => namespaceAllowed(s.namespaces, RELEASE_SEAL_NAMESPACE)).map((s) => Buffer.from(s.key.split(" ")[1] ?? "", "base64"));
92
- const r = verifySshSignatureWith(cut.signature, releaseSealPayload(cut), RELEASE_SEAL_NAMESPACE, keys);
93
- return r.ok ? null : `the cut's signature does not verify for ${cut.actor} against ${where}: ${r.reason}`;
139
+ const r = verifySshSignatureWith(cut.signature, payload, RELEASE_SEAL_NAMESPACE, keys);
140
+ return r.ok ? null : `the ${what}'s signature does not verify for ${cut.actor} against ${where}: ${r.reason}`;
141
+ }
142
+ /**
143
+ * The bytes a release status change's signature signs (#5163): the cut's
144
+ * four lines, then `status:<status>`, so it is never the bytes of a cut and
145
+ * one can't stand in for the other in the shared `chant-release` namespace.
146
+ */
147
+ export function releaseStatusSealPayload(s) {
148
+ return Buffer.concat([releaseSealPayload(s), Buffer.from(`\nstatus:${s.status}`, "utf-8")]);
149
+ }
150
+ /**
151
+ * Why a status change of a release may not be made under the `release`
152
+ * gate's rule, or null when it may (#5163): the same rule as a cut, so whoever
153
+ * may cut may deprecate, yank or restore, and no one else.
154
+ */
155
+ export function admitReleaseStatus(rule, s) {
156
+ const unknown = unknownClassRefusal(rule, "status change");
157
+ if (unknown !== null)
158
+ return unknown;
159
+ const seal = releaseSignatureRefusal(rule.signers, s, releaseStatusSealPayload(s), "status change");
160
+ if (seal !== null)
161
+ return `${seal}; identity.gates.${rule.gate} needs a status change signed with --sign`;
162
+ return classRefusal(rule, s.actor);
94
163
  }
95
164
  /**
96
165
  * Why `cut` may not be made under the `release` gate's rule, or null when
@@ -111,13 +180,13 @@ export function admitReleaseCut(rule, cut) {
111
180
  /** Judge a stored cut's signature against `rule`, read at base. A rule with no class checks the signature alone. */
112
181
  export function checkReleaseSignature(rule, cut) {
113
182
  if (cut.signature === null)
114
- return { status: "unsigned", key: null, reason: "the cut carries no signature" };
183
+ return { status: "unsigned", key: null, reason: "the cut carries no signature", gate: "unsigned" };
115
184
  const blob = sshSignatureKey(cut.signature);
116
185
  const key = blob ? sshKeyFingerprint(blob) : null;
117
186
  const why = unknownClassRefusal(rule, "cut") ?? releaseSignatureRefusal(rule.signers, cut) ?? classRefusal(rule, cut.actor);
118
187
  if (why !== null)
119
- return { status: "unverified", key, reason: why };
120
- return { status: "verified", key, reason: `signed by ${cut.actor}${rule.class !== null ? `, in the class ${rule.class}` : ""}` };
188
+ return { status: "unverified", key, reason: why, gate: "unsigned" };
189
+ return { status: "verified", key, reason: `signed by ${cut.actor}${rule.class !== null ? `, in the class ${rule.class}` : ""}`, gate: cut.sealVersion === 2 ? "signed" : "unsigned" };
121
190
  }
122
191
  /** The seal step, worded as `checkGateSeal` (`./trust/seal.ts`) words it against an active signers file at base. */
123
192
  function sealRefusal(gate, signers, a) {
@@ -53,7 +53,7 @@ export interface OutputsPlugin {
53
53
  outputs: LexiconWorkspaceOutput[];
54
54
  gaps?: string[];
55
55
  } | undefined;
56
- workspaceLinks?: (entities: ReadonlyMap<string, Declarable>, unread?: readonly LexiconUnreadSource[]) => LexiconWorkspaceLinks | undefined;
56
+ workspaceLinks?: (entities: ReadonlyMap<string, Declarable>, unread?: readonly LexiconUnreadSource[]) => LexiconWorkspaceLinks | undefined | Promise<LexiconWorkspaceLinks | undefined>;
57
57
  }
58
58
  /** Loads a lexicon plugin by name; `loadPlugin` from the CLI unless a test swaps it. */
59
59
  export type OutputsPluginLoader = (name: string) => Promise<OutputsPlugin>;
@@ -317,7 +317,7 @@ export async function gatherLexiconLinks(root, declaration, tree, groups, kinds,
317
317
  for (const { name, plugin } of member.reporting) {
318
318
  const read = { reader: `lexicon ${name}`, links: [], gaps: member.gaps.map((message) => ({ file: where, line: 1, message })) };
319
319
  try {
320
- const report = plugin.workspaceLinks(member.entities, member.unread);
320
+ const report = await plugin.workspaceLinks(member.entities, member.unread);
321
321
  if (!report)
322
322
  continue;
323
323
  for (const l of report.links) {
@@ -66,7 +66,8 @@ export declare function memberPipelineDir(provider: string): string | undefined;
66
66
  /**
67
67
  * The default path of a member's component pipeline for one environment,
68
68
  * relative to the repository root: `chant-<member>-<env>.yml` in the forge's
69
- * workflow directory, or `.gitlab/ci/chant-<member>-<env>.gitlab-ci.yml`.
69
+ * workflow directory, `.gitlab/ci/chant-<member>-<env>.gitlab-ci.yml`, or
70
+ * Prow's `prow/chant-<member>-<env>.yaml` (#5189).
70
71
  * A pull-request pipeline (`kind` `"pr"`, #3465) is `chant-pr.<member>.<env>`, with the dots the apply group uses so no
71
72
  * two member and environment pairs share one name, and it sits beside the
72
73
  * member's deploy pipeline for the same environment.
@@ -90,6 +90,8 @@ const PIPELINE_DIRS = {
90
90
  forgejo: ".forgejo/workflows",
91
91
  // GitLab reads only .gitlab-ci.yml, which includes these (`include: local: .gitlab/ci/*.gitlab-ci.yml`).
92
92
  gitlab: ".gitlab/ci",
93
+ // #5189: a Prow job config, which the installation's job_config_path names.
94
+ prow: "prow",
93
95
  };
94
96
  /** The directory a forge's generated files go in for a member, relative to the repository root, or undefined for a forge chant doesn't know. */
95
97
  export function memberPipelineDir(provider) {
@@ -98,7 +100,8 @@ export function memberPipelineDir(provider) {
98
100
  /**
99
101
  * The default path of a member's component pipeline for one environment,
100
102
  * relative to the repository root: `chant-<member>-<env>.yml` in the forge's
101
- * workflow directory, or `.gitlab/ci/chant-<member>-<env>.gitlab-ci.yml`.
103
+ * workflow directory, `.gitlab/ci/chant-<member>-<env>.gitlab-ci.yml`, or
104
+ * Prow's `prow/chant-<member>-<env>.yaml` (#5189).
102
105
  * A pull-request pipeline (`kind` `"pr"`, #3465) is `chant-pr.<member>.<env>`, with the dots the apply group uses so no
103
106
  * two member and environment pairs share one name, and it sits beside the
104
107
  * member's deploy pipeline for the same environment.
@@ -108,7 +111,7 @@ export function memberPipelineFile(provider, member, env, kind = "components") {
108
111
  if (dir === undefined)
109
112
  return undefined;
110
113
  const stem = kind === "pr" ? `chant-pr.${member}.${env}` : `chant-${member}-${env}`;
111
- return `${dir}/${stem}${provider === "gitlab" ? ".gitlab-ci.yml" : ".yml"}`;
114
+ return `${dir}/${stem}${provider === "gitlab" ? ".gitlab-ci.yml" : provider === "prow" ? ".yaml" : ".yml"}`;
112
115
  }
113
116
  /** A repository-relative path for an absolute one. */
114
117
  export function repoRelative(ctx, absolute) {
@@ -324,6 +324,8 @@ export declare const REASONS: {
324
324
  readonly "paths-changed": "The member has paths changed since its last release, after changes.ignore and generated files, or has no release yet.";
325
325
  readonly "needed-by": "A member of the release depends on this one, and this one has changes since its last release.";
326
326
  readonly "range-broken-by": "The range this member last published for a dependency does not admit that dependency's next label.";
327
+ readonly "intent-pending": "An intent file under .chant/release names the member, and no cut of it consumed the file (#5159).";
328
+ readonly "intent-invalid": "An intent file under .chant/release can't be read: its front matter is not lines of <member>: major|minor|patch, or names a member the declaration does not have (#5159).";
327
329
  readonly "lock-invalid": "The lineage lock can't be read.";
328
330
  readonly "manual-step-open": "A scope in the lineage lock has an open manual step.";
329
331
  readonly "missing-dir": "The chant member's directory does not exist, so there is nothing to build.";
@@ -300,7 +300,7 @@ export const REASONS = {
300
300
  "work-item-closed": "A claim on a work item in a closed state, such as done or dropped: there is no work left to claim.",
301
301
  // Evidence attached to a criterion under the run's work lease (#2772): why it was refused. Nothing is written.
302
302
  "work-criterion-unknown": "The work record lists no acceptance criterion with the id the evidence names, or its kind has no acceptance criteria.",
303
- // The work lease: why a claim, renew or release was refused (exit 2).
303
+ // The work lease: why a claim, renew or release was refused (exit 5 when held or raced, 1 when not held or the token is stale).
304
304
  "lease-held": "Someone holds a live lease on the work item: another worker, or, for a claim, the same one.",
305
305
  "lease-not-held": "Nobody holds a live lease on the work item: it expired, was released or was never claimed.",
306
306
  "lease-token-mismatch": "The live lease on the work item carries another fencing token than the one given.",
@@ -388,6 +388,8 @@ export const REASONS = {
388
388
  "paths-changed": "The member has paths changed since its last release, after changes.ignore and generated files, or has no release yet.",
389
389
  "needed-by": "A member of the release depends on this one, and this one has changes since its last release.",
390
390
  "range-broken-by": "The range this member last published for a dependency does not admit that dependency's next label.",
391
+ "intent-pending": "An intent file under .chant/release names the member, and no cut of it consumed the file (#5159).",
392
+ "intent-invalid": "An intent file under .chant/release can't be read: its front matter is not lines of <member>: major|minor|patch, or names a member the declaration does not have (#5159).",
391
393
  // The lineage lock (check).
392
394
  "lock-invalid": "The lineage lock can't be read.",
393
395
  "manual-step-open": "A scope in the lineage lock has an open manual step.",
@@ -11,8 +11,9 @@
11
11
  *
12
12
  * For each `chant` member it finds the commit of its last release: the newest
13
13
  * cut in the member's ledger, else the newest legacy tag, one of the
14
- * `release.legacyTags` prefixes of the root's `chant.config.ts` followed by a
15
- * version (`release/npm/0.124.44`, `chant-v0.124.44`). It then lists the
14
+ * `release.legacyTags` prefixes of the root's `chant.config.ts` or the
15
+ * member's own followed by a version (`release/npm/0.124.44`,
16
+ * `chant-v0.124.44`). It then lists the
16
17
  * paths changed from there to the commit, takes the outer member that holds
17
18
  * each (`memberHolding`, the outermost workspace's members, one of which has
18
19
  * the member's own name), and drops the paths `changes.ignore` matches and
@@ -37,9 +38,9 @@
37
38
  export declare const RELEASE_CHANGED_CONTRACT_VERSION = 1;
38
39
  export declare const RELEASE_CHANGED_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/release-changed/v1/release-changed.schema.json";
39
40
  /** Why the read stopped. Closed; each code is in `reason-codes.ts`. */
40
- export declare const RELEASE_CHANGED_ERROR_CODES: readonly ["not-a-git-repository", "declaration-missing", "revision-unknown", "bump-invalid", "ledger-unreadable"];
41
+ export declare const RELEASE_CHANGED_ERROR_CODES: readonly ["not-a-git-repository", "declaration-missing", "revision-unknown", "bump-invalid", "ledger-unreadable", "intent-invalid"];
41
42
  /** Why a member is in the release. Closed; each code is in `reason-codes.ts`. */
42
- export declare const RELEASE_CHANGED_REASON_CODES: readonly ["paths-changed", "needed-by", "range-broken-by"];
43
+ export declare const RELEASE_CHANGED_REASON_CODES: readonly ["paths-changed", "needed-by", "range-broken-by", "intent-pending"];
43
44
  export declare const RELEASE_BUMPS: readonly ["major", "minor", "patch"];
44
45
  export type ReleaseBump = (typeof RELEASE_BUMPS)[number];
45
46
  export interface ReleaseChangedReason {
@@ -64,6 +65,15 @@ export interface ReleaseChangedMember {
64
65
  last: LastRelease | null;
65
66
  /** The bump applied to `last.label`. */
66
67
  bump: ReleaseBump;
68
+ /**
69
+ * Where the bump came from (#5159): `flag` for `--bump-member`, `commits`
70
+ * or `intents` for the higher of the conventional commits over `paths`
71
+ * since the last release and the pending intent files (`commits` when
72
+ * they tie), `default` for a patch when neither gives one.
73
+ */
74
+ bumpFrom: "flag" | "commits" | "intents" | "default";
75
+ /** The intent files under `.chant/release/` that name the member and that no cut of it consumed (#5159), by path. */
76
+ intents: string[];
67
77
  /** The label a release of it would carry, or null when there is no last label to bump. */
68
78
  next: string | null;
69
79
  /** The changed paths that count, from the outermost workspace root. Empty for a member taken only by the closure. */
@@ -103,6 +113,67 @@ export declare function bumpLabel(label: string, bump: ReleaseBump): string | nu
103
113
  * (`workspace:*`, a URL, a tag) admits everything: it forces no release.
104
114
  */
105
115
  export declare function rangeAdmits(range: string, label: string): boolean;
116
+ /**
117
+ * The directory whose commits count for the member at `memberDir` (#5159):
118
+ * as `release changed` maps paths, the directory of the outermost
119
+ * workspace's member of the same name when there is one (a release member
120
+ * under `release/<name>` releases the package at `packages/<name>`), else
121
+ * the member's own directory.
122
+ */
123
+ export declare function memberSourcePath(memberDir: string): string;
124
+ /**
125
+ * A shape the version tags of earlier releases take: the literal before and
126
+ * after the version. A `release.legacyTags` prefix is a shape with no
127
+ * suffix; a `release.tag` template gives one through `tagShape`, with
128
+ * `render`, the tag a label gets, so a match is confirmed by rendering it
129
+ * back (#5200).
130
+ */
131
+ export interface VersionTagShape {
132
+ prefix: string;
133
+ suffix: string;
134
+ render?: (label: string) => string;
135
+ }
136
+ /**
137
+ * The newest tag of `shapes` that names a version, as a release, or null.
138
+ * The version between prefix and suffix holds no `/`: `release/npm/core/0.125.0`
139
+ * is a member's tag, not one of the prefix `release/`. The label drops a
140
+ * leading `v`, unless the shape's `render` only gives the tag back with it.
141
+ * With `at`, only a tag on that commit or an ancestor of it counts; with
142
+ * `stable`, only a version with no prerelease part; with `skip`, no
143
+ * version it lists (written without a leading `v`).
144
+ */
145
+ export declare function tagHistoryRelease(top: string, shapes: readonly VersionTagShape[], opts?: {
146
+ at?: string;
147
+ stable?: boolean;
148
+ skip?: readonly string[];
149
+ }): (LastRelease & {
150
+ tag: string;
151
+ }) | null;
152
+ /** The `release` settings of the `chant.config.ts` (or `.json`) in `dir` that pick a next label; empty when it has none or can't be read. */
153
+ export declare function releaseSettingsAt(dir: string): Promise<{
154
+ legacyTags: string[];
155
+ breakingOnZero?: "minor" | "major";
156
+ }>;
157
+ /**
158
+ * The settings for the member at `memberDir` (#5200, #5191): its own
159
+ * `release.legacyTags` with those of the workspace root it sits in, and its
160
+ * own `release.breakingOnZero`, else the root's. A project with no
161
+ * workspace reads its own config alone.
162
+ */
163
+ export declare function memberReleaseSettings(memberDir: string, root?: {
164
+ dir: string;
165
+ settings: Awaited<ReturnType<typeof releaseSettingsAt>>;
166
+ }): Promise<{
167
+ legacyTags: string[];
168
+ breakingOnZero: "minor" | "major";
169
+ }>;
170
+ /**
171
+ * The bump a commit gives on the version `label` (#5191): on 0.x, unless
172
+ * `breakingOnZero` is `major`, a breaking change bumps minor and a feature
173
+ * patch, since a 0.x project moves to 1.0.0 by choice (an intent file or a
174
+ * typed level of `major`). Any other version, or a null bump, is as given.
175
+ */
176
+ export declare function zeroShift(bump: ReleaseBump | null, label: string | null, breakingOnZero: "minor" | "major"): ReleaseBump | null;
106
177
  /** Read what a release at a commit of the workspace at `query.cwd` has to cut. */
107
178
  export declare function releaseChangedDocument(query: ReleaseChangedQuery): Promise<ReleaseChangedDocument>;
108
179
  export {};