forgedock 1.55.1 → 1.57.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 (133) hide show
  1. package/bin/config-schema.mjs +1 -1
  2. package/bin/engine/outcome-codes.mjs +1 -0
  3. package/bin/engine/phases.mjs +4 -3
  4. package/bin/engine-cli.mjs +58 -10
  5. package/bin/forgedock.mjs +52 -3
  6. package/bin/gc.mjs +43 -6
  7. package/bin/help-text.mjs +3 -1
  8. package/bin/lean/batch-health.mjs +5 -1
  9. package/bin/lean/batch-health.test.mjs +7 -1
  10. package/bin/lean/batch.mjs +7 -2
  11. package/bin/lean/batch.test.mjs +45 -0
  12. package/bin/lean/conformance.e2e.test.mjs +3 -2
  13. package/bin/lean/conformance.mjs +88 -17
  14. package/bin/lean/conformance.test.mjs +98 -3
  15. package/bin/lean/decisions.mjs +86 -1
  16. package/bin/lean/decisions.test.mjs +21 -1
  17. package/bin/lean/depcache.mjs +124 -13
  18. package/bin/lean/depcache.test.mjs +121 -3
  19. package/bin/lean/design-gate.mjs +144 -0
  20. package/bin/lean/design-gate.test.mjs +169 -0
  21. package/bin/lean/effects-cap.test.mjs +17 -0
  22. package/bin/lean/effects.mjs +58 -13
  23. package/bin/lean/heavy.mjs +25 -8
  24. package/bin/lean/hostload.test.mjs +28 -0
  25. package/bin/lean/intake.mjs +97 -0
  26. package/bin/lean/intake.test.mjs +105 -0
  27. package/bin/lean/interfaces.mjs +181 -0
  28. package/bin/lean/interfaces.test.mjs +192 -0
  29. package/bin/lean/issuewatch-install.mjs +52 -12
  30. package/bin/lean/issuewatch-install.test.mjs +50 -0
  31. package/bin/lean/issuewatch-parity.mjs +12 -2
  32. package/bin/lean/issuewatch-parity.test.mjs +26 -0
  33. package/bin/lean/issuewatch-reconcile.mjs +29 -1
  34. package/bin/lean/issuewatch-reconcile.test.mjs +21 -0
  35. package/bin/lean/issuewatch.mjs +34 -3
  36. package/bin/lean/issuewatch.test.mjs +49 -1
  37. package/bin/lean/lanecheck.test.mjs +15 -4
  38. package/bin/lean/lean.mjs +80 -25
  39. package/bin/lean/lean.test.mjs +149 -3
  40. package/bin/lean/orchestrate-blocked.test.mjs +18 -2
  41. package/bin/lean/orchestrate-owned.test.mjs +14 -5
  42. package/bin/lean/orchestrate.mjs +26 -4
  43. package/bin/lean/orphan-pr.mjs +125 -0
  44. package/bin/lean/orphan-pr.test.mjs +145 -0
  45. package/bin/lean/pagegate.mjs +35 -12
  46. package/bin/lean/pagegate.test.mjs +39 -1
  47. package/bin/lean/preflight.mjs +35 -1
  48. package/bin/lean/preflight.test.mjs +27 -1
  49. package/bin/lean/prompts.mjs +2 -1
  50. package/bin/lean/reap.test.mjs +39 -0
  51. package/bin/lean/recovery.test.mjs +25 -0
  52. package/bin/lean/release-config.mjs +158 -0
  53. package/bin/lean/release-config.test.mjs +109 -0
  54. package/bin/lean/release-control.mjs +148 -0
  55. package/bin/lean/release-control.test.mjs +143 -0
  56. package/bin/lean/release-fence.mjs +50 -0
  57. package/bin/lean/release-fence.test.mjs +105 -0
  58. package/bin/lean/release-flakes.mjs +139 -0
  59. package/bin/lean/release-flakes.test.mjs +116 -0
  60. package/bin/lean/release-ledger.mjs +160 -0
  61. package/bin/lean/release-ledger.test.mjs +226 -0
  62. package/bin/lean/release-minutes.mjs +92 -0
  63. package/bin/lean/release-minutes.test.mjs +99 -0
  64. package/bin/lean/release-nightly.mjs +75 -0
  65. package/bin/lean/release-nightly.test.mjs +48 -0
  66. package/bin/lean/release-postmerge.mjs +45 -21
  67. package/bin/lean/release-review.e2e.test.mjs +1 -0
  68. package/bin/lean/release-review.mjs +54 -7
  69. package/bin/lean/release-review.test.mjs +76 -7
  70. package/bin/lean/release-unitmap.mjs +35 -0
  71. package/bin/lean/release-unitmap.test.mjs +41 -0
  72. package/bin/lean/release.mjs +177 -19
  73. package/bin/lean/release.test.mjs +80 -16
  74. package/bin/lean/render.mjs +3 -1
  75. package/bin/lean/run-issue-placement.test.mjs +82 -0
  76. package/bin/lean/sandbox-remote.mjs +16 -0
  77. package/bin/lean/schedd.mjs +1 -1
  78. package/bin/lean/seam.mjs +115 -0
  79. package/bin/lean/seam.test.mjs +118 -0
  80. package/bin/lean/selftest-journey.mjs +40 -2
  81. package/bin/lean/selftest-journey.test.mjs +43 -3
  82. package/bin/lean/statuscomment.mjs +168 -0
  83. package/bin/lean/statuscomment.test.mjs +133 -0
  84. package/bin/lean/ui-quality.mjs +57 -0
  85. package/bin/lean/ui-quality.test.mjs +55 -0
  86. package/bin/lean/visual-gate.test.mjs +63 -0
  87. package/bin/pool/agent.mjs +16 -2
  88. package/bin/pool/router.mjs +5 -1
  89. package/bin/review-staging.mjs +8 -5
  90. package/bin/stats/card.mjs +117 -0
  91. package/bin/stats/card.test.mjs +109 -0
  92. package/bin/stats/conformance-outcomes.test.mjs +2 -1
  93. package/bin/stats/depth.mjs +1 -1
  94. package/bin/stats/gh-retry.test.mjs +152 -0
  95. package/bin/stats/github-source.mjs +147 -14
  96. package/bin/stats/index.mjs +35 -2
  97. package/bin/stats/stats.test.mjs +31 -3
  98. package/bin/vendor/js-yaml/LICENSE +21 -0
  99. package/bin/vendor/js-yaml/PIN.md +7 -0
  100. package/bin/vendor/js-yaml/js-yaml.mjs +3851 -0
  101. package/commands/design-render-critique-loop.md +2 -0
  102. package/commands/design.md +2 -0
  103. package/commands/incident-response.md +4 -0
  104. package/commands/issue.md +1 -1
  105. package/commands/milestone.md +1 -1
  106. package/commands/pipeline-status.md +13 -0
  107. package/commands/review-pr-agents/frontend.md +1 -0
  108. package/commands/review-pr-staging.md +5 -0
  109. package/docs/CONFIG.md +75 -1
  110. package/docs/ISSUE-WATCH.md +7 -0
  111. package/docs/OUTCOME-CODES.md +1 -0
  112. package/docs/STATS.md +10 -0
  113. package/docs/design/visual-gate.md +25 -0
  114. package/docs/eval/adversarial-bench.md +2 -2
  115. package/docs/eval/corpus/adversarial-v1.json +3 -3
  116. package/docs/site/start-a-new-project.md +7 -0
  117. package/docs/spec/forge-protocol-v1.md +31 -0
  118. package/package.json +1 -1
  119. package/pool/README.md +2 -0
  120. package/scripts/acceptance-red-green.sh +15 -1
  121. package/scripts/acceptance-red-green.test.sh +12 -0
  122. package/scripts/bench-adversarial.mjs +4 -0
  123. package/scripts/bench-lightlane.mjs +4 -1
  124. package/scripts/bootstrap-create.mjs +8 -2
  125. package/scripts/ci-local.test.sh +3 -3
  126. package/scripts/fixtures/ci-local/gha-dorny/.github/workflows/ci.yml +4 -0
  127. package/scripts/plan-validate-live.mjs +9 -6
  128. package/scripts/review-prepare.sh +7 -1
  129. package/scripts/review-roster.sh +5 -2
  130. package/scripts/review-roster.test.sh +9 -0
  131. package/scripts/visual-gate.mjs +64 -0
  132. package/templates/bootstrap/technical-spike.md +17 -0
  133. package/templates/contracts/seam-check.mjs +236 -0
@@ -20,6 +20,25 @@ const here = dirname(fileURLToPath(import.meta.url));
20
20
  const fx = (f) => join(here, "fixtures", f);
21
21
  const load = (f) => JSON.parse(readFileSync(fx(f), "utf8"));
22
22
  const ENV = { FORGE_TRAIL_TRUSTED_ASSOCIATIONS: "OWNER,MEMBER,COLLABORATOR" };
23
+ /** #5530: numbers mode reads aliased GraphQL batches; answer one from per-number REST stub replies (issues/N, issues/N/comments). */
24
+ async function gqlBatch(args, rest) {
25
+ const q = args.find((a) => typeof a === "string" && a.startsWith("query=")) ?? "";
26
+ const user = (u) => (u ? { __typename: u.type === "Bot" ? "Bot" : "User", login: u.login ?? null } : null);
27
+ const repository = {};
28
+ for (const [, n] of q.matchAll(/i(\d+): issueOrPullRequest/g)) {
29
+ const raw = await rest(["api", `repos/o/r/issues/${n}`]);
30
+ const it = raw ? (typeof raw === "string" ? JSON.parse(raw || "null") : raw) : null;
31
+ const item = Array.isArray(it) ? it[0] : it;
32
+ if (!item || !Number.isInteger(item.number)) { repository[`i${n}`] = null; continue; }
33
+ const cr = await rest(["api", "--paginate", `repos/o/r/issues/${n}/comments`]);
34
+ const comments = (typeof cr === "string" ? JSON.parse(cr || "[]") : cr) ?? [];
35
+ repository[`i${n}`] = { __typename: item.pull_request ? "PullRequest" : "Issue", number: item.number, createdAt: item.created_at ?? null, closedAt: item.closed_at ?? null,
36
+ updatedAt: item.updated_at ?? null, milestone: item.milestone ?? null, labels: { nodes: (item.labels ?? []).map((l) => ({ name: typeof l === "string" ? l : l?.name })) }, author: user(item.user),
37
+ comments: { pageInfo: { hasNextPage: false }, nodes: comments.map((c) => ({ body: c.body, authorAssociation: c.author_association ?? null, author: user(c.user) })) } };
38
+ }
39
+ return JSON.stringify({ data: { repository } });
40
+ }
41
+ const isBatch = (args) => args[0] === "api" && args[1] === "graphql" && args.some((a) => typeof a === "string" && /issueOrPullRequest/.test(a));
23
42
 
24
43
  // A fake `gh`: lists the fixture issues (honouring `since`), serves comments per number. Counts every call.
25
44
  function fakeGh() {
@@ -398,7 +417,8 @@ describe("cache", () => {
398
417
  const comments = [telemetryComment(2, "e1", "x", ts(2)), telemetryComment(4, "e2", "x", ts(3))];
399
418
  const h = storeGh(mkItems(50), { comments });
400
419
  const events = [];
401
- const r = await fetchGithubRecords({ repo: "o/r", gh: h.gh, env, numbers: [4, 2, 2], onProgress: (e) => events.push(e) });
420
+ const gh = (args) => (isBatch(args) ? gqlBatch(args, h.gh) : h.gh(args));
421
+ const r = await fetchGithubRecords({ repo: "o/r", gh, env, numbers: [4, 2, 2], onProgress: (e) => events.push(e) });
402
422
  assert.deepEqual(r.items.map((i) => i.number).sort((a, b) => a - b), [2, 4]);
403
423
  assert.equal(r.records.length, 2);
404
424
  assert.ok(h.calls.every((c) => /issues\/(2|4)(\/comments)?$/.test(c)), h.calls.join(","));
@@ -408,6 +428,7 @@ describe("cache", () => {
408
428
  it("--conformance-outcomes crawls only the joined PR and closing-issue numbers (#5363)", async () => {
409
429
  const calls = [];
410
430
  const gh = (args) => {
431
+ if (isBatch(args)) return gqlBatch(args, gh);
411
432
  calls.push(args.join(" "));
412
433
  if (/issues\/\d+\/comments/.test(args.join(" "))) return "[]";
413
434
  const m = /issues\/(\d+)$/.exec(args.join(" "));
@@ -419,10 +440,17 @@ describe("cache", () => {
419
440
  const crawl = calls.filter((c) => /issues/.test(c));
420
441
  assert.ok(crawl.length > 0 && crawl.every((c) => /issues\/(3|4|9)(\/comments)?$/.test(c)), crawl.join(","));
421
442
  });
422
- it("budget: AlterLab-scale conformance crawl costs two calls per joined issue, no comments scan or listing (#5363, R1 instrumentation)", async () => {
443
+ it("budget: AlterLab-scale conformance crawl costs one GraphQL call per 20 joined issues, no comments scan or listing (#5363, #5530, R1 instrumentation)", async () => {
423
444
  let n = 0;
445
+ const rest = (args) => {
446
+ const a = args.join(" ");
447
+ if (/issues\/\d+\/comments/.test(a)) return "[]";
448
+ const m = /issues\/(\d+)$/.exec(a);
449
+ return m ? JSON.stringify({ number: Number(m[1]), state: "closed", labels: [], created_at: ts(1), updated_at: ts(2) }) : null;
450
+ };
424
451
  const gh = (args) => {
425
452
  const a = args.join(" "); n++;
453
+ if (isBatch(args)) return gqlBatch(args, rest);
426
454
  if (/issues\/\d+\/comments/.test(a)) return "[]";
427
455
  const m = /issues\/(\d+)$/.exec(a);
428
456
  if (m) return JSON.stringify({ number: Number(m[1]), state: "closed", labels: [], created_at: ts(1), updated_at: ts(2) });
@@ -431,7 +459,7 @@ describe("cache", () => {
431
459
  const prs = Array.from({ length: 400 }, (_, i) => ({ number: 5000 + i, closingIssues: [{ number: 100 + i }] }));
432
460
  await buildReport({ repo: "o/r", conformanceOutcomes: true, local: false, cache: false, minN: 10, since: "2026-10-01" },
433
461
  { gh, env: ENV, releaseTimes: [], gatherConformanceOutcomes: async () => ({ prs }), now: () => Date.UTC(2026, 10, 10), git: null });
434
- assert.ok(n <= 2 * 800, `calls ${n}`);
462
+ assert.ok(n <= Math.ceil(800 / 20), `calls ${n}`);
435
463
  });
436
464
  it("progress printer shows an ETA when one is known (#5363)", () => {
437
465
  const out = [];
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (C) 2011-2015 by Vitaly Puzrin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ # Vendored js-yaml (#5551)
2
+
3
+ - Package: js-yaml 4.1.0 (MIT, see LICENSE), file `dist/js-yaml.mjs`, unmodified.
4
+ - Source: `npm pack js-yaml@4.1.0`
5
+ - sha256 of js-yaml.mjs: 16f210b939b359b6ec8dde581eb62c157185711dc7b719b33779c43db5c31a91
6
+ - Used only by `bin/lean/release-config.mjs` (`.forge/release.yaml`, JSON_SCHEMA, duplicate keys throw).
7
+ - To bump: re-vendor the new file, update version and sha256 here, run `bin/lean/release-config.test.mjs`.