forgedock 1.61.2 → 1.62.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 (131) hide show
  1. package/bin/config-schema.mjs +10 -1
  2. package/bin/engine/outcome-codes.mjs +4 -0
  3. package/bin/engine-cli.mjs +159 -17
  4. package/bin/env/env.mjs +6 -4
  5. package/bin/forge-home-check.mjs +91 -0
  6. package/bin/forgedock.mjs +50 -7
  7. package/bin/gc.mjs +2 -0
  8. package/bin/hooks/pre-tool-use.mjs +4 -0
  9. package/bin/journey.mjs +55 -5
  10. package/bin/lean/admission.mjs +16 -5
  11. package/bin/lean/batch-health.mjs +55 -16
  12. package/bin/lean/batch-health.test.mjs +67 -1
  13. package/bin/lean/batch.mjs +8 -0
  14. package/bin/lean/batch.test.mjs +5 -0
  15. package/bin/lean/ceiling.mjs +20 -0
  16. package/bin/lean/ceiling.test.mjs +33 -2
  17. package/bin/lean/ci-gate.mjs +240 -0
  18. package/bin/lean/ci-gate.test.mjs +227 -0
  19. package/bin/lean/ci-precheck.mjs +178 -0
  20. package/bin/lean/ci-precheck.test.mjs +149 -0
  21. package/bin/lean/conformance.mjs +85 -9
  22. package/bin/lean/conformance.test.mjs +155 -3
  23. package/bin/lean/context.test.mjs +7 -6
  24. package/bin/lean/dag.mjs +128 -0
  25. package/bin/lean/dag.test.mjs +131 -0
  26. package/bin/lean/decisions.mjs +5 -4
  27. package/bin/lean/decisions.test.mjs +11 -0
  28. package/bin/lean/delguard.mjs +84 -0
  29. package/bin/lean/delguard.test.mjs +104 -0
  30. package/bin/lean/depcache.mjs +125 -17
  31. package/bin/lean/depcache.test.mjs +111 -0
  32. package/bin/lean/design-gate.mjs +5 -5
  33. package/bin/lean/design-gate.test.mjs +14 -0
  34. package/bin/lean/effects.mjs +72 -4
  35. package/bin/lean/execution.mjs +41 -7
  36. package/bin/lean/execution.test.mjs +99 -3
  37. package/bin/lean/forgedock-lane-workflow.test.mjs +35 -0
  38. package/bin/lean/guardgate.mjs +30 -7
  39. package/bin/lean/guardgate.test.mjs +44 -1
  40. package/bin/lean/guards.test.mjs +1 -1
  41. package/bin/lean/heavy.test.mjs +87 -0
  42. package/bin/lean/hotarea.mjs +73 -0
  43. package/bin/lean/hotarea.test.mjs +73 -0
  44. package/bin/lean/issuewatch-reconcile.mjs +20 -1
  45. package/bin/lean/issuewatch-reconcile.test.mjs +30 -0
  46. package/bin/lean/lanecheck.mjs +27 -3
  47. package/bin/lean/lanecheck.test.mjs +47 -5
  48. package/bin/lean/laneconfine.mjs +83 -0
  49. package/bin/lean/laneconfine.test.mjs +113 -0
  50. package/bin/lean/lean.mjs +376 -79
  51. package/bin/lean/lean.test.mjs +710 -22
  52. package/bin/lean/live-reconcile.mjs +169 -0
  53. package/bin/lean/live-reconcile.test.mjs +176 -0
  54. package/bin/lean/orchestrate-envhold.test.mjs +245 -0
  55. package/bin/lean/orchestrate-hostfallback.test.mjs +39 -0
  56. package/bin/lean/orchestrate.mjs +207 -17
  57. package/bin/lean/outcomeevidence.mjs +104 -0
  58. package/bin/lean/outcomeevidence.test.mjs +78 -0
  59. package/bin/lean/page-capture.mjs +68 -0
  60. package/bin/lean/page-capture.test.mjs +44 -0
  61. package/bin/lean/pagegate.mjs +46 -7
  62. package/bin/lean/pagegate.test.mjs +66 -1
  63. package/bin/lean/postdeploy-check.mjs +18 -4
  64. package/bin/lean/postdeploy-check.test.mjs +32 -1
  65. package/bin/lean/prefilter.mjs +36 -4
  66. package/bin/lean/prefilter.test.mjs +31 -1
  67. package/bin/lean/preflight.mjs +22 -0
  68. package/bin/lean/preflight.test.mjs +19 -1
  69. package/bin/lean/probe.mjs +18 -0
  70. package/bin/lean/probe.test.mjs +40 -0
  71. package/bin/lean/prompts.mjs +40 -3
  72. package/bin/lean/recovery.test.mjs +20 -0
  73. package/bin/lean/recurrence.mjs +133 -0
  74. package/bin/lean/recurrence.test.mjs +99 -0
  75. package/bin/lean/release-config.mjs +2 -1
  76. package/bin/lean/release-config.test.mjs +18 -0
  77. package/bin/lean/release-control.mjs +4 -2
  78. package/bin/lean/release-control.test.mjs +15 -0
  79. package/bin/lean/release-merge-hold.mjs +65 -0
  80. package/bin/lean/release-merge-hold.test.mjs +69 -0
  81. package/bin/lean/release-review.mjs +26 -9
  82. package/bin/lean/release-review.test.mjs +53 -0
  83. package/bin/lean/release-status.mjs +3 -1
  84. package/bin/lean/release-status.test.mjs +11 -0
  85. package/bin/lean/release.test.mjs +26 -1
  86. package/bin/lean/render.mjs +8 -7
  87. package/bin/lean/routing.mjs +49 -0
  88. package/bin/lean/routing.test.mjs +54 -1
  89. package/bin/lean/run-issue-placement.test.mjs +30 -1
  90. package/bin/lean/sandbox-actions.mjs +121 -0
  91. package/bin/lean/sandbox-actions.test.mjs +94 -0
  92. package/bin/lean/sandbox-provider.contract.test.mjs +22 -1
  93. package/bin/lean/sandbox-remote.mjs +3 -1
  94. package/bin/lean/schedd-health.mjs +14 -2
  95. package/bin/lean/schedd-health.test.mjs +13 -0
  96. package/bin/lean/schedd.mjs +43 -17
  97. package/bin/lean/schedd.test.mjs +61 -1
  98. package/bin/lean/toolchain.mjs +16 -6
  99. package/bin/lean/toolplace.mjs +12 -0
  100. package/bin/lean/weakguard.mjs +105 -0
  101. package/bin/lean/weakguard.test.mjs +59 -0
  102. package/bin/lean/winspawn.mjs +61 -0
  103. package/bin/lean/winspawn.test.mjs +45 -0
  104. package/bin/lean/worktree.mjs +3 -1
  105. package/bin/lean/worktree.test.mjs +11 -0
  106. package/bin/pool/agent.mjs +210 -14
  107. package/bin/pool/cache-sweep.mjs +74 -0
  108. package/bin/pool/cli.mjs +11 -3
  109. package/bin/pool/docker.mjs +33 -2
  110. package/bin/pool/health.mjs +38 -0
  111. package/bin/pool/lane-tools.mjs +23 -4
  112. package/bin/pool/lane-tools.test.mjs +12 -1
  113. package/bin/pool/router.mjs +21 -3
  114. package/bin/runner.mjs +37 -0
  115. package/bin/splash-scene.mjs +356 -0
  116. package/bin/win-hide-children.mjs +114 -0
  117. package/commands/orchestrate.md +18 -27
  118. package/commands/review-pr-agents/infra.md +1 -0
  119. package/commands/review-pr-staging.md +2 -2
  120. package/docs/CONFIG.md +60 -3
  121. package/docs/OUTCOME-CODES.md +3 -0
  122. package/package.json +1 -1
  123. package/plugins/forgedock-splash/.claude-plugin/plugin.json +1 -1
  124. package/plugins/forgedock-splash/README.md +1 -1
  125. package/plugins/forgedock-splash/hooks/scene.ts +142 -8
  126. package/pool/README.md +6 -0
  127. package/pool/image/entrypoint.sh +1 -0
  128. package/scripts/check-spec-size.sh +3 -1
  129. package/scripts/gen-splash-scene.mjs +24 -0
  130. package/scripts/review-staging-pre.sh +8 -3
  131. package/scripts/review-staging-pre.test.sh +2 -0
@@ -0,0 +1,114 @@
1
+ // SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
2
+ /**
3
+ * Windows: stop background ForgeDock processes from flashing a console window per child process.
4
+ *
5
+ * The schedd daemon and batch lanes are spawned `detached` (DETACHED_PROCESS), so they own no console.
6
+ * On Windows every console-subsystem child (gh, git, bash, node, …) they start without `windowsHide`
7
+ * then gets a brand-new *visible* console window — an orchestrate run opens a window per `gh` call.
8
+ *
9
+ * Rather than thread `windowsHide: true` through ~600 call sites, this module defaults it on the
10
+ * `child_process` module itself. It must be imported before anything else in the CLI entry so every
11
+ * module's named imports (live-synced via `syncBuiltinESMExports`) see the wrapped functions.
12
+ *
13
+ * Scope: only on win32, and only when stdout is not a TTY (background/daemon/piped runs). Interactive
14
+ * runs keep their defaults, so anything that opens a GUI (browser, editor) from a terminal behaves as before.
15
+ * An explicit `windowsHide: false` is always respected.
16
+ *
17
+ * `detached` + piped stdio (#5799): on Windows `detached` means DETACHED_PROCESS, a child with *no console at
18
+ * all*, and it overrides `windowsHide`. Every console program that child starts then gets its own visible
19
+ * window: a lane's `claude --print` (runner.mjs) opened a window per bash tool call, and `bash -c` step
20
+ * commands (effects.mjs) one per tool they ran. When the parent reads the child's output through pipes the two
21
+ * lifetimes are tied anyway, so on win32 (interactive runs too) such spawns drop `detached`: the child gets a
22
+ * windowless console that its own children share. Fire-and-forget spawns (stdio ignore / file descriptors)
23
+ * keep `detached` so lanes and the daemon still outlive their parent.
24
+ */
25
+ import { createRequire } from "node:module";
26
+
27
+ const require = createRequire(import.meta.url);
28
+ const PROMISIFY = Symbol.for("nodejs.util.promisify.custom");
29
+
30
+ // What the wrapper changes in this process: `hide` (default windowsHide) only for background runs.
31
+ const policy = { hide: true };
32
+
33
+ /** True when the parent reads the child's stdio through pipes (Node's default stdio is "pipe"). */
34
+ export function pipedStdio(stdio) {
35
+ if (stdio === undefined || stdio === "pipe" || stdio === "overlapped") return true;
36
+ return Array.isArray(stdio) && stdio.slice(0, 3).some((s) => s === "pipe" || s === "overlapped" || s === undefined || s === null);
37
+ }
38
+
39
+ /** Return `opts` adjusted for Windows: default `windowsHide` (background runs), drop `detached` when piped. */
40
+ export function withHide(opts) {
41
+ if (opts == null) return policy.hide ? { windowsHide: true } : opts;
42
+ if (typeof opts !== "object") return opts;
43
+ let out = opts;
44
+ if (policy.hide && out.windowsHide === undefined) out = { ...out, windowsHide: true };
45
+ if (out.detached === true && pipedStdio(out.stdio)) out = { ...out, detached: false };
46
+ return out;
47
+ }
48
+
49
+ /** Re-shape `(file, args?, options?, ...rest)` — the spawn/execFile/fork signature. */
50
+ export function hideFileArgs(argv) {
51
+ const a = [...argv];
52
+ if (Array.isArray(a[1])) {
53
+ if (typeof a[2] === "function") a.splice(2, 0, withHide(undefined));
54
+ else a[2] = withHide(a[2]);
55
+ } else if (a[1] != null && typeof a[1] === "object") {
56
+ a[1] = withHide(a[1]);
57
+ } else if (typeof a[1] === "function") {
58
+ a.splice(1, 0, [], withHide(undefined));
59
+ } else {
60
+ // (file) or (file, undefined, …): keep positions, fill options
61
+ a[1] = a[1] ?? [];
62
+ if (typeof a[2] === "function") a.splice(2, 0, withHide(undefined));
63
+ else a[2] = withHide(a[2]);
64
+ }
65
+ return a;
66
+ }
67
+
68
+ /** Re-shape `(command, options?, ...rest)` — the exec/execSync signature. */
69
+ export function hideCmdArgs(argv) {
70
+ const a = [...argv];
71
+ if (typeof a[1] === "function") a.splice(1, 0, withHide(undefined));
72
+ else a[1] = withHide(a[1]);
73
+ return a;
74
+ }
75
+
76
+ /** Whether this process defaults `windowsHide` (win32 background runs). */
77
+ export function shouldInstall({ platform = process.platform, isTTY = process.stdout?.isTTY, env = process.env } = {}) {
78
+ if (platform !== "win32") return false;
79
+ if (env.FORGEDOCK_NO_WINDOWS_HIDE === "1") return false;
80
+ return !isTTY;
81
+ }
82
+
83
+ /** Whether the wrapper is installed at all (win32, not opted out); the detached rule applies to every run. */
84
+ export function shouldWrap({ platform = process.platform, env = process.env } = {}) {
85
+ return platform === "win32" && env.FORGEDOCK_NO_WINDOWS_HIDE !== "1";
86
+ }
87
+
88
+ export function install(cp = require("node:child_process"), { hide = true } = {}) {
89
+ if (cp.__forgedockWindowsHide) return false;
90
+ policy.hide = hide;
91
+ const FILE = ["spawn", "spawnSync", "execFile", "execFileSync", "fork"];
92
+ const CMD = ["exec", "execSync"];
93
+ for (const name of FILE) {
94
+ const orig = cp[name];
95
+ if (typeof orig !== "function") continue;
96
+ const wrapped = function (...argv) { return orig.apply(this, hideFileArgs(argv)); };
97
+ const custom = orig[PROMISIFY];
98
+ if (typeof custom === "function") wrapped[PROMISIFY] = (...argv) => custom(...hideFileArgs(argv));
99
+ cp[name] = wrapped;
100
+ }
101
+ for (const name of CMD) {
102
+ const orig = cp[name];
103
+ if (typeof orig !== "function") continue;
104
+ const wrapped = function (...argv) { return orig.apply(this, hideCmdArgs(argv)); };
105
+ const custom = orig[PROMISIFY];
106
+ if (typeof custom === "function") wrapped[PROMISIFY] = (...argv) => custom(...hideCmdArgs(argv));
107
+ cp[name] = wrapped;
108
+ }
109
+ Object.defineProperty(cp, "__forgedockWindowsHide", { value: true });
110
+ require("node:module").syncBuiltinESMExports();
111
+ return true;
112
+ }
113
+
114
+ if (shouldWrap()) install(undefined, { hide: shouldInstall() });
@@ -19,9 +19,9 @@ issue yourself.
19
19
  If the input contains `--path full`, stop: read `${CLAUDE_PLUGIN_ROOT}/commands/orchestrate/legacy.md`
20
20
  and follow it instead (the previous multi-phase orchestrator).
21
21
 
22
- ## 2. Resolve, triage and build the DAG
22
+ ## 2. Resolve and triage
23
23
 
24
- Do this yourself from issue text and the code. Spawn no sub-agents here.
24
+ Do this yourself. Spawn no sub-agents here.
25
25
 
26
26
  1. **Resolve.**
27
27
  - Explicit numbers (`#12 13 14`) are used as given.
@@ -43,29 +43,20 @@ Do this yourself from issue text and the code. Spawn no sub-agents here.
43
43
  those issues. This is the only pre-filter in this command: lanes run `forgedock run-issue`, which does not
44
44
  pre-filter again. Keep its
45
45
  `pre-filter:` line for the report.
46
- 3. **Triage.** For each issue, read it once (`gh issue view N --json title,body,labels`) and record:
47
- - **Ready / skip.** Skip when it is labelled `needs-human` or `workflow:merged`, or an open PR already
48
- closes it (`gh pr list --search "Closes #N" --state open`). Say why.
49
- - **Files.** The files or areas it will likely touch: paths named in the issue, or a quick
50
- `git grep` of the symbols it names. Keep this to a few greps per issue, not an investigation.
51
- - **Size.** S, M or L, from the scope the issue describes.
52
- 4. **Build the DAG.** Edge X → N means N waits until X merges:
53
- - **Explicit:** `Depends on #X` / `Blocked by #X` where X is in the set. Match it case-insensitively and
54
- also in bold or list form (`**Depends on** #X`, `- Depends on: #X, #Y`). An open X outside the set
55
- means N is skipped as blocked.
56
- - **Logical:** one issue's fix is needed by another (for example, it adds the helper the other uses).
57
-
58
- These are the only edges. File overlap is **never** an edge: two issues that touch the same file or
59
- function still run in parallel, because each lane merges `origin/<lane>` into a conflicting PR and
60
- resolves the conflict itself. Note the overlap in the plan table as a warning only.
61
-
62
- If you find a cycle, break it at the weakest (logical) edge and say so.
63
- 5. **Show the plan** as one table: issue, title, size, likely files, waits-on (explicit/logical only),
64
- overlaps (warning). There are no waves. Then proceed without asking.
46
+ 3. **Skip** an issue labelled `needs-human` or `workflow:merged`, or one an open PR already closes
47
+ (`gh pr list --search "Closes #N" --state open`). Say why.
48
+ 4. **The DAG and the plan table are code** (`bin/lean/dag.mjs`, #5824): `forgedock orchestrate` prints
49
+ `plan:` and one row per issue (title, waits on, likely files, overlap warning) before the first lane. Do not
50
+ build or print a DAG yourself. Edge X → N (N waits until X merges) comes only from a trusted `Depends on #X` /
51
+ `Blocked by #X` line (any case, bold, list, `:`, comma/`and` lists), or, logically, when X's frozen contract
52
+ delivers a new file N's body names. File overlap is **never** an edge: overlapping issues run in parallel and
53
+ each lane merges its base and resolves the conflict; the table shows the overlap as a warning. A logical edge
54
+ that closes a cycle is dropped. An edge you believe is missing goes on the dependent as a `Depends on #X` line
55
+ before launching. The report's `false holds:` line counts planned edges an operator removed. Without
56
+ `forgedock` (agent lanes), apply the same edge rules yourself and show the same table.
65
57
 
66
58
  `K` = `--parallel` if given, otherwise `orchestration.max_concurrent` from the repo's `forge.yaml`
67
- (`yq '.orchestration.max_concurrent' forge.yaml`), otherwise 3. State the value of K and where it came
68
- from in the plan.
59
+ (`yq '.orchestration.max_concurrent' forge.yaml`), otherwise 3.
69
60
 
70
61
  **Lanes (base branches).** Each issue has its own lane, and ForgeDock works it out: an issue with a milestone
71
62
  goes to forge.yaml `branches.feature_pattern` (`milestone/<slug>`, which must exist on origin), any other issue
@@ -112,10 +103,9 @@ remaining maintenance once no feature is pending; otherwise the rest ends `held
112
103
  deferrals stop after `orchestration.max_deferrals`), relaunches an `engine-error` once, and stops admitting after
113
104
  `orchestration.breaker` engine-errors (`errors` within `window_min`; held issues continue on `--resume`). Lanes are
114
105
  capped host-wide (`orchestration.global_parallel`, `forgedock sched cap N|show`), highest priority first; within a
115
- priority, slots are shared across repos by weight (`forgedock sched weight <owner/repo> N`, default equal). Logical
116
- edges you found in step 2.4 must be written to the dependent issue as a `Depends on #X` line before launching. The
106
+ priority, slots are shared across repos by weight (`forgedock sched weight <owner/repo> N`, default equal). The
117
107
  last lines are the report table.
118
- Issue-level readiness (#4773): a trusted author's `Blocked by #N` / `Depends on #N` line is a DAG edge, and `--add` prints the edges it created; an issue labelled `blocked` (`orchestration.blocked_label`) is admitted but not dispatched until the label is removed.
108
+ Issue-level readiness (#4773): `--add` prints the edges it created; an issue labelled `blocked` (`orchestration.blocked_label`) is admitted but not dispatched until the label is removed.
119
109
  - **Agent lane (only when the `forgedock` CLI is unavailable).** Spawn one background agent per issue.
120
110
  The prompt is:
121
111
 
@@ -174,13 +164,14 @@ When a lane finishes (agent lanes; the batch runner applies the same rules itsel
174
164
  `contract.invalid` without a mid-run issue edit): the runner does not recover it and it is not an escalation. The
175
165
  batch report lists it as `unrecovered: #N (<code>: <detail>)`, like a recovery that did not merge. Mark its dependents
176
166
  skipped and leave the issue for a later run once its cause is fixed.
177
- - `engine-error`: relaunch it once.
167
+ - `engine-error`: relaunch it once. A repeat of the same error, or an `env.tool_missing` the host still has, ends `held` (waiting on engine/env change): an engine upgrade, `--set-env` or the tool appearing re-admits it. Do not `--requeue` it.
178
168
  - `ci-pending` (PR not conflicting) or `deferred`: leave it. A later `/orchestrate` resumes it.
179
169
 
180
170
  **Operational decisions are yours.** Decide them without asking and keep going. Record each one as a
181
171
  `<!-- FORGE:DECISION -->` comment (what, why, alternative) on the issue, or on the batch for batch-wide choices. The
182
172
  runner posts its own decisions (recovery, relaunch, dependency requeue, sub-issues added). The decisions you take
183
173
  yourself:
174
+ - **Requirement tracked post-deploy:** `<!-- FORGE:DECISION {"requirement":"R5","disposition":"post-deploy","quote":"<row quote>"} -->`; `quote` survives renumbering. Never add a check id.
184
175
  - **Recovery and retries:** relaunch, resume, fix-ci, base-sync, and stopping and relaunching a stuck lane.
185
176
  - **Scheduling:** K changes under host pressure, ordering, adding logical `Depends on` edges, and adding newly filed or
186
177
  decomposed sub-issues to the running batch.
@@ -48,6 +48,7 @@ If no infra context is configured above, derive the deployment model from the ch
48
48
  - Diff them — flag any settings that changed, disappeared, or gained new defaults
49
49
  - **Env var delivery mechanism**: When `command:` uses `${VAR}` (Compose interpolation, host-side parse time) and the new approach uses an entrypoint script that reads `${VAR}` (shell, container runtime), the var MUST be explicitly passed via `environment:` or `env_file:`. Compose interpolation does NOT inject the var into the container — it resolves it before the container starts. If the entrypoint reads `$VAR` but no `environment:` block passes it, the var will be empty inside the container. **This is a CONFIRMED BLOCKING finding.**
50
50
  Compose interpolation (`${VAR}` in `command:`) resolves the variable at parse time on the host before the container starts — it does NOT inject the variable into the container's environment. If the new entrypoint script reads `$VAR` but no `environment:` block passes it, the variable will be empty inside the container. This is a silent misconfiguration that only surfaces at deploy time. <!-- Added: forge#185 -->
51
+ 1d. **CI cost (forge#5760)**: a new workflow or job missing `concurrency`, `timeout-minutes`, path scoping (`paths` on push/pull_request) or a job-level `if:` (issue/comment events) is a BLOCKING finding (precheck `ci_hygiene` detects it; cite it). Flag a `FORGE:CI_BUDGET` `why=` that does not explain why the configured `shared_regression_job` could not hold the check.
51
52
  2. **Blue-green compatibility**: Do old and new versions work simultaneously?
52
53
  - API responses compatible?
53
54
  - Database schema works with both versions?
@@ -129,7 +129,7 @@ FD_ROOT=$(forge_resolve review-staging-post.sh); FD_ROOT="${FD_ROOT%/scripts/rev
129
129
  node "$FD_ROOT/bin/forgedock.mjs" review-staging ${PR_ARG_NUM:+"$PR_ARG_NUM"} ${STAGING_THOROUGH:+"$STAGING_THOROUGH"} ${STAGING_DELTA:+--delta "$STAGING_DELTA"}
130
130
  ```
131
131
 
132
- Exit 0 prints the manifest. `REVIEW_STAGING: PR #N head <sha>` gives the PR number and the full head SHA. `BUNDLE_PRS:` lists the bundle member PRs. `SCOPE_MODE=` gives the 0B.1 mode. `ROSTER:` gives the tier and reason (record them in the final summary). `CONTEXT_FILE=` names the 0C context. There is one `DISPATCH <domain> <brief file>` line per roster domain. Exit 1 is a stop: the gate printed `RESULT: BLOCK DEPLOY` (report the blocking finding list), or a `REVIEW_RESULT: status: BLOCKED` line names the blocker. Report it and do not continue. A PR with no gate comment at all indicates a gate bypass, not a clean pass.
132
+ Exit 0 prints the manifest. `REVIEW_STAGING: PR #N head <sha>` gives the PR number and the full head SHA. `BUNDLE_PRS:` lists the bundle member PRs. `SCOPE_MODE=` gives the 0B.1 mode. `CI_NET:` gives the bundle's net workflows, jobs and estimated minutes (forge#5760; report it in the final summary). `ROSTER:` gives the tier and reason (record them in the final summary). `CONTEXT_FILE=` names the 0C context. There is one `DISPATCH <domain> <brief file>` line per roster domain. Exit 1 is a stop: the gate printed `RESULT: BLOCK DEPLOY` (report the blocking finding list), or a `REVIEW_RESULT: status: BLOCKED` line names the blocker. Report it and do not continue. A PR with no gate comment at all indicates a gate bypass, not a clean pass.
133
133
 
134
134
  **Delta pass** (forge#4360): after a fix lands on staging mid-review, re-run with `--delta <previous full head SHA>`. Only that range is reviewed, by the domains it touches (a `DELTA:` manifest line), and the earlier pass is credited. The earlier pass counts as complete when it was finalized, or when every launched domain (the PR-keyed launched-agent file) delivered findings at that head with no degraded marker (forge#4573). Dispatch only the DISPATCH lines.
135
135
 
@@ -429,7 +429,7 @@ The call runs these steps in order:
429
429
  Findings come only from `FINDING:` markers, never from free text. **Exit 1 is a stop**: a `REVIEW DELIVERY FAILURE`, `RESULT: BLOCK DEPLOY` or `REVIEW_RESULT: status: BLOCKED` line names the cause. File nothing and emit no deploy approval. On a delivery failure, re-dispatch each missing reviewer once with the note "structured findings block required". A second miss is a degraded panel. Then rerun 7A. `REVIEW DELIVERY UNVERIFIED` means GitHub could not list the comments on the last attempt. It stops the run, but nothing is labelled or posted. Do not re-dispatch anyone: rerun 7A once GitHub answers.
430
430
 
431
431
  Exit 0 prints the following:
432
- - `TEST_GATE:`, `SCOPE_MODE=`.
432
+ - `TEST_GATE:`, `SCOPE_MODE=`, `CI_NET:`.
433
433
  - The counters (`FINDINGS_KEPT`, `FINDINGS_DROPPED_STALE`, `FINDINGS_PREEXISTING`, `NOTES_DEMOTED_NO_SCENARIO`, `FINDINGS_FILED`, `NOTES_LISTED`, `NOTES_CAPPED`, `NOTES_REFLAG`, `OUT_OF_SCOPE`).
434
434
  - `CODE_BRANCH=`.
435
435
  - One `NOTE` line per NOTE.
package/docs/CONFIG.md CHANGED
@@ -925,6 +925,8 @@ One row per key path of `POLICY_SCHEMA` (`bin/lean/release-config.mjs`). `<name>
925
925
  | `branches.train` | string | none | Branch prefix or name for train waves. |
926
926
  | `branches.release` | string | none | Branch prefix or name for release waves. |
927
927
  | `branches.hotfix` | string | none | Branch prefix or name for hotfix (P0) branches. |
928
+ | `release` | object | - | Release-merge settings. |
929
+ | `release.hold_merges_during_release_ci` | boolean | `true` | While a release PR (head = the integration branch, base = the default branch) has CI running, lane merges into the integration branch wait (`merge.held_release`) so they do not restart that CI; `false` disables the hold. |
928
930
  | `trust` | object | - | Who the pipeline believes. |
929
931
  | `trust.actors` | array | none | Logins whose control comments and commits are trusted. |
930
932
  | `trust.require_verified_commits` | boolean | off | Refuse release commits that are not verified. |
@@ -968,9 +970,9 @@ One row per key path of `POLICY_SCHEMA` (`bin/lean/release-config.mjs`). `<name>
968
970
  | `risk.rules[].when.contract` | boolean | none | The change touches a contract. |
969
971
  | `risk.rules[].when.rolled_units_gt` | number | none | More than this many units roll. |
970
972
  | `risk.rules[].when.diff_lines_gt` | number | none | More than this many changed lines. |
971
- | `risk.rules[].when.requires` | string | none | Named requirement that must hold. |
972
973
  | `risk.rules[].risk` | low\|medium\|high | none | `low`, `medium` or `high`. |
973
974
  | `risk.rules[].forces` | string | none | Pipeline the rule forces. |
975
+ | `risk.rules[].requires` | string | none | Named requirement (for example `rollout-declaration`) reported with the risk when the rule matches. |
974
976
  | `features` | object | - | Feature wave policy (#5571). |
975
977
  | `features.flag_policy` | require\|warn\|off | none | `require` refuses a feature wave that adds no rollout key, `warn` warns, `off` does nothing; `lanes.<name>.flag_policy` wins. |
976
978
  | `plan` | object | - | The release plan. |
@@ -1438,6 +1440,10 @@ lean:
1438
1440
  repro_quality: shadow # off | shadow (default) | enforce
1439
1441
  precheck:
1440
1442
  max_minutes: 10 # optional pre-PR check round budget in minutes (1-120)
1443
+ ci_precheck: on # on (default) | off: run the PR's required CI jobs in the lane before the PR opens (#5820)
1444
+ ci_precheck_include: [e2e] # optional: heavy kinds (e2e, visual, lighthouse, docker, build) or job ids/names to run locally too
1445
+ ci_precheck_exclude: ["gha:ci:slow-*"] # optional: job ids/names/kinds never run locally (wins over include)
1446
+ ci_precheck_max_jobs: 8 # optional cap on locally run CI jobs per round (default 8)
1441
1447
  fix_model: claude-sonnet-5-5 # optional model of fresh fix-round sessions (default: the reviewer model)
1442
1448
  builder_routing: on # on (default) | off: route the build to a mid-tier model by the frozen contract
1443
1449
  builder_mid_model: claude-sonnet-5-5 # optional mid-tier builder model (default claude-sonnet-5-5)
@@ -1461,8 +1467,12 @@ lean:
1461
1467
  | `repro_test` | string | No | `prefer` (default): on an issue labelled `bug` or `type:bug`, the plan step must freeze a `repro_test` in the contract (`{"path","id","command"}`) when the bug is testable. Before review, the engine runs `scripts/acceptance-red-green.sh` for that command on the host in every verify mode: one targeted test, red on the base (head's changed test files overlaid) and green on head. A test that ran but is not red on the base and green on head fails the precheck as `conformance.unimplemented` (it blocks in shadow too) and goes back to the builder for one in-session fix round. A head the harness could not run at all (timeout, missing runner or dependencies) ends `needs-human` with the recoverable code `env.repro_unrunnable`, not a builder round: the batch runner's recovery lane reruns it through the repo's own toolchain (see docs/OUTCOME-CODES.md). The harness runs with the lane env (`TMPDIR`, toolchain) and the workspace dependency trees, and a repro test file that is new on head is run against the base sources. A bug that is not testable (specs, docs, workflows, environment) records `"repro_test":"none"` with a one-line `repro_test_reason` and the lane continues as before. `off` gives exactly the previous contract and precheck. Each proof emits a `REPRO_RED_GREEN` run-log event (`base`, `head`) and adds a trajectory decision. |
1462
1468
  | `repro_quality` | string | No | `shadow` (default): after a repro_test is red on the base and green on head, the engine checks it deterministically (0 LLM calls) and records `repro_quality` on the run's `RUN_TERMINAL` event (`behavioural`, `patch_echo`, `mutation_survivor`, `none`) plus a `REPRO_QUALITY` run-log event. `patch_echo`: every assertion only compares literals the same diff introduced; the reviewer prompt then asks for an explicit accept or reject. `mutation_survivor`: 1-3 targeted mutations of the fix's added lines (flipped condition, early return, dropped call) all left the repro green; the tree is restored after each. `enforce` blocks a `mutation_survivor` (`conformance.mutation_survived`, kind `repro_mutation_survivor`); `off` skips the check. Flip to `enforce` only after the false-positive rate is under 5% on a replay of recent lanes. |
1463
1469
  | `precheck.max_minutes` | number | No | Total budget in minutes (1–120) of one round of pre-PR check commands (#4331). The flat form `lean.precheck_max_minutes` also works and wins. When unset, `verify.precheck_total_seconds` applies (default 600 s). Check commands run change-scoped (a learned command with a test-map entry runs only when its globs match the changed files; unmapped commands always run), concurrently up to the host worker cap under one heavy slot, each timed (`ms` in the `PRECHECK_COMMANDS` run-log event). Commands not started when the budget runs out are recorded `deferred-to-ci` (an anomaly, not a failure) and left to CI. |
1470
+ | `ci_precheck` | string | No | `on` (default) or `off` (#5820). In the pre-PR check round (after the build, before review and `PR_OPENED`) the lane runs the CI jobs the PR must pass, locally and scoped to the change. The check set is the `scripts/ci-local` plan of the change (CI definitions from the base ref plus the lane's edits, path filters, change-scoped commands; see `verification.ci_local`), narrowed to the jobs whose name or id is a required status check on the lane base (classic branch protection plus rulesets) and the jobs a required aggregator job `needs`. When no required check maps to a job (none configured or unreadable), a conservative set runs: the lint, typecheck and unit-test jobs. Heavy jobs (e2e, visual/Storybook, Lighthouse, app builds, docker images) stay CI-only unless `ci_precheck_include` names them. Each job runs as one pre-PR check command (`ci-local.sh run` with a one-job plan) under the round's budget, per-command timeout and heavy slot. A failing job goes to the builder in the precheck fix round with its log tail, like a failed declared check; a job that cannot run locally (ci-local degraded or deferred, timeout, no `yq`) is recorded with its reason as an anomaly, is not rerun in later rounds and never blocks the PR. Run-log events: `CI_PRECHECK_PLAN` (`source` required/fallback, `commands` with `job`, `why`, `steps`, `command`; `skipped` and `unrunnable` with reasons) and `CI_PRECHECK_RESULT` (`round`, `green`, per-job `status` pass/fail/unrunnable/deferred/deferred-to-ci). |
1471
+ | `ci_precheck_include` | list | No | Heavy kinds (`e2e`, `visual`, `lighthouse`, `docker`, `build`) or job ids/names (`gha:<workflow>:<job>`, `*` globs) to run locally as well; a named job also runs when it is not a required check. |
1472
+ | `ci_precheck_exclude` | list | No | Kinds or job ids/names never run locally; wins over `ci_precheck_include`. |
1473
+ | `ci_precheck_max_jobs` | integer | No | At most this many CI jobs per round (default 8); the rest are left to CI and listed in `skipped`. |
1464
1474
  | `fix_model` | string | No | Model of fresh fix-round sessions (#4363; `engine.lean_fix_model` is also read). Default: the reviewer model (`engine.lean_reviewer_model`, else Sonnet). Fix rounds for precheck, CI, docs, structure, enumerating-test and sequence-number failures, and conformance or review FAILs whose failures all cite a `file:line`, run in a fresh session (no resume of the builder's transcript) whose prompt carries only the round's failure output, the capped `git diff <base>...HEAD`, the frozen contract and the issue title and summary (under 60K characters). A fresh session that makes no commit gets one resume of the original builder session in the same round. Other rounds (block or contract corrections, CI unavailable, base-sync conflicts, failures without a file:line) resume the builder as before; round limits (`verify.max_rounds`, the one review retry) are unchanged. The run log's `PHASE_ATTEMPT_USAGE` records `mode: "fresh"\|"resume"` on each fix-round attempt. Plan and build sessions keep the builder model. |
1465
- | `builder_routing` | string | No | `on` (default) or `off` (#4394). After the contract is frozen, the lane is classed from its deliverable paths only: `risk` (any path with a built-in risk word such as auth, billing, payments, session, secret or migration, or matching a `review.risk_paths` glob), `docs-config-test` (every path is a test, doc or config file; lockfiles count as code), `small` (at most 2 non-test deliverables) or `large` (more, or none). `docs-config-test` and `small` build on the mid tier (`builder_mid_model`); `risk` and `large` build on the top model (`--model`, else the CLI default). The plan and contract-correction calls always run on the top model. A failed validate round on the mid tier (`precheck`, `ci_red`, `merge_ci`) escalates the lane once: that fix round and every later builder call, fresh fix sessions included, run on the top model. Escalation adds no round. Conformance or review fix rounds do not escalate and keep `fix_model`. `off` keeps every builder call on the top model, as before, and still records the class. The run log gets `BUILDER_ROUTE {mode, class, tier, model, risk}` and `BUILDER_ESCALATED {from, to, trigger}`, and `RUN_TERMINAL` gets `builder_tier`, `builder_class`, `builder_escalated` and `builder_model`. `forgedock stats --tiers` reports merge, conformance and post-merge-rework rates, first-pass yield and cost per tier (`mid`, `mid->top`, `top`) and class, from local run logs. Target-repo risk areas (for example detection code) belong in `review.risk_paths`. A diff that relaxes a rule in a declared `review.risk_paths` path (a new accept/rescue/allow branch or a removed deny) must add a negative test (`conformance.unimplemented` `relaxation_untested` otherwise) and always gets the independent verifier, even with `review.verifier: off` (#5237). |
1475
+ | `builder_routing` | string | No | `on` (default) or `off` (#4394). After the contract is frozen, the lane is classed from its deliverable paths only: `risk` (any path with a built-in risk word such as auth, billing, payments, session, secret or migration, or matching a `review.risk_paths` glob), `docs-config-test` (every path is a test, doc or config file; lockfiles count as code), `small` (at most 2 non-test deliverables) or `large` (more, or none). `docs-config-test` and `small` build on the mid tier (`builder_mid_model`); `risk` and `large` build on the top model (`--model`, else the CLI default). Before the contract exists, the pre-contract calls (investigation, plan, contract corrections, light build) run on a provisional route from the issue alone (#5810): top for a risk word in the title (bar session/token), a label or a named path, a `size:L` label, more than 2 named code files, or a resumed, salvaged or recovery lane; else the mid tier (class `unscoped` when the issue names no files). The run log gets `BUILDER_PREROUTE {mode, class, tier, model, reason, risk}`. The contract route may then upgrade the tier without rerunning the plan, and a provisional `risk` class floors the build at top. A failed validate round on the mid tier (`precheck`, `ci_red`, `merge_ci`) escalates the lane once: that fix round and every later builder call, fresh fix sessions included, run on the top model. Escalation adds no round. Conformance or review fix rounds do not escalate and keep `fix_model`. `off` keeps every builder call on the top model, as before, and still records the class. The run log gets `BUILDER_ROUTE {mode, class, tier, model, risk}` and `BUILDER_ESCALATED {from, to, trigger}`, and `RUN_TERMINAL` gets `builder_tier`, `builder_class`, `builder_escalated` and `builder_model`. `forgedock stats --tiers` reports merge, conformance and post-merge-rework rates, first-pass yield and cost per tier (`mid`, `mid->top`, `top`) and class, from local run logs. Target-repo risk areas (for example detection code) belong in `review.risk_paths`. A diff that relaxes a rule in a declared `review.risk_paths` path (a new accept/rescue/allow branch or a removed deny) must add a negative test (`conformance.unimplemented` `relaxation_untested` otherwise) and always gets the independent verifier, even with `review.verifier: off` (#5237). |
1466
1476
  | `builder_mid_model` | string | No | Mid-tier builder model for `builder_routing` (#4394; `engine.lean_builder_mid_model` is also read). Default `claude-sonnet-5-5`. An invalid id is ignored. |
1467
1477
  | `light.mode` | string | No | `off`, `shadow` (default) or `on` (#4448). `bin/lean/light.mjs` decides whether an issue qualifies for the light lane: a repro, steps to reproduce, expected or actual behaviour or a code block in the body; 1 to `max_files` predicted non-test files; no `size:M`/`size:L` label; no predicted path with a built-in risk word or matching `review.risk_paths`; not an `investigate(` issue, a post-deploy issue (`post-deploy`/`awaiting-promotion` label, or only post-deploy checklist items) or a decision issue (`decision`, `needs-decision`, `product-decision`, `rfc` or `adr` label, or a `decision(`/`rfc(`/`adr(` title). A missing repro or file prediction is `ambiguous`, left to a cheap classifier. `off` is never eligible; `shadow` reports the verdict without changing the lane; `on` lets an eligible issue run light. The lane wiring is #4450. A light lane posts a `FORGE:LITE` receipt on the issue (outcome light or upgraded, diff stat, red/green repro, gates, true cost from the #4407 per-session deltas, eligibility reason, upgrade reasons), and the batch efficiency report ends with a `lanes:` line: the light/upgraded/full split with cost and the upgrade rate, upgraded ÷ (light + upgraded) (#4452). A predicted file over `maintenance.hotspot.file_lines` is a hard `hotspot` reason, and every evaluated signal (repro, named files, churn, hotspot, risk path, `docs`/`config`/`chore` labels, size) is recorded in the `LIGHT_ELIGIBILITY` event's `signals` without changing the verdict (#5209). `forgedock stats --depth` reports outcomes per verdict and signal and whether the #5052 promotion criterion is met; flipping `mode: on` stays a config decision. The flat form `lean.light_mode` also works and wins. |
1468
1478
  | `light.max_lines` | number | No | Upgrade trigger (#4448): a light lane whose non-test diff (added + deleted lines) exceeds this moves to the full lane. Default 40. The other triggers: more than `max_files` non-test changed files, a repro that is not red on the base, two failed test runs, a touched risk path, or a public-API-shape change (#4449). Flat `lean.light_max_lines` wins. |
@@ -1577,7 +1587,7 @@ lean:
1577
1587
  | `checks` | string | No | Comma-separated check names that gate CI verification without `workflow` (forge#4387). Overrides the required-check set; other checks are reported, not gating. |
1578
1588
  | `invariants` | list | No | Block list of cheap repo-wide check commands (#4585), e.g. the suites that list every table, export, key or namespace (cross-tenant registry, export and purge coverage, i18n status, boundary tests). They run in the pre-PR check round in every verify mode, whichever tests the test map selected: never scoped away by `.forge/test-map.json`, deduplicated against the learned commands, and subject to the same round budget and per-command timeout. A failure goes to the builder in the precheck fix round like a failed declared check. The plan and implement prompts also carry an invariants checklist built from the list (a new table, export or key must join every registry that enumerates its kind). `forgedock check` and the light lane run them too. Absent: nothing changes. |
1579
1589
  | `guard_block` | boolean | No | Default `true` (#5239). `invariants` are the repo's pre-merge guard set: they also run on the merged tree after a base-sync (before the push), and one still failing after the fix rounds ends the lane needs-human `ci.red` instead of opening or merging the PR. Before spending a builder round, a failing invariant is run once on the merge base: if it fails there too the base is already red, so the lane ends `deferred` with `base.red` (never needs-human, retried after 900 s), the commit that last changed the files the failure names is found with `git log`, and the issue it belongs to (closing keyword, `issue-N` branch, or last `(#N)` in the message) gets a `FORGE:BASE_RED` comment and is reopened if closed; with no issue number a tracking issue is filed. `false`: failing invariants stay advisory as before. No effect without `invariants`. |
1580
- | `guard_command` | map | No | Guard gate (#4693) test-file command per extension (#4792), e.g. `".py": "scripts/pytest {path}"` for a repo whose tests need a managed environment. Consulted before the contract's validate commands and the hard-coded `node --test` / `python -m pytest -q` fallbacks. `{path}` is replaced by the repo-relative path of the guard's base copy (`<name>__guardbase.<ext>`); a template without `{path}` gets it appended. Runs from the worktree root. Keys may be written with or without the leading dot. Absent: unchanged. |
1590
+ | `guard_command` | map | No | Guard gate (#4693) test-file command per extension (#4792), e.g. `".py": "scripts/pytest {path}"` for a repo whose tests need a managed environment. Consulted before the contract's validate commands and the hard-coded `node --test` / `python -m pytest -q` fallbacks. `{path}` is replaced by the repo-relative path of the guard's base copy (`<name>__guardbase.<ext>`); a template without `{path}` gets it appended. Runs from the worktree root. Keys may be written with or without the leading dot. Absent: unchanged. Weak guards (#5752): a base test that reads file text, imports no local non-test module, runs no process and only asserts that literals exist (`assert.match`, `assert.ok(x.includes(...))`, `expect(...).toContain/toMatch`, Python `assert "lit" in s`, `re.search`) breaking is a review note (`guard_weak` event, trajectory decision), not `conformance.guard_broken`; any other assertion keeps it a strong guard. `{"kind":"supersedes","mechanism":"<name>","why":"..."}` in result.json amendments removes a named mechanism in one decision: it retires every broken guard whose test files the lane deleted; a surviving strong guard still needs its own `{"kind":"supersedes","guard":"#N"}`. |
1581
1591
  | `sandboxes` | map | No | Test sandboxes (#5450): throwaway services a lane's validate commands need. One entry per name, written on one line: `postgres: { image: postgres:16, init: "make migrate DB_URL=$SANDBOX_URL", ttl: 30m }`, `redis: { image: redis:7 }`, `api: { compose: docker-compose.test.yml, service: api, needs: [postgres, redis] }`, `http-replay: { fixtures: tests/fixtures/http/, for: integration }`. Optional `port` and `ready` (a command run in the container until it exits 0) override the postgres/redis defaults. A frozen contract validate entry declares `env: ["postgres"]`; only then is a sandbox created, once per lane, with unique container names (`forge-sbx-<lane>-<name>`), ephemeral loopback ports and `forgedock.*` labels, registered in the lane ledger so teardown and `forgedock gc` reclaim it. Validate commands get `SANDBOX_<NAME>_URL` (a `fixtures` entry: `SANDBOX_<NAME>_DIR`, an absolute path); `init` runs on the host with `SANDBOX_URL`. A name with no entry, or a host without Docker, ends the lane `needs-human` (never a skip; no-Docker uses `env.tool_missing` so the lane is placed where Docker runs). A `fixtures` entry also exports `SANDBOX_<NAME>_MODE` (`replay`, or `record` with `record: true` or `FORGE_SANDBOX_RECORD=1`); an `http*` entry also exports `SANDBOX_HTTP_REPLAY_DIR`/`_MODE`. Each lane's image sandboxes join their own network `forge-sbx-<lane>-net`. `forgedock init --minimal` writes a commented proposal detected from compose files, migrations and test markers. Images are checked or pulled once per batch process (lanes share the cache). Each sandbox adds a `FORGE:SANDBOX {name, kind, ms, cost_usd}` line to the lane decisions. Operators: `forgedock sandbox up <name>... | down | ls`. Absent: no sandbox is ever created. |
1582
1592
  | `check_run` | boolean | No | Default `false` (no Checks API call, behaviour unchanged). `true`: after each push of a reviewed head (PR open, base-sync, merge-time fix round) the engine posts one completed `forgedock/verify` check run on that head (forge#4270), `success` iff every deterministic gate the lane already ran passed: declared check commands, undeclared package edges, docs freshness, contract scope, validate ids, requirement status, hotspot growth, amendments. The output carries each gate's id, pass/fail and evidence as JSON; the run log records a `VERIFY` event. Report only: ForgeDock never makes it required and never waits on it (it is ignored by its own CI waits); requiring it is the repository's branch-protection choice. Creating check runs needs a token that may (a GitHub App with `checks: write`); a Checks API failure is logged as an anomaly and never fails the lane. |
1583
1593
  | `settle` | string | No | How long CI verification waits for a gating check name that has not reported (forge#5718). `fixed` (default): the whole 5-minute grace period, unchanged. `condition`: until the head's check suites show nothing more can report (every suite completed, the same suites on two consecutive polls, at least 20 s after the push), never longer than the grace period; an unreadable suite list keeps the fixed wait. `shadow`: waits as `fixed` and logs a `CI_SETTLE` run-log event with when the condition held (`known_at_ms`) and whether the gating set was the same (`agreed`). Turn `condition` on after shadow agrees on your repo: a workflow that registers after every suite completed (a chained `workflow_run`) is the one case the condition cannot see. The set of gating checks and their verdicts is the same in every mode. |
@@ -1649,6 +1659,35 @@ ci:
1649
1659
 
1650
1660
  State lives in a `FORGE:INTEGRATION` block in the milestone description. A red run files or updates one `integration-red` issue on the milestone (failing specs, merge range); the next green run closes it. `/deploy-info` shows open ones as a ship-gate risk and `/pipeline-status` shows each milestone's last green run. Schedule it with cron or a scheduled workflow: `forgedock integration run [--repo owner/repo] [--milestone TITLE] [--force]` (exit 1 when a run is red; `forgedock integration status` prints each last green run); `forgedock orchestrate` also runs it every `every_merges` merges.
1651
1661
 
1662
+
1663
+ ### `ci.budget` CI budget gate (forge#5760)
1664
+
1665
+ The lane check (`bin/lean/ci-gate.mjs`, wired into the lean precheck) runs on every lane whose diff changes `.github/workflows/*.yml|yaml`; it needs no config. A lane that adds a workflow file, adds a job, or adds a step that runs a single test file must either fold it into `shared_regression_job` or carry a comment in the workflow YAML:
1666
+
1667
+ ```yaml
1668
+ # FORGE:CI_BUDGET trigger=pull_request:src/gpu/** minutes=120/month why=needs a GPU runner the shared job lacks
1669
+ ```
1670
+
1671
+ On a new workflow the comment can sit anywhere in the file; on a new job or step it goes inside the job or on the comment lines directly above its id. `trigger=`, `minutes=` and `why=` are all required.
1672
+
1673
+ ```yaml
1674
+ ci:
1675
+ budget:
1676
+ max_workflows: 15
1677
+ max_ci_jobs: 40
1678
+ monthly_minutes: 50000
1679
+ shared_regression_job: regression # a job id, or a test dir (contains "/") one-file checks must live under
1680
+ ```
1681
+
1682
+ | Key | Type | Default | Description |
1683
+ |---|---|---|---|
1684
+ | `max_workflows` | number | unset (no cap) | Workflow files allowed; a lane over it fails unless it removes as many as it adds. |
1685
+ | `max_ci_jobs` | number | unset (no cap) | Jobs across all workflows; same rule. |
1686
+ | `monthly_minutes` | number | unset | Actions minutes per month, shown in the release-bundle `CI_NET:` line. The forge.yaml parser flattens `ci`, so this is the same key as `ci.monthly_minutes` (#5278). Keep the other `ci.budget` names unique within `ci`. |
1687
+ | `shared_regression_job` | string | unset | Where new one-file checks belong; a step added to this job (or running a file under this dir) needs no annotation. |
1688
+
1689
+ Failure kinds (`conformance.unimplemented`): `ci_budget_unannotated`, `ci_budget_annotation_invalid`, `ci_budget_exceeded`, and `ci_hygiene`. `ci_hygiene` covers a new workflow or job with no `concurrency`, no job-level `timeout-minutes`, no `paths`/`paths-ignore` on `push`/`pull_request`, or no job-level `if:` on `issues`/`issue_comment`/`pull_request_review_comment`/`discussion_comment` events. The staging review prints the bundle's net change (`CI_NET: workflows ±N, jobs ±M, est. minutes/month ±K`). This block is separate from the `.forge/release.yaml` `ci.budget` (`on_exceed`) block.
1690
+
1652
1691
  ## `execution` (OPTIONAL)
1653
1692
 
1654
1693
  Where `forgedock orchestrate` runs its lanes (forge#4253). Block style only.
@@ -1703,6 +1742,8 @@ execution:
1703
1742
 
1704
1743
  **Lifecycle:** each sandbox is listed in the lane ledger (`~/.forge/ledger/<batch>/sandbox-<n>.json`, kind `sandbox`) before it starts and removed from it only after teardown succeeded: on success, failure, a lane that exits without a result, and adopt after `--resume`. A sandbox left by a killed dispatcher is reaped by `forgedock gc --apply` (scope `--sandboxes`). The container provider mounts the checkout's git dir read-only at `/src` (cloned to the container's own `/work`), `~/.forge/verify-cache` read-only at `/cache`, and the batch `lanes/` dir at `/result`.
1705
1744
 
1745
+ **Pool agent image hygiene** (forge#5758, keys in the pool agent config, not `forge.yaml`): after a self-update or start builds the lane image, the agent removes superseded `forgedock-lane:<version>` images and their per-repo `-t<hash>` tools variants. `keep_lane_images` (default `2`) is the number of newest versions kept, always including the running one; a tag any container (running or exited-but-kept) uses is never removed, and images outside the `forgedock-lane:` prefix (`image` overrides) are never touched. Every `build_cache_interval_s` seconds (default `21600`, 6 h) `reap()` also runs `docker builder prune --keep-storage <build_cache_keep_gb>gb` (`build_cache_keep_gb`, default `20`) and removes dangling anonymous volumes (64-hex names no container references; named `cs-work-`/`cs-cache-` volumes are not touched). Failures are logged and never fail an update or a reap.
1746
+
1706
1747
  **Remote provider** (`bin/lean/sandbox-remote.mjs`, forge#4254). The sandbox is addressed by the id ForgeDock picks (`fdrsbx-<batch>-<issue>`), JSON over HTTP:
1707
1748
 
1708
1749
  | Request | Response |
@@ -2115,6 +2156,8 @@ topology:
2115
2156
  | `docs.paths` / `docs.registries` | list | No | Globs of the docs pages and of their registration files (nav, sitemap, `llms.txt`). A diff touching a surface with no changed file under either, and no `docs: [{surface, justification}]` in the result file, fails `docs_missing` (`conformance.unimplemented`). `paths` defaults to `docs/**`. The planner is told to add an R-docs requirement naming them. |
2116
2157
  | `docs.surfaces` | map (kind → globs) | No | Repo globs for each kind's surface files. |
2117
2158
  | `docs.link_prefixes` / `docs.link_check` | list / command | No | Default prefix `/docs`. Each internal `href="/docs/..."` or `docsHref` link the diff adds must resolve: `link_check` gets the links as arguments and a non-zero exit fails `docs_link_broken`; without it a docs file under `paths` must serve the link. With `docs.required_for` set, `docs` is also a review domain (reviewer check for undocumented or contradicting docs), `forgedock docs gate --milestone T --repo o/r` blocks closing a milestone with user-facing children and no merged `docs` child, and `/review-pr-staging` Phase 1G blocks undocumented user-facing changes. |
2159
+ | `outcome_evidence.paths` | map (area → globs) | No | Default unset (#5752): no check. Declares areas whose changes must show a before/after measurement on recorded real inputs (a replay corpus, production samples), not only mocks. A lane whose non-test changed files match an area fails precheck (`conformance.unimplemented`, kind `outcome_evidence_missing`) unless its result.json carries `"outcome_evidence": [{"area": "<area>", "metric": "<name>", "corpus": "<path>", "before": <number>, "after": <number>, "better": "higher\|lower"}]`. A row with no metric, a missing or undeclared corpus or non-numeric values is `outcome_evidence_invalid`; an `after` worse than `before` is `outcome_evidence_regressed`. Each failure names the area, the files and the required row shape. |
2160
+ | `outcome_evidence.corpus` | map (area → globs) | No | Where each area's recorded real inputs live; a row's `corpus` must match them and exist in the tree. Corpus files themselves do not trigger the area. A `post-deploy` requirement of a lane touching an area needs a metric baseline on its `.forge/post-deploy-checks.json` entry, `"baseline": {"metric": "<name>", "value": <number>, "better": "higher\|lower"}`, not a string match (`outcome_evidence_baseline_missing`). |
2118
2161
  | `topology.prod_parity` | block map | No | Default unset (no check, no behaviour change; #5284). Production-only facts the lane tests cannot exercise (runtime build mode, migration role vs app role, env-file scope, ingress). Key: path glob; value: a check command, run once with the matching changed paths as arguments (non-zero or cannot-start blocks, `conformance.unimplemented` kind `prod_parity_failed`), or `note: <how to verify>`, which blocks (kind `prod_parity_unjustified`) until `.forge-lean/result.json` carries `parity: [{surface: <glob>, justification}]`. Read by `readEnvConfig`, run by `bin/lean/prodparity.mjs`. |
2119
2162
 
2120
2163
  **Commands that use this section**: `quality-gate`, `validate` (V2 runs `verification.commands`; V4.8 runs the local CI gate; health checks and `consumer_sweep`), `work-on`
@@ -2881,6 +2924,20 @@ There is no CLI subcommand to read it yet — `doctor()` reading the receipt to
2881
2924
 
2882
2925
  ---
2883
2926
 
2927
+ ## Pool agent cache volumes
2928
+
2929
+ Keys of the pool agent's JSON config (`forgedock pool agent`), not of `forge.yaml`. Each repo's `cs-cache-<slug>` volume holds the package caches, depcache, env snapshots, git mirror and lane work dirs. The agent labels the volumes it creates `computeshare.cache=1` (`forgedock gc` reports them and never reclaims them) and sweeps them every `cache_sweep_interval_s`.
2930
+
2931
+ | Key | Type | Default | Description |
2932
+ |---|---|---|---|
2933
+ | `cache_max_age_days` | number | `14` | uv/npm/pip/poetry cache files, depcache and env snapshot entries older than this are deleted by the agent sweep, with no launch needed. The pnpm store is pruned and the git mirror gets `git gc --auto`. |
2934
+ | `cache_max_gb` | number | unset (no cap) | Per-volume cap. A volume over it is shrunk oldest-first below the cap; work dirs of live sandboxes are never touched. |
2935
+ | `cache_idle_days` | number | `30` | A volume with no launch for this long and no referencing sandbox is removed. Evicted only when its last use is known (`/cache/.last-used`, written by the lane entrypoint). |
2936
+ | `cache_never_evict` | list of volume names | `[]` | Volumes (e.g. `cs-cache-marcode`) that are never swept or evicted. |
2937
+ | `cache_sweep_interval_s` | number | `3600` | Gap between cache sweeps. |
2938
+
2939
+ A failed or timed-out sweep (10 min limit) shows as `cache_sweep_error` in the agent's `/capacity`, next to `cache_volumes` (size per volume).
2940
+
2884
2941
  ## Complete Example
2885
2942
 
2886
2943
  See [`forge.yaml.example`](../forge.yaml.example) at the repository root for a fully annotated example covering all sections.
@@ -45,6 +45,7 @@ An absent or unknown code is recorded as `unclassified`, with the raw reason kep
45
45
  | `gh.auth` | A `gh` call in a core run answered HTTP 401 (expired or revoked bot token) and one run of `scripts/refresh-bot-token.sh` plus a retry did not fix it; the run is `deferred` (retry in 120s), never `engine-error`. See `docs/CONFIG.md` "Bot token refresh" | lean | `bin/lean/retry.mjs` |
46
46
  | `rate_limited` | Session or usage limit outlasted the pause budget | engine | `err.usageLimit` / `err.resetAtEpochMs` |
47
47
  | `backend.auth` | The claude CLI login failed ("Failed to authenticate", expired or invalid login); the lane is `deferred` (retry in 900s) under a per-account hold like a usage limit, never `engine-error`, never relaunched or counted by the breaker (#5168) | lean | `bin/runner.mjs` `err.authFailure` |
48
+ | `backend.cli_failed` | The claude CLI exited 1 without reaching the API (`duration_api_ms` 0) and the result is no login or usage-limit text; the lane is `deferred` (retry in 120s), capped by `maxDeferrals`, with no account hold; the CLI `result`/`is_error` (redacted) and the account number ride on the deferral and its `RUN_TERMINAL` (#5762) | lean | `bin/runner.mjs` `err.cliFailed` |
48
49
  | `quota.exhausted` | No account has capacity (the rotator picks none: every login at its ceiling); the lane is `deferred` until the earliest reset, never spawned through the shim, never `backend.auth` (#5236) | lean | `bin/lean/quota.mjs` `poolExhausted` |
49
50
  | `engine.error` | Engine or tool failure (missing key/SDK, CLI crash, max turns, unresolved args, runner threw every attempt) | engine | `err.code` |
50
51
  | `engine.dco_rewrite` | Core work-on (forge#4997): the DCO sign-off rewrite (`git filter-branch`) of the lane's unpushed commits failed, or the lane's uncommitted changes could not be restored after it (kept on `refs/forgedock/dco-stash`). A mechanical engine step, not a human block: the lane ends `engine-error` (never `needs-human`), which `forgedock orchestrate` relaunches like any engine-error | lean | `bin/lean/signoff.mjs` `ensureSignedOff` |
@@ -100,6 +101,8 @@ An absent or unknown code is recorded as `unclassified`, with the raw reason kep
100
101
  | `docs.stale` | Core work-on: the target repo's own `scripts/check-devdocs-freshness.sh` (docs must move with `bin/lean/` / `scripts/` behaviour) still fails after one builder resume; caught before the PR instead of by its required check | lean | the repo's `scripts/check-devdocs-freshness.sh <base>` exit 1 |
101
102
  | `structure.undeclared_edge` | Core work-on: the change adds a package.json dependency between workspace packages that the frozen contract does not name, still present after one builder resume | lean | `unnamedEdges` over `scripts/structure-delta.sh` `package_edges_added` |
102
103
  | `maintenance.hotspot_growth` | Core work-on: the change grows a file already over `maintenance.hotspot.file_lines` by more than `growth_lines` without a `hotspot-exempt: <reason>` in the contract, still present after one builder resume; blocks in shadow and enforce | lean | `hotspotGrowth` precheck over `scripts/hotspots.sh --base` `growth` |
104
+ | `maintenance.counter_growth` | Core work-on: a `forge.yaml` `recurrence.counters` count grew between the merge base and the lane head without a `counter-ok: <name> <reason>` contract decision; blocks in shadow and enforce | lean | `bin/lean/hotarea.mjs` `counterGrowth` |
105
+ | `recurrence.design_missing` | Core work-on: a recurring issue (design lane) whose contract lacks a `design` block with `why_failed`, a delete/replace/extend disposition and a measurable outcome; blocks in shadow and enforce | lean | `bin/lean/recurrence.mjs` `designContractFailures` |
103
106
  | `followup.unavailable` | Core work-on: filing or verifying the tracking issue for a deferral failed; the run is deferred with nothing merged, never needs-human | lean | `file-deferred-followups.sh` exit 3/4 or an unreadable tracking issue |
104
107
  | `merge.head_mismatch` | Core work-on: CI passed for a head other than the reviewed head; merge refused | lean | Gate head differs from the reviewed head |
105
108
  | `split.unsupported` | Core work-on `refactor:split` lane (forge#4211): no codemod or index tool for the target's language (Python and TypeScript have movers), or libcst / ts-morph is not available; refused before any edit | lean | target extension, `scripts/symbol-index.py`/`symbol-index.mjs` `unsupported`, `scripts/symbol-move.py` exit 3 naming libcst, `scripts/symbol-move.mjs` exit 3 `no codemod tool for ts` (forge#4212), `scripts/refactor-verify.sh` exit 2 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgedock",
3
- "version": "1.61.2",
3
+ "version": "1.62.0",
4
4
  "description": "An AI engineering team that ships to production",
5
5
  "bin": {
6
6
  "forgedock": "bin/forgedock.mjs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "forgedock-splash",
3
3
  "version": "0.1.0",
4
- "description": "ForgeDock's startup splash for Claude Code: the F mark is forged, Clawd bonks it, sparks fly, and it settles on 'supercharged' before clearing.",
4
+ "description": "ForgeDock's startup splash for Claude Code: the F mark is forged in fire, Clawd bonks it, sparks fly, hearts float, and it settles on 'supercharged' before clearing.",
5
5
  "author": { "name": "RapierCraft Studios" },
6
6
  "homepage": "https://github.com/RapierCraftStudios/ForgeDock",
7
7
  "repository": "https://github.com/RapierCraftStudios/ForgeDock",
@@ -1,6 +1,6 @@
1
1
  # forgedock-splash
2
2
 
3
- A startup splash for ForgeDock users in Claude Code. When an interactive terminal session starts, the row above the prompt plays a short (about 6.5 s) scene: the ForgeDock "F" mark is forged white-hot and cools to chrome, Clawd walks in under the top bar, jumps and bonks it, sparks fly and a shine ring crosses the mark, the `F O R G E D O C K` wordmark types in, and it settles on `» supercharged` before the row clears.
3
+ A startup splash for ForgeDock users in Claude Code. When an interactive terminal session starts, the row above the prompt plays a short (about 6.5 s) scene: the ForgeDock "F" mark is forged white-hot with flames licking up its edges, steam puffs off as it cools to beveled, brushed chrome with a faint ember glow, Clawd trots in, spots the bar (`!`), jumps and bonks it, sparks fly and a shine ring crosses the mark, Clawd wobbles dizzy, cheers with floating hearts, the `F O R G E D O C K` wordmark types in, and it settles on `» supercharged` with Clawd waving before the row clears. `npx forgedock` opens with the same scene.
4
4
 
5
5
  It changes nothing else: no commands, prompts, tools or settings.
6
6