forgedock 1.59.2 → 1.60.1

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 (97) hide show
  1. package/bin/engine/outcome-codes.mjs +3 -3
  2. package/bin/engine-cli.mjs +50 -10
  3. package/bin/labels.json +5 -0
  4. package/bin/lean/batch.mjs +21 -2
  5. package/bin/lean/batch.test.mjs +116 -1
  6. package/bin/lean/conformance.mjs +19 -6
  7. package/bin/lean/conformance.test.mjs +37 -3
  8. package/bin/lean/depcache.mjs +34 -15
  9. package/bin/lean/depcache.test.mjs +100 -1
  10. package/bin/lean/design-gate.mjs +15 -10
  11. package/bin/lean/design-gate.test.mjs +21 -0
  12. package/bin/lean/effects.mjs +18 -2
  13. package/bin/lean/execution.mjs +23 -5
  14. package/bin/lean/execution.test.mjs +81 -1
  15. package/bin/lean/gatewatch.test.mjs +5 -5
  16. package/bin/lean/issuewatch-triage.mjs +68 -0
  17. package/bin/lean/issuewatch-triage.test.mjs +98 -0
  18. package/bin/lean/issuewatch.mjs +34 -6
  19. package/bin/lean/issuewatch.test.mjs +11 -0
  20. package/bin/lean/lanelock.mjs +5 -4
  21. package/bin/lean/lean.mjs +144 -21
  22. package/bin/lean/lean.test.mjs +180 -6
  23. package/bin/lean/orchestrate-cancel.test.mjs +33 -0
  24. package/bin/lean/orchestrate-hostfallback.test.mjs +41 -0
  25. package/bin/lean/orchestrate-recovering.test.mjs +42 -0
  26. package/bin/lean/orchestrate.mjs +23 -10
  27. package/bin/lean/pagegate.mjs +50 -12
  28. package/bin/lean/pagegate.test.mjs +38 -1
  29. package/bin/lean/phaseledger.mjs +65 -2
  30. package/bin/lean/phaseledger.test.mjs +70 -2
  31. package/bin/lean/preflight.mjs +67 -3
  32. package/bin/lean/preflight.test.mjs +37 -1
  33. package/bin/lean/prompts.mjs +2 -1
  34. package/bin/lean/recovery.test.mjs +11 -6
  35. package/bin/lean/release-classify.mjs +143 -0
  36. package/bin/lean/release-classify.test.mjs +130 -0
  37. package/bin/lean/release-conductor.mjs +163 -0
  38. package/bin/lean/release-conductor.test.mjs +194 -0
  39. package/bin/lean/release-config.mjs +60 -8
  40. package/bin/lean/release-config.test.mjs +43 -1
  41. package/bin/lean/release-control.mjs +22 -5
  42. package/bin/lean/release-control.test.mjs +22 -0
  43. package/bin/lean/release-credentials.mjs +40 -0
  44. package/bin/lean/release-credentials.test.mjs +42 -0
  45. package/bin/lean/release-deploy.mjs +3 -3
  46. package/bin/lean/release-deploy.test.mjs +8 -0
  47. package/bin/lean/release-docs.test.mjs +93 -0
  48. package/bin/lean/release-fence.mjs +2 -0
  49. package/bin/lean/release-gate.mjs +88 -0
  50. package/bin/lean/release-gate.test.mjs +116 -0
  51. package/bin/lean/release-gates.mjs +5 -1
  52. package/bin/lean/release-ledger.mjs +47 -1
  53. package/bin/lean/release-ledger.test.mjs +33 -1
  54. package/bin/lean/release-mergeback.mjs +148 -0
  55. package/bin/lean/release-mergeback.test.mjs +129 -0
  56. package/bin/lean/release-p0.mjs +193 -0
  57. package/bin/lean/release-p0.test.mjs +127 -0
  58. package/bin/lean/release-plan.mjs +267 -0
  59. package/bin/lean/release-plan.test.mjs +202 -0
  60. package/bin/lean/release-preflight.mjs +16 -0
  61. package/bin/lean/release-regate.mjs +141 -0
  62. package/bin/lean/release-regate.test.mjs +149 -0
  63. package/bin/lean/release-review.mjs +5 -3
  64. package/bin/lean/release-rollback.mjs +277 -0
  65. package/bin/lean/release-rollback.test.mjs +245 -0
  66. package/bin/lean/release-snapshot.mjs +48 -9
  67. package/bin/lean/release-snapshot.test.mjs +43 -1
  68. package/bin/lean/release-start.mjs +164 -0
  69. package/bin/lean/release-start.test.mjs +171 -0
  70. package/bin/lean/release-status.mjs +6 -2
  71. package/bin/lean/release-train.mjs +159 -0
  72. package/bin/lean/release-train.test.mjs +139 -0
  73. package/bin/lean/release.mjs +127 -5
  74. package/bin/lean/release.test.mjs +80 -0
  75. package/bin/lean/sandbox-remote.mjs +2 -0
  76. package/bin/lean/schedd-load.test.mjs +82 -0
  77. package/bin/lean/schedd.mjs +67 -31
  78. package/bin/lean/schedd.test.mjs +80 -1
  79. package/bin/lean/validate-catalog.mjs +110 -0
  80. package/bin/lean/validate-catalog.test.mjs +55 -0
  81. package/bin/pool/agent.mjs +12 -1
  82. package/bin/pool/lane-tools.mjs +146 -0
  83. package/bin/pool/lane-tools.test.mjs +26 -0
  84. package/bin/pool/router.mjs +3 -1
  85. package/bin/pool/warm.mjs +14 -3
  86. package/docs/CONFIG.md +225 -1
  87. package/docs/ISSUE-WATCH.md +1 -0
  88. package/docs/design/visual-gate.md +10 -0
  89. package/docs/eval/adversarial-bench.md +1 -0
  90. package/package.json +1 -1
  91. package/pool/README.md +2 -0
  92. package/scripts/acceptance-red-green.sh +5 -2
  93. package/scripts/acceptance-red-green.test.sh +11 -0
  94. package/scripts/bench-adversarial.mjs +4 -0
  95. package/scripts/bench-lightlane.mjs +2 -1
  96. package/templates/github-actions/forge-conductor.scopes.json +7 -0
  97. package/templates/github-actions/forge-conductor.yml +57 -0
@@ -87,6 +87,17 @@ check "workspace node_modules and .venv linked into base; new nested test overla
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
89
 
90
+ # 11b. Python service venv (AlterLab 40652): a test under services/api runs with services/api/.venv (next to its tracked
91
+ # pyproject.toml), not the root .venv; base gets that tree linked, so it fails on the defect instead of UNRUNNABLE
92
+ R6="$TMP/r6"; make_repo "$R6"
93
+ mkdir -p "$R6/services/api"; printf '[project]\nname="api"\n' > "$R6/services/api/pyproject.toml"
94
+ printf '.venv/\n' > "$R6/.gitignore"; git -C "$R6" add -A; git -C "$R6" commit -qm svc; git -C "$R6" update-ref refs/remotes/origin/main HEAD
95
+ fix_head "$R6"
96
+ mkdir -p "$R6/services/api/.venv/bin" "$R6/services/api/tests"; printf 'echo venv\n' > "$R6/services/api/.venv/bin/python"
97
+ printf 'bash .venv/bin/python >/dev/null 2>&1 || exit 127\ntest "$(bash ../../app.sh)" = good && echo "1 passed"\n' > "$R6/services/api/tests/t.sh"
98
+ git -C "$R6" add -A; git -C "$R6" commit -qm test
99
+ check "service .venv next to a tracked pyproject.toml is linked into base" "BASE=FAILED HEAD=RAN" "$R6" "cd services/api && bash tests/t.sh"
100
+
90
101
  # 12. #5544 test-only fix: the base's own version of the test fails, head's passes, source unchanged
91
102
  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
103
  git -C "$R5" add -A; git -C "$R5" commit -qm "bad test"; git -C "$R5" update-ref refs/remotes/origin/main HEAD
@@ -131,6 +131,8 @@ export function aggregateAdversarial(rows, meta) {
131
131
  oracle_pass_rate: oracle.length ? r4(oracle.filter((r) => r.oracle_pass === true).length / oracle.length) : null,
132
132
  cost_usd: r4(sumOf(mine, "cost_usd")),
133
133
  wall_ms: sumOf(mine, "wall_ms"),
134
+ start_ms: sumOf(mine, "start_ms"), // #5620: sandbox start wait, to compare execution.warm_sandboxes on/off
135
+ start_unobserved: mine.filter((r) => !Number.isFinite(r.start_ms)).length,
134
136
  light_unobserved: mine.filter((r) => r.light_unobserved === true).length, // #5541
135
137
  };
136
138
  }
@@ -147,6 +149,8 @@ export function renderScorecard({ meta, arms }) {
147
149
  ["Oracle pass rate", (a) => (a.oracle_pass_rate == null ? "n/a" : `${a.oracle_pass_rate} (n=${a.oracle_n})`)],
148
150
  ["Cost (USD, sum)", (a) => String(a.cost_usd)],
149
151
  ["Wall time (ms, sum)", (a) => String(a.wall_ms)],
152
+ ["Sandbox start (ms, sum)", (a) => String(a.start_ms)],
153
+ ["Lanes with no start timing (start_unobserved)", (a) => String(a.start_unobserved)],
150
154
  ["Lanes with no `light` in the result (light_unobserved)", (a) => String(a.light_unobserved)],
151
155
  ];
152
156
  return [
@@ -138,7 +138,7 @@ async function grade({ run, src, head, base, corpus, issue, tmp, tag, apiShape }
138
138
  /** Run one arm on one corpus issue and grade it -> one row (see aggregate). `now` and `apiShape` are injectable. */
139
139
  export async function runArm({ arm, issue, corpus, cfg, run = benchDefaultRun, tmp, now = () => Date.now(), apiShape = detectApiShape }) {
140
140
  const tag = `${arm}-${issue.id}`, a = cfg.arms[arm];
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,
141
+ const row = { arm, id: issue.id, cost_usd: null, wall_ms: null, model_ms: null, start_ms: null, harness_wall_ms: null, claimed_fix: false, oracle_pass: false, suite_pass: null,
142
142
  api_shape: null, light: null, light_unobserved: false, light_eligibility: null, light_upgrade: null, terminal: null };
143
143
  const t0 = now();
144
144
  let src = null, head = null, base = corpus.base, claimed = false;
@@ -165,6 +165,7 @@ export async function runArm({ arm, issue, corpus, cfg, run = benchDefaultRun, t
165
165
  const res = readJson(rf);
166
166
  row.terminal = res?.terminalReason ?? `exit ${r.code}`;
167
167
  row.cost_usd = num(res?.cost_usd); row.wall_ms = num(res?.wall_ms); row.model_ms = num(res?.model_ms);
168
+ row.start_ms = num(res?.phases?.sandbox_start?.ms); // #5620: lane sandbox start wait (SANDBOX_STEP steps live under it); null when the result has no phases
168
169
  row.light = typeof res?.light === "boolean" ? res.light : null;
169
170
  row.light_unobserved = row.light === null; // #5541: no result file (or no `light` field), so the lane's depth is unknown, not false
170
171
  row.light_eligibility = res?.light_eligibility ?? null;
@@ -0,0 +1,7 @@
1
+ {
2
+ "schema": "forgedock.release.conductor-scopes/v1",
3
+ "token": "GITHUB_TOKEN of the conductor workflow",
4
+ "permissions": { "actions": "write", "contents": "write", "issues": "write" },
5
+ "allows": ["read workflow runs (actions)", "workflow dispatch and rerun (actions: write)", "write the forge-ledger/* branches (contents: write, limited by ledger rulesets)", "lease comment and needs-agent issue (issues: write)"],
6
+ "forbids": ["production secrets", "pull-requests: write", "merge", "id-token: write"]
7
+ }
@@ -0,0 +1,57 @@
1
+ # ForgeDock release conductor (#5564): host-less recovery for a managed release whose driver went away.
2
+ # Installed by `forgedock release init --conductor` (placeholders are filled with the exact forgedock version).
3
+ # It never plans, builds, reviews, merges or patches: it calls `forgedock release recover <id>`, which takes a stale lease
4
+ # and runs only the GitHub-only recovery actions. The token scopes are listed in forge-conductor.scopes.json.
5
+ name: ForgeDock Conductor
6
+
7
+ on:
8
+ workflow_run:
9
+ workflows: __DEPLOY_WORKFLOWS__
10
+ types: [completed]
11
+ deployment_status:
12
+ workflow_dispatch:
13
+ schedule:
14
+ - cron: '__WATCHDOG_CRON__'
15
+
16
+ permissions:
17
+ actions: write
18
+ contents: write
19
+ issues: write
20
+
21
+ concurrency:
22
+ group: forge-conductor
23
+ cancel-in-progress: false
24
+
25
+ jobs:
26
+ recover:
27
+ runs-on: ubuntu-latest
28
+ timeout-minutes: 60
29
+ steps:
30
+ # No-op path: nothing is checked out or installed unless `_active` names a release.
31
+ - name: Find the active release
32
+ id: active
33
+ env:
34
+ GH_TOKEN: ${{ github.token }}
35
+ run: |
36
+ id=$(gh api "repos/${GITHUB_REPOSITORY}/contents/active.json?ref=_active" --jq '.content' 2>/dev/null | base64 -d 2>/dev/null | jq -r '.lease.release // empty' 2>/dev/null || true)
37
+ echo "release=${id}" >> "$GITHUB_OUTPUT"
38
+ [ -n "$id" ] || echo "no active release; nothing to do"
39
+
40
+ - name: Checkout default branch
41
+ if: steps.active.outputs.release != ''
42
+ uses: actions/checkout@v4
43
+ with:
44
+ fetch-depth: 0
45
+
46
+ - name: Set up Node
47
+ if: steps.active.outputs.release != ''
48
+ uses: actions/setup-node@v4
49
+ with:
50
+ node-version: 20
51
+
52
+ - name: Recover
53
+ if: steps.active.outputs.release != ''
54
+ env:
55
+ GH_TOKEN: ${{ github.token }}
56
+ RELEASE_ID: ${{ steps.active.outputs.release }}
57
+ run: npx --yes forgedock@__FORGEDOCK_VERSION__ release recover "$RELEASE_ID" --repo "$GITHUB_REPOSITORY"