forgedock 1.52.0 → 1.54.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 (233) hide show
  1. package/.claude-plugin/marketplace.json +51 -0
  2. package/README.md +8 -2
  3. package/bin/auth/app-manifest.mjs +89 -0
  4. package/bin/auth/app-manifest.test.mjs +75 -0
  5. package/bin/auth/app-token.mjs +256 -0
  6. package/bin/auth/app-token.test.mjs +232 -0
  7. package/bin/brand.mjs +7 -0
  8. package/bin/config-history.mjs +151 -0
  9. package/bin/config-schema.mjs +115 -0
  10. package/bin/demo.mjs +65 -11
  11. package/bin/engine/outcome-codes.mjs +9 -3
  12. package/bin/engine/telemetry-seam.mjs +11 -3
  13. package/bin/engine/telemetry-seam.test.mjs +17 -0
  14. package/bin/engine-cli.mjs +110 -36
  15. package/bin/experiment.mjs +58 -6
  16. package/bin/first-run.mjs +122 -0
  17. package/bin/forge-utils.mjs +6 -2
  18. package/bin/forgedock.mjs +138 -142
  19. package/bin/help-text.mjs +144 -0
  20. package/bin/hooks/pre-tool-use.mjs +7 -0
  21. package/bin/journey.mjs +82 -83
  22. package/bin/lean/acceptance.mjs +313 -0
  23. package/bin/lean/acceptance.test.mjs +215 -0
  24. package/bin/lean/account-watch.mjs +28 -0
  25. package/bin/lean/account-watch.test.mjs +30 -0
  26. package/bin/lean/activation.mjs +38 -0
  27. package/bin/lean/activation.test.mjs +36 -1
  28. package/bin/lean/basered.mjs +115 -0
  29. package/bin/lean/basered.test.mjs +66 -0
  30. package/bin/lean/batch-health.mjs +114 -7
  31. package/bin/lean/batch-health.test.mjs +87 -1
  32. package/bin/lean/batch.mjs +41 -2
  33. package/bin/lean/batch.test.mjs +115 -11
  34. package/bin/lean/branchlock.mjs +54 -0
  35. package/bin/lean/branchlock.test.mjs +49 -0
  36. package/bin/lean/ceiling.mjs +72 -0
  37. package/bin/lean/ceiling.test.mjs +54 -0
  38. package/bin/lean/checkpoint-reconcile.mjs +43 -0
  39. package/bin/lean/checkpoint-reconcile.test.mjs +95 -0
  40. package/bin/lean/ci-budget.mjs +366 -0
  41. package/bin/lean/ci-budget.test.mjs +167 -0
  42. package/bin/lean/conformance.e2e.test.mjs +8 -1
  43. package/bin/lean/conformance.mjs +269 -38
  44. package/bin/lean/conformance.test.mjs +280 -7
  45. package/bin/lean/context.mjs +35 -6
  46. package/bin/lean/context.test.mjs +27 -1
  47. package/bin/lean/depcache.mjs +25 -1
  48. package/bin/lean/depcache.test.mjs +26 -0
  49. package/bin/lean/e2e.mjs +18 -2
  50. package/bin/lean/e2e.test.mjs +26 -1
  51. package/bin/lean/effects.mjs +47 -14
  52. package/bin/lean/execution.mjs +19 -3
  53. package/bin/lean/execution.test.mjs +63 -0
  54. package/bin/lean/facts.mjs +3 -3
  55. package/bin/lean/facts.test.mjs +5 -0
  56. package/bin/lean/findinglabel.mjs +16 -0
  57. package/bin/lean/findinglabel.test.mjs +39 -0
  58. package/bin/lean/fixround.mjs +14 -0
  59. package/bin/lean/fixround.test.mjs +25 -2
  60. package/bin/lean/gh-assoc.test.mjs +2 -1
  61. package/bin/lean/integration.mjs +100 -9
  62. package/bin/lean/integration.test.mjs +98 -0
  63. package/bin/lean/issuewatch-parity.mjs +64 -0
  64. package/bin/lean/issuewatch-parity.test.mjs +127 -0
  65. package/bin/lean/issuewatch-release.mjs +6 -2
  66. package/bin/lean/issuewatch-release.test.mjs +17 -1
  67. package/bin/lean/issuewatch.mjs +45 -6
  68. package/bin/lean/issuewatch.test.mjs +3 -2
  69. package/bin/lean/lanelock.mjs +14 -0
  70. package/bin/lean/lean.mjs +473 -100
  71. package/bin/lean/lean.test.mjs +686 -33
  72. package/bin/lean/light.mjs +48 -7
  73. package/bin/lean/light.test.mjs +37 -3
  74. package/bin/lean/limits.test.mjs +142 -9
  75. package/bin/lean/mechfix.mjs +124 -0
  76. package/bin/lean/mechfix.test.mjs +75 -0
  77. package/bin/lean/orchestrate-cancel.test.mjs +143 -0
  78. package/bin/lean/orchestrate.mjs +116 -28
  79. package/bin/lean/phaseledger.mjs +47 -5
  80. package/bin/lean/phaseledger.test.mjs +30 -1
  81. package/bin/lean/postdeploy-check.test.mjs +39 -0
  82. package/bin/lean/precheck.mjs +23 -4
  83. package/bin/lean/precheck.test.mjs +14 -1
  84. package/bin/lean/prereq.mjs +28 -0
  85. package/bin/lean/prereq.test.mjs +20 -0
  86. package/bin/lean/probe.mjs +4 -2
  87. package/bin/lean/prodparity.mjs +52 -0
  88. package/bin/lean/prodparity.test.mjs +67 -0
  89. package/bin/lean/prompts.mjs +77 -19
  90. package/bin/lean/quota.mjs +39 -0
  91. package/bin/lean/recovery.test.mjs +11 -1
  92. package/bin/lean/relaxation.mjs +73 -0
  93. package/bin/lean/relaxation.test.mjs +54 -0
  94. package/bin/lean/release-io.test.mjs +42 -0
  95. package/bin/lean/release-postmerge.mjs +125 -0
  96. package/bin/lean/release-preflight.mjs +58 -0
  97. package/bin/lean/release-preflight.test.mjs +114 -0
  98. package/bin/lean/release-rehearsal.mjs +64 -0
  99. package/bin/lean/release-rehearsal.test.mjs +93 -0
  100. package/bin/lean/release-review.e2e.test.mjs +77 -0
  101. package/bin/lean/release-review.mjs +254 -0
  102. package/bin/lean/release-review.test.mjs +307 -0
  103. package/bin/lean/release-snapshot.mjs +188 -0
  104. package/bin/lean/release-snapshot.test.mjs +190 -0
  105. package/bin/lean/release.mjs +296 -0
  106. package/bin/lean/release.test.mjs +387 -0
  107. package/bin/lean/render.mjs +1 -1
  108. package/bin/lean/replan.mjs +184 -0
  109. package/bin/lean/replan.test.mjs +110 -0
  110. package/bin/lean/resume.mjs +9 -7
  111. package/bin/lean/resume.test.mjs +16 -0
  112. package/bin/lean/rotator.mjs +150 -31
  113. package/bin/lean/rotator.test.mjs +105 -2
  114. package/bin/lean/sandbox-remote.mjs +9 -2
  115. package/bin/lean/schedd.mjs +83 -5
  116. package/bin/lean/schedd.test.mjs +108 -7
  117. package/bin/lean/selfreview.mjs +94 -0
  118. package/bin/lean/selfreview.test.mjs +58 -1
  119. package/bin/lean/selftest-gate.mjs +22 -0
  120. package/bin/lean/selftest-gate.test.mjs +18 -1
  121. package/bin/lean/selftest-journey.mjs +234 -0
  122. package/bin/lean/selftest-journey.test.mjs +130 -0
  123. package/bin/lean/selftest-live.mjs +2 -1
  124. package/bin/lean/seqlease.mjs +35 -1
  125. package/bin/lean/seqlease.test.mjs +15 -0
  126. package/bin/lean/seqreserve.e2e.test.mjs +135 -0
  127. package/bin/lean/seqreserve.mjs +73 -0
  128. package/bin/lean/seqreserve.test.mjs +134 -0
  129. package/bin/lean/sequence.mjs +35 -6
  130. package/bin/lean/seqversioned.mjs +147 -0
  131. package/bin/lean/stagestamp.mjs +28 -0
  132. package/bin/lean/stagestamp.test.mjs +32 -0
  133. package/bin/lean/surfaces.mjs +75 -0
  134. package/bin/lean/surfaces.test.mjs +59 -0
  135. package/bin/lean/toolplace.mjs +28 -0
  136. package/bin/lean/toolplace.test.mjs +24 -0
  137. package/bin/lean/toolstats.mjs +3 -1
  138. package/bin/lean/toolstats.test.mjs +11 -0
  139. package/bin/lean/validatebest.mjs +28 -0
  140. package/bin/lean/validatebest.test.mjs +27 -0
  141. package/bin/lean/verifier.mjs +3 -2
  142. package/bin/lean/verify.mjs +2 -1
  143. package/bin/lean/verify.test.mjs +6 -0
  144. package/bin/pool/agent.mjs +27 -4
  145. package/bin/pool/docker.mjs +5 -0
  146. package/bin/pool/router.mjs +74 -28
  147. package/bin/prereqs.mjs +111 -0
  148. package/bin/replay-timelapse.mjs +149 -0
  149. package/bin/review-staging.mjs +123 -16
  150. package/bin/review-staging.test.mjs +18 -0
  151. package/bin/runner.mjs +43 -6
  152. package/bin/splash-install.mjs +157 -0
  153. package/bin/stats/aggregate.mjs +8 -1
  154. package/bin/stats/conformance-outcomes.mjs +289 -0
  155. package/bin/stats/conformance-outcomes.test.mjs +274 -0
  156. package/bin/stats/depth.mjs +275 -0
  157. package/bin/stats/depth.test.mjs +158 -0
  158. package/bin/stats/efficiency.mjs +26 -5
  159. package/bin/stats/efficiency.test.mjs +45 -1
  160. package/bin/stats/experiment.mjs +7 -5
  161. package/bin/stats/first-review.mjs +77 -0
  162. package/bin/stats/first-review.test.mjs +36 -0
  163. package/bin/stats/firstmerge.mjs +40 -0
  164. package/bin/stats/firstmerge.test.mjs +41 -0
  165. package/bin/stats/github-source.mjs +53 -15
  166. package/bin/stats/index.mjs +147 -9
  167. package/bin/stats/local-source.mjs +12 -0
  168. package/bin/stats/origin.mjs +80 -0
  169. package/bin/stats/origin.test.mjs +58 -0
  170. package/bin/stats/query.mjs +69 -0
  171. package/bin/stats/render.mjs +3 -1
  172. package/bin/stats/scoreboard.mjs +137 -0
  173. package/bin/stats/scoreboard.test.mjs +87 -0
  174. package/bin/stats/selffiled.mjs +52 -0
  175. package/bin/stats/selffiled.test.mjs +71 -0
  176. package/bin/stats/stats.test.mjs +80 -0
  177. package/bin/tui.mjs +3 -2
  178. package/commands/bootstrap.md +15 -14
  179. package/commands/deploy-pr.md +18 -3
  180. package/commands/forge-stats.md +1 -1
  181. package/commands/forgedock-ci-setup.md +28 -0
  182. package/commands/forgedock-init.md +4 -5
  183. package/commands/issue.md +2 -0
  184. package/commands/milestone.md +9 -1
  185. package/commands/orchestrate.md +1 -1
  186. package/commands/replay.md +2 -0
  187. package/commands/review-pr-agents/security.md +4 -0
  188. package/commands/review-pr-staging.md +6 -1
  189. package/commands/work-on/build.md +4 -6
  190. package/commands/work-on/close.md +8 -0
  191. package/docs/CONFIG.md +170 -18
  192. package/docs/ISSUE-WATCH.md +25 -0
  193. package/docs/OUTCOME-CODES.md +4 -0
  194. package/docs/REPLAY.md +9 -0
  195. package/docs/SELFTEST.md +11 -0
  196. package/docs/STATS.md +61 -0
  197. package/docs/TELEMETRY.md +1 -1
  198. package/docs/eval/README.md +6 -0
  199. package/docs/eval/adversarial-bench.md +68 -0
  200. package/docs/eval/corpus/adversarial-v1.json +285 -0
  201. package/docs/eval/feature-bench.md +42 -0
  202. package/docs/eval/feature-specs/crud-auth/journeys/notes-crud-isolated.mjs +21 -0
  203. package/docs/eval/feature-specs/crud-auth/journeys/register-login.mjs +12 -0
  204. package/docs/eval/feature-specs/crud-auth/spec.md +15 -0
  205. package/docs/site/start-a-new-project.md +2 -1
  206. package/package.json +5 -2
  207. package/plugins/forgedock-splash/.claude-plugin/plugin.json +10 -0
  208. package/plugins/forgedock-splash/README.md +27 -0
  209. package/plugins/forgedock-splash/hooks/hooks.json +1 -0
  210. package/plugins/forgedock-splash/hooks/register.tsx +74 -0
  211. package/plugins/forgedock-splash/hooks/scene.ts +222 -0
  212. package/plugins/forgedock-splash/types/index.d.ts +10 -0
  213. package/pool/README.md +1 -1
  214. package/pool/image/cs-cred +14 -1
  215. package/scripts/backfill-finding-labels.mjs +50 -0
  216. package/scripts/backfill-finding-labels.test.mjs +36 -0
  217. package/scripts/bench-adversarial.mjs +216 -0
  218. package/scripts/bench-feature.mjs +170 -0
  219. package/scripts/bench-lightlane.mjs +2 -2
  220. package/scripts/bootstrap-create.mjs +2 -2
  221. package/scripts/bootstrap-validate.mjs +35 -2
  222. package/scripts/check-spec-size.sh +4 -3
  223. package/scripts/check-spec-size.test.sh +3 -0
  224. package/scripts/doctor-pipeline-state.sh +21 -6
  225. package/scripts/file-deferred-followups.sh +59 -251
  226. package/scripts/file-deferred-followups.test.sh +85 -206
  227. package/scripts/followup-route.mjs +12 -0
  228. package/scripts/owner-route-parity.test.sh +17 -1
  229. package/scripts/plan-validate-live.mjs +40 -6
  230. package/scripts/review-pr-side-effects.test.sh +40 -0
  231. package/scripts/review-pr-staging-scope.test.sh +1 -1
  232. package/scripts/review-staging-post.sh +23 -0
  233. package/scripts/review-staging-post.test.sh +8 -0
@@ -371,12 +371,23 @@ else
371
371
  # old query errored and defaulted to 0 = "no failures"). An unreadable result counts as failing.
372
372
  # forgedock/verify (the lean engine's report-only gate summary) is not a code failure: ignored, as wait-ci-green.sh does.
373
373
  # forge/deploy-gate and "Check for FORGE gate markers" (the staging review's marker status and its workflow job) are not fixable by /fix-ci: ignored here, still waited on in Phase 5.
374
+ # A still-running check is not passed (#5277): the reads below count fail, cancel and pending. When nothing has failed yet and
375
+ # checks are only unfinished, this phase reports PENDING and leaves the wait to Phase 5 (wait-ci-green.sh); never PASSED.
376
+ CI_PENDING=false
377
+ ci_only_pending() {
378
+ gh pr checks "$PR_NUMBER" $GH_FLAG --json name,bucket \
379
+ --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel")] | length' 2>/dev/null | grep -qx 0
380
+ }
374
381
  CURRENT_CI_STATUS=$(gh pr checks "$PR_NUMBER" $GH_FLAG --json name,bucket \
375
- --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel")] | length' 2>/dev/null || echo "1")
382
+ --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel" or .bucket == "pending")] | length' 2>/dev/null || echo "1")
376
383
 
377
384
  if [ "$CURRENT_CI_STATUS" -eq 0 ]; then
378
385
  echo "CI gate: PASSED (no failing checks)"
379
386
  CI_GATE_PASSED=true
387
+ elif ci_only_pending; then
388
+ echo "CI gate: PENDING ($CURRENT_CI_STATUS check(s) unfinished, none failed) — deferred to Phase 5 (wait-ci-green.sh)"
389
+ CI_PENDING=true
390
+ CI_GATE_PASSED=true
380
391
  else
381
392
  echo "CI has $CURRENT_CI_STATUS failing checks — invoking /fix-ci (max $MAX_CI_ITER iterations)"
382
393
 
@@ -394,11 +405,15 @@ else
394
405
 
395
406
  # Re-check CI status after fix attempt (same fail-closed query as above)
396
407
  FAILING_AFTER=$(gh pr checks "$PR_NUMBER" $GH_FLAG --json name,bucket \
397
- --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel")] | length' 2>/dev/null || echo "1")
408
+ --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel" or .bucket == "pending")] | length' 2>/dev/null || echo "1")
398
409
 
399
410
  if [ "$FAILING_AFTER" -eq 0 ]; then
400
411
  echo "CI gate: PASSED after $CI_ITER iteration(s)"
401
412
  CI_GATE_PASSED=true
413
+ elif ci_only_pending; then
414
+ echo "CI gate: PENDING after $CI_ITER iteration(s) ($FAILING_AFTER check(s) unfinished, none failed) — deferred to Phase 5 (wait-ci-green.sh)"
415
+ CI_PENDING=true
416
+ CI_GATE_PASSED=true
402
417
  else
403
418
  echo "CI still has $FAILING_AFTER failing checks after iteration $CI_ITER"
404
419
  fi
@@ -414,7 +429,7 @@ fi
414
429
 
415
430
  # Emit gate state marker for auditability <!-- Ref: issue #1582 — gate passes must be auditable -->
416
431
  if [ "$DRY_RUN" = "false" ] && [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "DRY_RUN" ]; then
417
- gh pr comment "$PR_NUMBER" $GH_FLAG --body "<!-- FORGE:GATE_PASS phase=ci iterations=${CI_ITER} fixes=${CI_FIXES} -->" 2>/dev/null || true
432
+ gh pr comment "$PR_NUMBER" $GH_FLAG --body "<!-- FORGE:GATE_PASS phase=ci iterations=${CI_ITER} fixes=${CI_FIXES} pending=${CI_PENDING:-false} -->" 2>/dev/null || true
418
433
  fi
419
434
  ```
420
435
 
@@ -11,7 +11,7 @@ install: internal
11
11
 
12
12
  **Input**: $ARGUMENTS (default: `diff`; modes: `diff`, `baseline`, `full`, `cost`)
13
13
 
14
- Tracks the size of every Forge command file over time. Detects bloat by comparing current sizes against the git-tracked baseline and per-command thresholds.
14
+ Run-level reports (cost, flow, issue origin via `forgedock stats --origin`) live in the CLI: see docs/STATS.md. Tracks the size of every Forge command file over time. Detects bloat by comparing current sizes against the git-tracked baseline and per-command thresholds.
15
15
 
16
16
  ## Config
17
17
 
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Conversational setup of the Actions-minutes budget and ci.mode (remote / local-first / local-attested / auto) in forge.yaml
3
+ argument-hint: "<plain-language request, e.g. keep me under 2,000 minutes, run tests locally first>"
4
+ install: extras
5
+ ---
6
+ <!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios -->
7
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
8
+
9
+ # /forgedock-ci-setup — Actions budget and CI placement
10
+
11
+ **Input**: $ARGUMENTS
12
+
13
+ Turn a plain-language request about GitHub Actions minutes into a valid `ci` block in `forge.yaml`. Deterministic facts come from `forgedock ci budget`; you only map the request to keys and confirm.
14
+
15
+ ## Steps
16
+
17
+ 1. Read plan and usage: `forgedock ci budget --json`. It gives `plan`, `includedMinutes`, `monthToDate` (across the account), `projected`, `public`, `mode`. A public repo is free hosted minutes: say so and recommend `auto` (it never switches there).
18
+ 2. Map the request to keys (flat, under `ci:`):
19
+ - "keep me under N minutes" -> `monthly_minutes: N`; "leave headroom" -> `reserve_pct` (0-90, default 10).
20
+ - "run tests locally first" -> `mode: local-first` (host checks must pass before anything is pushed that triggers paid CI).
21
+ - "post the local result as a status" -> `mode: local-attested`. Tell the user the trade-off: the status is attested by ForgeDock, not run by Actions, the same trust as a self-hosted runner.
22
+ - "just handle it" / no preference -> `mode: auto` (remote while the projection stays under budget, then local-first with a warning).
23
+ - "keep current behaviour" -> `mode: remote`.
24
+ 3. Show the projection per mode: `remote` spends about `projected` minutes; `local-first` and `local-attested` spend paid CI only on release or nightly runs. State the budget and reserve you will write.
25
+ 4. Ask the user to confirm. Only then write it: `forgedock ci budget --set-mode <mode> --budget <N> [--reserve <P>] [--plan <free|pro|team|enterprise>]`. This keeps any `milestone_integration` keys in the `ci:` block.
26
+ 5. Re-run `forgedock ci budget` and print the resulting mode. To see which local commands match the repo's workflows (same tool pins): `forgedock ci budget --propose --base origin/<base>`.
27
+
28
+ Never write a key the user did not ask for, and never guess a plan: if `plan` is `unknown`, ask for the included minutes (`--budget`).
@@ -579,10 +579,9 @@ For each optional section that is ALREADY ACTIVE in forge.yaml (detected in Phas
579
579
 
580
580
  ### 5D: Write the file
581
581
 
582
- Backup the existing file:
582
+ Record the existing file in the config history (never a `forge.yaml.bak*` file in the repo; #5315):
583
583
  ```bash
584
- cp "$FORGE_YAML" "${FORGE_YAML}.bak"
585
- echo "Backed up: forge.yaml → forge.yaml.bak"
584
+ npx forgedock config record "init edit"
586
585
  ```
587
586
 
588
587
  Write the complete new file: required sections (preserved verbatim) + active optional sections (newly generated) + inactive optional sections (left as commented-out blocks matching forge.yaml.example structure).
@@ -676,7 +675,7 @@ EOF
676
675
 
677
676
  Component options come from the Phase 5E domain-label list (fallback `core`), so board components and domain labels line up.
678
677
 
679
- **Write the IDs.** Re-run the Phase 3C field/option queries against `PROJECT_NUMBER`, then write the `project_board` section (Phase 5B schema) into `forge.yaml`, replacing any previous `project_board` block, and keep `forge.yaml.bak` from 5D. If any `gh project` call fails with a missing-scope error, print `gh auth refresh -h github.com -s read:project,project` and stop this step.
678
+ **Write the IDs.** Re-run the Phase 3C field/option queries against `PROJECT_NUMBER`, then write the `project_board` section (Phase 5B schema) into `forge.yaml`, replacing any previous `project_board` block, and keep the config-history version recorded in 5D. If any `gh project` call fails with a missing-scope error, print `gh auth refresh -h github.com -s read:project,project` and stop this step.
680
679
 
681
680
  ---
682
681
 
@@ -751,7 +750,7 @@ Next steps:
751
750
  2. Test the pipeline:
752
751
  /work-on next
753
752
  3. If any WARNING appeared above, edit forge.yaml to fix the flagged values.
754
- 4. Backup file: forge.yaml.bak (delete when satisfied)
753
+ 4. Previous version: npx forgedock config history (restore with: npx forgedock config rollback <n>)
755
754
  {If BOUNDARY_ALLOW_ALL (2G): "5. Your boundary config allows every package to import every package ({BOUNDARY_ALLOW_ALL_AT}). Consider tightening it per package once its design settles: core work-on reports import growth but only blocks undeclared package.json edges."}
756
755
 
757
756
  ForgeDock commands now use your project's config from forge.yaml.
package/commands/issue.md CHANGED
@@ -153,6 +153,8 @@ ISSUE_CREATE_SCRIPT=$(forge_resolve issue-create.sh)
153
153
  bash "$ISSUE_CREATE_SCRIPT" --title "{TITLE}" --body-file "$BODY_FILE" --label "{PRIORITY_LABEL}" --label "{CATEGORY_LABEL}" {--milestone "M"} {--repo OWNER/NAME} {--dry-run}
154
154
  ```
155
155
 
156
+ **Epic gate (forge#5336)**: when a label is `epic`, first run `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation (the body needs a ```` ```forge-acceptance ```` block with at least one journey).
157
+
156
158
  Report `**#{N}**: {title}`, URL, labels, milestone, and "Run `/work-on {N}` to start the pipeline."
157
159
 
158
160
  **Batch**: draft every issue, create each in order (no confirmation prompt), and report a table `| # | Issue | Priority | Category | Deps |`. With `--dry-run`, print the draft table plus each body and create nothing.
@@ -207,6 +207,8 @@ Present the proposed issues to the user. Ask:
207
207
 
208
208
  ### Step 6: Create issues and assign to milestone
209
209
 
210
+ **Epic acceptance (forge#5336, hard gate)**: an issue labelled `epic` (including a planned tracker) is created only with a ```` ```forge-acceptance ```` block of at least one user journey in its body (format: `bin/lean/acceptance.mjs`). Check the body first with `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation.
211
+
210
212
  **Issue body standard**: Use the **Pipeline Issue Template** from `issue.md` Phase 3D as the body structure for every issue created here (it is the single canonical standard; no bespoke inline template). The body content (Problem, Root Cause, Affected Files, Acceptance Criteria, Context, Dependencies) comes from the per-issue investigation in Step 4B. <!-- Added: forge#293 --> In greenfield mode it comes from the Step 4G plan instead, and Affected Files are planned paths inside the spike's `Repo layout`. <!-- Added: forge#4175 -->
211
213
 
212
214
  **Route creation through `/issue`'s programmatic invocation contract** (`commands/issue.md`, added #2085) instead of calling `gh issue create` directly — this gets dedup (Phase 2D) and mandatory-section body validation (Phase 3F) for free. <!-- Changed: forge#2086 — route through /issue create-hook -->
@@ -360,6 +362,8 @@ fi
360
362
 
361
363
  ### Step 6C: Re-validate dependency order
362
364
 
365
+ A milestone/feature epic's first wave has one `skeleton`-labelled issue (builds, boots, one journey passes); every other issue depends on it. Run `npx forgedock plan validate --live` to check.
366
+
363
367
  After a milestone is added, the train order changes or an issue is decomposed, run `npx forgedock plan validate --live` (#4659). Fix every `invalid` edge (a dependency in a later milestone) before continuing; `held` edges are reported only.
364
368
 
365
369
  ### Step 7: Report
@@ -442,6 +446,10 @@ bash "$(forge_resolve milestone-drift.sh)" "{slug}" --format text
442
446
 
443
447
  ### Step 1: Pre-flight check
444
448
 
449
+ **Re-plan (forge#5342)**: a lane or journey run that finds the design wrong ends with a `design-invalidated` block; the engine files one spike-amendment issue and holds the affected open siblings behind it. After it merges, run `npx forgedock replan apply --amendment N --repo {REPO}` to mark each open child unchanged, re-scoped or dropped and update the epic checklist. A re-scoped user-visible child is routed to `/design` before build (forge#5330 owns the generic visual gate).
450
+
451
+ **Feature acceptance (forge#5336, hard gate)**: `npx forgedock acceptance gate --milestone "{TITLE}" --stage ship`. A non-zero exit (a journey is red or never ran on the branch head) blocks the ship; print its lines and stop. A milestone without an epic is not gated.
452
+
445
453
  ```bash
446
454
  # Check milestone branch exists
447
455
  git fetch origin milestone/{slug}
@@ -784,7 +792,7 @@ Protected branches get ONE sync PR (`sync/milestone-{slug}`) whose head is force
784
792
 
785
793
  ## Action: Close Milestone (without shipping)
786
794
 
787
- For milestones that are abandoned or superseded:
795
+ For milestones that are abandoned or superseded: shipped milestones close only after `npx forgedock acceptance gate --milestone "{TITLE}" --stage close` exits 0 (post-deploy journeys passed; the epic keeps `awaiting-measurement` until then). Abandoning an unshipped milestone is not gated.
788
796
 
789
797
  ```bash
790
798
  gh api repos/{owner}/{repo}/milestones/{MILESTONE_NUMBER} --method PATCH --field state="closed"
@@ -105,7 +105,7 @@ remaining maintenance once no feature is pending; otherwise the rest ends `held
105
105
  `forgedock orchestrate --add <id> N...` (or `--resume <id> N...`), under its K and DAG; never start a second batch
106
106
  for them. After a decision (a `FORGE:DECISION` posted and `needs-human` removed), a blocked issue that already ended in the batch
107
107
  (`needs-human`, `invalid`, `skipped`, `dependency-*`, `ci-pending`, `deferred`) returns to it with
108
- `forgedock orchestrate --requeue <id> N... --reason "..."` (refused while it is labelled `needs-human` or closed; skipped dependents
108
+ `forgedock orchestrate --requeue <id> N... --reason "..."` (it also releases an issue shown as `paused (quota) until <ISO>`) (refused while it is labelled `needs-human` or closed; skipped dependents
109
109
  return to pending with it; a finished batch is reopened); `--add` on a `skipped` issue re-queues it (other ended issues still report `already in batch`). A dependency-skipped issue shows as `waiting on #X` while the batch runs (the blocker is re-checked each pass; merged or closed re-admits it, closed as not planned keeps it skipped) and ends `skipped` only if the blocker never resolved. Its pre-filter still closes already-fixed ones. The runner requeues `deferred` lanes by code (host busy and a full sandbox pool after their
110
110
  retry-in, uncapped, a usage limit holds admissions for that account (backend identity) until the reset, never capped, across every batch on
111
111
  the host; `forgedock limits show|clear <id>|--all` lists or drops holds; transient merge/push/idle failures back off; other
@@ -10,6 +10,8 @@ install: extras
10
10
 
11
11
  Replay a completed pipeline run. Fetches all FORGE annotations posted during the pipeline and displays them chronologically — phase headings, timestamps, and key structured fields. Read-only: nothing is written, no labels changed.
12
12
 
13
+ For a time-lapse of a whole batch or epic, run `forgedock replay --timelapse <batch|epic>` (see docs/REPLAY.md).
14
+
13
15
  **Agent model policy**: `model: "{DEFAULT_MODEL}"` — resolved from forge.yaml `agents.default_model`, else "sonnet" (standard tier). Fallback: `model: "opus"` if rate-limited. Feature gate: pass `effort` in Task/Skill spawns only on Claude Code >= 2.1.154.
14
16
 
15
17
  ---
@@ -241,6 +241,9 @@ For each named volume found: determine its container mount point. Named volumes
241
241
  **Severity**: HIGH — filesystem writes fail silently at runtime with `PermissionError`; no startup crash, so the failure only surfaces when the code path executes.
242
242
  **Evidence**: When a container's runtime user changes from root to a non-root UID, Docker named volumes retain their existing ownership (root:root). Any code path that writes to a path under a named volume mount point will fail with `[Errno 13] Permission denied`. The fix is to add `chown -R <user>:<group> <mount_point>` to the entrypoint script before the privilege-drop `exec` call. <!-- Added: forge#323 -->
243
243
 
244
+ ### Step 2.10: Production side effects × frequency
245
+ If the diff adds or changes code that creates, mutates, deletes or sends production resources (accounts, payments, emails, DNS, side-effecting external calls) and it runs from a loop, cron, `schedule:`, probe/monitor or retry, state: (a) runs/day derived from the schedule; (b) downstream effects (metrics, emails, credits, billing); (c) idempotent or rate-bounded? Per-cycle or unbounded without explicit justification, or cleanup that leaves downstream effects: CONFIRMED HIGH, blocking.
246
+
244
247
  ## Step 3: Code Quality Scan
245
248
  1. **Error handling**: Exceptions swallowed silently, generic except clauses
246
249
  2. **Resource leaks**: Unclosed connections, files, async tasks not awaited
@@ -392,6 +395,7 @@ EOF
392
395
  | XSS | Step 2.6 | COVERED | |
393
396
  | Token privilege confusion | Step 2.7 | COVERED | |
394
397
  | Unbounded resource consumption | Step 2.8 | COVERED | |
398
+ | Per-cycle production side effects | Step 2.10 | COVERED | #5238 |
395
399
  | API information disclosure | Step 2.9 (a/b/c) | COVERED | #302 |
396
400
  | Port bind address exposure | Step 2.5A | COVERED | #296 |
397
401
  | Missing container USER directive | Step 2.5B | COVERED | #296 |
@@ -10,6 +10,8 @@ install: core
10
10
 
11
11
  # Staging Review
12
12
 
13
+ > **Default path:** `forgedock release [--repo R] [--merge] [--resume <id>]` runs the whole staging→default release (PR, review panel, findings, gate, promotion, post-merge) as one resumable job; issue-watch `mode: release` starts it for the deploy PR it opens. This spec is the manual fallback when the job is unavailable or you need to drive a step by hand.
14
+
13
15
  > **Skill names**: `{FORGE_SKILL_PREFIX}` is `forgedock:` (plugin install) or empty (`install.sh`), resolved once per run by `commands/work-on.md` § Skill Name Resolution. If the skill is not found under either name, STOP and report "skill not found" — never run the phase inline.
14
16
 
15
17
  **Trigger**: Invoked by the orchestrator via `Skill("{FORGE_SKILL_PREFIX}review-pr-staging", $ARGUMENTS)`, or directly with `$ARGUMENTS` = "staging", a PR number targeting main, or "staging:feature".
@@ -215,6 +217,7 @@ CI_FAILING=$(gh pr checks "$PR_NUMBER" -R "$GH_REPO" --json name,bucket \
215
217
  --jq '[.[] | select(.name != "forgedock/verify" and .name != "forge/deploy-gate" and .name != "Check for FORGE gate markers") | select(.bucket == "fail" or .bucket == "cancel")] | length' 2>/dev/null || echo "1")
216
218
  echo "CI_FAILING: $CI_FAILING"
217
219
  ```
220
+ When the target branch's protection or rulesets (or `gate.required_checks` in forge.yaml) name required checks, only those count toward `CI_FAILING`; other red checks are listed as non-blocking warnings (`forgedock review-staging --summary` does this). With no readable required set every red check counts.
218
221
  `CI_FAILING` > 0 → BLOCK DEPLOY (unless autofixed in Phase 1F). A red `forgedock/verify` alone does not block, and neither do `forge/deploy-gate` or `Check for FORGE gate markers`: they report this review's own gate marker, so an earlier `GATE_FAILURE` never blocks the re-run that clears it.
219
222
 
220
223
  ### Phase 1F: CI Autofix
@@ -236,7 +239,7 @@ For fixable failures: checkout staging, apply fix, verify locally, commit as `fi
236
239
 
237
240
  ## Phase 2: Material Change Analysis
238
241
 
239
- **Launched-agent bookkeeping (MANDATORY)**: Step 1 truncated the PR-keyed launched-agent file. Before launching **every** Phase 2-6 reviewer (the DISPATCH briefs and the spec-owned panel), append its lowercase marker domain (for example `security`, `bug-hunter-api` or `regression-risk`) to that file: `printf '%s\n' "<domain>" >> "${FORGE_SCRATCHPAD:-$PWD/.forge-scratch}/<PR>_launched_review_agents"`. Step 7A checks delivery for exactly these domains.
242
+ **Launched-agent bookkeeping (MANDATORY)**: Step 1 writes the launch manifest (`<PR>_review_manifest.json`) and fills the PR-keyed launched-agent file from the DISPATCH briefs, so briefed domains need no append. Before launching each spec-owned Phase 2-6 reviewer (e.g. `bug-hunter-api`, `regression-risk`), append its lowercase marker domain: `printf '%s\n' "<domain>" >> "${FORGE_SCRATCHPAD:-$PWD/.forge-scratch}/<PR>_launched_review_agents"`. Reviewers post with `forgedock review-staging <PR> --post-reviewer <domain> --body-file <file>`: it writes the marker and the full `Reviewed-SHA:` from the manifest and refuses a domain that is not launched. Step 7A checks delivery for exactly these domains; on a shortfall it names each reviewer and why (stale SHA, no findings block, absent) with a `REDISPATCH <domain>` line: re-run only that reviewer.
240
243
 
241
244
  **Head SHA binding**: substitute `[REVIEW_SHA]` in every template below with the literal full head SHA from the manifest's `REVIEW_STAGING:` line before dispatch. The reviewer's post fence runs in a fresh shell, so it must never reference a shell variable and must never invent a value.
242
245
 
@@ -379,6 +382,8 @@ Invoke `/test-gate` with the manifest's `BUNDLE_PRS` and the default branch. Sav
379
382
  >>> INVOKE: Skill(skill="{FORGE_SKILL_PREFIX}test-gate", args="--prs \"<BUNDLE_PRS>\" --base <default branch>")
380
383
  ```
381
384
 
385
+ **Feature acceptance (forge#5336, blocking)**: for a milestone release PR, `--summary` runs `npx forgedock acceptance gate --branch <head ref> --stage ship` itself: a red or never-run epic journey, or a test-gate SKIP on a milestone that has an epic, is BLOCK DEPLOY, never a pass.
386
+
382
387
  **Route reachability (forge#5087, blocking when declared)**: when `forge.yaml` declares `topology.route_reachability`, list the route paths the bundle adds (`git diff --name-only --diff-filter=A <default>...HEAD`, Next.js `app/**/route.*` / `pages/api/**` mapped to URL paths, route groups removed) and run the command with them as arguments. A non-zero exit is a BLOCK finding naming the path; unset = skip.
383
388
 
384
389
  Do not judge the result yourself. Step 7A reads the output's last `FORGE:TEST_GATE:RESULT=` marker through `scripts/review-staging-post.sh test-gate`. A missing or invalid marker (gate result missing/invalid) is BLOCK, never SKIP (fail closed). The step then applies the override and the posture. It posts `FORGE:GATE_PASS` (PASS) or `FORGE:GATE_FAILURE` (blocking BLOCK, with `RESULT: BLOCK DEPLOY`), and persists the verdict for Phase 8.
@@ -376,7 +376,7 @@ Every item in the contract's `### Out of Scope` section must carry exactly one d
376
376
  - **Known-flaw rule**: a contract that keeps a known-flawed design (a design the investigation or architect plan identified as flawed, a fail-open caller, an unsound threshold) must state the flaw and list it as a `deferred → #N` item with a linked follow-up. It may not hide behind `accepted-risk` or free text.
377
377
  - Free-text exclusions without a disposition are invalid. `->` is accepted for `→`.
378
378
 
379
- **Fold, then batch** <!-- Added: forge#3843 -->: before filing anything, fold small siblings into scope. A candidate deferred item that is the same mechanical change at a sibling path and fits the remaining scope budget (a small fraction of the plan's own estimate: at most 20% of the current `ESTIMATED_DIFF_LINES`, or 200 lines when no estimate exists) goes into the contract's Deliverables, not Out of Scope; count it as `folded`. Defer only genuinely separate work (different module, design or owner). All remaining deferred items of this build go into ONE follow-up issue per class (engineering | post-deploy | external | ops, each labelled `followup:<class>` and carrying the parent's milestone, #4664) with a checklist; `scripts/file-deferred-followups.sh` appends to an existing trusted follow-up for the same parent (exact path match; a closed one is reopened only if completed, not resolved by a person, and given new items) or creates one, then records a `<!-- FORGE:DEFERRED_ISSUE: #M -->` claim marker on the parent.
379
+ **Fold, then batch** <!-- Added: forge#3843 -->: before filing anything, fold small siblings into scope. A candidate deferred item that is the same mechanical change at a sibling path and fits the remaining scope budget (a small fraction of the plan's own estimate: at most 20% of the current `ESTIMATED_DIFF_LINES`, or 200 lines when no estimate exists) goes into the contract's Deliverables, not Out of Scope; count it as `folded`. Defer only genuinely separate work (different module, design or owner). Engineering items are never filed (#5207): fold them into scope, or list them in the PR body under Out of scope. Only `post-deploy:`/`external:`/`ops:`/`host:` items are piped to `scripts/file-deferred-followups.sh`, which appends them to the aggregates (the release rollup, the batch external aggregate, the batch host aggregate), never a per-parent issue; an engineering row exits 2.
380
380
 
381
381
  **File the `deferred` follow-ups** (skip the filing on resume when the contract already exists):
382
382
 
@@ -384,7 +384,7 @@ Every item in the contract's `### Out of Scope` section must carry exactly one d
384
384
  # <Script resolution block from work-on/build.md, verbatim>
385
385
  # DEFERRED_TSV: one line per remaining deferred item: path-or-`-`<TAB>one-line why<TAB>known-flaw (or empty)[<TAB>class<TAB>label]
386
386
  # Column 1 must be a path or `-` (never requirement text or an `R<n>:` prefix: that exits 2, nothing filed); a requirement-level item
387
- # is `-` with its text in the label column. class: engineering|post-deploy|external|ops (default: the why's `post-deploy:`/`external:`/`ops:` prefix, else engineering).
387
+ # is `-` with its text in the label column. class: post-deploy|external|ops|host (default: the why's prefix; none = engineering, rejected).
388
388
  SCRIPT_REF=$(resolve_script 'file-deferred-followups')
389
389
  case "$SCRIPT_REF" in
390
390
  prose:*) echo "DEFERRED_SCRIPT=PROSE" ;; # file ONE issue by hand: marker + checklist of every path (see below)
@@ -695,7 +695,6 @@ if [ -n "$JUSTIFICATION" ]; then echo "OVERRIDE=VALID"; else echo "OVERRIDE=NONE
695
695
  # <Script resolution block from above goes here, verbatim>
696
696
  MB=$(git -C "{WORKTREE_PATH}" merge-base HEAD "origin/{PR_BASE}") || { echo "TRIM=FAILED"; exit 0; }
697
697
  PATCH_PATH="$(git -C "{WORKTREE_PATH}" rev-parse --git-common-dir)/forge-trimmed-{NUMBER}.patch"
698
- DEFERRED_TSV=""
699
698
  # OOP_PATHS: the out_of_plan= values, one per line (data, never evaluated)
700
699
  while IFS= read -r _p; do
701
700
  [ -n "$_p" ] || continue
@@ -705,12 +704,11 @@ while IFS= read -r _p; do
705
704
  else
706
705
  git -C "{WORKTREE_PATH}" rm -q -f --cached -- "$_p" && rm -f -- "{WORKTREE_PATH}/$_p" || { echo "TRIM=FAILED"; exit 0; }
707
706
  fi
708
- DEFERRED_TSV="${DEFERRED_TSV}${_p}"$'\t'"out-of-plan hunks trimmed from #{NUMBER}; saved in ${PATCH_PATH}"$'\t'$'\n'
709
707
  done <<< "$OOP_PATHS"
710
- printf '%s' "$DEFERRED_TSV" | bash "$(resolve_script 'file-deferred-followups' | sed 's/^[^:]*://')" --parent {NUMBER} --repo {GH_REPO}; echo "DEFERRED_RC=$?"
708
+ echo "TRIMMED_PATCH=${PATCH_PATH}"
711
709
  ```
712
710
 
713
- `TRIM=FAILED` or a non-zero `DEFERRED_RC` → do not trim further; keep whatever state is staged, fall back to the flag outcome (`SCOPE_FLAGGED`, nothing lost), and say so in the comment. After a successful trim re-run Step 2 once so `FORGE:DIFF_SIZE` records the trimmed numbers, set `trimmed: <N> file(s) -> #<follow-up>` and result `SCOPE_FLAGGED`.
711
+ The trimmed paths and `TRIMMED_PATCH` go into the PR body under Out of scope, never into a follow-up issue (#5207). `TRIM=FAILED` → do not trim further; keep whatever state is staged, fall back to the flag outcome (`SCOPE_FLAGGED`, nothing lost), and say so in the comment. After a successful trim re-run Step 2 once so `FORGE:DIFF_SIZE` records the trimmed numbers, set `trimmed: <N> file(s) -> <patch path>` and result `SCOPE_FLAGGED`.
714
712
 
715
713
  **Step 5 — record.** Set `DIFF_LINES`, `EXCLUDED_LINES`, `WS_LINES`, `REVIEW_WEIGHT`, `MODULES`, `ESTIMATE`, `SCOPE`, `REVIEW_DEPTH` and `RESULT` from the steps above, then post one `<!-- FORGE:DIFF_SIZE -->` comment, idempotently: find the latest trusted comment starting with the marker and edit it, otherwise create it (on resume never stack duplicates; readers use the latest trusted one). `diff_lines` stays the first field close.md and the protocol read:
716
714
 
@@ -859,6 +859,14 @@ OPEN_SUBS=${OPEN_SUBS:-0}
859
859
 
860
860
  If `OPEN_SUBS == 0` (all sub-issues done), branch on the parent's `state` <!-- Added: forge#3736 -->. An OPEN parent is closed and transitioned to `merged` with the same tiered dispatch and FULL remove list as C2. A CLOSED parent (closed at decomposition by `decomposition.close_parent`) is never closed a second time and never reopened: post the completion comment (once) and set `merged`:
861
861
  ```bash
862
+ # forge#5336: an epic closes only when its journeys are green; post-deploy journeys keep it open and labelled. Requirements transferred from lanes (#5339) count too.
863
+ if [ "$OPEN_SUBS" -eq 0 ] && gh issue view "$PARENT_REF" {GH_FLAG} --json labels --jq '.labels[].name' 2>/dev/null | grep -qx epic; then
864
+ _MS=$(gh issue view "$PARENT_REF" {GH_FLAG} --json milestone --jq '.milestone.title // empty' 2>/dev/null)
865
+ if [ -n "$_MS" ] && ! npx forgedock acceptance gate --milestone "$_MS" --stage close --repo "{GH_REPO}"; then
866
+ gh issue edit "$PARENT_REF" {GH_FLAG} --add-label awaiting-measurement # allowlist:check-command-side-effects
867
+ OPEN_SUBS=1
868
+ fi
869
+ fi
862
870
  if [ "$OPEN_SUBS" -eq 0 ]; then
863
871
  PARENT_STATE=$(gh issue view "$PARENT_REF" {GH_FLAG} --json state --jq '.state' 2>/dev/null || echo OPEN)
864
872
  COMPLETE_MSG="All sub-issues complete. Closing parent tracker. Last completed: #{NUMBER}${PR_NUMBER:+ (PR #${PR_NUMBER})}."