forgedock 1.52.0 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/.claude-plugin/marketplace.json +51 -0
  2. package/README.md +8 -2
  3. package/bin/auth/app-manifest.mjs +89 -0
  4. package/bin/auth/app-manifest.test.mjs +75 -0
  5. package/bin/auth/app-token.mjs +256 -0
  6. package/bin/auth/app-token.test.mjs +232 -0
  7. package/bin/brand.mjs +7 -0
  8. package/bin/config-history.mjs +151 -0
  9. package/bin/config-schema.mjs +115 -0
  10. package/bin/demo.mjs +65 -11
  11. package/bin/engine/outcome-codes.mjs +9 -3
  12. package/bin/engine/telemetry-seam.mjs +11 -3
  13. package/bin/engine/telemetry-seam.test.mjs +17 -0
  14. package/bin/engine-cli.mjs +110 -36
  15. package/bin/experiment.mjs +58 -6
  16. package/bin/first-run.mjs +122 -0
  17. package/bin/forge-utils.mjs +6 -2
  18. package/bin/forgedock.mjs +138 -142
  19. package/bin/help-text.mjs +144 -0
  20. package/bin/hooks/pre-tool-use.mjs +7 -0
  21. package/bin/journey.mjs +82 -83
  22. package/bin/lean/acceptance.mjs +313 -0
  23. package/bin/lean/acceptance.test.mjs +215 -0
  24. package/bin/lean/account-watch.mjs +28 -0
  25. package/bin/lean/account-watch.test.mjs +30 -0
  26. package/bin/lean/activation.mjs +38 -0
  27. package/bin/lean/activation.test.mjs +36 -1
  28. package/bin/lean/basered.mjs +115 -0
  29. package/bin/lean/basered.test.mjs +66 -0
  30. package/bin/lean/batch-health.mjs +114 -7
  31. package/bin/lean/batch-health.test.mjs +87 -1
  32. package/bin/lean/batch.mjs +41 -2
  33. package/bin/lean/batch.test.mjs +115 -11
  34. package/bin/lean/branchlock.mjs +54 -0
  35. package/bin/lean/branchlock.test.mjs +49 -0
  36. package/bin/lean/ceiling.mjs +72 -0
  37. package/bin/lean/ceiling.test.mjs +54 -0
  38. package/bin/lean/checkpoint-reconcile.mjs +43 -0
  39. package/bin/lean/checkpoint-reconcile.test.mjs +95 -0
  40. package/bin/lean/ci-budget.mjs +366 -0
  41. package/bin/lean/ci-budget.test.mjs +167 -0
  42. package/bin/lean/conformance.e2e.test.mjs +8 -1
  43. package/bin/lean/conformance.mjs +269 -38
  44. package/bin/lean/conformance.test.mjs +280 -7
  45. package/bin/lean/context.mjs +35 -6
  46. package/bin/lean/context.test.mjs +27 -1
  47. package/bin/lean/depcache.mjs +25 -1
  48. package/bin/lean/depcache.test.mjs +26 -0
  49. package/bin/lean/e2e.mjs +18 -2
  50. package/bin/lean/e2e.test.mjs +26 -1
  51. package/bin/lean/effects.mjs +47 -14
  52. package/bin/lean/execution.mjs +19 -3
  53. package/bin/lean/execution.test.mjs +63 -0
  54. package/bin/lean/facts.mjs +3 -3
  55. package/bin/lean/facts.test.mjs +5 -0
  56. package/bin/lean/findinglabel.mjs +16 -0
  57. package/bin/lean/findinglabel.test.mjs +39 -0
  58. package/bin/lean/fixround.mjs +14 -0
  59. package/bin/lean/fixround.test.mjs +25 -2
  60. package/bin/lean/gh-assoc.test.mjs +2 -1
  61. package/bin/lean/integration.mjs +100 -9
  62. package/bin/lean/integration.test.mjs +98 -0
  63. package/bin/lean/issuewatch-parity.mjs +64 -0
  64. package/bin/lean/issuewatch-parity.test.mjs +127 -0
  65. package/bin/lean/issuewatch-release.mjs +6 -2
  66. package/bin/lean/issuewatch-release.test.mjs +17 -1
  67. package/bin/lean/issuewatch.mjs +45 -6
  68. package/bin/lean/issuewatch.test.mjs +3 -2
  69. package/bin/lean/lanelock.mjs +14 -0
  70. package/bin/lean/lean.mjs +473 -100
  71. package/bin/lean/lean.test.mjs +686 -33
  72. package/bin/lean/light.mjs +48 -7
  73. package/bin/lean/light.test.mjs +37 -3
  74. package/bin/lean/limits.test.mjs +142 -9
  75. package/bin/lean/mechfix.mjs +124 -0
  76. package/bin/lean/mechfix.test.mjs +75 -0
  77. package/bin/lean/orchestrate-cancel.test.mjs +143 -0
  78. package/bin/lean/orchestrate.mjs +116 -28
  79. package/bin/lean/phaseledger.mjs +47 -5
  80. package/bin/lean/phaseledger.test.mjs +30 -1
  81. package/bin/lean/postdeploy-check.test.mjs +39 -0
  82. package/bin/lean/precheck.mjs +23 -4
  83. package/bin/lean/precheck.test.mjs +14 -1
  84. package/bin/lean/prereq.mjs +28 -0
  85. package/bin/lean/prereq.test.mjs +20 -0
  86. package/bin/lean/probe.mjs +4 -2
  87. package/bin/lean/prodparity.mjs +52 -0
  88. package/bin/lean/prodparity.test.mjs +67 -0
  89. package/bin/lean/prompts.mjs +77 -19
  90. package/bin/lean/quota.mjs +39 -0
  91. package/bin/lean/recovery.test.mjs +11 -1
  92. package/bin/lean/relaxation.mjs +73 -0
  93. package/bin/lean/relaxation.test.mjs +54 -0
  94. package/bin/lean/release-io.test.mjs +42 -0
  95. package/bin/lean/release-postmerge.mjs +125 -0
  96. package/bin/lean/release-preflight.mjs +58 -0
  97. package/bin/lean/release-preflight.test.mjs +114 -0
  98. package/bin/lean/release-rehearsal.mjs +64 -0
  99. package/bin/lean/release-rehearsal.test.mjs +93 -0
  100. package/bin/lean/release-review.e2e.test.mjs +77 -0
  101. package/bin/lean/release-review.mjs +254 -0
  102. package/bin/lean/release-review.test.mjs +307 -0
  103. package/bin/lean/release-snapshot.mjs +188 -0
  104. package/bin/lean/release-snapshot.test.mjs +190 -0
  105. package/bin/lean/release.mjs +296 -0
  106. package/bin/lean/release.test.mjs +387 -0
  107. package/bin/lean/render.mjs +1 -1
  108. package/bin/lean/replan.mjs +184 -0
  109. package/bin/lean/replan.test.mjs +110 -0
  110. package/bin/lean/resume.mjs +9 -7
  111. package/bin/lean/resume.test.mjs +16 -0
  112. package/bin/lean/rotator.mjs +150 -31
  113. package/bin/lean/rotator.test.mjs +105 -2
  114. package/bin/lean/sandbox-remote.mjs +9 -2
  115. package/bin/lean/schedd.mjs +83 -5
  116. package/bin/lean/schedd.test.mjs +108 -7
  117. package/bin/lean/selfreview.mjs +94 -0
  118. package/bin/lean/selfreview.test.mjs +58 -1
  119. package/bin/lean/selftest-gate.mjs +22 -0
  120. package/bin/lean/selftest-gate.test.mjs +18 -1
  121. package/bin/lean/selftest-journey.mjs +234 -0
  122. package/bin/lean/selftest-journey.test.mjs +130 -0
  123. package/bin/lean/selftest-live.mjs +2 -1
  124. package/bin/lean/seqlease.mjs +35 -1
  125. package/bin/lean/seqlease.test.mjs +15 -0
  126. package/bin/lean/seqreserve.e2e.test.mjs +135 -0
  127. package/bin/lean/seqreserve.mjs +73 -0
  128. package/bin/lean/seqreserve.test.mjs +134 -0
  129. package/bin/lean/sequence.mjs +35 -6
  130. package/bin/lean/seqversioned.mjs +147 -0
  131. package/bin/lean/stagestamp.mjs +28 -0
  132. package/bin/lean/stagestamp.test.mjs +32 -0
  133. package/bin/lean/surfaces.mjs +75 -0
  134. package/bin/lean/surfaces.test.mjs +59 -0
  135. package/bin/lean/toolplace.mjs +28 -0
  136. package/bin/lean/toolplace.test.mjs +24 -0
  137. package/bin/lean/toolstats.mjs +3 -1
  138. package/bin/lean/toolstats.test.mjs +11 -0
  139. package/bin/lean/validatebest.mjs +28 -0
  140. package/bin/lean/validatebest.test.mjs +27 -0
  141. package/bin/lean/verifier.mjs +3 -2
  142. package/bin/lean/verify.mjs +2 -1
  143. package/bin/lean/verify.test.mjs +6 -0
  144. package/bin/pool/agent.mjs +27 -4
  145. package/bin/pool/docker.mjs +5 -0
  146. package/bin/pool/router.mjs +74 -28
  147. package/bin/prereqs.mjs +111 -0
  148. package/bin/replay-timelapse.mjs +149 -0
  149. package/bin/review-staging.mjs +123 -16
  150. package/bin/review-staging.test.mjs +18 -0
  151. package/bin/runner.mjs +43 -6
  152. package/bin/splash-install.mjs +157 -0
  153. package/bin/stats/aggregate.mjs +8 -1
  154. package/bin/stats/conformance-outcomes.mjs +289 -0
  155. package/bin/stats/conformance-outcomes.test.mjs +274 -0
  156. package/bin/stats/depth.mjs +275 -0
  157. package/bin/stats/depth.test.mjs +158 -0
  158. package/bin/stats/efficiency.mjs +26 -5
  159. package/bin/stats/efficiency.test.mjs +45 -1
  160. package/bin/stats/experiment.mjs +7 -5
  161. package/bin/stats/first-review.mjs +77 -0
  162. package/bin/stats/first-review.test.mjs +36 -0
  163. package/bin/stats/firstmerge.mjs +40 -0
  164. package/bin/stats/firstmerge.test.mjs +41 -0
  165. package/bin/stats/github-source.mjs +53 -15
  166. package/bin/stats/index.mjs +147 -9
  167. package/bin/stats/local-source.mjs +12 -0
  168. package/bin/stats/origin.mjs +80 -0
  169. package/bin/stats/origin.test.mjs +58 -0
  170. package/bin/stats/query.mjs +69 -0
  171. package/bin/stats/render.mjs +3 -1
  172. package/bin/stats/scoreboard.mjs +137 -0
  173. package/bin/stats/scoreboard.test.mjs +87 -0
  174. package/bin/stats/selffiled.mjs +52 -0
  175. package/bin/stats/selffiled.test.mjs +71 -0
  176. package/bin/stats/stats.test.mjs +80 -0
  177. package/bin/tui.mjs +3 -2
  178. package/commands/bootstrap.md +15 -14
  179. package/commands/deploy-pr.md +18 -3
  180. package/commands/forge-stats.md +1 -1
  181. package/commands/forgedock-ci-setup.md +28 -0
  182. package/commands/forgedock-init.md +4 -5
  183. package/commands/issue.md +2 -0
  184. package/commands/milestone.md +9 -1
  185. package/commands/orchestrate.md +1 -1
  186. package/commands/replay.md +2 -0
  187. package/commands/review-pr-agents/security.md +4 -0
  188. package/commands/review-pr-staging.md +6 -1
  189. package/commands/work-on/build.md +4 -6
  190. package/commands/work-on/close.md +8 -0
  191. package/docs/CONFIG.md +170 -18
  192. package/docs/ISSUE-WATCH.md +25 -0
  193. package/docs/OUTCOME-CODES.md +4 -0
  194. package/docs/REPLAY.md +9 -0
  195. package/docs/SELFTEST.md +11 -0
  196. package/docs/STATS.md +61 -0
  197. package/docs/TELEMETRY.md +1 -1
  198. package/docs/eval/README.md +6 -0
  199. package/docs/eval/adversarial-bench.md +68 -0
  200. package/docs/eval/corpus/adversarial-v1.json +285 -0
  201. package/docs/eval/feature-bench.md +42 -0
  202. package/docs/eval/feature-specs/crud-auth/journeys/notes-crud-isolated.mjs +21 -0
  203. package/docs/eval/feature-specs/crud-auth/journeys/register-login.mjs +12 -0
  204. package/docs/eval/feature-specs/crud-auth/spec.md +15 -0
  205. package/docs/site/start-a-new-project.md +2 -1
  206. package/package.json +5 -2
  207. package/plugins/forgedock-splash/.claude-plugin/plugin.json +10 -0
  208. package/plugins/forgedock-splash/README.md +27 -0
  209. package/plugins/forgedock-splash/hooks/hooks.json +1 -0
  210. package/plugins/forgedock-splash/hooks/register.tsx +74 -0
  211. package/plugins/forgedock-splash/hooks/scene.ts +222 -0
  212. package/plugins/forgedock-splash/types/index.d.ts +10 -0
  213. package/pool/README.md +1 -1
  214. package/pool/image/cs-cred +14 -1
  215. package/scripts/backfill-finding-labels.mjs +50 -0
  216. package/scripts/backfill-finding-labels.test.mjs +36 -0
  217. package/scripts/bench-adversarial.mjs +216 -0
  218. package/scripts/bench-feature.mjs +170 -0
  219. package/scripts/bench-lightlane.mjs +2 -2
  220. package/scripts/bootstrap-create.mjs +2 -2
  221. package/scripts/bootstrap-validate.mjs +35 -2
  222. package/scripts/check-spec-size.sh +4 -3
  223. package/scripts/check-spec-size.test.sh +3 -0
  224. package/scripts/doctor-pipeline-state.sh +21 -6
  225. package/scripts/file-deferred-followups.sh +59 -251
  226. package/scripts/file-deferred-followups.test.sh +85 -206
  227. package/scripts/followup-route.mjs +12 -0
  228. package/scripts/owner-route-parity.test.sh +17 -1
  229. package/scripts/plan-validate-live.mjs +40 -6
  230. package/scripts/review-pr-side-effects.test.sh +40 -0
  231. package/scripts/review-pr-staging-scope.test.sh +1 -1
  232. package/scripts/review-staging-post.sh +23 -0
  233. package/scripts/review-staging-post.test.sh +8 -0
@@ -0,0 +1,68 @@
1
+ # Adversarial benchmark: full lane vs bare agent (#5292)
2
+
3
+ This benchmark checks the claim that a fixed process beats a bare agent session when the issues are not all valid. The corpus has 20 issues over more-itertools at `670b715`. Of these, 12 must **not** be implemented, and 5 only pass if the change reaches a second integration point.
4
+
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
+ - Corpus: `docs/eval/corpus/adversarial-v1.json`
7
+ - Arms: `full` (`forgedock run-issue` with the light lane off) and `control` (a plain `claude -p` session).
8
+
9
+ ## Corpus
10
+
11
+ | Kind | Count | Correct outcome | What a bad arm does |
12
+ |---|---|---|---|
13
+ | `valid` | 3 | Implement; the upstream fix tests (oracle) pass | Fails the oracle |
14
+ | `wrong-premise` | 5 | Close with evidence: the behaviour reported as broken is correct at the base | Implements a change anyway (a *wrong issue implemented*) |
15
+ | `duplicate` | 4 | Close with evidence: the feature exists | Adds a second function (a *duplicate implementation*) |
16
+ | `already-fixed` | 3 | Close with evidence: it already ships at the base | Implements it again |
17
+ | `integration` | 5 | Implement in `more.py` and also touch `more.pyi` and `docs/api.rst` | Skips a file (an *integration point missed*) |
18
+
19
+ Each invalid issue has `evidence: {file, pattern}`. The pattern must match the file at the base commit. `calibrate` checks this.
20
+
21
+ ## Prerequisites and run config
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: off`. File the corpus issues in the sandbox with the title and body taken verbatim from the corpus:
24
+
25
+ ```sh
26
+ jq -c '.issues[]' docs/eval/corpus/adversarial-v1.json | while read -r i; do
27
+ gh issue create -R <you>/mi-full --title "$(jq -r .title <<<"$i")" --body "$(jq -r .body <<<"$i")"
28
+ done
29
+ ```
30
+
31
+ `runcfg.json` (not committed) maps each corpus id to its sandbox issue number for `full`, and sets the model for `control`:
32
+
33
+ ```json
34
+ { "arms": { "full": { "repo": "<you>/mi-full", "issues": { "adv-valid-1293": 1, "adv-wp-chunked-tail": 2 } }, "control": { "model": "claude-opus-5-5" } } }
35
+ ```
36
+
37
+ List every corpus id under `full.issues` (20 entries). Use the same model in both arms and no web tools.
38
+
39
+ ## Steps
40
+
41
+ ```sh
42
+ # 1. The corpus shape (20 issues, at least 5 invalid) and its evidence at the base
43
+ node scripts/bench-adversarial.mjs validate --corpus docs/eval/corpus/adversarial-v1.json
44
+ node scripts/bench-adversarial.mjs calibrate --corpus docs/eval/corpus/adversarial-v1.json
45
+ # 2. Run both arms (sequential; appends one graded JSON row per arm and issue)
46
+ node scripts/bench-adversarial.mjs run --corpus docs/eval/corpus/adversarial-v1.json --config runcfg.json --out rows.jsonl
47
+ # 3. Aggregate into the published scorecard
48
+ node scripts/bench-adversarial.mjs aggregate rows.jsonl --corpus docs/eval/corpus/adversarial-v1.json \
49
+ --model claude-opus-5-5 --date YYYY-MM-DD --scorecard docs/eval/published/adversarial-YYYY-MM-DD.md
50
+ ```
51
+
52
+ Use `--arms control` or `--issues id,id` to rerun part of the set, and `--keep` to keep the scratch clones.
53
+
54
+ ## Metrics (per arm)
55
+
56
+ | Metric | Definition |
57
+ |---|---|
58
+ | Wrong issues implemented | Rows of kind `wrong-premise`, `duplicate` or `already-fixed` where the arm claimed a fix (a merged or ci-pending lane, or a control that exited cleanly) with a non-empty diff. Lower is better. |
59
+ | Duplicate implementations created | A `duplicate` row that claimed a fix and whose diff adds a line matching one of the issue's `forbid_new_defs` patterns. |
60
+ | Integration points missed | For each `integration` row, the number of `must_touch` paths absent from the diff against the base. |
61
+ | Oracle pass rate | Over the rows with an oracle (`valid`): the upstream fix tests pass after being overlaid on the arm's head. |
62
+ | Cost and wall time | Sum of `cost_usd` and `wall_ms`, as in `lightlane-bench.md`. |
63
+
64
+ Grading is deterministic: the diff paths and added lines, never an LLM. The scorecard records the run date, the model and the corpus revision (`version@base+<hash of the corpus file>`).
65
+
66
+ ## Published scorecard
67
+
68
+ Scorecards live in `docs/eval/published/adversarial-<date>.md`. No run has been published yet: it needs API spend and private sandbox repos (#5292 follows up).
@@ -0,0 +1,285 @@
1
+ {
2
+ "version": "adversarial-v1",
3
+ "description": "Adversarial corpus (#5292): more-itertools at the lightlane-v1 base. Valid issues (upstream fixes), wrong-premise, duplicate and already-shipped issues that must be closed with evidence, and integration issues that must touch more.py, more.pyi and docs/api.rst. Instructions: docs/eval/adversarial-bench.md.",
4
+ "upstream": "more-itertools/more-itertools",
5
+ "license": "MIT",
6
+ "clone_url": "https://github.com/more-itertools/more-itertools.git",
7
+ "base": "670b715b307adfe5d2fca08a87ca562cb8bfea2c",
8
+ "suite_command": "python3 -m unittest discover -q -s tests -t .",
9
+ "control_prompt": "Fix this issue in the repository in the current directory. Write a failing regression test first, then the fix, then run the targeted tests. Do not use web tools.\n\nIssue: {title}\n\n{body}",
10
+ "issues": [
11
+ {
12
+ "id": "adv-valid-1293",
13
+ "kind": "valid",
14
+ "expected": "implement",
15
+ "upstream_issue": 1293,
16
+ "fix_pr": 1294,
17
+ "fix_sha": "1dd480a08bc2a4c399c84bf21cb1558f8b5fc838",
18
+ "title": "Repeated zero-cache seekable.peek() retains nested chain iterators",
19
+ "body": "On current master (`b5e3886`), the fix for #1268 preserves values but each `seekable(..., maxlen=0).peek()` prepends a new `chain` around the previous source. Repeated peeking without advancing retains an iterator chain proportional to the number of calls, despite having no history cache.\n\n```python\nimport tracemalloc\nfrom more_itertools import seekable\n\ns = seekable(range(3), maxlen=0)\ntracemalloc.start()\ns.peek()\nbaseline = tracemalloc.get_traced_memory()[0]\nfor _ in range(10000):\n assert s.peek() == 0\nprint(tracemalloc.get_traced_memory()[0] - baseline)\nprint(list(s.elements()), list(s))\n```\n\nOn CPython 3.12.13/macOS this retains 2,427,672 additional bytes; output remains `[] [0, 1, 2]`. A single lookahead slot should be sufficient regardless of the number of repeated `peek()`/`bool()` calls. I am checking a fix that reuses the existing `peekable` helper only in the zero-history case, with unchanged bounded/unbounded history behavior.\n\nInvestigation performed with AI assistance.\n",
20
+ "oracle": {
21
+ "files": [
22
+ "tests/test_more.py"
23
+ ],
24
+ "command": "python3 -m unittest -q tests.test_more.SeekableTest.test_repeated_zero_cache_peek_has_bounded_memory",
25
+ "note": "670b715 is the merge parent of the fix, but the fix branch also carries the #1268/#1269 seekable maxlen=0 value fix; on the base the oracle errors with StopIteration, so an arm passes only by bounding memory and keeping the peeked values."
26
+ }
27
+ },
28
+ {
29
+ "id": "adv-valid-1304",
30
+ "kind": "valid",
31
+ "expected": "implement",
32
+ "upstream_issue": 1304,
33
+ "fix_pr": 1305,
34
+ "fix_sha": "1ea82a711c69f590054987b5cb194157f8ce8ac4",
35
+ "title": "ichunked(..., 0) raises islice's ValueError on a nonempty iterable",
36
+ "body": "`ichunked` is documented as being like `chunked`, but with lazy chunks. `chunked` treats `n=0` as \"yield nothing\". `ichunked` only does that when the source is already empty; with any remaining items it calls `islice(iterator, n - 1)` and blows up.\n\nI hit this switching a streaming pipeline from `chunked` to `ichunked` so batches would not be materialized as lists. Chunk size comes from the same config in both paths; `0` means \"this stage is disabled, emit nothing.\"\n\n```python\nfrom more_itertools import chunked, ichunked\n\nrows = [\"a\", \"b\", \"c\"] # e.g. leftover rows from a DB cursor\nchunk_size = 0 # config: skip this sink\n\nprint(list(chunked(rows, chunk_size)))\n# []\n\nprint([list(c) for c in ichunked(rows, chunk_size)])\n# ValueError: Stop argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\n`IchunkedTests.test_zero` only uses `iterable = []`, which never enters the `for first in iterator` loop, so the `islice(..., n - 1)` path is untested.\n\nNegative `n` has the same leak: `chunked` raises `ValueError: n must be at least 0`, `ichunked` raises islice's \"Indices for islice() must be None or an integer...\".\n\nHappy to send a PR.",
37
+ "oracle": {
38
+ "files": [
39
+ "tests/test_more.py"
40
+ ],
41
+ "command": "python3 -m unittest -q tests.test_more.IchunkedTests.test_zero_nonempty tests.test_more.IchunkedTests.test_negative"
42
+ }
43
+ },
44
+ {
45
+ "id": "adv-valid-1308",
46
+ "kind": "valid",
47
+ "expected": "implement",
48
+ "upstream_issue": 1308,
49
+ "fix_pr": 1309,
50
+ "fix_sha": "67fcf640477c78605580f5ee703a54c73c1e7a8a",
51
+ "title": "bucket ignores a supplied validator when the callable is falsey",
52
+ "body": "`bucket` replaces a supplied validator with its default when the callable has a false truth value. An empty callable set is one example:\n\n```python\nfrom more_itertools import bucket\n\nclass AllowedKeys(set):\n def __call__(self, key):\n return key in self\n\nallowed = AllowedKeys()\nsource = iter([1, 2, 3])\nbuckets = bucket(source, key=lambda x: x, validator=allowed)\nprint(list(buckets[1])) # [1]; expected []\n```\n\nThe validator rejects every key, so selecting a bucket should return an empty iterator without consuming `source`. Instead, `validator or (lambda x: True)` discards it. Membership checks and iteration over bucket keys also accept keys the validator rejects. On an infinite input, a lookup for an absent, rejected key can keep scanning rather than return immediately.\n\nI reproduced this on current main (11.1.0). Changing the default selection to `(lambda x: True) if validator is None else validator` preserves the supplied callable. My regression checks rejected selection, membership, source consumption, and key iteration; the full unittest suite passes with that change.\n\nI can send the small fix and regression test if this behavior is unintended.\n",
53
+ "oracle": {
54
+ "files": [
55
+ "tests/test_more.py"
56
+ ],
57
+ "command": "python3 -m unittest -q tests.test_more.BucketTests.test_falsey_validator_is_honoured"
58
+ }
59
+ },
60
+ {
61
+ "id": "adv-wp-chunked-tail",
62
+ "kind": "wrong-premise",
63
+ "expected": "close",
64
+ "title": "chunked() silently drops the final partial chunk",
65
+ "body": "`list(chunked(range(5), 2))` should be `[[0, 1], [2, 3], [4]]`, but I believe the trailing `[4]` is lost on current master, so data disappears whenever the length is not a multiple of n. Please make chunked() keep the remainder.",
66
+ "evidence": {
67
+ "file": "more_itertools/more.py",
68
+ "pattern": "not divisible by \\*n\\*"
69
+ }
70
+ },
71
+ {
72
+ "id": "adv-wp-one-empty",
73
+ "kind": "wrong-premise",
74
+ "expected": "close",
75
+ "title": "one() returns None for an empty iterable instead of raising",
76
+ "body": "Calling `one([])` gives back `None` on master, which hides bugs in callers that expect exactly one item. It should raise instead; please change one() to raise on an empty iterable.",
77
+ "evidence": {
78
+ "file": "more_itertools/more.py",
79
+ "pattern": "if too_short is not None"
80
+ }
81
+ },
82
+ {
83
+ "id": "adv-wp-first-true-default",
84
+ "kind": "wrong-premise",
85
+ "expected": "close",
86
+ "title": "first_true() has no way to supply a default value",
87
+ "body": "When nothing matches, `first_true` always returns `None` and there is no argument for a fallback, so callers need an extra `or`. Please add a `default` parameter.",
88
+ "evidence": {
89
+ "file": "more_itertools/recipes.py",
90
+ "pattern": "def first_true\\(iterable, default=None, pred=None\\)"
91
+ }
92
+ },
93
+ {
94
+ "id": "adv-wp-batched-strict",
95
+ "kind": "wrong-premise",
96
+ "expected": "close",
97
+ "title": "batched() cannot enforce equal-sized batches",
98
+ "body": "Unlike chunked(strict=True), `more_itertools.batched` has no strict option, so a short final batch cannot be rejected. Please add a keyword-only `strict` argument.",
99
+ "evidence": {
100
+ "file": "more_itertools/recipes.py",
101
+ "pattern": "def batched\\(iterable, n, \\*, strict=False\\)"
102
+ }
103
+ },
104
+ {
105
+ "id": "adv-wp-sliding-window-short",
106
+ "kind": "wrong-premise",
107
+ "expected": "close",
108
+ "title": "sliding_window() raises when the iterable is shorter than the window",
109
+ "body": "`list(sliding_window([1, 2], 3))` blows up on master instead of returning an empty list. Please make short inputs yield nothing.",
110
+ "evidence": {
111
+ "file": "more_itertools/recipes.py",
112
+ "pattern": "then nothing is yielded"
113
+ }
114
+ },
115
+ {
116
+ "id": "adv-dup-chunks",
117
+ "kind": "duplicate",
118
+ "expected": "close",
119
+ "title": "Add a chunks() helper that splits an iterable into fixed-size lists",
120
+ "body": "There is no helper to split an iterable into lists of at most n items. Please add `chunks(iterable, n)` that yields lists, with the last one shorter when needed.",
121
+ "evidence": {
122
+ "file": "more_itertools/more.py",
123
+ "pattern": "def chunked\\("
124
+ },
125
+ "forbid_new_defs": [
126
+ "^\\s*def (chunks|chunk|batches|grouper|split_into_chunks)\\("
127
+ ]
128
+ },
129
+ {
130
+ "id": "adv-dup-flatten-once",
131
+ "kind": "duplicate",
132
+ "expected": "close",
133
+ "title": "Add flatten_once() to flatten one level of nesting",
134
+ "body": "I need a function that flattens exactly one level of an iterable of iterables. Please add `flatten_once(iterables)`.",
135
+ "evidence": {
136
+ "file": "more_itertools/recipes.py",
137
+ "pattern": "def flatten\\("
138
+ },
139
+ "forbid_new_defs": [
140
+ "^\\s*def (flatten_once|flatten_one|flat|flatten_one_level)\\("
141
+ ]
142
+ },
143
+ {
144
+ "id": "adv-dup-nth-default",
145
+ "kind": "duplicate",
146
+ "expected": "close",
147
+ "title": "Add nth_or_default() returning the n-th item or a default",
148
+ "body": "Getting the n-th item of an iterator without raising IndexError needs islice plus next. Please add `nth_or_default(iterable, n, default)`.",
149
+ "evidence": {
150
+ "file": "more_itertools/recipes.py",
151
+ "pattern": "def nth\\(iterable, n, default=None\\)"
152
+ },
153
+ "forbid_new_defs": [
154
+ "^\\s*def (nth_or_default|get_nth|nth_item|item_at)\\("
155
+ ]
156
+ },
157
+ {
158
+ "id": "adv-dup-consecutive-pairs",
159
+ "kind": "duplicate",
160
+ "expected": "close",
161
+ "title": "Add pairs() yielding each item with its successor",
162
+ "body": "Please add `pairs(iterable)` so `pairs('ABC')` yields `('A', 'B')` then `('B', 'C')`.",
163
+ "evidence": {
164
+ "file": "more_itertools/recipes.py",
165
+ "pattern": "def pairwise\\(iterable\\)"
166
+ },
167
+ "forbid_new_defs": [
168
+ "^\\s*def (pairs|consecutive_pairs|neighbours|neighbors)\\("
169
+ ]
170
+ },
171
+ {
172
+ "id": "adv-af-triplewise",
173
+ "kind": "already-fixed",
174
+ "expected": "close",
175
+ "title": "Add a triplewise() recipe for overlapping triples",
176
+ "body": "There is no recipe that yields overlapping triples such as `('A','B','C'), ('B','C','D')`. Please add `triplewise(iterable)` to the recipes.",
177
+ "evidence": {
178
+ "file": "more_itertools/recipes.py",
179
+ "pattern": "def triplewise\\(iterable\\)"
180
+ }
181
+ },
182
+ {
183
+ "id": "adv-af-sum-of-squares",
184
+ "kind": "already-fixed",
185
+ "expected": "close",
186
+ "title": "Add sum_of_squares() to the recipes",
187
+ "body": "Please add a `sum_of_squares(iterable)` recipe that returns the sum of the squares of the values.",
188
+ "evidence": {
189
+ "file": "more_itertools/recipes.py",
190
+ "pattern": "def sum_of_squares\\(iterable\\)"
191
+ }
192
+ },
193
+ {
194
+ "id": "adv-af-polynomial-eval",
195
+ "kind": "already-fixed",
196
+ "expected": "close",
197
+ "title": "Add polynomial_eval() for evaluating a polynomial at a point",
198
+ "body": "There is no recipe to evaluate a polynomial given its coefficients. Please add `polynomial_eval(coefficients, x)`.",
199
+ "evidence": {
200
+ "file": "more_itertools/recipes.py",
201
+ "pattern": "def polynomial_eval\\(coefficients, x\\)"
202
+ }
203
+ },
204
+ {
205
+ "id": "adv-int-take-until",
206
+ "kind": "integration",
207
+ "expected": "implement",
208
+ "title": "Add take_until(predicate, iterable): like takewhile but includes the first failing item",
209
+ "body": "Please add `take_until(predicate, iterable)` to more_itertools.more. It yields items until predicate is true, and includes that first matching item. It must be available as `more_itertools.take_until`, with the same public surface as the other helpers.",
210
+ "must_touch": [
211
+ "more_itertools/more.py",
212
+ "more_itertools/more.pyi",
213
+ "docs/api.rst"
214
+ ],
215
+ "evidence": {
216
+ "file": "docs/api.rst",
217
+ "pattern": "autofunction:: chunked"
218
+ }
219
+ },
220
+ {
221
+ "id": "adv-int-count-runs",
222
+ "kind": "integration",
223
+ "expected": "implement",
224
+ "title": "Add count_runs(iterable): the number of maximal runs of equal items",
225
+ "body": "Please add `count_runs(iterable)` to more_itertools.more, returning how many runs of consecutive equal items the iterable has (`count_runs('aabccc') == 3`). It must be part of the public API like the other helpers.",
226
+ "must_touch": [
227
+ "more_itertools/more.py",
228
+ "more_itertools/more.pyi",
229
+ "docs/api.rst"
230
+ ],
231
+ "evidence": {
232
+ "file": "docs/api.rst",
233
+ "pattern": "autofunction:: chunked"
234
+ }
235
+ },
236
+ {
237
+ "id": "adv-int-minmax-by",
238
+ "kind": "integration",
239
+ "expected": "implement",
240
+ "title": "Add minmax_by(iterable, key): the min and max items by a key in one pass",
241
+ "body": "Please add `minmax_by(iterable, key)` to more_itertools.more, returning a `(smallest, largest)` tuple by key from a single pass over the input. It must be part of the public API like the other helpers.",
242
+ "must_touch": [
243
+ "more_itertools/more.py",
244
+ "more_itertools/more.pyi",
245
+ "docs/api.rst"
246
+ ],
247
+ "evidence": {
248
+ "file": "docs/api.rst",
249
+ "pattern": "autofunction:: chunked"
250
+ }
251
+ },
252
+ {
253
+ "id": "adv-int-lstrip-all",
254
+ "kind": "integration",
255
+ "expected": "implement",
256
+ "title": "Add lstrip_all(iterable, preds): strip leading items that match any of several predicates",
257
+ "body": "Please add `lstrip_all(iterable, preds)` to more_itertools.more that drops leading items for which any predicate in preds is true. It must be part of the public API like the other helpers.",
258
+ "must_touch": [
259
+ "more_itertools/more.py",
260
+ "more_itertools/more.pyi",
261
+ "docs/api.rst"
262
+ ],
263
+ "evidence": {
264
+ "file": "docs/api.rst",
265
+ "pattern": "autofunction:: chunked"
266
+ }
267
+ },
268
+ {
269
+ "id": "adv-int-span-by",
270
+ "kind": "integration",
271
+ "expected": "implement",
272
+ "title": "Add span_by(iterable, key): split into the leading run sharing a key and the rest",
273
+ "body": "Please add `span_by(iterable, key)` to more_itertools.more that returns an iterator over the leading items that share the first item's key and an iterator over the remainder. It must be part of the public API like the other helpers.",
274
+ "must_touch": [
275
+ "more_itertools/more.py",
276
+ "more_itertools/more.pyi",
277
+ "docs/api.rst"
278
+ ],
279
+ "evidence": {
280
+ "file": "docs/api.rst",
281
+ "pattern": "autofunction:: chunked"
282
+ }
283
+ }
284
+ ]
285
+ }
@@ -0,0 +1,42 @@
1
+ # Feature benchmark (forge#5341)
2
+
3
+ The lane benchmark ([lightlane-bench.md](lightlane-bench.md)) grades one issue at a time. This one grades a whole feature: a spec goes
4
+ in, an app comes out, and hidden journey tests decide how much of it works.
5
+
6
+ ## Specs
7
+
8
+ `docs/eval/feature-specs/<id>/` holds `spec.md` (the only thing an arm sees) and `journeys/*.mjs` (the oracle, never shown to an arm).
9
+ A journey is a script that exits 0 on a pass and reads the app checkout from `BENCH_APP`. Shipped: `crud-auth` (accounts and per-user
10
+ notes). Planned: a CLI with a plugin registry, a two-service queue pipeline, a small web app.
11
+
12
+ ## Arms
13
+
14
+ | Arm | What runs |
15
+ |---|---|
16
+ | `full` | `arms.full.steps` (default: `forgedock bootstrap`, `orchestrate`, `release` on the sandbox repo; `{repo}`, `{spec}`, `{result}` are filled in), then a clone of the repo |
17
+ | `control` | one bare `claude -p <spec> --output-format json --model <model>` session in an empty directory |
18
+
19
+ ```json
20
+ {"arms": {"full": {"repo": "acme/sandbox"}, "control": {"model": "claude-opus-5-5"}}}
21
+ ```
22
+
23
+ ## Run
24
+
25
+ ```
26
+ node scripts/bench-feature.mjs run --spec docs/eval/feature-specs/crud-auth --config cfg.json --out rows.jsonl
27
+ node scripts/bench-feature.mjs aggregate rows.jsonl [--previous last-scorecard.json]
28
+ ```
29
+
30
+ Row: `journeys_passed`, `journeys_total`, `cost_usd`, `wall_ms`, `interventions`, `terminal`. The scorecard has per-arm metrics, the target
31
+ `full_journeys_ge_control` and `regression` (the full arm's journey pass rate fell below `--previous`). Exit 2 on a failed target or a regression.
32
+
33
+ ## Per-release scorecard and the promotion gate
34
+
35
+ Publish the `aggregate` output for each release next to the lane benchmark (`docs/eval/`). A default-flag promotion that affects
36
+ milestone lanes must first pass `scoreboardGate({ bench, board })` (`bin/stats/scoreboard.mjs`): the latest scorecard has no
37
+ regression, and the shipped milestone's journeys (`forgedock stats --milestone <id>`) are not red. Real arm runs cost money and are never part of CI.
38
+
39
+ ## Baselines
40
+
41
+ `forgedock stats --milestone <id|title> --repo <owner/repo>` records the scoreboard of a shipped milestone (journey status at ship,
42
+ first merge to first green journey, defects after the last child by class, rework share, interventions).
@@ -0,0 +1,21 @@
1
+ // Hidden oracle: a user creates, edits and deletes a note, and a second user cannot see or touch it.
2
+ import assert from "node:assert/strict";
3
+ import { pathToFileURL } from "node:url";
4
+ import { join } from "node:path";
5
+ const { createApp } = await import(pathToFileURL(join(process.env.BENCH_APP, "app.mjs")).href);
6
+ const app = createApp();
7
+ const login = async (u) => {
8
+ await app.handle({ method: "POST", path: "/register", body: { username: u, password: "pw" } });
9
+ return { authorization: `Bearer ${(await app.handle({ method: "POST", path: "/login", body: { username: u, password: "pw" } })).body.token}` };
10
+ };
11
+ const a = await login("ann"), b = await login("bob");
12
+ assert.equal((await app.handle({ method: "POST", path: "/notes", body: { text: "x" } })).status, 401);
13
+ const made = await app.handle({ method: "POST", path: "/notes", headers: a, body: { text: "one" } });
14
+ assert.equal(made.status, 201);
15
+ const id = made.body.id;
16
+ assert.equal((await app.handle({ method: "GET", path: "/notes", headers: b })).body.length, 0);
17
+ assert.equal((await app.handle({ method: "PUT", path: `/notes/${id}`, headers: b, body: { text: "hijack" } })).status, 404);
18
+ assert.equal((await app.handle({ method: "PUT", path: `/notes/${id}`, headers: a, body: { text: "two" } })).status, 200);
19
+ assert.equal((await app.handle({ method: "GET", path: "/notes", headers: a })).body[0].text, "two");
20
+ assert.equal((await app.handle({ method: "DELETE", path: `/notes/${id}`, headers: a })).status, 200);
21
+ assert.equal((await app.handle({ method: "GET", path: "/notes", headers: a })).body.length, 0);
@@ -0,0 +1,12 @@
1
+ // Hidden oracle: a user registers, logs in, and a bad password is refused. BENCH_APP is the app checkout.
2
+ import assert from "node:assert/strict";
3
+ import { pathToFileURL } from "node:url";
4
+ import { join } from "node:path";
5
+ const { createApp } = await import(pathToFileURL(join(process.env.BENCH_APP, "app.mjs")).href);
6
+ const app = createApp();
7
+ assert.equal((await app.handle({ method: "POST", path: "/register", body: { username: "ann", password: "pw1" } })).status, 201);
8
+ assert.equal((await app.handle({ method: "POST", path: "/register", body: { username: "ann", password: "pw1" } })).status, 409);
9
+ assert.equal((await app.handle({ method: "POST", path: "/login", body: { username: "ann", password: "bad" } })).status, 401);
10
+ const ok = await app.handle({ method: "POST", path: "/login", body: { username: "ann", password: "pw1" } });
11
+ assert.equal(ok.status, 200);
12
+ assert.ok(ok.body.token);
@@ -0,0 +1,15 @@
1
+ # Notes service with accounts
2
+
3
+ Build a small in-memory notes service in plain Node (ESM, no dependencies, no network).
4
+
5
+ Write `app.mjs` in the repository root exporting `createApp()`, which returns `{ handle(req) }`. `handle` takes
6
+ `{ method, path, headers, body }` (body is an object or undefined) and resolves to `{ status, body }`.
7
+
8
+ Endpoints:
9
+ - `POST /register` with `{ username, password }`: 201, or 409 when the username exists, or 400 when a field is missing.
10
+ - `POST /login` with `{ username, password }`: 200 with `{ token }`, or 401 on bad credentials.
11
+ - `POST /notes` with `{ text }`: needs header `authorization: Bearer <token>`; 201 with `{ id, text }`; 401 without a valid token.
12
+ - `GET /notes`: the caller's own notes only, 200 with an array.
13
+ - `PUT /notes/:id` with `{ text }` and `DELETE /notes/:id`: 200 on the caller's note, 404 on anyone else's or an unknown id.
14
+
15
+ Passwords must not be stored or returned in clear text. Add a `README.md` saying how to run it.
@@ -206,7 +206,8 @@ Two milestones, a spike, four build issues and one needs-human issue. `INVITES`
206
206
  "SPIKE"
207
207
  ],
208
208
  "priority": "p0",
209
- "body": "## Problem\n\nScaffold the Next.js app with pnpm and a CI workflow.\n\n## Root Cause (if known)\n\nGreenfield: not built yet.\n\n## Affected Files\n\n1. `package.json` — new\n2. `app/layout.tsx` — new\n3. `.github/workflows/ci.yml` — new\n\n## Acceptance Criteria\n\n- [ ] `pnpm build` succeeds [type:unit]\n\n## Context\n\n**Parent**: #{{SPIKE}}\n\n## Dependencies\n\nDepends on #{{SPIKE}} — needs the stack decision\n"
209
+ "body": "## Problem\n\nScaffold the Next.js app with pnpm and a CI workflow.\n\n## Root Cause (if known)\n\nGreenfield: not built yet.\n\n## Affected Files\n\n1. `package.json` — new\n2. `app/layout.tsx` — new\n3. `.github/workflows/ci.yml` — new\n\n## Acceptance Criteria\n\n- [ ] `pnpm build` succeeds [type:unit]\n- [ ] The project builds, boots, and one acceptance journey passes on the thinnest real path [type:e2e]\n\n## Context\n\n**Parent**: #{{SPIKE}}\n\n## Dependencies\n\nDepends on #{{SPIKE}} — needs the stack decision\n",
210
+ "skeleton": true
210
211
  },
211
212
  {
212
213
  "key": "DB",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "forgedock",
3
- "version": "1.52.0",
4
- "description": "Autonomous development pipeline for coding agents. GitHub as institutional memory, with native Claude Code and OpenCode entrypoints.",
3
+ "version": "1.54.0",
4
+ "description": "An AI engineering team that ships to production",
5
5
  "bin": {
6
6
  "forgedock": "bin/forgedock.mjs"
7
7
  },
@@ -42,6 +42,9 @@
42
42
  "!docs/site/.vitepress/",
43
43
  "examples/",
44
44
  "packages/protocol/src/",
45
+ "plugins/forgedock-splash/",
46
+ "!plugins/forgedock-splash/tests/",
47
+ ".claude-plugin/marketplace.json",
45
48
  "scripts/",
46
49
  "templates/",
47
50
  "LICENSE",
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "forgedock-splash",
3
+ "version": "0.1.0",
4
+ "description": "ForgeDock's startup splash for Claude Code: the F mark is forged, Clawd bonks it, sparks fly, and it settles on 'supercharged' before clearing.",
5
+ "author": { "name": "RapierCraft Studios" },
6
+ "homepage": "https://github.com/RapierCraftStudios/ForgeDock",
7
+ "repository": "https://github.com/RapierCraftStudios/ForgeDock",
8
+ "license": "AGPL-3.0",
9
+ "types": "./types/index.d.ts"
10
+ }
@@ -0,0 +1,27 @@
1
+ # forgedock-splash
2
+
3
+ A startup splash for ForgeDock users in Claude Code. When an interactive terminal session starts, the row above the prompt plays a short (about 6.5 s) scene: the ForgeDock "F" mark is forged white-hot and cools to chrome, Clawd walks in under the top bar, jumps and bonks it, sparks fly and a shine ring crosses the mark, the `F O R G E D O C K` wordmark types in, and it settles on `» supercharged` before the row clears.
4
+
5
+ It changes nothing else: no commands, prompts, tools or settings.
6
+
7
+ ## Behaviour
8
+
9
+ - Plays on a fresh launch only: not after `/clear` and not on a resumed session.
10
+ - Stops at once when you submit a prompt, and skips itself when the terminal is narrower than 56 columns or shorter than 9 rows.
11
+ - Follows Claude Code's `theme` setting: a darker palette on light themes.
12
+ - Draws nothing in `claude -p` or SDK runs.
13
+
14
+ ## Install and turn off
15
+
16
+ `npx forgedock` installs it by default at user scope (through a local `forgedock-local` marketplace under `~/.forge`) when the `claude` CLI is on PATH, and refreshes it on every re-run. Skip it with `npx forgedock --no-splash` or `FORGEDOCK_NO_SPLASH=1`; a plugin you disabled is never re-enabled. `npx forgedock uninstall` removes it.
17
+
18
+ Manual install:
19
+
20
+ ```
21
+ /plugin marketplace add RapierCraftStudios/ForgeDock
22
+ /plugin install forgedock-splash@forgedock
23
+ ```
24
+
25
+ Turn it off with `/plugin disable forgedock-splash` (or uninstall it).
26
+
27
+ It uses Claude Code's plugin hooks module API (early access); on Claude Code versions without it, the plugin does nothing.
@@ -0,0 +1 @@
1
+ { "modules": ["./register.tsx"] }
@@ -0,0 +1,74 @@
1
+ // SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
2
+ // SPDX-License-Identifier: AGPL-3.0-or-later
3
+ import { atom, read, update } from 'claude-code'
4
+ import type { Register } from 'claude-code'
5
+ import type { Frame } from '../types'
6
+ import { LAST, MIN_COLUMNS, MIN_ROWS, TICK, scene, setTheme } from './scene'
7
+
8
+ // -1 = hidden. Frames advance every TICK ms; the band clears after the last one.
9
+ const frame = atom({ plugin: 'forgedock-splash', key: 'frame' } as const, -1 as Frame)
10
+
11
+ export const register: Register = on => {
12
+ // Play on a fresh launch only: not after /clear, not on a resumed session.
13
+ let skipNext = false
14
+ on('session.end', ($, e, next) => {
15
+ if (e.reason === 'clear') skipNext = true
16
+ return next(e)
17
+ })
18
+
19
+ on('session.start', async ($, e, next) => {
20
+ const result = await next(e)
21
+ if (e.surface !== 'terminal' || !e.isInteractive) return result
22
+ if (skipNext) {
23
+ skipNext = false
24
+ return result
25
+ }
26
+ const { startedAt } = await $.session.usage()
27
+ if ((await $.clock.now()) - startedAt > 15_000) return result // a resumed session
28
+
29
+ const theme = (await $.config.list()).find(row => row.key === 'theme')?.value
30
+ setTheme(typeof theme === 'string' && theme.startsWith('light'))
31
+
32
+ await update($, frame, () => 0)
33
+ const timer = $.clock.every(TICK, async () => {
34
+ const f = await read($, frame)
35
+ if (f < 0 || f >= LAST) {
36
+ timer.cancel()
37
+ await update($, frame, () => -1)
38
+ return
39
+ }
40
+ await update($, frame, () => f + 1)
41
+ })
42
+ return result
43
+ })
44
+
45
+ on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
46
+ const f = await read($, frame)
47
+ if (f < 0 || e.props.hasSurvey) return next(e)
48
+ // Get out of the way: once work starts, or when the band is too small to draw the scene whole.
49
+ if (e.props.isWorking || e.props.bodyColumns < MIN_COLUMNS || e.props.maxRows < MIN_ROWS) {
50
+ await update($, frame, () => -1)
51
+ return next(e)
52
+ }
53
+ const { Box, Text } = $.ui.resolve(e)
54
+ return (
55
+ <Box flexDirection="column">
56
+ {scene(f).map((runs, r) => (
57
+ <Box key={`r${r}`}>
58
+ {runs.length === 0 ? (
59
+ <Text>{' '}</Text>
60
+ ) : (
61
+ runs.map((run, i) =>
62
+ run.color ? (
63
+ <Text key={`t${i}`} color={run.color} bold={run.bold}>{run.text}</Text>
64
+ ) : (
65
+ <Text key={`t${i}`}>{run.text}</Text>
66
+ ),
67
+ )
68
+ )}
69
+ </Box>
70
+ ))}
71
+ </Box>
72
+ )
73
+ })
74
+ }