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.
- package/.claude-plugin/marketplace.json +51 -0
- package/README.md +8 -2
- package/bin/auth/app-manifest.mjs +89 -0
- package/bin/auth/app-manifest.test.mjs +75 -0
- package/bin/auth/app-token.mjs +256 -0
- package/bin/auth/app-token.test.mjs +232 -0
- package/bin/brand.mjs +7 -0
- package/bin/config-history.mjs +151 -0
- package/bin/config-schema.mjs +115 -0
- package/bin/demo.mjs +65 -11
- package/bin/engine/outcome-codes.mjs +9 -3
- package/bin/engine/telemetry-seam.mjs +11 -3
- package/bin/engine/telemetry-seam.test.mjs +17 -0
- package/bin/engine-cli.mjs +110 -36
- package/bin/experiment.mjs +58 -6
- package/bin/first-run.mjs +122 -0
- package/bin/forge-utils.mjs +6 -2
- package/bin/forgedock.mjs +138 -142
- package/bin/help-text.mjs +144 -0
- package/bin/hooks/pre-tool-use.mjs +7 -0
- package/bin/journey.mjs +82 -83
- package/bin/lean/acceptance.mjs +313 -0
- package/bin/lean/acceptance.test.mjs +215 -0
- package/bin/lean/account-watch.mjs +28 -0
- package/bin/lean/account-watch.test.mjs +30 -0
- package/bin/lean/activation.mjs +38 -0
- package/bin/lean/activation.test.mjs +36 -1
- package/bin/lean/basered.mjs +115 -0
- package/bin/lean/basered.test.mjs +66 -0
- package/bin/lean/batch-health.mjs +114 -7
- package/bin/lean/batch-health.test.mjs +87 -1
- package/bin/lean/batch.mjs +41 -2
- package/bin/lean/batch.test.mjs +115 -11
- package/bin/lean/branchlock.mjs +54 -0
- package/bin/lean/branchlock.test.mjs +49 -0
- package/bin/lean/ceiling.mjs +72 -0
- package/bin/lean/ceiling.test.mjs +54 -0
- package/bin/lean/checkpoint-reconcile.mjs +43 -0
- package/bin/lean/checkpoint-reconcile.test.mjs +95 -0
- package/bin/lean/ci-budget.mjs +366 -0
- package/bin/lean/ci-budget.test.mjs +167 -0
- package/bin/lean/conformance.e2e.test.mjs +8 -1
- package/bin/lean/conformance.mjs +269 -38
- package/bin/lean/conformance.test.mjs +280 -7
- package/bin/lean/context.mjs +35 -6
- package/bin/lean/context.test.mjs +27 -1
- package/bin/lean/depcache.mjs +25 -1
- package/bin/lean/depcache.test.mjs +26 -0
- package/bin/lean/e2e.mjs +18 -2
- package/bin/lean/e2e.test.mjs +26 -1
- package/bin/lean/effects.mjs +47 -14
- package/bin/lean/execution.mjs +19 -3
- package/bin/lean/execution.test.mjs +63 -0
- package/bin/lean/facts.mjs +3 -3
- package/bin/lean/facts.test.mjs +5 -0
- package/bin/lean/findinglabel.mjs +16 -0
- package/bin/lean/findinglabel.test.mjs +39 -0
- package/bin/lean/fixround.mjs +14 -0
- package/bin/lean/fixround.test.mjs +25 -2
- package/bin/lean/gh-assoc.test.mjs +2 -1
- package/bin/lean/integration.mjs +100 -9
- package/bin/lean/integration.test.mjs +98 -0
- package/bin/lean/issuewatch-parity.mjs +64 -0
- package/bin/lean/issuewatch-parity.test.mjs +127 -0
- package/bin/lean/issuewatch-release.mjs +6 -2
- package/bin/lean/issuewatch-release.test.mjs +17 -1
- package/bin/lean/issuewatch.mjs +45 -6
- package/bin/lean/issuewatch.test.mjs +3 -2
- package/bin/lean/lanelock.mjs +14 -0
- package/bin/lean/lean.mjs +473 -100
- package/bin/lean/lean.test.mjs +686 -33
- package/bin/lean/light.mjs +48 -7
- package/bin/lean/light.test.mjs +37 -3
- package/bin/lean/limits.test.mjs +142 -9
- package/bin/lean/mechfix.mjs +124 -0
- package/bin/lean/mechfix.test.mjs +75 -0
- package/bin/lean/orchestrate-cancel.test.mjs +143 -0
- package/bin/lean/orchestrate.mjs +116 -28
- package/bin/lean/phaseledger.mjs +47 -5
- package/bin/lean/phaseledger.test.mjs +30 -1
- package/bin/lean/postdeploy-check.test.mjs +39 -0
- package/bin/lean/precheck.mjs +23 -4
- package/bin/lean/precheck.test.mjs +14 -1
- package/bin/lean/prereq.mjs +28 -0
- package/bin/lean/prereq.test.mjs +20 -0
- package/bin/lean/probe.mjs +4 -2
- package/bin/lean/prodparity.mjs +52 -0
- package/bin/lean/prodparity.test.mjs +67 -0
- package/bin/lean/prompts.mjs +77 -19
- package/bin/lean/quota.mjs +39 -0
- package/bin/lean/recovery.test.mjs +11 -1
- package/bin/lean/relaxation.mjs +73 -0
- package/bin/lean/relaxation.test.mjs +54 -0
- package/bin/lean/release-io.test.mjs +42 -0
- package/bin/lean/release-postmerge.mjs +125 -0
- package/bin/lean/release-preflight.mjs +58 -0
- package/bin/lean/release-preflight.test.mjs +114 -0
- package/bin/lean/release-rehearsal.mjs +64 -0
- package/bin/lean/release-rehearsal.test.mjs +93 -0
- package/bin/lean/release-review.e2e.test.mjs +77 -0
- package/bin/lean/release-review.mjs +254 -0
- package/bin/lean/release-review.test.mjs +307 -0
- package/bin/lean/release-snapshot.mjs +188 -0
- package/bin/lean/release-snapshot.test.mjs +190 -0
- package/bin/lean/release.mjs +296 -0
- package/bin/lean/release.test.mjs +387 -0
- package/bin/lean/render.mjs +1 -1
- package/bin/lean/replan.mjs +184 -0
- package/bin/lean/replan.test.mjs +110 -0
- package/bin/lean/resume.mjs +9 -7
- package/bin/lean/resume.test.mjs +16 -0
- package/bin/lean/rotator.mjs +150 -31
- package/bin/lean/rotator.test.mjs +105 -2
- package/bin/lean/sandbox-remote.mjs +9 -2
- package/bin/lean/schedd.mjs +83 -5
- package/bin/lean/schedd.test.mjs +108 -7
- package/bin/lean/selfreview.mjs +94 -0
- package/bin/lean/selfreview.test.mjs +58 -1
- package/bin/lean/selftest-gate.mjs +22 -0
- package/bin/lean/selftest-gate.test.mjs +18 -1
- package/bin/lean/selftest-journey.mjs +234 -0
- package/bin/lean/selftest-journey.test.mjs +130 -0
- package/bin/lean/selftest-live.mjs +2 -1
- package/bin/lean/seqlease.mjs +35 -1
- package/bin/lean/seqlease.test.mjs +15 -0
- package/bin/lean/seqreserve.e2e.test.mjs +135 -0
- package/bin/lean/seqreserve.mjs +73 -0
- package/bin/lean/seqreserve.test.mjs +134 -0
- package/bin/lean/sequence.mjs +35 -6
- package/bin/lean/seqversioned.mjs +147 -0
- package/bin/lean/stagestamp.mjs +28 -0
- package/bin/lean/stagestamp.test.mjs +32 -0
- package/bin/lean/surfaces.mjs +75 -0
- package/bin/lean/surfaces.test.mjs +59 -0
- package/bin/lean/toolplace.mjs +28 -0
- package/bin/lean/toolplace.test.mjs +24 -0
- package/bin/lean/toolstats.mjs +3 -1
- package/bin/lean/toolstats.test.mjs +11 -0
- package/bin/lean/validatebest.mjs +28 -0
- package/bin/lean/validatebest.test.mjs +27 -0
- package/bin/lean/verifier.mjs +3 -2
- package/bin/lean/verify.mjs +2 -1
- package/bin/lean/verify.test.mjs +6 -0
- package/bin/pool/agent.mjs +27 -4
- package/bin/pool/docker.mjs +5 -0
- package/bin/pool/router.mjs +74 -28
- package/bin/prereqs.mjs +111 -0
- package/bin/replay-timelapse.mjs +149 -0
- package/bin/review-staging.mjs +123 -16
- package/bin/review-staging.test.mjs +18 -0
- package/bin/runner.mjs +43 -6
- package/bin/splash-install.mjs +157 -0
- package/bin/stats/aggregate.mjs +8 -1
- package/bin/stats/conformance-outcomes.mjs +289 -0
- package/bin/stats/conformance-outcomes.test.mjs +274 -0
- package/bin/stats/depth.mjs +275 -0
- package/bin/stats/depth.test.mjs +158 -0
- package/bin/stats/efficiency.mjs +26 -5
- package/bin/stats/efficiency.test.mjs +45 -1
- package/bin/stats/experiment.mjs +7 -5
- package/bin/stats/first-review.mjs +77 -0
- package/bin/stats/first-review.test.mjs +36 -0
- package/bin/stats/firstmerge.mjs +40 -0
- package/bin/stats/firstmerge.test.mjs +41 -0
- package/bin/stats/github-source.mjs +53 -15
- package/bin/stats/index.mjs +147 -9
- package/bin/stats/local-source.mjs +12 -0
- package/bin/stats/origin.mjs +80 -0
- package/bin/stats/origin.test.mjs +58 -0
- package/bin/stats/query.mjs +69 -0
- package/bin/stats/render.mjs +3 -1
- package/bin/stats/scoreboard.mjs +137 -0
- package/bin/stats/scoreboard.test.mjs +87 -0
- package/bin/stats/selffiled.mjs +52 -0
- package/bin/stats/selffiled.test.mjs +71 -0
- package/bin/stats/stats.test.mjs +80 -0
- package/bin/tui.mjs +3 -2
- package/commands/bootstrap.md +15 -14
- package/commands/deploy-pr.md +18 -3
- package/commands/forge-stats.md +1 -1
- package/commands/forgedock-ci-setup.md +28 -0
- package/commands/forgedock-init.md +4 -5
- package/commands/issue.md +2 -0
- package/commands/milestone.md +9 -1
- package/commands/orchestrate.md +1 -1
- package/commands/replay.md +2 -0
- package/commands/review-pr-agents/security.md +4 -0
- package/commands/review-pr-staging.md +6 -1
- package/commands/work-on/build.md +4 -6
- package/commands/work-on/close.md +8 -0
- package/docs/CONFIG.md +170 -18
- package/docs/ISSUE-WATCH.md +25 -0
- package/docs/OUTCOME-CODES.md +4 -0
- package/docs/REPLAY.md +9 -0
- package/docs/SELFTEST.md +11 -0
- package/docs/STATS.md +61 -0
- package/docs/TELEMETRY.md +1 -1
- package/docs/eval/README.md +6 -0
- package/docs/eval/adversarial-bench.md +68 -0
- package/docs/eval/corpus/adversarial-v1.json +285 -0
- package/docs/eval/feature-bench.md +42 -0
- package/docs/eval/feature-specs/crud-auth/journeys/notes-crud-isolated.mjs +21 -0
- package/docs/eval/feature-specs/crud-auth/journeys/register-login.mjs +12 -0
- package/docs/eval/feature-specs/crud-auth/spec.md +15 -0
- package/docs/site/start-a-new-project.md +2 -1
- package/package.json +5 -2
- package/plugins/forgedock-splash/.claude-plugin/plugin.json +10 -0
- package/plugins/forgedock-splash/README.md +27 -0
- package/plugins/forgedock-splash/hooks/hooks.json +1 -0
- package/plugins/forgedock-splash/hooks/register.tsx +74 -0
- package/plugins/forgedock-splash/hooks/scene.ts +222 -0
- package/plugins/forgedock-splash/types/index.d.ts +10 -0
- package/pool/README.md +1 -1
- package/pool/image/cs-cred +14 -1
- package/scripts/backfill-finding-labels.mjs +50 -0
- package/scripts/backfill-finding-labels.test.mjs +36 -0
- package/scripts/bench-adversarial.mjs +216 -0
- package/scripts/bench-feature.mjs +170 -0
- package/scripts/bench-lightlane.mjs +2 -2
- package/scripts/bootstrap-create.mjs +2 -2
- package/scripts/bootstrap-validate.mjs +35 -2
- package/scripts/check-spec-size.sh +4 -3
- package/scripts/check-spec-size.test.sh +3 -0
- package/scripts/doctor-pipeline-state.sh +21 -6
- package/scripts/file-deferred-followups.sh +59 -251
- package/scripts/file-deferred-followups.test.sh +85 -206
- package/scripts/followup-route.mjs +12 -0
- package/scripts/owner-route-parity.test.sh +17 -1
- package/scripts/plan-validate-live.mjs +40 -6
- package/scripts/review-pr-side-effects.test.sh +40 -0
- package/scripts/review-pr-staging-scope.test.sh +1 -1
- package/scripts/review-staging-post.sh +23 -0
- package/scripts/review-staging-post.test.sh +8 -0
package/docs/CONFIG.md
CHANGED
|
@@ -594,6 +594,28 @@ pipeline:
|
|
|
594
594
|
|
|
595
595
|
---
|
|
596
596
|
|
|
597
|
+
### `ci` budget and placement (forge#5278)
|
|
598
|
+
|
|
599
|
+
Actions-minutes awareness and where CI runs. Keys are flat under `ci:` (the parser is one level deep; they coexist with the `milestone_integration` keys above).
|
|
600
|
+
|
|
601
|
+
```yaml
|
|
602
|
+
ci:
|
|
603
|
+
mode: auto # remote | local-first | local-attested | auto (default)
|
|
604
|
+
monthly_minutes: 40000 # budget; default: the plan's included minutes
|
|
605
|
+
reserve_pct: 10 # headroom under the budget before auto switches (0-90, default 10)
|
|
606
|
+
# included_minutes: 50000 # override the built-in plan table (free 2000, pro/team 3000, enterprise 50000)
|
|
607
|
+
# plan: enterprise # override the detected plan
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
| `mode` | Behaviour |
|
|
611
|
+
|---|---|
|
|
612
|
+
| `remote` | Current behaviour: `verify.mode` ci/hybrid push and wait for Actions. |
|
|
613
|
+
| `local-first` | Host checks must pass before anything is pushed that triggers paid CI; `verify.mode` ci/hybrid run as `local`. Paid CI runs once on the release head. |
|
|
614
|
+
| `local-attested` | As `local-first`, and the host result is posted as a `forgedock/ci-local` commit status; paid CI only for release/nightly. Trust trade-off: the status is attested by ForgeDock, not run by Actions, the same trust as a self-hosted runner. |
|
|
615
|
+
| `auto` | `remote` while the projected month stays under `monthly_minutes` less `reserve_pct`; otherwise `local-first`, announced in the next batch/release report. A public repo (free hosted minutes) is never switched; an unreadable billing API stays `remote`. |
|
|
616
|
+
|
|
617
|
+
`forgedock ci budget [--repo owner/repo] [--json] [--digest] [--propose [--base REF]]` prints the plan, included minutes, month-to-date usage across the account (billing usage API: needs a token that can read the org or user billing), the projection, the active mode, alerts (projected overage, a new burn source such as a repo flipped private) and the parity hit rate (local green -> remote red, per suite). `--digest` adds the per-repo and per-workflow month digest; `--propose` lists the runnable local jobs derived from the repo's workflow files (same tool pins). `--set-mode`, `--budget`, `--reserve`, `--plan` write the `ci` block (see `/forgedock-ci-setup`). Runner minutes are weighted by OS (Linux 1, Windows 2, macOS 10). Caches live in `~/.forge/ci-budget/` (`FORGEDOCK_CI_BUDGET_DIR`).
|
|
618
|
+
|
|
597
619
|
## `execution` (OPTIONAL)
|
|
598
620
|
|
|
599
621
|
Owner opt-in for the paid API agent backend (#4257). The API backend is **never the default**: under `--backend auto` (the default) ForgeDock uses the `claude` CLI, and when no CLI is available it fails with `CLI_BACKEND_UNAVAILABLE` instead of billing `ANTHROPIC_API_KEY`.
|
|
@@ -721,6 +743,72 @@ selftest:
|
|
|
721
743
|
|
|
722
744
|
---
|
|
723
745
|
|
|
746
|
+
## `gate` (OPTIONAL)
|
|
747
|
+
|
|
748
|
+
```yaml
|
|
749
|
+
gate:
|
|
750
|
+
required_checks: ["CI"] # extra checks the staging review treats as required
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
`forgedock review-staging --summary` blocks only on the required checks of the target branch (branch protection and rulesets, read from the GitHub API) plus this explicit list; the list is never inferred. Other red checks are reported as non-blocking warnings. When no required checks can be read, every red check blocks.
|
|
754
|
+
|
|
755
|
+
## `release` (OPTIONAL)
|
|
756
|
+
|
|
757
|
+
Settings for `forgedock release [--repo owner/repo] [--merge] [--watch] [--resume <id>]` (#5208), which runs the `branches.staging` → `branches.default` release as one resumable job. State is kept in `~/.forge/releases/<id>/` (or `FORGEDOCK_RELEASE_DIR`); `--resume <id>` continues from the last completed step (preflight, release-pr, review, fixes, promotion, post-merge). Preflight refuses while lanes of the repo run or PRs to the staging branch are open, and sets the repo's batches to K=1 until the job ends. Review and fixes are not automated yet: the job stops there and tells you to use the manual path (`commands/review-pr-staging.md`). Post-merge is automated (#5213): it confirms a publish run for the merge commit (dispatching one when none appears), waits for `artifact_check`, then opens and merges the version-sync PR; a bound that runs out stops the job as blocked and `--resume <id>` retries. `--watch` is accepted and has no effect until the review step lands.
|
|
758
|
+
|
|
759
|
+
```yaml
|
|
760
|
+
release:
|
|
761
|
+
auto_merge: false
|
|
762
|
+
artifact_check: ""
|
|
763
|
+
version_sync: false
|
|
764
|
+
publish_workflow: publish.yml
|
|
765
|
+
preflight_command: ""
|
|
766
|
+
preflight_timeout: 1200
|
|
767
|
+
preflight_blocking: true
|
|
768
|
+
rehearsal_command: ""
|
|
769
|
+
rehearsal_timeout: 1200
|
|
770
|
+
rehearsal_blocking: true
|
|
771
|
+
mode: freeze
|
|
772
|
+
branch_pattern: "release/{date}-{n}"
|
|
773
|
+
fix_mode: cherry-pick
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
`forgedock release verify <sha> [--repo owner/repo]` reads the `FORGE:RELEASE` record from the PR that contains `<sha>` and exits 0 only when `<sha>` is the snapshot plus recorded picks, each a clean cherry-pick of a `branches.staging` commit (same tree as `git cherry-pick`), so a repo workflow that trusted `head.ref == staging` can call it instead.
|
|
777
|
+
|
|
778
|
+
The forge.yaml reader handles two levels, so the rehearsal block is written as the flat keys `rehearsal_command`, `rehearsal_timeout` and `rehearsal_blocking`.
|
|
779
|
+
|
|
780
|
+
| Key | Type | Required | Description |
|
|
781
|
+
|-----|------|----------|-------------|
|
|
782
|
+
| `auto_merge` | boolean | No | `true` merges the release PR with `--match-head-commit` once `FORGE:GATE_PASS` is posted and `forge/deploy-gate` is success, as `--merge` does. Default: `false` (the job stops at GATE_PASS and prints the merge command). |
|
|
783
|
+
| `artifact_check` | string | No | Shell command that confirms the published artifact (e.g. `npm view pkg@1.2.3 version`). Post-merge retries it with a bounded exponential backoff (npm propagation delay) and blocks when it keeps failing. Default: none. |
|
|
784
|
+
| `version_sync` | boolean | No | The repo pushes a `chore/sync-version-<VERSION>` branch after a release. Post-merge opens its PR to `branches.staging` if missing and merges it with `--match-head-commit` once its checks are green (no checks, or a red one, blocks the job). Default: `false`. |
|
|
785
|
+
| `publish_workflow` | string | No | Workflow file post-merge looks for (and dispatches when no run appears) for the merge commit. Default: `publish.yml`. |
|
|
786
|
+
|
|
787
|
+
| `preflight_command` | string | No | Shell command run on the host (not as Actions minutes) in the repo checkout on the staging head **before** the release PR is opened (#5277), again after each fix round, and once more on the final head before the PR is marked ready. Put the repo's own suites here, e.g. `preflight_command: npm test`. Setting it also opens the release PR as a **draft** and marks it ready only after review and a passing preflight, so Actions CI runs once on the final head. Unset: no preflight, the PR is opened ready as before. |
|
|
788
|
+
| `preflight_timeout` | integer | No | Seconds before the command is killed (counts as a failure). Default: `1200`. |
|
|
789
|
+
| `preflight_blocking` | boolean | No | `true` (default): a failure files one `release-blocker` issue per head (a re-run comments on it) and stops the job before the PR is opened or marked ready; fix it and `--resume <id>`. `false`: the failure is recorded and the release goes on. |
|
|
790
|
+
| `rehearsal_command` | string | No | Shell command run on the host (not as Actions minutes) in the repo checkout, on the release-PR head after review and before promotion (#5253). Wire the project's deploy dry-run here: bundle build, env load and the trusted-runtime closure check, e.g. `rehearsal_command: ./scripts/deploy-dry-run.sh` where the script builds the release bundle, loads the production env file in check mode and verifies the trusted-runtime closure, exiting non-zero on the first failure. Unset: no rehearsal, release behavior is unchanged. |
|
|
791
|
+
| `rehearsal_timeout` | integer | No | Seconds before the command is killed (counts as a failure). Default: `1200`. |
|
|
792
|
+
| `rehearsal_blocking` | boolean | No | `true` (default): a failure files one `release-blocker` issue per release head (a re-run at the same head comments on it) with the output tail and the head SHA, and stops the job before promotion; fix it and `--resume <id>`. `false`: the failure is recorded and promotion goes on. |
|
|
793
|
+
| `mode` | `snapshot` \| `freeze` | No | `freeze` (default) is the original behaviour: the release PR head is `branches.staging`, preflight refuses while a lane runs or a PR targets staging, and every batch is held at K=1 until the job ends. `snapshot` (#5276) cuts `release/<id>` from a staging SHA and opens `release/<id>` → `branches.default`; lanes keep merging to staging and no batch K is touched. A `FORGE:RELEASE` record (snapshot SHA, base/head range, bundle PRs, issues, cherry-picks) is kept in the job state and as a hidden marker in the PR body. Only one release branch may exist at a time. Promotion is unchanged (merge commit, `--match-head-commit`) but is stopped unless the head is the snapshot plus exactly the recorded cherry-picks. The branch is deleted after post-merge; fixes are already on staging, so nothing is back-merged. |
|
|
794
|
+
| `branch_pattern` | string | No | Snapshot branch name; `{date}` is `YYYYMMDD`, `{n}` counts the day's release PRs. Default `release/{date}-{n}`. Everything under the pattern's prefix before `{` counts as a release in flight. |
|
|
795
|
+
| `fix_mode` | `cherry-pick` \| `recut` | No | Snapshot mode only. `cherry-pick` (default): after a fix lane merges to staging, the merged commits of PRs labelled `release-blocker`, or closing a `release-blocker` issue or the blocking issue the job filed, are cherry-picked onto `release/<id>` (a clean pick only; a conflict blocks the job) and appended to `FORGE:RELEASE`. `recut`: the branch is moved to the current staging tip and the picks start over. |
|
|
796
|
+
|
|
797
|
+
The result (pass or fail, head SHA, blocker issue) is recorded in the release state (`steps.rehearsal`) and in a `FORGE:REHEARSAL` section of the release PR body next to the gate result.
|
|
798
|
+
|
|
799
|
+
Repos that set `preflight_command` should skip their Actions CI while the release PR is a draft, so the paid run happens once, on the final head:
|
|
800
|
+
|
|
801
|
+
```yaml
|
|
802
|
+
on:
|
|
803
|
+
pull_request:
|
|
804
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
805
|
+
jobs:
|
|
806
|
+
test:
|
|
807
|
+
if: ${{ !github.event.pull_request.draft }}
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
**Commands that use this section**: `forgedock release`
|
|
811
|
+
|
|
724
812
|
## `issue_watch` (OPTIONAL)
|
|
725
813
|
|
|
726
814
|
Named, scoped, capped watches for `forgedock issue-watch` (see [ISSUE-WATCH.md](ISSUE-WATCH.md)). Write `issue_watch:`, then `watches:`, then one block per watch name. The release keys need `mode: release` and at least a `threshold` or `immediate`.
|
|
@@ -757,6 +845,8 @@ issue_watch:
|
|
|
757
845
|
| `include_followups` | string | No | `none` (default) or `defer-only`. |
|
|
758
846
|
| `trust_app` | boolean | No | Claim issues authored by this repo's ForgeDock App. Other bots and `NONE`-association authors stay untrusted. Default false. |
|
|
759
847
|
| `trust_app_labels` | list | No | Needs `trust_app`: an App-authored issue must carry one of these labels. |
|
|
848
|
+
| `skip_labels` | list | No | Issues carrying any of these labels are skipped. Default for `mode: batch`: `epic, needs-human, post-deploy, workflow:merged, awaiting-promotion, host-task`; `[]` for the other modes and to switch it off. |
|
|
849
|
+
| `release_pause` | boolean | No | Pause the watch while a `forgedock release` job is in flight; it resumes by itself. Default true in `mode: batch`. |
|
|
760
850
|
| `postdeploy_rollup` | issue number | No | Release issue that collects post-deploy-only follow-ups as checklist lines. |
|
|
761
851
|
| `sweep_needs_human` | boolean | No | Also settle `needs-human` escalations that predate the watch (the backlog). Default false; `forgedock issue-watch run --dry-run` classifies them first and writes nothing. |
|
|
762
852
|
| `max_launches` | integer | No | Total lane launches (claims plus requeues by the decision engine); at N the watch drains. Default: none. Decision-stage issues also count against `max_issues`. |
|
|
@@ -775,12 +865,12 @@ Deferred follow-ups (`scripts/file-deferred-followups.sh`) are routed by kind (#
|
|
|
775
865
|
| Kind | Where it goes |
|
|
776
866
|
|---|---|
|
|
777
867
|
| Post-promotion, production-verify, rollout-promote (`post-deploy`, `owner:orchestrator`, `owner:promote:<flag>`, or an owner why such as "after release", "rollout", "purge") | A checklist line in the repo's ONE open post-deploy rollup (`FORGE:POSTDEPLOY_ROLLUP`, else the lowest open issue labelled `followups.rollup_issue_label`). Never a new issue when one is open. |
|
|
778
|
-
| Read-only production data or capture (bucket `host`, or an owner why naming obs-psql, a `*-monitor` or a read-only prod query) |
|
|
779
|
-
| Truly external (credentials, spend, an account, a third party, a customer) | ONE issue per batch (`FORGE:EXTERNAL_BATCH: <batch id>`) holding every item under a `### #<parent>` heading, labelled `followup:external`, `external-prerequisite` and `needs-human`. |
|
|
780
|
-
|
|
|
781
|
-
| Engineering |
|
|
868
|
+
| Read-only production data or capture (bucket `host`, or an owner why naming obs-psql, a `*-monitor` or a read-only prod query) | ONE host aggregate per batch (`FORGE:HOST_BATCH: <batch id>`) holding every item under a `### #<parent>` heading. Labels `followup:host` and `host-task`, never `needs-human` (#5207). |
|
|
869
|
+
| Truly external, and `ops` (credentials, spend, an account, a third party, a customer) | ONE issue per batch (`FORGE:EXTERNAL_BATCH: <batch id>`) holding every item under a `### #<parent>` heading, labelled `followup:external`, `external-prerequisite` and `needs-human`. |
|
|
870
|
+
| `verify-now` | The release rollup, like `post-deploy` (#5207). |
|
|
871
|
+
| Engineering (bucket `new-issue`, class `engineering`, or no class) | Never filed (#5207): the conformance review rejects the deferral and the builder delivers it in the same lane; the script exits 2. No per-parent follow-up issue is filed for any class. |
|
|
782
872
|
|
|
783
|
-
Each issue carries the label `followup:<class>` and inherits the parent's milestone. A requirement may set an optional `class` in the contract. Otherwise `post-deploy` items are `post-deploy` and the rest `engineering
|
|
873
|
+
Each issue carries the label `followup:<class>` and inherits the parent's milestone. A requirement may set an optional `class` in the contract. Otherwise `post-deploy` items are `post-deploy` and the rest `engineering` (rejected). A parent milestone that has shipped (closed) is replaced by the next open milestone by due date, else `followups.default_milestone`. The batch report lists `follow-ups appended: #N (<class>: k item(s) from #a,#b)` per issue, not "issues filed".
|
|
784
874
|
|
|
785
875
|
```yaml
|
|
786
876
|
followups:
|
|
@@ -816,6 +906,29 @@ A post-deploy requirement carries a check id (`[check:<id>]` in the follow-up it
|
|
|
816
906
|
|
|
817
907
|
`pass` is `exit 0` (default) or a `/regex/flags` over the output; `timeout` is seconds. When the gate reports the follow-up ready, the check runs with no model call: pass closes the follow-up with a `FORGE:PROBE` record, fail reopens the parent with the output. An item with no check id, or an id the default branch does not define, gets the `awaiting-measurement` label and never a lane. A contract's check id must be on the default branch or added by the same PR.
|
|
818
908
|
|
|
909
|
+
### Experiment arm overrides (#5206)
|
|
910
|
+
|
|
911
|
+
An `experiment:` arm can carry config overrides that apply only to the lanes hashed to that arm, so one batch, one checkout and the normal issue flow run both arms. A key is `<arm>.<key>: <value>`, where `<arm>` is a declared arm:
|
|
912
|
+
|
|
913
|
+
```yaml
|
|
914
|
+
experiment:
|
|
915
|
+
id: explore-ab
|
|
916
|
+
arms: on,off
|
|
917
|
+
on.lean.explore: on
|
|
918
|
+
off.lean.explore: off
|
|
919
|
+
min_n: 20
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
| Override key | Values | Overrides |
|
|
923
|
+
|---|---|---|
|
|
924
|
+
| `lean.explore` | `on`, `off` | `lean.explore` |
|
|
925
|
+
| `lean.explore_model` | a model id | `lean.explore_model` |
|
|
926
|
+
| `lean.light_mode` | `off`, `shadow`, `on` | `lean.light_mode` |
|
|
927
|
+
| `context_pack` | `shadow`, `on`, `off` (not `ab`) | `engine.context_pack` |
|
|
928
|
+
| `review.verifier` | `off`, `shadow`, `enforce` | `review.verifier` |
|
|
929
|
+
|
|
930
|
+
Any other dotted key, a key for an undeclared arm, or an invalid value makes the whole `experiment:` declaration invalid. The experiment is then ignored, with the reason printed to stderr, and no override is ever partly applied. The lane applies its arm's overrides before it reads any of these settings. `RUN_TERMINAL` (and `phase_attempt` telemetry) records `arm_overrides`: the applied overrides as a sorted `key=value` list, or `none`. `forgedock stats --experiment <id>` adds an `applied` column per arm: the runs whose recorded overrides match the arm's. A count below `n` means the toggle did not apply on some runs.
|
|
931
|
+
|
|
819
932
|
Closing an experiment follow-up (#4634): add a check that runs `forgedock stats --experiment <id> --require-met` (exit 0 only when every target of the forge.yaml `experiment:` is met; n/a below min n is not met), and put `[check:<check id>]` in the follow-up item:
|
|
820
933
|
|
|
821
934
|
```json
|
|
@@ -877,12 +990,13 @@ lean:
|
|
|
877
990
|
| `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. |
|
|
878
991
|
| `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. |
|
|
879
992
|
| `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. |
|
|
880
|
-
| `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`. |
|
|
993
|
+
| `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). |
|
|
881
994
|
| `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. |
|
|
882
|
-
| `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). The flat form `lean.light_mode` also works and wins. |
|
|
995
|
+
| `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. |
|
|
883
996
|
| `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. |
|
|
884
997
|
| `light.max_files` | number | No | Max predicted non-test files for eligibility and max changed non-test files before an upgrade (#4448). Default 2. Flat `lean.light_max_files` wins. |
|
|
885
998
|
| `sequence.regenerate` | string | No | Command run in the lane worktree (`sh -c`) after the engine renumbers a schema-changing sequence-numbered migration (#4386), to regenerate its snapshot, e.g. `pnpm --filter @x/db db:generate`. The flat form `lean.sequence_regenerate` also works and wins. When a lane-added numbered file (`NNNN_*.sql`, a drizzle `meta/_journal.json` + `meta/NNNN_snapshot.json`, a numbered ADR) shares its number with the base, the engine renumbers it without a builder session: `git mv` to max(base)+1…, the document's own number in its heading, references to the old name repo-wide, the base journal plus the lane's entries, and a data-only migration's snapshot cloned from the base tip with a new `id`/`prevId`. A schema-changing migration without this command, or a migration in another language (`.py`, `.ts`), falls back to the builder renumber, and the trajectory records why. When the generator writes no snapshot for a hand-written migration (no schema diff), the engine reruns it with ` --custom` appended (drizzle-kit's empty migration), keeps its snapshot and restores the lane's SQL byte-identical, so the command must forward trailing args (a pnpm/yarn script, or `npm run x --`). A base-sync whose conflicts are only in such files is resolved the same way, with no re-review. At the merge gate a lane with numbered files holds a host sequence lease per (repo, lane branch, directory) from its last renumber check through the merge, so only one numbered-file PR is in the renumber→CI→merge window at a time. |
|
|
999
|
+
| `sequence.versioned` | string | No | Versioned-directory sequence classes (#5235), `<dir>/v{N} -> companion[, companion]; ...`, e.g. `scripts/backup-contracts/v{N} -> src/version.ts=VERSION = {N}`. A companion is a file that references the version, as `path` (it holds the class name, `v{N}`) or `path=template` (`{N}` is the version). When a lane-added `<dir>/vN` collides with a version the base has, the engine renumbers it (`git mv`, then rewrites each companion from the old to the new version) without a builder. The flat form `lean.sequence_versioned` also works and wins. Build-start reservation: before the build the engine reserves, through the host sequence lease, one number per numbered series dir (and one version per configured class) the frozen contract's deliverables touch, above the base and the other open PRs, and tells the builder which to use, so concurrent lanes on one branch get distinct numbers. A renumber after a base-sync reruns the frozen validate commands before the merge (one fix round, then an anomaly). Fail-open: errors mean no reservation. Default: none, so nothing changes. |
|
|
886
1000
|
| `base_merge_union_globs` / `base_merge_json_globs` / `base_merge_generated_globs` / `base_merge_generated_command` | string | No | Deterministic resolution of sibling-lane conflicts when the lane merges its base (#4588, `bin/lean/conflictres.mjs`; flat keys only). Comma-separated globs (`*` within a segment, `**` across; no `/` matches the file name anywhere). `union_globs`: hunks where both sides only added lines keep both. `json_globs`: a 3-way key union of a JSON object (a key both sides changed differently is refused). `generated_globs` + `generated_command`: the base side is taken, then the command runs once in the lane worktree (`sh -c`) and the files are re-added. A file that cannot be fully resolved, and every sequence/migration file, goes on as before (sequence resolver, then the builder). Default: none, so nothing changes. The same keys apply to milestone branch syncs (`forgedock milestone-sync`, #4663). |
|
|
887
1001
|
| `milestones.sync_debounce` | string | No | Debounce window of the milestone sync PR (#4663, `bin/lean/milestonesync.mjs`): on a protected milestone branch `forgedock milestone-sync` keeps ONE `sync/milestone-{slug}` PR and force-pushes its head in place; a base that moved again inside the window reports `debounced` (a `ship` sync ignores the window). `10m`, `1h`, `1d`. Default: `10m`. |
|
|
888
1002
|
|
|
@@ -940,6 +1054,7 @@ verify:
|
|
|
940
1054
|
".py": "scripts/pytest {path}"
|
|
941
1055
|
e2e: auto # optional e2e merge gate: auto (default) | always | never
|
|
942
1056
|
precheck_block: false # optional (#5079); true: a declared pre-PR check still failing after the fix round (or a round with no commit) ends the lane needs-human ci.red (recoverable) instead of opening the PR with an anomaly
|
|
1057
|
+
guard_block: true # optional (#5239); default true: verify.invariants (the pre-merge guard set) block the merge; false keeps a failing invariant advisory
|
|
943
1058
|
e2e_label: full-ci # PR label that makes the repo's CI run e2e (label path)
|
|
944
1059
|
e2e_checks: "e2e" # check names of the e2e jobs the label path waits on
|
|
945
1060
|
# e2e_workflow: e2e.yml # or: a workflow_dispatch workflow that runs e2e (wins over the label)
|
|
@@ -959,6 +1074,7 @@ verify:
|
|
|
959
1074
|
| `precheck_total_seconds` | integer | No | Total budget of one round of pre-PR check commands (1–7200, default 600; it was 1800 before 1.30.0). `lean.precheck.max_minutes` takes precedence. Commands not started within the budget are deferred to CI, not failed. |
|
|
960
1075
|
| `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. |
|
|
961
1076
|
| `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. |
|
|
1077
|
+
| `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`. |
|
|
962
1078
|
| `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. |
|
|
963
1079
|
| `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. |
|
|
964
1080
|
| `post_merge` | string | No | Command run in the lane worktree on the merged tree after each base-sync merge, before the push (forge#4406). Default: the typecheck rows of the lane's change-scoped checks (`bin/lean/checks.mjs`), in `local` and `hybrid` mode only; `ci` mode runs no host typecheck unless `post_merge` is set. A failure resumes the builder with the output, up to `max_rounds` rounds, and the fixed head is re-reviewed; still failing is a trajectory anomaly and CI stays the gate. |
|
|
@@ -1071,7 +1187,7 @@ execution:
|
|
|
1071
1187
|
| `day_budget_minutes`, `day_budget_usd` | number | No | The same cap per host UTC day, summed over every batch on the host from the host-day store (`execution-budget.json` in `~/.forge/sched/`, or `FORGEDOCK_EXECUTION_BUDGET_FILE`). A corrupt or unreadable store refuses remote lanes while a day cap is set; remove the file to reset it. |
|
|
1072
1188
|
| `fallback_local` | boolean | No | `true`: a remote-placed lane runs on the host while the provider reports no agent online (`GET {endpoint}/status -> {"online": N}`, the built-in router answers it with `online`, `total` and per-agent `ok`/`paused`), so a batch completes locally with every pool agent offline or asleep (forge#4547). Default `false`: such lanes defer (`sandbox.capacity`). A missing or failing `/status` is unknown and never triggers it. It also covers a sustained `sandbox.capacity`: an issue the pool refused `capacity_fallback_after` times (default 3) for capacity runs on the host when the host has headroom (the host-busy guard; a busy host or a failing probe keeps it waiting remote) (forge#5112). |
|
|
1073
1189
|
| `capacity_fallback_after` | integer | No | With `fallback_local: true`: how many `sandbox.capacity` deferrals of one issue make it run on the host, subject to the host-busy guard (forge#5112). Default: 3. A missing, non-integer or non-positive value uses the default. |
|
|
1074
|
-
| `account_rotator` | string | No | `tokenbaton`: the `claude` on PATH is the tokenbaton shim, which runs each call on the logged-in account with the most room (`CLAUDE_CONFIG_DIR=~/.claude-<n>`) (forge#5094). forgedock reads `~/.tokenbaton
|
|
1190
|
+
| `account_rotator` | string | No | `tokenbaton`: the `claude` on PATH is the tokenbaton shim, which runs each call on the logged-in account with the most room (`CLAUDE_CONFIG_DIR=~/.claude-<n>`) (forge#5094). Unset: detected (forge#5205) when `TOKENBATON_HOME` is set or the first `claude` on PATH resolves to `tokenbaton-exec` / a `.tokenbaton/shim/claude`; `off` (also `none`, `false`) or env `FORGEDOCK_ACCOUNT_ROTATOR=off` disables it. forgedock reads `$TOKENBATON_HOME` (as-is, else `~/.tokenbaton`): `current` (the account number) and `live.<n>` (`<5h used %> <5h reset s> <weekly used %> <weekly reset s> <updated s>`), re-read on every check and never written. An account has headroom when its 5-hour use is under 95% and its weekly use under 100%; a sample whose reset has passed is stale: unknown, never 0%, worth one try but ranked after fresh samples. While any account has headroom no host-wide usage hold is recorded and admissions continue. A lane whose call hits a usage limit records that account (from the run's `/proc/<pid>/environ`), excludes it until its reset, and relaunches the same call (same session) at once pinned to the account tokenbaton picks (the real `claude` past the shim, `CLAUDE_CONFIG_DIR=~/.claude-<n>`), at most once per account; the lane result reports `rotations` and `limited`, and the batch keeps excluding those accounts until their reset. Only when no account has room does the lane pause or defer, and the batch holds until tokenbaton's earliest reset over every account. When the installed tokenbaton has the tokenbaton#3 API, forgedock uses `tokenbaton --pick --json --exclude <n,..>` (exit 2 = none with room, `earliest_reset`) and `tokenbaton-ctl mark-limited <n> --until <s>`; otherwise it computes the same from `live.<n>`. `forgedock limits show` lists each account's 5-hour use, `(stale)` for a passed reset. Any other value, or unreadable files: off (per-account holds as before). |
|
|
1075
1191
|
| `warm_sandboxes` | integer | No | Warm sandboxes per repo the pool agent keeps ready (checkout at the base ref, dependency cache primed). When `N > 0` the launch spec carries `warm: N` and the lane first calls `POST {endpoint}/sandboxes/claim`; a ready warm sandbox takes the lane (refreshed to the lane's base ref with an incremental fetch before work starts), and when none is ready, the claim fails or the endpoint lacks the route the lane starts cold. Default `0` (off): no claim call and the launch spec is unchanged (forge#4912). |
|
|
1076
1192
|
| `unreachable_window_min` | number | No | Remote providers: how long a lane keeps polling (with backoff, up to 30s) after the provider's transport fails (connection refused/reset, `fetch failed`, timeout, 502/503/504) before it ends `deferred` with `sandbox.unreachable` (forge#4672). Inside the window the lane never ends and the sandbox is never torn down; after it the sandbox is kept and adopted on the next attempt or `--resume`; the engine-error breaker does not count it. `adopt` applies the same window. Default: 5 |
|
|
1077
1193
|
| `on_budget` | string | No | `stop` (default): running lanes finish and the rest end `held` (`execution budget: ...`) for a later `--resume`. `local`: the rest run as detached host lanes. |
|
|
@@ -1401,6 +1517,9 @@ verification:
|
|
|
1401
1517
|
|
|
1402
1518
|
topology:
|
|
1403
1519
|
route_reachability: "bash scripts/check-ingress.sh" # optional; blocking when declared
|
|
1520
|
+
prod_parity: # optional; block map {path glob: command | "note: how to verify"}
|
|
1521
|
+
"db/migrations/**": "bash scripts/check-migration-role.sh"
|
|
1522
|
+
"web/app/**": "note: run under the production ISR runtime"
|
|
1404
1523
|
```
|
|
1405
1524
|
|
|
1406
1525
|
| Field | Type | Required | Description |
|
|
@@ -1421,6 +1540,7 @@ topology:
|
|
|
1421
1540
|
| `coupled_files` | map (glob → glob list) | No | Default unset (#5079). "If file A changes, file B must change": a block map `{when glob: required glob[, glob]}`, e.g. `"infra/guard/bootstrap.sh": "infra/guard/MANIFEST.sha256"`. A key prefixed `added:` fires only for files the lane adds (`"added:scripts/tests/test_*.py": ".github/workflows/ci.yml"`). A lane that changes a `when` file without a matching required file fails precheck with `coupled_file_missing` (`conformance.unimplemented`, builder resumed once). Quote keys that contain `*`, and list alternatives as separate keys: brace globs (`*.{ts,tsx}`) are not expanded. |
|
|
1422
1541
|
| `validate.recipes` | map (regex → replacement) | No | Default unset. A top-level `validate:` block with a block-style `recipes:` map, e.g. `"poetry run pytest": "uv run --with-requirements r.txt pytest"`. Each key is a regex source; the first recipe that matches a frozen validate or `repro_test` command rewrites it at contract freeze (`applyValidateRecipes`), recorded as a decision. Use it for commands whose environment is not installed in lane sandboxes. |
|
|
1423
1542
|
| `topology.route_reachability` | string (command) | No | Default unset (no check, no behaviour change). A repo-supplied command that takes the route paths a diff adds (Next.js `app/**/route.*`, `pages/api/**`; URL form, route groups removed) as arguments and exits non-zero when the production ingress does not deliver them to the service that implements them. Runs in the lean lane after validate and in `review-pr-staging`; a non-zero exit blocks (`conformance.unimplemented`, kind `route_unreachable`). Read by `readEnvConfig` (`bin/engine-cli.mjs`), run by `bin/lean/routecheck.mjs`. |
|
|
1543
|
+
| `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`. |
|
|
1424
1544
|
|
|
1425
1545
|
**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`
|
|
1426
1546
|
|
|
@@ -1506,6 +1626,31 @@ the gate is DEGRADED and reported in `verification_skipped`, never a silent pass
|
|
|
1506
1626
|
|
|
1507
1627
|
---
|
|
1508
1628
|
|
|
1629
|
+
## Schema check and config history (#5315)
|
|
1630
|
+
|
|
1631
|
+
forge.yaml is parsed tolerantly, so a setting nobody reads used to be silent. `bin/config-schema.mjs` now checks it:
|
|
1632
|
+
|
|
1633
|
+
| Finding | Level | Meaning |
|
|
1634
|
+
|---------|-------|---------|
|
|
1635
|
+
| `unknown-key` | error | A top-level key outside the sections in this document, or an unknown child of a closed section (`verification.ci_local`) |
|
|
1636
|
+
| `ignored-on-path` | error | The key is set, but the active `engine.path` never reads it (the legacy `full` path ignores `env`, `verify`, `lean`, `engine.conformance`, `engine.conformance_kinds`) |
|
|
1637
|
+
| `wrong-type` | error | A typed key has the wrong shape (for example `verification.ci_local.extra_commands` that is not a list, `engine.path` outside `core\|full\|lean\|auto`) |
|
|
1638
|
+
| `deprecated-alias` | warning | `pipeline.token_budget_per_batch`, `build.diff_size.threshold` |
|
|
1639
|
+
|
|
1640
|
+
`npx forgedock doctor` reports errors as failures and aliases as warnings; `orchestrate` prints one `config: ...` line per finding at batch start, naming the key.
|
|
1641
|
+
|
|
1642
|
+
### Config history
|
|
1643
|
+
|
|
1644
|
+
Every setup or agent edit of forge.yaml records a version under `~/.forge/config-history/<owner>__<repo>/` (override the root with `FORGE_CONFIG_HISTORY_DIR`), never a `forge.yaml.bak-*` file in the repo.
|
|
1645
|
+
|
|
1646
|
+
| Command | Does |
|
|
1647
|
+
|---------|------|
|
|
1648
|
+
| `forgedock config history` | Lists versions with date and reason |
|
|
1649
|
+
| `forgedock config diff <n>` | Diffs version `n` against the current forge.yaml |
|
|
1650
|
+
| `forgedock config rollback <n>` | Restores version `n`; the current content is recorded first, so a rollback can be undone |
|
|
1651
|
+
| `forgedock config record [reason]` | Records the current forge.yaml as a version |
|
|
1652
|
+
| `forgedock config import-bak [--delete]` | One-time import of `forge.yaml.bak*` files in the repo into the history (idempotent); `--delete` removes them |
|
|
1653
|
+
|
|
1509
1654
|
## Credentials File Format
|
|
1510
1655
|
|
|
1511
1656
|
If `paths.credentials.file` is set, the file at that path is expected to be a YAML file with this structure:
|
|
@@ -1712,21 +1857,28 @@ systemctl --user daemon-reload && systemctl --user enable --now forgedock-bot-to
|
|
|
1712
1857
|
|
|
1713
1858
|
## GitHub App Install
|
|
1714
1859
|
|
|
1715
|
-
During `npx forgedock`, the installer prompts you to install the ForgeDock GitHub App (`rapiercraft-forgedock`)
|
|
1860
|
+
During `npx forgedock`, the installer prompts you to install the ForgeDock GitHub App (`rapiercraft-forgedock`). Installing alone changes nothing; to run the pipeline as the App's bot (its own API budget, `<app>[bot]` authorship) sign in with `forgedock auth login`. Without a login, every pipeline `gh` call uses your own `gh auth`, exactly as before.
|
|
1861
|
+
|
|
1862
|
+
### Broker sign-in
|
|
1863
|
+
|
|
1864
|
+
```
|
|
1865
|
+
forgedock auth login --broker-url https://<broker> --client-id <App client id> [--installation N]
|
|
1866
|
+
forgedock auth status
|
|
1867
|
+
forgedock auth logout
|
|
1868
|
+
```
|
|
1716
1869
|
|
|
1717
|
-
**
|
|
1870
|
+
- Login uses the GitHub App **device flow** (client ID only; no secret on your machine). The CLI stores the user token and installation under `~/.forge/app-auth.json` (mode 0600; `FORGE_HOME_DIR` overrides the directory). `FORGEDOCK_BROKER_URL` and `FORGEDOCK_APP_CLIENT_ID` can replace the flags.
|
|
1871
|
+
- On every CLI start the stored login yields a short-lived installation token, scoped to your repository ids and the permissions the pipeline uses, which is set as `GH_TOKEN` in the CLI process env only. It is not a global credential: no `gh auth login`, no git credential helper (#4565). It is refreshed when under 10 minutes remain, and long-running commands (`orchestrate`, `schedd`, `watch`, `issue-watch`, `prod-watch`) refresh it in process before it expires. Processes ForgeDock spawns, such as the auto-started `schedd`, recognise the token it set by a fingerprint in `FORGEDOCK_APP_TOKEN_FP` (never the token itself) and keep refreshing it. A `GH_TOKEN` you exported yourself is never overridden.
|
|
1872
|
+
- If the broker is unreachable or refuses, one warning line is printed and the pipeline continues on your own `gh` auth. `FORGEDOCK_NO_APP_AUTH=1` skips the App identity.
|
|
1873
|
+
- Broker contract (client side): `POST {broker}/v1/token` with `Authorization: Bearer <user token>` and body `{installation_id, repository_ids, permissions}`, answering `{token, expires_at}`. The broker server, quotas, mint logs, revocation and security page live on the platform side.
|
|
1718
1874
|
|
|
1719
|
-
|
|
1720
|
-
- It does **not** create a bot token. GitHub App *installation* tokens can only be minted with the app's private key, and that key is held solely by RapierCraft Studios (the app's owner) — your installation grants *your* installation ID against *RapierCraft's* app, not a key you can use yourself.
|
|
1721
|
-
- It does **not** auto-refresh anything, and there is no background process managing token expiry.
|
|
1722
|
-
- It does **not** change which `gh` auth context pipeline commands (`/work-on`, `/orchestrate`, etc.) use. Every pipeline `gh` call always uses whatever auth is currently active in your shell — your personal token unless you've manually configured something else.
|
|
1723
|
-
- It does **not** wire up webhook-driven "automatic pipeline triggers" — no webhook receiver exists yet.
|
|
1875
|
+
### Bring your own App
|
|
1724
1876
|
|
|
1725
|
-
|
|
1877
|
+
`forgedock auth login --byo [--org ORG] [--installation N]` runs GitHub's App manifest flow through a loopback page, stores the App id and private key (`~/.forge/app-byo.pem`, 0600) and mints installation tokens locally. No third-party broker is involved.
|
|
1726
1878
|
|
|
1727
|
-
|
|
1879
|
+
### Doctor
|
|
1728
1880
|
|
|
1729
|
-
|
|
1881
|
+
`npx forgedock doctor` (Check 12, "GitHub App / bot token") shows the active identity, its source (`broker`, `byo` or personal fallback) and the `core.limit` of the active token. Without a login it keeps the earlier messages, including the refresh-stamp check for the self-hosted `scripts/refresh-bot-token.sh` setup.
|
|
1730
1882
|
|
|
1731
1883
|
---
|
|
1732
1884
|
|
package/docs/ISSUE-WATCH.md
CHANGED
|
@@ -69,6 +69,29 @@ The lane follows the repo rule: a milestone issue goes to `milestone/<slug>` (fo
|
|
|
69
69
|
|
|
70
70
|
When agents and `gh` run as the ForgeDock App, the issues they file are authored by `rapiercraft-forgedock[bot]` with association `NONE`, so a watch skips them. `trust_app: true` (default false) claims issues authored by this repo's own ForgeDock App. Other bots and outsiders (`NONE` humans) stay excluded. It is an explicit opt-in because the App also files issues from untrusted inputs (prod-watch, ingestion). `trust_app_labels: [operator]` (needs `trust_app`) narrows it further: the App issue must carry one of those labels. `follow-up:` issues from the App still follow `include_followups`.
|
|
71
71
|
|
|
72
|
+
## Parity with an owner-run intake script
|
|
73
|
+
|
|
74
|
+
A watch never claims a pull request: only issues are listed, a PR-shaped item is dropped, a `search` that selects PRs (`is:pr`, `type:pr`) fails the watch at load, and an issue an open PR closes is skipped (`skip #N: open closing PR #M`). `skip_labels` (default for `mode: batch`: `epic`, `needs-human`, `post-deploy`, `workflow:merged`, `awaiting-promotion`, `host-task`) skips by label. One watch per selector gives each its own created-since window:
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
issue_watch:
|
|
78
|
+
watches:
|
|
79
|
+
nomilestone: { milestone: none, since: 2026-11-08T00:00:00Z, include_followups: defer-only, postdeploy_rollup: 100, mode: batch }
|
|
80
|
+
release-1-5: { milestone: "1.5", since: 2026-11-01T00:00:00Z, include_followups: defer-only, postdeploy_rollup: 100, mode: batch }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`--dry-run` lists what each would claim. A batch that reported is never added to: the next claims start a new one.
|
|
84
|
+
|
|
85
|
+
## Release pause and liveness
|
|
86
|
+
|
|
87
|
+
With `release_pause` (default in `mode: batch`) the watch pauses while a `forgedock release` job is in flight (its `~/.forge/releases/<id>/state.json` has no end `status` and was written in the last 6 hours): no claims, retries or decisions. The next pass after the job ends resumes by itself. Every pass writes `heartbeat` to `status.json`, and `forgedock issue-watch status` prints it:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
state: paused (release r20261110-110000-9 in flight (preflight)) last heartbeat: 2026-11-10T12:00:00.000Z (30s ago)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`running`, `paused`, `stale` (no heartbeat for 3 intervals: the watch is not running) or `done`. `watchLiveness` (`bin/lean/issuewatch-parity.mjs`) is the read for tools such as doctor; it never greps processes.
|
|
94
|
+
|
|
72
95
|
## Dry run
|
|
73
96
|
|
|
74
97
|
In `per-issue` and `batch` mode, `forgedock issue-watch run --name <w> --dry-run` prints what one pass would claim and why, then the needs-human classification. It writes nothing: no claim, no status, no launch.
|
|
@@ -107,6 +130,8 @@ All pass: the issue counts as **verified**, and a `FORGE:WATCH_VERIFY` comment r
|
|
|
107
130
|
|
|
108
131
|
`mode: release` claims nothing immediately. It pools the issues that match the selectors and cut a **themed release** when a trigger fires, then orchestrates just that set.
|
|
109
132
|
|
|
133
|
+
Once the batch reports and the deploy PR is open, the watch starts `forgedock release` for it (resumable; promotion stays opt-in via `--merge` / `release.auto_merge`, the watch never merges).
|
|
134
|
+
|
|
110
135
|
```yaml
|
|
111
136
|
issue_watch:
|
|
112
137
|
watches:
|
package/docs/OUTCOME-CODES.md
CHANGED
|
@@ -45,8 +45,10 @@ 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
|
+
| `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` |
|
|
48
49
|
| `engine.error` | Engine or tool failure (missing key/SDK, CLI crash, max turns, unresolved args, runner threw every attempt) | engine | `err.code` |
|
|
49
50
|
| `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` |
|
|
51
|
+
| `engine.push_diverged` | Core work-on (forge#5202): the lane-branch push was rejected non-fast-forward and no other live lane owns the branch (no open PR, no live lease), after the pre-push reconcile could not merge the remote-only commits (they are not this worktree's own `wip(forge): checkpoint` commits). The lane's own history diverged: a mechanical engine state, not a human block. The lane ends `engine-error` (never `needs-human`), which `forgedock orchestrate` relaunches; the exit rescue pushes HEAD to `forge-salvage/<issue>-<sha>` | lean | `bin/lean/lean.mjs` push-rejection classification, `bin/lean/checkpoint-reconcile.mjs` |
|
|
50
52
|
| `engine.validate_result_lost` | Core work-on (forge#4708): a validate result recorded before a merge-time CI fix round is missing from the fix session's result file and could not be carried forward; an engine bookkeeping error, not an unimplemented requirement | lean | `bin/lean/lean.mjs` `mergeFixRound` |
|
|
51
53
|
| `infra.disk_quota` | Disk full or quota exhausted (EDQUOT/ENOSPC, errno -28/-122); retryable infra failure, never `needs-human` | engine | Runner error text |
|
|
52
54
|
| `infra.cli_spawn_transient` | CLI spawn failed transiently before the child ran (ETIMEDOUT, EAGAIN, ENOMEM, EMFILE); retried with backoff on a separate bounded counter that does not consume a phase attempt | engine | `err.code` `CLI_SPAWN_TRANSIENT` |
|
|
@@ -58,12 +60,14 @@ An absent or unknown code is recorded as `unclassified`, with the raw reason kep
|
|
|
58
60
|
| `env.repro_unrunnable` | Core work-on (forge#4334): on a bug lane the frozen `repro_test` could not be run on head by `scripts/acceptance-red-green.sh` (`HEAD=UNRUNNABLE`: timeout, exit 126/127, unclassifiable output) or the harness returned no result. An environment error, not a conformance failure: no builder resume, no reviewer. Ends `needs-human`; recoverable by `forgedock orchestrate` (the recovery lane reruns the repro command through the repo's own toolchain and installed dependencies). Other non-proofs (passes on base, fails on head, base unrunnable) stay `conformance.unimplemented` | lean | `gate()` `io.redGreen` words, classified by `conformance.mjs` `reproFailures` |
|
|
59
61
|
| `env.capability_remote` | Core work-on (forge#4542): a lane placed in a remote sandbox ended `builder.blocked (credentials)` and its summary names only host capabilities declared in `execution.host_capabilities` (SOPS/age key, ops credentials, prod monitor SSH), which the sandbox does not relay but the dispatching host has. Recoverable by `forgedock orchestrate`: the recovery lane is placed local, once, under the same lease. A credential need the host lacks too stays `builder.blocked` | lean | `endBlocked` via `execution.mjs` `hostCapabilityBlock` |
|
|
60
62
|
| `sandbox.start_failed` | A `forgedock orchestrate` lane sandbox (forge.yaml `execution`, provider `container` or `remote`) could not start: bad image, missing endpoint, a refused launch (HTTP 4xx other than 401/403/429) or a non-HTTP start failure. The lane never ran. Final `needs-human` row: not relaunched and not counted by the engine-error circuit breaker | orchestrate | `bin/lean/execution.mjs` `providerLanes`: `provider.start` threw without `retryable`, `transient` or a 5xx/401/403 `status` |
|
|
63
|
+
| `base.red` | Core work-on: a `verify.invariants` guard command fails on the base too (forge#5239). `deferred` (retry 900 s), never needs-human; the introducing issue gets a `FORGE:BASE_RED` comment (reopened if closed) | lean | `bin/lean/basered.mjs` guard run on the base |
|
|
61
64
|
| `sandbox.capacity` | The sandbox provider had no capacity for the lane (HTTP 429/503 from the remote transport). `deferred`, requeued after `Retry-After` when sent, else 60s; not counted toward `orchestration.max_deferrals`, like `host.busy` (forge#4528) | orchestrate | `provider.start` threw with `err.retryable: true` |
|
|
62
65
|
| `sandbox.transient` | The remote sandbox provider answered HTTP 500/502/504 on launch: a router or agent infrastructure failure, not a code or human problem (forge#5095). `deferred`, requeued after `Retry-After` when sent, else 60s; counted toward `orchestration.max_deferrals` (so a broken pool ends `deferred`, never `needs-human`); not counted by the engine-error circuit breaker | orchestrate | `bin/lean/execution.mjs` `providerLanes` `startFailed`: `provider.start` threw with `err.status` 5xx (not retryable) or `err.transient` |
|
|
63
66
|
| `sandbox.auth` | The remote sandbox provider refused the lane's credential (HTTP 401/403) at start (forge#4685). `deferred`, retried after 300s, never `needs-human`; the pool token resolves from the env, the keychain, then `~/.config/computeshare/forgedock.token` | orchestrate | `provider.start` threw with `err.status` 401/403 |
|
|
64
67
|
| `sandbox.unreachable` | The remote sandbox provider stayed unreachable (connection refused/reset, `fetch failed`, timeout, 502/503/504) for `execution.unreachable_window_min` while a lane polled or adopted its sandbox (forge#4672). `deferred`, requeued after 60s; not counted by the engine-error circuit breaker. The sandbox is NOT torn down: the next attempt or `--resume` adopts it | orchestrate | `bin/lean/execution.mjs` `providerLanes` poll guard |
|
|
65
68
|
| `lease.held` | Another live agent holds the issue lease | engine | Foreign live lease on acquire |
|
|
66
69
|
| `dependency.open` | A dependency is still open: a trusted `**Depends on**: #N` line refused the run before any state write, or the core builder reported `block.kind: "dependency"` naming an issue that is open. Carries `dependencies`; never `needs-human`. `forgedock orchestrate` adds the edge and requeues the issue behind it, without skipping dependents | engine, lean | Trusted `**Depends on**` line, or `result.json` `block.issues`, + the dependency issue's live open state |
|
|
70
|
+
| `design.invalidated` | Core work-on: the builder reported `block.kind: "design-invalidated"` (a decision or interface no longer holds). The engine files one spike-amendment issue, holds the affected open siblings behind it with `**Depends on**` edges, and requeues the lane. Carries `dependencies`, `amendment`, `epic`; never `needs-human`. The rework-share rollup counts it | lean | `result.json` `block` + the `FORGE:REPLAN` comment |
|
|
67
71
|
| `dependency.unreadable` | The issue body or a declared dependency could not be read, so the run was refused (fail closed) | engine, lean | Failed or unparsable `gh api` / `gh issue view` read |
|
|
68
72
|
| `dependency.blocked` | Core work-on: the builder's dependency is open and itself labelled `needs-human`. Terminal reason `dependency-blocked` (blocked by #X); this issue is not labelled `needs-human` | lean | `result.json` `block.kind: "dependency"` + the dependency's `needs-human` label |
|
|
69
73
|
| `lane.mismatch` | Core work-on: `--lane` differs from the lane worked out from the issue (milestone → `branches.feature_pattern`, else `branches.staging`); refused before any lease, comment or worktree. `--lane-override` forces it and is recorded in the trajectory. A resumed PR whose base is not the lane is refused the same way before merge | lean | Issue milestone + forge.yaml `branches`, or the open PR's `baseRefName` |
|
package/docs/REPLAY.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Replay time-lapse
|
|
2
|
+
|
|
3
|
+
`forgedock replay --timelapse <batch-id|epic-number> [--repo owner/repo] [--out dir] [--format gif|mp4] [--duration 30-90] [--events file]`
|
|
4
|
+
|
|
5
|
+
Renders a time-lapse of a recorded batch or epic: issues appearing, lanes starting, PRs opening and merging, the release gate passing, with a clock and a running cost counter. The video is 30-90 s (default 60) however long the real run took.
|
|
6
|
+
|
|
7
|
+
- **Data**: the local lifecycle event log (`~/.forge/events/<owner>_<repo>.jsonl`, see `docs/EVENTS.md`; `FORGE_EVENTS_DIR` or `--events` override). A batch id takes its issues from the batch plan (`~/.forge/batches/<id>/plan.json`); an epic number takes the `#N` references in the epic body.
|
|
8
|
+
- **Read-only**: no model call and no GitHub writes. The only `gh` calls are an `issue view` read for an epic, and the runner refuses anything else.
|
|
9
|
+
- **Output** (`--out`, default `timelapse-<id>/`): `frames/frame-NNNN.txt`, `timelapse.tape` and `timelapse.json`. When `vhs` is on PATH the tape is rendered to `timelapse.gif` or `timelapse.mp4`; otherwise the command is printed (`cd <out> && vhs timelapse.tape`). Nothing is installed.
|
package/docs/SELFTEST.md
CHANGED
|
@@ -5,6 +5,7 @@ The engine's unit tests mock `gh`, git and the pool transport, so defects such a
|
|
|
5
5
|
```
|
|
6
6
|
forgedock selftest --static
|
|
7
7
|
forgedock selftest --live [--repo <owner/sandbox>] [--lang node|python] [--pr <staging->main PR>]
|
|
8
|
+
forgedock selftest --journey [--repo <owner/sandbox>] [--pr <N>] [--update-snapshots]
|
|
8
9
|
```
|
|
9
10
|
|
|
10
11
|
`--live` also runs the static check. The sandbox repo comes from `--repo` or `selftest.sandbox_repo` in forge.yaml ([CONFIG.md](CONFIG.md#selftest-optional)). Run it on the host or the pool, not in GitHub Actions. The exit code is non-zero and the output names the failed step.
|
|
@@ -32,3 +33,13 @@ With `--pr N`, the PR head is read before the run (from `--release-repo`, else t
|
|
|
32
33
|
## Nightly run
|
|
33
34
|
|
|
34
35
|
Off by default. Set `selftest.nightly_interval_hours` (see [CONFIG.md](CONFIG.md#selftest-optional)) and the schedd daemon starts `selftest --live --nightly-report <repo>` on the host, as a detached process, once that many hours have passed since that repo's last run (last run time cached per repo in `selftest-nightly-<owner>_<repo>.json` under the sched dir). The daemon never runs the harness itself, so a long run never holds its other sweeps. It never runs on GitHub Actions. A failing run, including one that cannot start (for example no `selftest.sandbox_repo`, step `config`) or a harness crash, files one issue titled `selftest --live failed at step <step> (nightly)` carrying `<!-- FORGE:SELFTEST_NIGHTLY -->`; the next failure edits that open issue instead of filing another. A passing run writes nothing. The issue lives in the repo schedd resolves for the working directory, and the sandbox repo must be set by `selftest.sandbox_repo`.
|
|
36
|
+
|
|
37
|
+
## New-user journey
|
|
38
|
+
|
|
39
|
+
`forgedock selftest --journey` (#5305) checks what a first-time user sees, which the mocked unit tests and `--live` do not. Run it on the host before each release, never in GitHub Actions.
|
|
40
|
+
|
|
41
|
+
1. **Clean environment**: `npm pack`, then `npx --package <tarball> forgedock` in a container holding only Node and git (`docker run --rm`, image `node:22`, override with `FORGE_JOURNEY_IMAGE`; without Docker, a throwaway HOME and a PATH of only node, git and the shell basics). It runs the bare command (the not-ready output), `help`, `doctor` and an unknown command. It fails on: success wording on a machine without gh and Claude Code (steps `banner`), a doctor that exits 0 or does not name the missing tools (`doctor`), raw runtime error text (`errors`), placeholder values in a `forge.yaml` it wrote (`files`), and a CLI that does not start.
|
|
42
|
+
2. **Sandbox repo**: needs `gh` authenticated and Claude Code; otherwise skipped with a note. In a fresh directory it runs `demo --repo <sandbox>` (`setup`), `doctor` (must exit 0), and `demo --run` (`first-merge`), then requires a PR merged after the start. It prints the time to first merged PR and every prompt shown, and always removes the directory and closes the issues it opened.
|
|
43
|
+
3. **Snapshots**: the scrubbed output (ANSI, paths, versions and timings removed) is compared with `bin/tests/fixtures/journey-snapshots/*.txt` (`banner`, `help`, `doctor`, `errors`, and `not-ready` for exit codes and the files written). A wording change fails with the file and line; review it and run with `--update-snapshots` to accept it, so the change shows in the diff.
|
|
44
|
+
|
|
45
|
+
The sandbox repo comes from `--repo` or `selftest.sandbox_repo`; the harness refuses the project repo and the release repo. With `--pr N` the result is posted on the release PR as `<!-- FORGE:JOURNEY result=pass|fail sha=<head> step=<failed step|none> ttfm=<seconds|na> -->`, next to the review's `GATE_PASS`. It is a separate marker from `FORGE:SELFTEST` and is informational: `review-staging` does not read it.
|
package/docs/STATS.md
CHANGED
|
@@ -18,6 +18,16 @@ version (the table embedded in the staging review summary). `--json` is machine-
|
|
|
18
18
|
is resolved to its tag time minus one day; an unknown tag falls back to a full crawl and says so on stderr). Progress is
|
|
19
19
|
printed to stderr while crawling, so `--json` stdout stays parseable.
|
|
20
20
|
|
|
21
|
+
## Feature scoreboard (`--milestone <id|title>`, forge#5341)
|
|
22
|
+
|
|
23
|
+
`forgedock stats --milestone <number|title> [--repo <owner/repo>] [--json]` grades a whole milestone from GitHub (its issues, PRs and
|
|
24
|
+
epic FORGE:ACCEPTANCE comments) and the local run logs, with no manual input. Columns: journey status at ship (pass, fail or
|
|
25
|
+
never-ran, per epic with head and time); minutes from the first lane merge to the first green journey; defects created after the last
|
|
26
|
+
planned child closed, by class (`release-review`, `post-deploy`, `hotfix`, `other`, from labels or title); rework share (issues whose body
|
|
27
|
+
says fix/redo/rework/follow-up of a sibling `#N`, or labelled `rework`); operator interventions (hand PRs whose head branch is not a
|
|
28
|
+
`<type>/issue-N` lane branch, PRs labelled `manual-merge`, plus `needs-human` issues); cost from the run logs. A signal that cannot be read prints n/a. `--json`
|
|
29
|
+
keeps the earlier verdict mix under `query.mix` and adds `query.scoreboard`. The feature benchmark is in `docs/eval/feature-bench.md`.
|
|
30
|
+
|
|
21
31
|
## Sources
|
|
22
32
|
|
|
23
33
|
1. **GitHub (primary).** Issues, PRs and labels of the target repo, plus trusted `<!-- FORGE:TELEMETRY v1 -->` comments
|
|
@@ -106,6 +116,28 @@ conformance pass, and then the post − pre delta.
|
|
|
106
116
|
the result is under `query.efficiency.compare`. Cohorts are split by batch `plan.created`, as `--window` is; a lane run
|
|
107
117
|
outside a batch is in neither.
|
|
108
118
|
|
|
119
|
+
## Lane depth (`--depth`, forge#5209)
|
|
120
|
+
|
|
121
|
+
`forgedock stats --depth [--since <version|date>] [--min-n N] [--offline] [--repo <owner/repo>] [--json]` reads the local
|
|
122
|
+
run logs (`~/.forge/runs/*.jsonl`, every RUN_START..RUN_TERMINAL slice that logged `LIGHT_ELIGIBILITY`) and uses gh only
|
|
123
|
+
for post-merge defect signals; `--offline` skips that crawl (defects print n/a, as does a gh failure).
|
|
124
|
+
|
|
125
|
+
Columns per cell: n, merge rate, first-pass rate, needs-human rate, median cost, median wall minutes, median wall/model
|
|
126
|
+
time, review findings per lane (conformance failures + verifier findings) and the share of lanes with any, conformance
|
|
127
|
+
failure rate, and the post-merge defect rate over merged lanes with known defect data. A defect is any of the
|
|
128
|
+
`--conformance-outcomes` signals within 7 days (#5364): reverted, reopened, cited (a later PR names the PR or issue as
|
|
129
|
+
the cause), or `same_hunks` (a later fix PR's old-side lines git-blame to the lane's merge commit). `same_hunks` needs a
|
|
130
|
+
local clone of the repo (run from it); without one a lane with no other signal is n/a, counted as unresolved. Each fix PR
|
|
131
|
+
is blamed once per run (`same-hunks i/N` progress goes to stderr).
|
|
132
|
+
|
|
133
|
+
Cells are grouped by verdict (eligible, ambiguous, ineligible) and by every reason and signal code (`hotspot`,
|
|
134
|
+
`churn_high`, `label_docs`, `size_S`, ...), so outcomes can be attributed to each signal.
|
|
135
|
+
|
|
136
|
+
Promotion (#5052): treatment = light-shaped lanes (light or upgraded), control = full lanes the gate rated eligible, in the
|
|
137
|
+
size buckets both have. Met when median cost ratio <= 1.2x, median wall/model <= 1.3x and the treatment defect rate is no
|
|
138
|
+
worse than the control's; a cell under `--min-n` (default 10) is `insufficient data`, with n per cell printed. Flipping
|
|
139
|
+
`lean.light.mode: on` stays a config decision.
|
|
140
|
+
|
|
109
141
|
## Pool utilisation (`--pool`, forge#4549)
|
|
110
142
|
|
|
111
143
|
`forgedock stats --pool [--window 7d,30d] [--json]` reads the repo's local batch `report.json` rows and prints, per window,
|
|
@@ -133,6 +165,31 @@ Efficiency next to quality: run `forgedock stats --efficiency --compare <date|ve
|
|
|
133
165
|
$/merge, turns/merge and wall p50. Baseline before #4693 enforces: run `forgedock stats --compounding --json --since <date>` in
|
|
134
166
|
a full clone of this repo and one other and keep the output with the #4697 tracker.
|
|
135
167
|
|
|
168
|
+
## Conformance outcomes (`--conformance-outcomes`, forge#5210)
|
|
169
|
+
|
|
170
|
+
`forgedock stats --conformance-outcomes [--repo R] [--since <date>] [--window-days 7] [--min-n 20] [--json]` asks whether conformance
|
|
171
|
+
blocks predict post-merge defects. Read only, no model and no GitHub writes. GitHub reads are one `gh api graphql` search per
|
|
172
|
+
page of 100 merged PRs (`repo:R is:pr is:merged merged:>=<since>`, `--since` defaults to 30 days ago; GitHub search stops at
|
|
173
|
+
1000 results, flagged `capped`) plus the usual FORGE:TELEMETRY crawl. Verdicts also come from the local run logs and batch
|
|
174
|
+
reports unless `--no-local`.
|
|
175
|
+
|
|
176
|
+
- **lane PR**: a merged PR with a conformance verdict (`query.mjs` `conformanceVerdicts`; the latest of the telemetry
|
|
177
|
+
`run_terminal`/`conformance_shadow`, run-log `RUN_TERMINAL`/`CONFORMANCE_SHADOW`/`CONFORMANCE` and batch-row `conformance`
|
|
178
|
+
wins). `shadow_would: conforms` conforms. Any other `would` is nonconforming, and its failure codes are the kinds. An
|
|
179
|
+
enforce merge with no `would` passed the enforced gate and conforms. A merged PR without a verdict counts under `unjoined`.
|
|
180
|
+
- **signals** inside `--window-days` after the merge:
|
|
181
|
+
- `reverted`: a later merged `Revert ...` PR naming `#N`, `Reverts R#N` or the title.
|
|
182
|
+
- `reopened`: a closing issue was reopened.
|
|
183
|
+
- `cited`: a later merged PR says `fix ... #N` or `review-finding ... #N` for the PR or its issue on one line.
|
|
184
|
+
- `same_hunks`: a later `fix`/`revert` PR whose old-side lines `git blame` to this PR's merge commit. Only in a clone of R.
|
|
185
|
+
Otherwise it is `null` and counted under `same_hunks_unresolved`.
|
|
186
|
+
- A PR is defective when any signal is true. A PR whose window has not elapsed is `pending` and is not counted.
|
|
187
|
+
- **cells**: per repo, then the same split per mode and per failure kind. Each cell is `defects/n rate [Wilson 95% interval]`
|
|
188
|
+
for nonconforming-merged vs conforming-merged, `n/a` under `--min-n` (default 20 per cell).
|
|
189
|
+
- **conclusion** (last line): `nonconforming merges show a higher defect rate` when the nonconforming interval lies wholly
|
|
190
|
+
above the conforming one, `no higher defect rate shown for nonconforming merges` otherwise, and `insufficient data` when
|
|
191
|
+
either overall cell is under min n.
|
|
192
|
+
|
|
136
193
|
## Explorer A/B (`--explore-ab`, forge#4418)
|
|
137
194
|
|
|
138
195
|
Compares lanes run with forge.yaml `lean.explore: on` against `off` (#4391), from the local run logs only (no GitHub
|
|
@@ -146,6 +203,10 @@ crawl). Every RUN_START slice of each log counts, so re-running an issue with th
|
|
|
146
203
|
|
|
147
204
|
`--json` prints the same data as `query.explore_ab`.
|
|
148
205
|
|
|
206
|
+
## Issue origin (`--origin`, forge#5294)
|
|
207
|
+
|
|
208
|
+
`forgedock stats --origin [--repo owner/repo] [--since <date>] [--json]` splits the issues opened in the window (default: last 30 days) into requested (human author), production (`FORGE:PRODWATCH` marker or `prod-watch` label), review-finding (`review-finding`/`staging-review` labels), follow-up (`FORGE:DEFERRED_FROM`, rollup markers) and unknown (no positive evidence; never assumed requested). For each origin it prints the count, the cost from trusted `FORGE:TELEMETRY` runs and how many issues have no recorded cost (counted apart, never as $0). Outcomes are merged, closed-invalid (not planned, duplicate, `invalid`/`duplicate`/`wontfix` label), other-closed and open. The last line gives the pipeline-originated share of recorded cost.
|
|
209
|
+
|
|
149
210
|
## Sections (per version and repo)
|
|
150
211
|
|
|
151
212
|
- **Cost**: cache-read tokens per issue (mean, median), per phase (mean over all runs, so phases add up to the per-issue
|
package/docs/TELEMETRY.md
CHANGED
|
@@ -43,7 +43,7 @@ is dropped. Payload keys are `[A-Za-z0-9_]+` and cannot shadow the shared keys;
|
|
|
43
43
|
| `ci_local_check` | `scripts/ci-local.sh run`, one per scoped, widened or executed check (at most 20 per run) | `job`, `selector`, `selected`, `total`, `cache` = `hit` \| `miss` \| `dedup` \| `na`, `duration_ms`, `wait_ms` (job slot wait), `widen` (reason or `none`). A remote-CI failure at merge on a check recorded here as narrowed is a selector bug |
|
|
44
44
|
| `liveness` | `scripts/remediate-liveness.sh` | `decision` = `PROCEED` \| `DEFER` \| `EXHAUSTED`, `why` |
|
|
45
45
|
| `phase_attempt` | the engine (`bin/engine/telemetry-seam.mjs`, one per phase attempt; `phase` = the phase id) | `attempt`, `trigger` (#4362: why the attempt ran, one of `plan`, `build`, `block_correction`, `contract_correction`, `precheck`, `structure`, `docs`, `enumerating`, `sequence`, `ci_unavailable`, `ci_red`, `conformance`, `review`, `merge_ci`, `timeout_restart`, `recovery`; `restart_of` = the trigger a `timeout_restart` replaced), `model`, `backend` (`cli`/`api`), `turns`, `duration_ms`, `cost_usd` (the raw reported value: a running total when the attempt resumed a CLI session), `cost_usd_delta` (#4407: this attempt's cost; consumers sum it when present, else `cost_usd`), `cost_usd_session` (the CLI session's running total), `input_tokens`, `output_tokens`, `cache_read_tokens`, `cache_creation_tokens` (any value the runner did not report is omitted) |
|
|
46
|
-
| `run_terminal` | the engine (`terminate()`, one per run segment) | `experiment` and `arm` (#4629, only when forge.yaml declares an `experiment:`; also on `phase_attempt`), `reason` (terminal reason), `code` (see `docs/OUTCOME-CODES.md`), `wall_ms` (this engine process, start to terminal) |
|
|
46
|
+
| `run_terminal` | the engine (`terminate()`, one per run segment) | `experiment` and `arm` (#4629, only when forge.yaml declares an `experiment:`; also on `phase_attempt`), `arm_overrides` (#5206, with them: the arm's applied overrides as sorted `key=value,...`, `none` when the arm has none), `reason` (terminal reason), `code` (see `docs/OUTCOME-CODES.md`), `wall_ms` (this engine process, start to terminal) |
|
|
47
47
|
|
|
48
48
|
The engine records carry `run` = `r_<issue>_<start epoch seconds>` (one per `forgedock run-issue` process) so `forgedock stats`
|
|
49
49
|
(`docs/STATS.md`) can group the attempts of a run and tell a finished run from an unfinished one. They are the GitHub-side
|
package/docs/eval/README.md
CHANGED
|
@@ -30,6 +30,12 @@ Per-release pipeline evaluation results for ForgeDock. Every scorecard here was
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
+
## Adversarial benchmark
|
|
34
|
+
|
|
35
|
+
Full lane vs a bare `claude -p` session on 20 issues, 12 of which must be closed instead of implemented (#5292). Corpus: `corpus/adversarial-v1.json`. Reproduce it with [adversarial-bench.md](adversarial-bench.md). Its scorecards are published as `published/adversarial-<date>.md`; none has been run yet.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
33
39
|
## Scorecard schema
|
|
34
40
|
|
|
35
41
|
Every file in `published/` is a JSON object with the following fields:
|