forgedock 1.56.0 → 1.58.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/bin/config-schema.mjs +1 -1
- package/bin/engine/outcome-codes.mjs +2 -1
- package/bin/engine/phases.mjs +4 -3
- package/bin/engine-cli.mjs +48 -12
- package/bin/forgedock.mjs +52 -3
- package/bin/gc.mjs +43 -6
- package/bin/help-text.mjs +4 -2
- package/bin/lean/batch-health.mjs +5 -1
- package/bin/lean/batch-health.test.mjs +7 -1
- package/bin/lean/batch.mjs +7 -2
- package/bin/lean/batch.test.mjs +45 -0
- package/bin/lean/conformance.e2e.test.mjs +3 -2
- package/bin/lean/conformance.mjs +118 -20
- package/bin/lean/conformance.test.mjs +172 -3
- package/bin/lean/decisions.mjs +98 -1
- package/bin/lean/decisions.test.mjs +30 -1
- package/bin/lean/depcache.mjs +124 -13
- package/bin/lean/depcache.test.mjs +121 -3
- package/bin/lean/design-gate.mjs +144 -0
- package/bin/lean/design-gate.test.mjs +169 -0
- package/bin/lean/effects-cap.test.mjs +17 -0
- package/bin/lean/effects.mjs +58 -13
- package/bin/lean/heavy.mjs +25 -8
- package/bin/lean/hostload.test.mjs +28 -0
- package/bin/lean/intake.mjs +97 -0
- package/bin/lean/intake.test.mjs +105 -0
- package/bin/lean/interfaces.mjs +181 -0
- package/bin/lean/interfaces.test.mjs +192 -0
- package/bin/lean/issuewatch-install.mjs +52 -12
- package/bin/lean/issuewatch-install.test.mjs +50 -0
- package/bin/lean/issuewatch-parity.mjs +16 -3
- package/bin/lean/issuewatch-parity.test.mjs +32 -0
- package/bin/lean/issuewatch-reconcile.mjs +29 -1
- package/bin/lean/issuewatch-reconcile.test.mjs +21 -0
- package/bin/lean/issuewatch.mjs +34 -3
- package/bin/lean/issuewatch.test.mjs +49 -1
- package/bin/lean/lanecheck.test.mjs +15 -4
- package/bin/lean/lean.mjs +110 -24
- package/bin/lean/lean.test.mjs +183 -4
- package/bin/lean/orchestrate-blocked.test.mjs +18 -2
- package/bin/lean/orchestrate-owned.test.mjs +14 -5
- package/bin/lean/orchestrate.mjs +26 -4
- package/bin/lean/orphan-pr.mjs +3 -2
- package/bin/lean/orphan-pr.test.mjs +8 -1
- package/bin/lean/pagegate.mjs +35 -12
- package/bin/lean/pagegate.test.mjs +39 -1
- package/bin/lean/preflight.mjs +35 -1
- package/bin/lean/preflight.test.mjs +27 -1
- package/bin/lean/prompts.mjs +2 -1
- package/bin/lean/reap.test.mjs +39 -0
- package/bin/lean/recovery.test.mjs +28 -3
- package/bin/lean/release-config.mjs +169 -0
- package/bin/lean/release-config.test.mjs +132 -0
- package/bin/lean/release-control.mjs +171 -0
- package/bin/lean/release-control.test.mjs +167 -0
- package/bin/lean/release-deploy.mjs +209 -0
- package/bin/lean/release-deploy.test.mjs +217 -0
- package/bin/lean/release-fence.mjs +50 -0
- package/bin/lean/release-fence.test.mjs +105 -0
- package/bin/lean/release-flakes.mjs +139 -0
- package/bin/lean/release-flakes.test.mjs +116 -0
- package/bin/lean/release-gates.mjs +230 -0
- package/bin/lean/release-gates.test.mjs +146 -0
- package/bin/lean/release-ledger.mjs +176 -0
- package/bin/lean/release-ledger.test.mjs +226 -0
- package/bin/lean/release-minutes.mjs +102 -0
- package/bin/lean/release-minutes.test.mjs +107 -0
- package/bin/lean/release-nightly.mjs +75 -0
- package/bin/lean/release-nightly.test.mjs +48 -0
- package/bin/lean/release-postmerge.mjs +8 -2
- package/bin/lean/release-review.e2e.test.mjs +1 -0
- package/bin/lean/release-review.mjs +54 -7
- package/bin/lean/release-review.test.mjs +76 -7
- package/bin/lean/release-status.mjs +300 -0
- package/bin/lean/release-status.test.mjs +220 -0
- package/bin/lean/release-unitmap.mjs +35 -0
- package/bin/lean/release-unitmap.test.mjs +41 -0
- package/bin/lean/release-verify.mjs +221 -0
- package/bin/lean/release-verify.test.mjs +176 -0
- package/bin/lean/release.mjs +244 -22
- package/bin/lean/release.test.mjs +44 -0
- package/bin/lean/render.mjs +3 -1
- package/bin/lean/run-issue-placement.test.mjs +82 -0
- package/bin/lean/sandbox-remote.mjs +16 -0
- package/bin/lean/schedd.mjs +1 -1
- package/bin/lean/seam.mjs +115 -0
- package/bin/lean/seam.test.mjs +118 -0
- package/bin/lean/selftest-journey.mjs +40 -2
- package/bin/lean/selftest-journey.test.mjs +43 -3
- package/bin/lean/statuscomment.mjs +168 -0
- package/bin/lean/statuscomment.test.mjs +133 -0
- package/bin/lean/ui-quality.mjs +57 -0
- package/bin/lean/ui-quality.test.mjs +55 -0
- package/bin/lean/visual-gate.test.mjs +63 -0
- package/bin/pool/agent.mjs +16 -2
- package/bin/pool/router.mjs +5 -1
- package/bin/review-staging.mjs +5 -3
- package/bin/stats/card.mjs +117 -0
- package/bin/stats/card.test.mjs +109 -0
- package/bin/stats/conformance-outcomes.test.mjs +2 -1
- package/bin/stats/depth.mjs +1 -1
- package/bin/stats/gh-retry.test.mjs +152 -0
- package/bin/stats/github-source.mjs +147 -14
- package/bin/stats/index.mjs +35 -2
- package/bin/stats/stats.test.mjs +31 -3
- package/bin/vendor/js-yaml/LICENSE +21 -0
- package/bin/vendor/js-yaml/PIN.md +7 -0
- package/bin/vendor/js-yaml/js-yaml.mjs +3851 -0
- package/commands/design-render-critique-loop.md +2 -0
- package/commands/design.md +2 -0
- package/commands/issue.md +1 -1
- package/commands/milestone.md +1 -1
- package/commands/review-pr-agents/frontend.md +1 -0
- package/commands/review-pr-staging.md +5 -0
- package/docs/CONFIG.md +95 -2
- package/docs/ISSUE-WATCH.md +7 -0
- package/docs/OUTCOME-CODES.md +1 -0
- package/docs/STATS.md +10 -0
- package/docs/design/visual-gate.md +25 -0
- package/docs/eval/adversarial-bench.md +2 -2
- package/docs/eval/corpus/adversarial-v1.json +3 -3
- package/docs/site/start-a-new-project.md +7 -0
- package/docs/spec/forge-protocol-v1.md +31 -0
- package/package.json +1 -1
- package/pool/README.md +2 -0
- package/scripts/acceptance-red-green.sh +15 -1
- package/scripts/acceptance-red-green.test.sh +12 -0
- package/scripts/bench-adversarial.mjs +4 -0
- package/scripts/bench-lightlane.mjs +4 -1
- package/scripts/bootstrap-create.mjs +8 -2
- package/scripts/ci-local/scoping.mjs +19 -0
- package/scripts/ci-local.test.sh +16 -3
- package/scripts/fixtures/ci-local/gha-dorny/.github/workflows/ci.yml +4 -0
- package/scripts/plan-validate-live.mjs +9 -6
- package/scripts/review-prepare.sh +7 -1
- package/scripts/review-roster.sh +5 -2
- package/scripts/review-roster.test.sh +9 -0
- package/scripts/visual-gate.mjs +64 -0
- package/templates/bootstrap/technical-spike.md +17 -0
- package/templates/contracts/seam-check.mjs +236 -0
|
@@ -98,6 +98,8 @@ auditable artifact:
|
|
|
98
98
|
<!-- FORGE:CRITIQUE:COMPLETE -->
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
Also run, one iteration per route, by `review-pr-staging` 1I (forge#5369).
|
|
102
|
+
|
|
101
103
|
## Success measure
|
|
102
104
|
|
|
103
105
|
The loop works when a page **improves across iterations** and when, on the seed set, *A-with-loop* scores higher than
|
package/commands/design.md
CHANGED
|
@@ -27,6 +27,8 @@ end to end.
|
|
|
27
27
|
it does not reimplement them. The only executable helper in the chain is the deterministic linter
|
|
28
28
|
`scripts/design-system-lint.mjs` (#884).
|
|
29
29
|
|
|
30
|
+
**Auto-routing (forge#5330, opt-in).** With forge.yaml `design.routes` set, a lane that would build a page under it is routed here (blocked with `design.gate: blocking`) until a `FORGE:DESIGN_SPEC` or the `design.spec_label` label exists; see `docs/CONFIG.md` `design`.
|
|
31
|
+
|
|
30
32
|
---
|
|
31
33
|
|
|
32
34
|
## Universal Stage Dispatcher
|
package/commands/issue.md
CHANGED
|
@@ -153,7 +153,7 @@ ISSUE_CREATE_SCRIPT=$(forge_resolve issue-create.sh)
|
|
|
153
153
|
bash "$ISSUE_CREATE_SCRIPT" --title "{TITLE}" --body-file "$BODY_FILE" --label "{PRIORITY_LABEL}" --label "{CATEGORY_LABEL}" {--milestone "M"} {--repo OWNER/NAME} {--dry-run}
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
**Epic gate (forge#5336)**: when a label is `epic`, first run `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation (the body needs a ```` ```forge-acceptance ```` block with at least one journey).
|
|
156
|
+
**Epic gate (forge#5336)**: when a label is `epic`, first run `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation (the body needs a ```` ```forge-acceptance ```` block with at least one journey). An epic with 2+ slices also passes `npx forgedock interfaces check --body-file "$BODY_FILE" --kind epic` (#5338).
|
|
157
157
|
|
|
158
158
|
Report `**#{N}**: {title}`, URL, labels, milestone, and "Run `/work-on {N}` to start the pipeline."
|
|
159
159
|
|
package/commands/milestone.md
CHANGED
|
@@ -209,7 +209,7 @@ Present the proposed issues to the user. Ask:
|
|
|
209
209
|
|
|
210
210
|
### Step 6: Create issues and assign to milestone
|
|
211
211
|
|
|
212
|
-
**Epic acceptance (forge#5336, hard gate)**: an issue labelled `epic` (including a planned tracker) is created only with a ```` ```forge-acceptance ```` block of at least one user journey in its body (format: `bin/lean/acceptance.mjs`). Check the body first with `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation.
|
|
212
|
+
**Epic acceptance (forge#5336, hard gate)**: an issue labelled `epic` (including a planned tracker) is created only with a ```` ```forge-acceptance ```` block of at least one user journey in its body (format: `bin/lean/acceptance.mjs`). Check the body first with `npx forgedock acceptance check --body-file "$BODY_FILE"`; a non-zero exit refuses the creation. **Interfaces (forge#5338, hard gate)**: an epic with two or more slices needs an `## Interfaces` section (boundary, signature or schema, auth mode, owner issue, `provider:`/`consumer:` anchors, consumers); check it with `npx forgedock interfaces check --body-file "$BODY_FILE" --kind epic` before creating, and after creating run `npx forgedock interfaces register --issue {N} --body-file "$BODY_FILE"` so every lane touching the anchors gets the row as a preserve row. `interfaces contract` generates the seam contract tests.
|
|
213
213
|
|
|
214
214
|
**Issue body standard**: Use the **Pipeline Issue Template** from `issue.md` Phase 3D as the body structure for every issue created here (it is the single canonical standard; no bespoke inline template). The body content (Problem, Root Cause, Affected Files, Acceptance Criteria, Context, Dependencies) comes from the per-issue investigation in Step 4B. <!-- Added: forge#293 --> In greenfield mode it comes from the Step 4G plan instead, and Affected Files are planned paths inside the spike's `Repo layout`. <!-- Added: forge#4175 -->
|
|
215
215
|
|
|
@@ -36,6 +36,7 @@ If no frontend context is configured above, derive conventions from the changed
|
|
|
36
36
|
9. **Performance**: Large bundles, unnecessary client-side rendering, missing dynamic imports
|
|
37
37
|
10. **Hook provider scope**: For any new `useX()` hook call added to a component, verify the hook is safe to call outside its provider. If `useX` internally calls `useContext(XContext)` and throws when context is undefined (i.e., the hook contains `if (!ctx) throw new Error(...)`), check ALL mount sites of the component across the codebase. If the component is used in both authenticated routes (e.g., `app/dashboard/`) AND public routes (e.g., `app/(public)/`, `app/playground/`) that do not wrap children in the provider, the hook call will crash the public route with a React error boundary cascade. Flag as CONFIRMED HIGH if a public mount site exists without the provider. <!-- Added: forge#381 -->
|
|
38
38
|
11. **Dynamic API in static/ISR tree**: Flag `headers()`, `cookies()`, `connection()` or `searchParams` reads in layouts, `not-found`/`error` boundaries and any module they import when the route tree is static or ISR (`revalidate`, `generateStaticParams`, `dynamic = 'force-static'`). They opt the route out of static rendering or throw at render, turning pages into HTTP 500. Flag as CONFIRMED HIGH when the call is reachable from such a tree. <!-- Added: forge#5077 -->
|
|
39
|
+
12. **Visual/UX**: judge Visual check screenshots: design-system fit, states, polish. <!-- #5330 -->
|
|
39
40
|
|
|
40
41
|
## Post Findings
|
|
41
42
|
```bash
|
|
@@ -242,6 +242,11 @@ On for repos with `app/**/page.*` files unless `pages.enabled: false`. List ever
|
|
|
242
242
|
|
|
243
243
|
---
|
|
244
244
|
|
|
245
|
+
### 1I: Visual Gate (opt-in `design.routes`; BLOCKING with `design.gate: blocking`, forge#5330, #5369)
|
|
246
|
+
Unset `design.routes` = skip. Otherwise follow [docs/design/visual-gate.md](../docs/design/visual-gate.md): `scripts/visual-gate.mjs --list` names the bundle's new or changed routes; render each at every `design.viewports` width, run `design-render-critique-loop` against its spec, then post the script's `FORGE:VISUAL_GATE` comment (screenshots, verdict). Exit 1 (missing spec or screenshots, failed critique) is a BLOCKER: `FORGE:GATE_FAILURE`.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
245
250
|
### 1G: Docs Gate (BLOCKING when `docs.required_for` is set, forge#5419)
|
|
246
251
|
`git diff --name-only origin/$DEFAULT_BRANCH...origin/$STAGING_BRANCH` lists the bundle's changes. When forge.yaml sets `docs.required_for`, list every user-facing change in it (public API endpoint, MCP tool, dashboard page, CLI command, SDK method; `docs.surfaces` globs) that has no docs change under `docs.paths`/`docs.registries` and no `docs` justification: each is a BLOCKER (`Docs: <path> has no user docs`). Every `/docs/...` link the bundle adds must resolve (`docs.link_check`). Unset = skip. A blocker here makes the gate fail (`FORGE:GATE_FAILURE`).
|
|
247
252
|
|
package/docs/CONFIG.md
CHANGED
|
@@ -758,7 +758,7 @@ gate:
|
|
|
758
758
|
|
|
759
759
|
## `release` (OPTIONAL)
|
|
760
760
|
|
|
761
|
-
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
|
|
761
|
+
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. `forgedock release status [<id>] [--watch] [--interval s] [--json]` (bare `forgedock release --watch` runs the same loop) and `forgedock release explain <id | #issue | PR> [--json]` (#5554) are read-only: status reads the ledger (when `release.managed`) or the local cache plus the release PR's gate; `--watch` polls until the release is done, refused or blocked. `explain #N` prints the ordered rule trace (skip labels, priority, theme_map, `Depends on`, recorded release set, each with its config key), the lane and what would change it; `explain <PR>` prints the gate decision. `--json` output has schema `forgedock.release.status/v1` or `forgedock.release.explain/v1` and `next_actions[]`, the exact commands an agent may run; output carries no host name, so another host prints the same text. `status --watch [--interval s]` prints only when the output changes and stops at a terminal state; `forgedock release --watch` runs the same loop. Status prints `unknown` for any field the ledger does not hold. `explain #N` also reads the `FORGE:CLASSIFY` record (else `classification: absent`), `plan.skip_labels`, `classify.min_confidence`, `risk.rules[i]`, `forces[i]`, prints `planner: not installed` until the planner registers, and takes the lane from the latest `lane` entry in `controls.jsonl`; `explain <PR>` lists each required check with its outcome and any demotion (actor, expiry, reason, issue). `next_actions[]` carries `hold|resume|cancel` and `lane #N --force <lane>` commands (the `release-control.mjs` verbs) with `--reason <reason>` placeholders; there is no `rollback` verb yet, so none is emitted. `explain <PR>` reads the live `_active.exemptions` records (`release exempt`), `explain #N` the `_active.lanes` records.
|
|
762
762
|
|
|
763
763
|
```yaml
|
|
764
764
|
release:
|
|
@@ -779,6 +779,15 @@ release:
|
|
|
779
779
|
|
|
780
780
|
`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.
|
|
781
781
|
|
|
782
|
+
`forgedock release verify <release id>` (#5562) re-runs the deploy verification of a release that passed LIVE_CHECK; a release id (`rYYYYMMDD-HHMMSS-N`) is never mistaken for a sha. Policy `verify` block (default branch, `.forge/release.yaml`): `results` (list of `{workflow, kind: smoke|edge|convergence}`, layer 1), `workflow` (verification workflow dispatched through the epoch fence, layer 2), `slis` (layer 3, entries `{name, tolerance, worse: higher|lower, abs}` read through an injected read-only metric source; without one the layer reports `sli: skipped (no host)`), `post_deploy_checks_file` (layer 4, each issue's `[check:id]` runs once; entries with `for` are windowed and become rollup follow-ups), `flags` (layer 5, `{flag, off_command}` verified in the off state, never activated) and `close_requires: verified|deployed`. With `verified` (default once the block is set) an issue is closed only after a `FORGE:VERIFIED <deploy sha>` comment; `deployed` closes without it. Soak minutes by risk class: low 10, medium 20, full 30, p0 15, overridden by `lanes.<lane>.soak_min` (a number or a map by class). An empty `verify` block leaves VERIFYING a bare transition to LIVE.
|
|
783
|
+
|
|
784
|
+
### `.forge/release.yaml` (#5551)
|
|
785
|
+
|
|
786
|
+
Nested release policy (`schema: 1`) lives in a committed `.forge/release.yaml`, not in the host-local forge.yaml. It is read from the default branch with `git show origin/<default>:.forge/release.yaml`, never from the PR head or the worktree, so a PR cannot weaken its own gates. The flat `release.*` keys above stay the fallback when the file is absent there. Sections: `branches`, `trust`, `state`, `units`, `couplings`, `contracts`, `forces`, `classify`, `risk`, `plan`, `lanes`, `merge`, `ci`, `preflight`, `deploy`, `verify`, `rollback`, `controls`.
|
|
787
|
+
|
|
788
|
+
- `forgedock release check-config [--ref <git ref>]` parses it with the vendored, pinned YAML parser and fails (exit 1) on unknown keys, wrong types, duplicate keys, unreachable lanes (unknown pipeline, `base: integration` with no `branches.integration`, `ci_tier` not in `ci.tiers`) and keys deferred to a later phase (`plan.auto_if`, `retention_days`, `ci.forbid_per_issue_steps`, `couplings[].refine`, `ci.provider: command`, `risk.weights`).
|
|
789
|
+
- `forgedock release init` writes the zero-config profile (`schema: 1`, `branches.default: main`, `plan.approval: wait`, `lanes.release.pipeline: existing`, `merge.approval: confirm`) to `.forge/release.yaml` and nothing else; it never overwrites.
|
|
790
|
+
|
|
782
791
|
The forge.yaml reader handles two levels, so the rehearsal block is written as the flat keys `rehearsal_command`, `rehearsal_timeout` and `rehearsal_blocking`.
|
|
783
792
|
|
|
784
793
|
| Key | Type | Required | Description |
|
|
@@ -798,6 +807,50 @@ The forge.yaml reader handles two levels, so the rehearsal block is written as t
|
|
|
798
807
|
| `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. |
|
|
799
808
|
| `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. |
|
|
800
809
|
|
|
810
|
+
### Managed release: nightly and budget (#5569)
|
|
811
|
+
|
|
812
|
+
Both blocks are read only when `release.managed` is on; otherwise no nightly, minutes or budget call is made. Before the first step `forgedock release [--lane release|train|p0]` (default `release`) reads the latest nightly run and applies the budget.
|
|
813
|
+
|
|
814
|
+
```yaml
|
|
815
|
+
nightly:
|
|
816
|
+
workflow: nightly.yml # workflow file of the nightly run
|
|
817
|
+
branch: staging # integration branch
|
|
818
|
+
block_release: true
|
|
819
|
+
t0_t2_hours: 24 # T0-T2 cadence; results older than twice this are stale and never block
|
|
820
|
+
t3_t4_hours: 168 # T3-T4 cadence (weekly)
|
|
821
|
+
t3_jobs: "hands e2e" # comma list of job-name substrings that are T3 (a leading "T<n>" in a job name wins)
|
|
822
|
+
t4_jobs: "trivy"
|
|
823
|
+
unskippable: "migration" # job-name substrings that block a release whatever their tier
|
|
824
|
+
budget:
|
|
825
|
+
on_exceed: local-first # local-first | hold | proceed
|
|
826
|
+
ignore: false # true: budget never blocks this repo
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
| Key | Description |
|
|
830
|
+
|-----|-------------|
|
|
831
|
+
| `nightly.block_release` | Default `true`. A red T0-T2 job (an unclassified job counts as T2) or an `unskippable` job blocks `lane: release` with status blocked at step `gate`. T3/T4 reds never block; `train` and `p0` are never blocked. Any red files one open `nightly-red` issue (an existing one has its body edited). |
|
|
832
|
+
| `budget.on_exceed` | Applied at the gate when the forecast (median of the lane's last 5 recorded releases) exceeds the month's remaining minutes (`ci.monthly_minutes` less the reserve, less month-to-date). `local-first` records `ciMode` in the release state, `hold` blocks, `proceed` continues. `p0` always proceeds. Unknown forecast or usage proceeds. |
|
|
833
|
+
|
|
834
|
+
`forgedock release report` prints the model (`budget.model_release_minutes`, default 500, per release) against the measured minutes of the first 3 recorded releases and says whether they are within 25%; outside it, `budget.on_exceed` and the nightly cadence are the levers.
|
|
835
|
+
|
|
836
|
+
The release state (and so the ledger) records `lane` and `minutes: {runs, total}`, where total is the sum of ceil(job minutes) of the Actions runs created since the release started, read from the jobs API.
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
### Deploy gate catalogue and false-block telemetry (#5583)
|
|
840
|
+
|
|
841
|
+
Optional; with no `.forge/gates.yaml` (on the ref) every command below is a no-op with zero writes. `forgedock release check-config` validates the file when present. Fields per gate under `gates:` (`schema: 1`): `id`, `protects_against` (origin issue), `where`, `determinism`, `pre_merge_artifact` (fixture), `version`, `mode` (`block|skip|rollback|freeze|warn|red`), `owner`, `review_by` (`YYYY-MM-DD`); admission also needs `on_uncertainty: inconclusive`, `failure_triggers` and `proportionality`.
|
|
842
|
+
|
|
843
|
+
`.forge/release.yaml` `gates:`: `demote_fb_rate` (percent, default 5), `demote_window` (runs, default 20), `safety` (never demoted; default `migration-immutability`, `identity-preflight`, `backup-freshness`, `health-auto-restore`, plus the unskippable classes).
|
|
844
|
+
|
|
845
|
+
A `deploy-telemetry` job prints one JSON line per gate per run: `{"schema":"forgedock.release.gate/v1","gate":"<id>","outcome":"pass|fail|inconclusive|skip","class":"TP|FB|unknown","minutes":<n>,"evidence":"<text>"}`. A `TP`/`FB` class without `evidence` is stored as `unknown`. `forgedock release gates record <release-id> --file <jsonl>` stores the lines in the release state (`gates`). When `FORGE_GATE_TELEMETRY` names such a JSON-lines file and a catalogue exists, the release run stores its lines in `state.gates` next to `state.minutes` automatically; `historyFromRoot` exposes them as its `gates` property.
|
|
846
|
+
|
|
847
|
+
| Command | Description |
|
|
848
|
+
|---------|-------------|
|
|
849
|
+
| `release gates [--since 30d] [--json]` | Per gate: `runs`, `fails`, `fb`, `fb_share` (FB runs / runs, in percent), `minutes`. Text: a tab-separated header `gate runs fails fb fb_share minutes` and one row per gate. JSON: one line `{"schema":"forgedock.release.gates/v1","gates":[{gate,runs,fails,fb,minutes,fb_share}]}`. |
|
|
850
|
+
| `release gates check [--base <ref>]` | Fails for a gate added or changed against the base ref (default `origin/<default>`) that lacks the fixture, version, `on_uncertainty: inconclusive`, failure trigger with proportionality, or owner and `review_by`. |
|
|
851
|
+
| `release gates demote` | A gate whose FB rate over the last `demote_window` runs (a full window) exceeds `demote_fb_rate` is demoted to `warn` for 14 days via the audited `release demote` control, and an issue is filed. Safety gates are never demoted. |
|
|
852
|
+
| `release promote <gate> --fixture <ref> --reason <text>` | Re-promotes a demoted gate; refused without a fixture reference. |
|
|
853
|
+
|
|
801
854
|
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.
|
|
802
855
|
|
|
803
856
|
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:
|
|
@@ -851,6 +904,7 @@ issue_watch:
|
|
|
851
904
|
| `trust_app_labels` | list | No | Needs `trust_app`: an App-authored issue must carry one of these labels. |
|
|
852
905
|
| `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. |
|
|
853
906
|
| `release_pause` | boolean | No | Pause the watch while a `forgedock release` job is in flight; it resumes by itself. Default true in `mode: batch`. |
|
|
907
|
+
| `freeze.intake_auto_resume` / `release.tracker` | boolean / issue number | No | With `release.managed` (#5555): `freeze.intake_auto_resume: true` lets the issue watch clear a `forgedock intake pause --release <id>` once release `<id>` has ended in the ledger; `release.tracker` is the issue that gets the `forge:intake-paused` label. Default off. |
|
|
854
908
|
| `postdeploy_rollup` | issue number | No | Release issue that collects post-deploy-only follow-ups as checklist lines. |
|
|
855
909
|
| `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. |
|
|
856
910
|
| `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`. |
|
|
@@ -978,6 +1032,7 @@ lean:
|
|
|
978
1032
|
fix_model: claude-sonnet-5-5 # optional model of fresh fix-round sessions (default: the reviewer model)
|
|
979
1033
|
builder_routing: on # on (default) | off: route the build to a mid-tier model by the frozen contract
|
|
980
1034
|
builder_mid_model: claude-sonnet-5-5 # optional mid-tier builder model (default claude-sonnet-5-5)
|
|
1035
|
+
contract_max_corrections: 3 # #5623: builder correction rounds for a builder-correctable invalid contract before it ends contract.invalid (which a batch then requeues once with a fresh plan)
|
|
981
1036
|
light:
|
|
982
1037
|
mode: shadow # off | shadow (default) | on: light-lane eligibility (#4448; lane wiring #4450)
|
|
983
1038
|
max_lines: 40 # upgrade to the full lane above this many non-test diff lines
|
|
@@ -1411,6 +1466,43 @@ services:
|
|
|
1411
1466
|
|
|
1412
1467
|
---
|
|
1413
1468
|
|
|
1469
|
+
## `design` (OPTIONAL)
|
|
1470
|
+
|
|
1471
|
+
UI lanes and the visual gate (forge#5330, forge#5369). Everything is opt-in: a repo with no `design.routes` is never routed or gated and behaves as before. `design.system` is read independently by every UI lane.
|
|
1472
|
+
|
|
1473
|
+
| Key | Meaning | Default |
|
|
1474
|
+
| --- | --- | --- |
|
|
1475
|
+
| `system` | design-system docs, token files or component dirs (list or comma-separated). A UI lane reads them first, reuses their components, tokens, spacing and type, and gives a new surface its empty, loading and error states | `[]` |
|
|
1476
|
+
| `routes` | globs of user-visible route files, e.g. `web/src/app/(site)/**/page.tsx`. **Setting it turns the design gate on** | unset = off |
|
|
1477
|
+
| `exclude` | globs removed from `routes` (e.g. `web/src/app/(site)/api/**`) | `[]` |
|
|
1478
|
+
| `gate` | `blocking` or `advisory`. Blocking turns a finding into a failed lane precheck (`conformance.unimplemented`) and a `GATE_FAILURE` at `review-pr-staging`; advisory reports the same findings and never fails | `advisory` |
|
|
1479
|
+
| `spec_label` | the label that counts as an approved design (besides a non-draft `FORGE:DESIGN_SPEC` comment) | `design:approved` |
|
|
1480
|
+
| `needed_label` | the label that marks an issue waiting for `/design` | `design:needed` |
|
|
1481
|
+
| `directions_param` | query parameter that selects a design direction when `/design` renders variants of a route | unset |
|
|
1482
|
+
| `viewports` | widths (px) every route is rendered at | `[390, 1440]` |
|
|
1483
|
+
| `require_visual_check` | the staging visual gate requires a screenshot at every viewport and a render-critique verdict per route | `true` |
|
|
1484
|
+
|
|
1485
|
+
What the keys drive:
|
|
1486
|
+
|
|
1487
|
+
- **Routing (lane time).** When the frozen contract's deliverables include a page entry (`page.tsx|jsx`, `.vue`, `.svelte`) under `routes` and the issue has neither a `FORGE:DESIGN_SPEC` comment nor the `spec_label` label, the lane is routed to `/design` instead of being built from a functional spec. With `gate: blocking` the lane stops before the implement call (`needs-human`, outcome code `design.spec_required`) until a spec exists; with `advisory` the implement prompt tells the builder to reference a `/design` spec.
|
|
1488
|
+
- **Lane precheck (blocking only).** The same visual gate that runs at staging runs over the lane's diff with the deterministic source critique and the spec check, so a plain-text hero page with empty boxes fails before it reaches a PR. Rendered screenshots are not required here: lanes never install a browser and record `not rendered: <reason>` under `### Visual Check`.
|
|
1489
|
+
- **`review-pr-staging` Phase 1I.** `scripts/visual-gate.mjs` lists every new or changed route (`--list`), the reviewer renders each at every viewport, runs `design-render-critique-loop` against the route's spec, and the script judges the evidence, posts a `FORGE:VISUAL_GATE` comment (routes, screenshot paths, critique verdict) and exits 1 on a blocking finding. A changed route also adds the Frontend review persona (`review-roster.sh --design-routes true`).
|
|
1490
|
+
- **Deterministic critique floor** (`critiqueMarkup`, 0 LLM calls): empty or label-only boxes, placeholder copy or null samples, and a text-only page (an `h1` with no component, media or background) block; a page whose only calls to action are bare links warns.
|
|
1491
|
+
|
|
1492
|
+
```yaml
|
|
1493
|
+
design:
|
|
1494
|
+
system: [docs/design-system.md, web/styles/tokens.css]
|
|
1495
|
+
routes: ["web/app/**/page.tsx", "web/app/**/layout.tsx"] # opt-in: setting this turns the design gate on
|
|
1496
|
+
exclude: ["web/app/api/**"]
|
|
1497
|
+
gate: blocking # blocking | advisory (default advisory)
|
|
1498
|
+
spec_label: design:approved
|
|
1499
|
+
needed_label: design:needed
|
|
1500
|
+
viewports: [390, 1440]
|
|
1501
|
+
require_visual_check: true
|
|
1502
|
+
```
|
|
1503
|
+
|
|
1504
|
+
---
|
|
1505
|
+
|
|
1414
1506
|
## `review` (OPTIONAL)
|
|
1415
1507
|
|
|
1416
1508
|
Context injected into review agent prompts. Helps the 9-agent review system give relevant, project-specific feedback.
|
|
@@ -1559,6 +1651,7 @@ topology:
|
|
|
1559
1651
|
| `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. |
|
|
1560
1652
|
| `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`. |
|
|
1561
1653
|
| `pages.enabled` / `pages.routes` | bool / list | No | Page gate (#5428). Default on only when the repo tracks Next `app/**/page.*` files; `enabled: false` turns it off, and `routes` globs add non-Next page files. A diff touching a public page needs `page_gate` {design_spec, seo, geo} in the contract (checked by `validateContract`), and `page_missing`-class precheck rows (`page_design_missing`, `page_visual_missing`, `page_metadata_missing`, `page_canonical_missing`, `page_structured_data_missing`, `page_sitemap_missing`, `page_forbidden_pattern`, `page_link_broken`, `page_lint_failed`) fail as `conformance.unimplemented`. Read by `readEnvConfig`, checked by `bin/lean/pagegate.mjs`. |
|
|
1654
|
+
| `pages.exclude` / `pages.design_only` | lists | No | Globs (#5585). `exclude` drops internal, auth-gated or admin routes from the page gate entirely (no `page_gate` brief, no `page_*` rows). `design_only` keeps the `design` requirement (`page_gate.design_spec`, an approved spec, 390/1440 screenshots) but skips SEO/GEO. A page whose own file or an ancestor `layout.*` declares `robots: { index: false }` or `noindex` is excluded automatically (needs the file to exist in the worktree). Default empty. |
|
|
1562
1655
|
| `pages.require` / `pages.icp_doc` | list / path | No | Default `[design, seo_intent, geo]`. `icp_doc` names the repo's ICP doc the SEO brief must cite. `design` also needs a 390 and 1440 screenshot in the result's `page_gate.screenshots`; `design` and `seo-geo` become review domains and `/review-pr-staging` Phase 1H blocks. |
|
|
1563
1656
|
| `pages.sitemap` / `pages.metadata_patterns` / `pages.canonical_patterns` / `pages.structured_data_patterns` / `pages.forbid_patterns` / `pages.lint` | lists / command | No | Regex and glob overrides of the built-in Next defaults (sitemap files, `metadata`/`generateMetadata`, `canonical`, JSON-LD, `[[null]]`/raw-JSON/dead-end patterns on added page lines). A generated sitemap is justified in the result as `page_gate.sitemap_justification`. `lint` is a repo command given the page files; non-zero fails. |
|
|
1564
1657
|
| `docs.required_for` | string or list | No | Default unset (#5419): the docs gate is off, so library/CLI repos are unchanged. Kinds of user-facing surface that need user docs: `api`, `mcp`, `dashboard`, `cli`, `sdk`. Built in: Next route handlers (`api`) and `app/**/page.*` under a `dashboard` path (`dashboard`); other kinds need `docs.surfaces`. Read by `readEnvConfig`, checked by `bin/lean/docsgate.mjs`. |
|
|
@@ -1621,7 +1714,7 @@ from the host by a major version (`setup-node` 18 vs host 26: version drift, lis
|
|
|
1621
1714
|
DEGRADED, never FAIL, and its clock starts when the job starts executing, not while it waits for a machine slot.
|
|
1622
1715
|
|
|
1623
1716
|
**Exact scoping** (runs only what the change can affect): job-level path filters from the CI definition (including
|
|
1624
|
-
`dorny/paths-filter` outputs) gate whole jobs; per-file linters (shellcheck, eslint, prettier, ruff, black, flake8, ...) run
|
|
1717
|
+
`dorny/paths-filter` outputs) gate whole jobs (generate such a filter step in git mode: `actions/checkout` with `fetch-depth: 0`, and `token: ''` with `base:` set on `dorny/paths-filter`, because the default PR files API times out on large diffs and every gated suite is then skipped, #5592); per-file linters (shellcheck, eslint, prettier, ruff, black, flake8, ...) run
|
|
1625
1718
|
on the changed files only; tests use the ecosystem selector (`jest --findRelatedTests`, `vitest related`, `go` affected
|
|
1626
1719
|
packages with reverse dependencies, `cargo test -p` affected crates, Maven `-pl ... -amd`, `nx affected`, `turbo --filter`) or a
|
|
1627
1720
|
git-grep reference graph for file-list runners (pytest, mocha, `node --test`, bats, rspec, direct `*.test.*` invocations);
|
package/docs/ISSUE-WATCH.md
CHANGED
|
@@ -84,6 +84,10 @@ issue_watch:
|
|
|
84
84
|
|
|
85
85
|
`--dry-run` lists what each would claim. A batch that reported is never added to: the next claims start a new one.
|
|
86
86
|
|
|
87
|
+
## Intake pause from GitHub (#5555)
|
|
88
|
+
|
|
89
|
+
With `release.managed` on, the watch also reads the pause from GitHub on every pass, so every host honours it and nothing depends on a local state file: `_active.intake.paused` on the ledger control branch, an active ledger entry (the lease's release has no end `status`), or any open `release/*`, `train/*` or `hotfix/*` PR. `forgedock intake pause|resume|status [--reason <text>] [--tracker <issue>] [--release <id>]` writes `_active.intake` (with an audit line in `controls.jsonl`) and the `forge:intake-paused` label on the tracker (`--tracker` or `release.tracker`). With `freeze.intake_auto_resume: true` a pause that names `--release <id>` is cleared by the watch once that release's ledger has an end status. Unmanaged repos make no extra call. A failed GitHub read does not pause (it shows as `pauseError` in `status.json`).
|
|
90
|
+
|
|
87
91
|
## Release pause and liveness
|
|
88
92
|
|
|
89
93
|
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:
|
|
@@ -160,4 +164,7 @@ issue_watch:
|
|
|
160
164
|
- **Retry.** A transient `gh` failure (TLS handshake timeout, connection reset, DNS, HTTP 5xx or 429, secondary rate limit) is retried 3 times with doubling backoff (2 s, 4 s, 8 s) inside the same call. A call that still fails fails its pass only: the pass is logged and recorded as `passError`, and the next pass runs. A 4xx is never retried.
|
|
161
165
|
- **Exit state.** Whenever `run` stops (crash, SIGTERM/SIGINT, `--once`) `status.json` gets `phase: exited`, `exitReason` and `exitedAt`; it is never left as `running`. A restart resumes it.
|
|
162
166
|
- **Supervision.** `forgedock issue-watch install --name <w>` writes a systemd user unit `forgedock-issue-watch-<w>.service` (`Restart=on-failure`, run from the current directory so `forge.yaml` is found) and a 60 s watchdog timer, or a launchd agent (`KeepAlive` on failure) on macOS. A finished (`done`) or stopped watch exits 0 and stays down.
|
|
167
|
+
- **Lane environment (#5529).** systemd starts a user unit with almost no environment (`PATH=/usr/local/bin:/usr/bin`), so the unit carries the lane environment resolved from the installing shell: `PATH` with the tokenbaton shim and the resolved `claude` directory first, `TMPDIR` (else `/tmp`), `TOKENBATON_HOME`/`TOKENBATON_SWITCH_AT` when set, and `UnsetEnvironment=CLAUDE_CONFIG_DIR`. The computeshare token is read when the unit starts (keychain `service forgedock account COMPUTESHARE_TOKEN`, else the router's `forgedock_token_file`); only the file path is in the unit, never the value. The launchd agent gets the same variables in `EnvironmentVariables` (no token). Reinstall after moving `claude`.
|
|
168
|
+
- **claude check (#5529).** Each pass the watcher records in `status.json` whether it can resolve `claude` on its own PATH (the PATH its lanes inherit). `issue-watch status`, `forgedock status` and `forgedock doctor` warn when it cannot.
|
|
169
|
+
- **Stranded re-drive (#5529).** A stranded claim (a final batch result that is not merged, needs-human or parked) is re-driven, not only counted: requeued into its batch (`orchestrate --requeue`), or its claim released when the batch is gone, at most twice per issue. An `engine-error` whose lane could not find its CLI (`Failed to find executable`, `spawn ... ENOENT`, `command not found`) is re-driven only once the watcher resolves `claude` again. `status` shows the `re-driven` count.
|
|
163
170
|
- **DEAD.** A heartbeat older than 3 × `heartbeatEveryMs` (+60 s grace) is shown as `state: DEAD` by `issue-watch status` and in a `issue-watch` section of `forgedock status`. `issue-watch watchdog` (the install timer) and `forgedock status` post a `watch.dead` event once per dead heartbeat to `events.webhook_url` (see EVENTS.md).
|
package/docs/OUTCOME-CODES.md
CHANGED
|
@@ -68,6 +68,7 @@ An absent or unknown code is recorded as `unclassified`, with the raw reason kep
|
|
|
68
68
|
| `lease.held` | Another live agent holds the issue lease | engine | Foreign live lease on acquire |
|
|
69
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
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 |
|
|
71
|
+
| `design.spec_required` | Core work-on (#5330): the lane predicts a page entry under forge.yaml `design.routes` with no `FORGE:DESIGN_SPEC` comment or `design:approved` label, and `design.gate` is `blocking`. The lane stops before implementation as `needs-human` until `/design` approves a spec; under `advisory` the implement prompt gets a note instead. |
|
|
71
72
|
| `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 |
|
|
72
73
|
| `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 |
|
|
73
74
|
| `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/STATS.md
CHANGED
|
@@ -44,6 +44,16 @@ keeps the earlier verdict mix under `query.mix` and adds `query.scoreboard`. The
|
|
|
44
44
|
|
|
45
45
|
With no local state at all, `forgedock stats --repo <r>` reproduces the report from GitHub alone.
|
|
46
46
|
|
|
47
|
+
## Shareable card (`--card`, forge#5291)
|
|
48
|
+
|
|
49
|
+
`forgedock stats --card [--week|--month] [--include-repo-names] [--public-repo] [--out <dir>] [--repo <owner/repo>]` prints a Markdown
|
|
50
|
+
card and, with `--out`, also writes `stats-card.svg`, `stats-card.png` and `stats-card.md`. It reuses the normal stats crawl (no extra
|
|
51
|
+
network calls) and shows aggregates only: PRs merged, issues completed, cost per merge, issues closed before code
|
|
52
|
+
(invalid or duplicate), release-gate catches (blocked acceptance, diff-size, CI and liveness gates) and a time-saved
|
|
53
|
+
estimate (1.5 h per merged PR, labelled as an estimate). `--week` and `--month` bound the window to 7 or 30 days.
|
|
54
|
+
Issue titles are never included, and the repo name only with `--include-repo-names`. The footer link follows
|
|
55
|
+
`branding.show_attribution` in `forge.yaml` (default on). `--public-repo` asserts the repo is public: it names the repo and adds a link to its merged-PR history (no network lookup is made to verify visibility). The PNG is rendered by a built-in dependency-free encoder (`node:zlib` and a 5x7 bitmap font, upper-case text), so it looks plainer than the SVG.
|
|
56
|
+
|
|
47
57
|
## Efficiency (`--efficiency`, forge#4402)
|
|
48
58
|
|
|
49
59
|
```bash
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Visual gate at `review-pr-staging` (forge#5330, forge#5369)
|
|
2
|
+
|
|
3
|
+
Opt-in per repo through forge.yaml `design.routes` (see [`docs/CONFIG.md`](../CONFIG.md) `design`). With `design.routes` unset the gate is skipped and the review behaves as before. This is Phase 1I of `commands/review-pr-staging.md`. It is the same gate the lane precheck runs (`bin/lean/design-gate.mjs` `visualGate`); `scripts/visual-gate.mjs` is a thin CLI over it, so there is one implementation.
|
|
4
|
+
|
|
5
|
+
## Procedure
|
|
6
|
+
|
|
7
|
+
1. List the bundle's routes. `git diff --name-only origin/$DEFAULT_BRANCH...origin/$STAGING_BRANCH > "$FILES"`, then `node "$FORGE_ROOT/scripts/visual-gate.mjs" --list --files-file "$FILES" --root .`. The JSON names every new or changed user-visible route (`design.routes` minus `design.exclude`) and the `viewports` (default 390 and 1440). No routes: `Visual gate: PASS (no routes)`.
|
|
8
|
+
2. Resolve each route's spec. Find the issue that added it (the merged PR's `Closes #N`); it has a spec when a non-draft `FORGE:DESIGN_SPEC` comment or the `design.spec_label` label (default `design:approved`) exists. Write `{"<route>": true|false}` to `$SPECS`.
|
|
9
|
+
3. Render and critique. Render each route at every viewport with the Playwright MCP (read-only; `design.directions_param` selects a variant), save screenshots as `$RUNTMP/visual/<route>-<width>.png`, and run the `design-render-critique-loop` skill against the route's spec, one iteration, for the verdict `PASS`, `ITERATE` or `BUDGET-EXHAUSTED`. Write `{"<route>": {"screenshots": [...], "verdict": "..."}}` to `$EVIDENCE`. With no browser, record that and leave the route out: with `design.require_visual_check: true` the missing evidence is a finding. A review reports, it never edits the page.
|
|
10
|
+
4. Judge. `node "$FORGE_ROOT/scripts/visual-gate.mjs" --files-file "$FILES" --root . --specs-json "$SPECS" --evidence "$EVIDENCE" --comment` prints the `FORGE:VISUAL_GATE` comment (route, file, screenshot paths, critique verdict, findings); post it on the staging PR. Exit codes: `0` PASS, ADVISORY or SKIP; `1` FAIL.
|
|
11
|
+
|
|
12
|
+
## Findings
|
|
13
|
+
|
|
14
|
+
| Kind | Meaning |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `design_spec_missing` | a page entry with no approved design spec |
|
|
17
|
+
| `visual_screenshots_missing` | no screenshot at one of the `viewports` |
|
|
18
|
+
| `visual_critique_missing` | no render-critique verdict for the route |
|
|
19
|
+
| `visual_critique_failed` | a verdict other than `PASS`, or the deterministic source critique found an empty or label-only box, placeholder copy or a null sample, or a text-only page (an `h1` with no component, media or background) |
|
|
20
|
+
|
|
21
|
+
With `design.gate: blocking` every finding is a BLOCKER (`Visual: <route> <kind>`) and the review posts `FORGE:GATE_FAILURE`. With `advisory` the same findings are reported and the gate never fails.
|
|
22
|
+
|
|
23
|
+
## Regression fixture
|
|
24
|
+
|
|
25
|
+
`bin/lean/design-gate.test.mjs` and `bin/lean/visual-gate.test.mjs` hold the fixture from the 2026-11-09 Hands pages: a plain-text hero (`h1` and prose), empty Needs/Evidence/Action boxes and a bare "Get access" link. A bundle adding it fails the gate; a page with a component hero, filled cards and a real button passes.
|
|
@@ -4,7 +4,7 @@ This benchmark checks the claim that a fixed process beats a bare agent session
|
|
|
4
4
|
|
|
5
5
|
- Harness: `scripts/bench-adversarial.mjs`. It is a sibling of `scripts/bench-lightlane.mjs` (#4453) and reuses its arm runner, so the arms are run and costed the same way.
|
|
6
6
|
- Corpus: `docs/eval/corpus/adversarial-v1.json`
|
|
7
|
-
- Arms: `full` (`forgedock run-issue` with the light
|
|
7
|
+
- Arms: `full` (`forgedock run-issue` with the fast path engaged: `lean.light.mode: on`, `lean.light.source: investigation`, #5426) and `control` (a plain `claude -p` session).
|
|
8
8
|
|
|
9
9
|
## Corpus
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ Each invalid issue has `evidence: {file, pattern}`. The pattern must match the f
|
|
|
20
20
|
|
|
21
21
|
## Prerequisites and run config
|
|
22
22
|
|
|
23
|
-
Same as `docs/eval/lightlane-bench.md`: `python3`, `git`, `gh`, `claude` and `forgedock` on PATH, plus one **private sandbox repo** for the full arm. The base SHA must exist in it, and its `forge.yaml` sets `lean:` → `light:` → `mode:
|
|
23
|
+
Same as `docs/eval/lightlane-bench.md`: `python3`, `git`, `gh`, `claude` and `forgedock` on PATH, plus one **private sandbox repo** for the full arm. The base SHA must exist in it, and its `forge.yaml` sets `lean:` → `light:` → `mode: on` and `source: investigation`. The default `shadow` (and `off`) never fast-forwards, so the full lane would pay for plan, freeze and review and miss the ≤ 1.3× control cost target. Run each lane with `--result-file`; a lane whose result has no boolean `light` is counted as `light_unobserved` in the scorecard (#5541). File the corpus issues in the sandbox with the title and body taken verbatim from the corpus:
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
26
|
jq -c '.issues[]' docs/eval/corpus/adversarial-v1.json | while read -r i; do
|
|
@@ -202,11 +202,11 @@
|
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
|
-
"id": "adv-int-
|
|
205
|
+
"id": "adv-int-is-permutation",
|
|
206
206
|
"kind": "integration",
|
|
207
207
|
"expected": "implement",
|
|
208
|
-
"title": "Add
|
|
209
|
-
"body": "Please add `
|
|
208
|
+
"title": "Add is_permutation(a, b): True when two iterables hold the same items with the same counts, in any order",
|
|
209
|
+
"body": "Please add `is_permutation(a, b)` to more_itertools.more. It returns True when the two iterables hold the same items, each the same number of times, in any order (`is_permutation([1, 2, 2], [2, 1, 2])` is True, `is_permutation([1, 2], [1, 2, 2])` is False). Items are compared with `==`, so unhashable items such as lists must work. It must be available as `more_itertools.is_permutation`, with the same public surface as the other helpers.",
|
|
210
210
|
"must_touch": [
|
|
211
211
|
"more_itertools/more.py",
|
|
212
212
|
"more_itertools/more.pyi",
|
|
@@ -145,6 +145,13 @@ shadcn/ui; `pnpm build`, lint and unit tests in CI.
|
|
|
145
145
|
`/api/lists`, `/api/invites`.
|
|
146
146
|
**Rationale**: one route per milestone feature.
|
|
147
147
|
|
|
148
|
+
## Interfaces
|
|
149
|
+
| Boundary | Signature or schema | Auth mode | Owner issue | Anchors | Consumers |
|
|
150
|
+
|----------|---------------------|-----------|-------------|---------|-----------|
|
|
151
|
+
| web -> lists API | POST /api/lists {name} -> {id} | session cookie | LISTS | `provider:src/app/api/lists/`, `consumer:src/components/lists/` | SHARING |
|
|
152
|
+
|
|
153
|
+
**Rationale**: the web app and the API agree on one signature before either is built.
|
|
154
|
+
|
|
148
155
|
## Credentials
|
|
149
156
|
Resend API key (needs-human); the mock mailer is used until it exists.
|
|
150
157
|
**Rationale**: agents cannot create third-party accounts.
|
|
@@ -428,6 +428,37 @@ A permanent audit trail of a completed pipeline run.
|
|
|
428
428
|
**Completed**: {ISO 8601 timestamp}
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
+
#### `FORGE:STATUS` (lean engine, #5592)
|
|
432
|
+
|
|
433
|
+
- **Written by**: the lean engine and the batch runner, one comment per issue, edited in place
|
|
434
|
+
- **Read by**: any reader of a section marker (the section markers below stay in the body)
|
|
435
|
+
|
|
436
|
+
The machine-state markers `FORGE:STARTED`, `FORGE:CONTEXT`, `FORGE:LANE_BRANCH`, `FORGE:LITE`,
|
|
437
|
+
`FORGE:TRAJECTORY` (with its `FORGE:WORK-ON` alias) and the engine's prose `FORGE:DECISION` are
|
|
438
|
+
sections of one trusted comment instead of a comment per run. A requeue or recovery edits the
|
|
439
|
+
same comment: a section holds the newest run's text (`FORGE:DECISION` keeps its last 5 entries).
|
|
440
|
+
The engine finds its comment by the leading marker and a trusted author (trusted association, Bot,
|
|
441
|
+
or the ForgeDock App) and edits only that; an untrusted comment carrying the marker is ignored.
|
|
442
|
+
|
|
443
|
+
```
|
|
444
|
+
<!-- FORGE:STATUS -->
|
|
445
|
+
<!-- FORGE:STATUS:SEP -->
|
|
446
|
+
<!-- FORGE:STARTED -->
|
|
447
|
+
Started work on #{NUMBER} (base `{lane}`).
|
|
448
|
+
<!-- FORGE:STATUS:SEP -->
|
|
449
|
+
<!-- FORGE:TRAJECTORY -->
|
|
450
|
+
<!-- FORGE:WORK-ON -->
|
|
451
|
+
## Pipeline Trajectory — #{NUMBER}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
A reader that searches a body for a marker keeps working. A reader that anchors the marker at the
|
|
455
|
+
start of the comment must also accept a section (`hasSection` in `bin/lean/statuscomment.mjs`).
|
|
456
|
+
`FORGE:INVESTIGATION`, `FORGE:IMPLEMENTATION` and `FORGE:PARKED` are single comments edited in
|
|
457
|
+
place (marker still leading). `FORGE:NEEDS_HUMAN`, `FORGE:HOST_TASK`, `FORGE:DEPENDENCY`,
|
|
458
|
+
`FORGE:CONTRACT`/`FORGE:PLAN`, `FORGE:REVIEW`, `FORGE:FACTS`, `FORGE:TRACKED`, owner asks and JSON
|
|
459
|
+
`FORGE:DECISION` records stay separate comments: a person must see them (an edit does not
|
|
460
|
+
notify) or other code reads them in comment order.
|
|
461
|
+
|
|
431
462
|
### 4.2 Cross-artifact annotations
|
|
432
463
|
|
|
433
464
|
These annotations move context between issues — useful when a parent issue is
|
package/package.json
CHANGED
package/pool/README.md
CHANGED
|
@@ -12,4 +12,6 @@ The module boundary is the ForgeDock HTTP sandbox protocol: the router speaks it
|
|
|
12
12
|
|
|
13
13
|
Claude login choice (#5165): among the router host's logins with 30+ minutes left, the router hands out the one with the lowest 5-hour use in tokenbaton's `live.<n>` (account `n` = `~/.claude-<n>`), read from router.json `usage_source` (default `$TOKENBATON_HOME`, else `~/.tokenbaton`); validity only breaks ties. An account at or above `usage_ceiling_pct` (default 95) or at 100% weekly use is skipped; when every login is, `/agent/creds/claude` answers a typed 429 (`code: rate_limited`, `reset_at` = the earliest reset, `retry-after`), which the agent passes through and `cs-cred` prints as `usage limit hit; resets at <ISO>` so the lane defers. Without readable usage it falls back to the longest validity and logs a warning. The selected account index and usage are logged, never the token. A sample whose 5-hour reset has passed is stale (#5205): unknown usage, never 0%, ranked after fresh samples. A lane that hits a usage limit runs `cs-cred claude --limited <reset>`, which drops the sandbox's cached token and posts to `/sandboxes/<id>/creds/claude/limited`; the agent drops its own cache and forwards to the router's `POST /agent/creds/claude/limited`, which excludes the account it last handed that agent until the reset (default one hour), then the lane fetches the next login and relaunches at once. With every login excluded or blocked, the 429 carries the earliest reset, limited accounts included.
|
|
14
14
|
|
|
15
|
+
Disk reporting (#5535, all fields optional; absent from an old agent means unknown): the agent's `GET /capacity` carries `disk_free_gb` (free space under its state dir) and `sandbox_disk_mb` (`{sandbox id: MB}`, refreshed at most every 60s). The router's `GET /agents` passes `disk_free_gb` through in `agents[]` and adds `disk_used_mb` to each `sandboxes[id]`. `forgedock gc` prints the disk used per pool entry (`unknown` when absent) and `forgedock doctor` shows each agent's free disk, warning below `hygiene.min_free_gb`.
|
|
16
|
+
|
|
15
17
|
The `forgedock pool` CLI wiring is tracked separately (#4544).
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
# UNRUNNABLE could not execute (timeout 124, not executable 126/127, worktree/overlay/classifier failure, or head failed
|
|
16
16
|
# only on a missing host module/command such as `No module named pytest`; forge#4655)
|
|
17
17
|
# SKIPPED base was not run because head did not PASS (never a missing file: head's new test files are overlaid)
|
|
18
|
+
# BASE=RAN additionally reruns base with the base's own version of modified test files; FAILED appends " PRISTINE=FAILED" (#5544: the test was the bug).
|
|
18
19
|
# Never prints a verdict on success of cleanup: the base worktree is removed on every exit path (trap + explicit remove).
|
|
19
20
|
# Callers map: HEAD=RAN BASE=FAILED -> proof; BASE=RAN -> passes on base (gate FAIL); anything else that is not a proof -> DEGRADED/FAIL.
|
|
20
21
|
# Exit: 0 line printed | 2 usage error (stdout empty so callers fail closed)
|
|
@@ -111,6 +112,19 @@ while IFS= read -r t; do
|
|
|
111
112
|
done <<< "$DEPS"
|
|
112
113
|
|
|
113
114
|
if [ "$OVERLAY_OK" != "true" ]; then BASE_RES=UNRUNNABLE; else BASE_RES=$(run_in "$BASE_WT"); fi
|
|
115
|
+
# #5544: BASE=RAN means head's test passes on base source, which a test-only fix satisfies by construction. Rerun with the
|
|
116
|
+
# base's own version of each test file that exists at base (head-added files stay overlaid): FAILED there means the test was the bug.
|
|
117
|
+
PRISTINE=""
|
|
118
|
+
if [ "$BASE_RES" = "RAN" ]; then
|
|
119
|
+
RESTORED=false
|
|
120
|
+
while IFS= read -r f; do
|
|
121
|
+
[ -n "$f" ] || continue
|
|
122
|
+
is_test_path "$f" || continue
|
|
123
|
+
git -C "$REPO" cat-file -e "$BASE_SHA:$f" 2>/dev/null || continue
|
|
124
|
+
git -C "$BASE_WT" checkout "$BASE_SHA" -- "$f" >/dev/null 2>&1 && RESTORED=true
|
|
125
|
+
done <<< "$CHANGED"
|
|
126
|
+
if [ "$RESTORED" = "true" ] && [ "$(run_in "$BASE_WT")" = "FAILED" ]; then PRISTINE=" PRISTINE=FAILED"; fi
|
|
127
|
+
fi
|
|
114
128
|
cleanup # explicit; the EXIT trap is the backstop
|
|
115
|
-
echo "BASE=$BASE_RES HEAD=$HEAD_RES"
|
|
129
|
+
echo "BASE=$BASE_RES HEAD=$HEAD_RES$PRISTINE"
|
|
116
130
|
exit 0
|
|
@@ -86,5 +86,17 @@ git -C "$R5" add -A; git -C "$R5" commit -qm test
|
|
|
86
86
|
check "workspace node_modules and .venv linked into base; new nested test overlaid" "BASE=FAILED HEAD=RAN" "$R5" "cd apps/web && bash __tests__/t.test.sh"
|
|
87
87
|
[ -d "$R5/apps/web/node_modules/dep" ] && [ -d "$R5/.venv/bin" ] && ok "head dependency trees survive base cleanup" || bad "head dependency trees removed by cleanup"
|
|
88
88
|
|
|
89
|
+
|
|
90
|
+
# 12. #5544 test-only fix: the base's own version of the test fails, head's passes, source unchanged
|
|
91
|
+
R5="$TMP/r5"; make_repo "$R5"; mkdir -p "$R5/tests"; printf 'test "$(bash app.sh)" = good && echo "1 passed"\n' > "$R5/tests/t.sh"
|
|
92
|
+
git -C "$R5" add -A; git -C "$R5" commit -qm "bad test"; git -C "$R5" update-ref refs/remotes/origin/main HEAD
|
|
93
|
+
printf 'test "$(bash app.sh)" = bad && echo "1 passed"\n' > "$R5/tests/t.sh"; git -C "$R5" add -A; git -C "$R5" commit -qm "fix test"
|
|
94
|
+
check "test-only fix: base version of the test fails (#5544)" "BASE=RAN HEAD=RAN PRISTINE=FAILED" "$R5" "bash tests/t.sh"
|
|
95
|
+
# 13. modified test passes on base in both versions: no PRISTINE word
|
|
96
|
+
R6="$TMP/r6"; make_repo "$R6"; mkdir -p "$R6/tests"; printf 'echo "1 passed"\n' > "$R6/tests/t.sh"
|
|
97
|
+
git -C "$R6" add -A; git -C "$R6" commit -qm t; git -C "$R6" update-ref refs/remotes/origin/main HEAD
|
|
98
|
+
printf 'echo "2 passed"\n' > "$R6/tests/t.sh"; git -C "$R6" add -A; git -C "$R6" commit -qm t2
|
|
99
|
+
check "modified test passing on base in both versions has no PRISTINE word (#5544)" "BASE=RAN HEAD=RAN" "$R6" "bash tests/t.sh"
|
|
100
|
+
|
|
89
101
|
echo "$PASS passed, $FAILN failed"
|
|
90
102
|
[ "$FAILN" -eq 0 ]
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* Sibling of bench-lightlane.mjs (#4453), which it reuses for the arm runs. The corpus mixes valid issues with ones that
|
|
8
8
|
* must not be implemented (wrong premise, duplicate of an existing feature, already shipped) and with integration issues
|
|
9
9
|
* whose correct change touches more than one file. Grading is deterministic (diff paths and added lines), no LLM.
|
|
10
|
+
* The fast-forward depth (#5426) only engages with the sandbox forge.yaml at lean.light.mode: on and a result file per lane;
|
|
11
|
+
* rows without a `light` field count as light_unobserved in the scorecard (#5541).
|
|
10
12
|
* Instructions: docs/eval/adversarial-bench.md. Corpus: docs/eval/corpus/adversarial-v1.json.
|
|
11
13
|
*
|
|
12
14
|
* Usage:
|
|
@@ -129,6 +131,7 @@ export function aggregateAdversarial(rows, meta) {
|
|
|
129
131
|
oracle_pass_rate: oracle.length ? r4(oracle.filter((r) => r.oracle_pass === true).length / oracle.length) : null,
|
|
130
132
|
cost_usd: r4(sumOf(mine, "cost_usd")),
|
|
131
133
|
wall_ms: sumOf(mine, "wall_ms"),
|
|
134
|
+
light_unobserved: mine.filter((r) => r.light_unobserved === true).length, // #5541
|
|
132
135
|
};
|
|
133
136
|
}
|
|
134
137
|
return { meta, arms };
|
|
@@ -144,6 +147,7 @@ export function renderScorecard({ meta, arms }) {
|
|
|
144
147
|
["Oracle pass rate", (a) => (a.oracle_pass_rate == null ? "n/a" : `${a.oracle_pass_rate} (n=${a.oracle_n})`)],
|
|
145
148
|
["Cost (USD, sum)", (a) => String(a.cost_usd)],
|
|
146
149
|
["Wall time (ms, sum)", (a) => String(a.wall_ms)],
|
|
150
|
+
["Lanes with no `light` in the result (light_unobserved)", (a) => String(a.light_unobserved)],
|
|
147
151
|
];
|
|
148
152
|
return [
|
|
149
153
|
"# Adversarial benchmark scorecard (#5292)",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
* light, full: `forgedock run-issue <n> --repo <sandbox> --result-file <f>` on a sandbox repo whose forge.yaml sets
|
|
18
18
|
* lean.light.mode on (light) or off (full). Cost is the run result's cost_usd (the sum of the #4407 per-session
|
|
19
19
|
* deltas); model time is model_ms (summed session time, #4451).
|
|
20
|
+
* A light-lane cost target needs the sandbox forge.yaml at lean.light.mode: on (default is shadow, which never fast-forwards)
|
|
21
|
+
* and a result file; a row without a boolean `light` is flagged light_unobserved (#5541).
|
|
20
22
|
* control: `claude -p <prompt> --output-format json --model <model>` in a fresh clone at the base; cost is
|
|
21
23
|
* total_cost_usd, wall and model time are duration_ms (one session).
|
|
22
24
|
*
|
|
@@ -137,7 +139,7 @@ async function grade({ run, src, head, base, corpus, issue, tmp, tag, apiShape }
|
|
|
137
139
|
export async function runArm({ arm, issue, corpus, cfg, run = benchDefaultRun, tmp, now = () => Date.now(), apiShape = detectApiShape }) {
|
|
138
140
|
const tag = `${arm}-${issue.id}`, a = cfg.arms[arm];
|
|
139
141
|
const row = { arm, id: issue.id, cost_usd: null, wall_ms: null, model_ms: null, harness_wall_ms: null, claimed_fix: false, oracle_pass: false, suite_pass: null,
|
|
140
|
-
api_shape: null, light: null, light_eligibility: null, light_upgrade: null, terminal: null };
|
|
142
|
+
api_shape: null, light: null, light_unobserved: false, light_eligibility: null, light_upgrade: null, terminal: null };
|
|
141
143
|
const t0 = now();
|
|
142
144
|
let src = null, head = null, base = corpus.base, claimed = false;
|
|
143
145
|
if (arm === "control") {
|
|
@@ -164,6 +166,7 @@ export async function runArm({ arm, issue, corpus, cfg, run = benchDefaultRun, t
|
|
|
164
166
|
row.terminal = res?.terminalReason ?? `exit ${r.code}`;
|
|
165
167
|
row.cost_usd = num(res?.cost_usd); row.wall_ms = num(res?.wall_ms); row.model_ms = num(res?.model_ms);
|
|
166
168
|
row.light = typeof res?.light === "boolean" ? res.light : null;
|
|
169
|
+
row.light_unobserved = row.light === null; // #5541: no result file (or no `light` field), so the lane's depth is unknown, not false
|
|
167
170
|
row.light_eligibility = res?.light_eligibility ?? null;
|
|
168
171
|
row.light_upgrade = Array.isArray(res?.light_upgrade) ? res.light_upgrade : null;
|
|
169
172
|
claimed = CLAIMED_REASONS.has(row.terminal);
|
|
@@ -33,6 +33,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
33
33
|
import { fileURLToPath } from "node:url";
|
|
34
34
|
import { validatePlan, formatErrors, resolvePlaceholders, isNeedsHuman, isSkeleton } from "./bootstrap-validate.mjs";
|
|
35
35
|
import { milestoneSlug } from "../bin/lean/lane.mjs";
|
|
36
|
+
import { checkInterfaces, seedDecisions, INTERFACES_SECTION } from "../bin/lean/interfaces.mjs";
|
|
36
37
|
|
|
37
38
|
const SELF_DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
38
39
|
const DEFAULT_SPIKE_DOC = "docs/engineering/technical-spike.md";
|
|
@@ -45,6 +46,7 @@ export const SPIKE_SECTIONS = [
|
|
|
45
46
|
"Stack", "Repo layout", "Runtime topology", "Data model", "Security and privacy",
|
|
46
47
|
"Design system and quality gates", "Route/API map", "Credentials", "Milestone plan",
|
|
47
48
|
];
|
|
49
|
+
export { INTERFACES_SECTION }; // #5338: required (like SPIKE_SECTIONS) once the spike's Milestone plan lists two or more slices
|
|
48
50
|
|
|
49
51
|
/** `## ` sections of a markdown text, fenced code ignored: [{ heading, lines }]. */
|
|
50
52
|
function h2Sections(text) {
|
|
@@ -72,6 +74,8 @@ export function checkSpikeDoc(text) {
|
|
|
72
74
|
if (!s) missing.push(name);
|
|
73
75
|
else if (!s.lines.some((l) => /\*\*Rationale\*\*:/.test(l))) noRationale.push(name);
|
|
74
76
|
}
|
|
77
|
+
const ifc = checkInterfaces(text, { kind: "spike" }); // #5338
|
|
78
|
+
if (!ifc.ok) (ifc.hasSection ? noRationale : missing).push(INTERFACES_SECTION);
|
|
75
79
|
return { ok: missing.length === 0 && noRationale.length === 0, missing, noRationale };
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -205,7 +209,7 @@ const parseIssueNumber = (out) => {
|
|
|
205
209
|
* io.sh(cmd, args, input?) -> stdout string (bash helpers: transition-label.sh, trusted-comments.sh)
|
|
206
210
|
* @returns {object} result for handoffText (spike, issues, milestones, notes)
|
|
207
211
|
*/
|
|
208
|
-
export function createBacklog(plan, { io, repo, config = {}, base }) {
|
|
212
|
+
export function createBacklog(plan, { io, repo, config = {}, base, spikeText = null }) {
|
|
209
213
|
const spikeKey = plan.spike ?? "SPIKE";
|
|
210
214
|
const spikePlan = plan.issues.find((it) => it.key === spikeKey);
|
|
211
215
|
if (!spikePlan) throw new Error(`plan has no spike issue with key ${spikeKey}`);
|
|
@@ -308,6 +312,8 @@ export function createBacklog(plan, { io, repo, config = {}, base }) {
|
|
|
308
312
|
const attribution = String(config.branding?.show_attribution ?? "true") !== "false";
|
|
309
313
|
if (!trusted("^<!-- FORGE:BOOTSTRAP_PLAN -->")) gh(["issue", "comment", String(spikeNo), "-R", repo, "--body-file", "-"], bootstrapPlanComment(plan));
|
|
310
314
|
if (!trusted("^<!-- FORGE:DECOMPOSED -->")) gh(["issue", "comment", String(spikeNo), "-R", repo, "--body-file", "-"], decomposedComment(plan, numbers, { attribution }));
|
|
315
|
+
// #5338: the spike's Interfaces rows and anchored architecture choices enter the decision register (once per id).
|
|
316
|
+
seedDecisions({ text: spikeText, issue: spikeNo, repo, comments: JSON.parse(comments || "[]").map((c) => c?.body), post: (body) => gh(["issue", "comment", String(spikeNo), "-R", repo, "--body-file", "-"], body) });
|
|
311
317
|
if (!records.get(spikeKey).labels.includes("workflow:decomposed")) {
|
|
312
318
|
io.sh("bash", [`${SELF_DIR}transition-label.sh`, String(spikeNo), "-R", repo, "decomposed"]);
|
|
313
319
|
}
|
|
@@ -380,7 +386,7 @@ export function main(argv, { io = defaultIo, out = process.stdout, err = process
|
|
|
380
386
|
repo ||= config.project?.owner && config.project?.repo ? `${config.project.owner}/${config.project.repo}` : "";
|
|
381
387
|
if (!/^[^/\s]+\/[^/\s]+$/.test(repo)) { err.write("bootstrap-create: no target repository: pass --repo OWNER/NAME or a forge.yaml with project.owner/project.repo\n"); return 2; }
|
|
382
388
|
let result;
|
|
383
|
-
try { result = createBacklog(plan, { io, repo, config, base }); } catch (e) {
|
|
389
|
+
try { result = createBacklog(plan, { io, repo, config, base, spikeText }); } catch (e) {
|
|
384
390
|
err.write(`bootstrap-create: GitHub error: ${String(e?.stderr || e?.message || e).trim().slice(0, 500)}\nRe-run the same command to resume; existing issues are reused.\n`);
|
|
385
391
|
return 3;
|
|
386
392
|
}
|