forgedock 1.54.1 → 1.55.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.
- package/bin/config-schema.mjs +12 -0
- package/bin/engine/events.mjs +1 -0
- package/bin/engine/events.test.mjs +5 -1
- package/bin/engine/outcome-codes.mjs +3 -0
- package/bin/engine-cli.mjs +126 -34
- package/bin/forge-utils.mjs +37 -5
- package/bin/forgedock.mjs +54 -2
- package/bin/gc-schedule.mjs +83 -0
- package/bin/gc.mjs +66 -10
- package/bin/help-text.mjs +1 -1
- package/bin/hooks/pre-tool-use.mjs +1 -0
- package/bin/init-detect.mjs +73 -2
- package/bin/labels.json +5 -0
- package/bin/lean/admission.mjs +21 -1
- package/bin/lean/baselines.mjs +43 -0
- package/bin/lean/baselines.test.mjs +33 -0
- package/bin/lean/batch-health.mjs +43 -6
- package/bin/lean/batch-health.test.mjs +41 -1
- package/bin/lean/batch.mjs +41 -4
- package/bin/lean/batch.test.mjs +106 -3
- package/bin/lean/conformance.mjs +131 -12
- package/bin/lean/conformance.test.mjs +172 -3
- package/bin/lean/depcache.mjs +23 -2
- package/bin/lean/depcache.test.mjs +22 -0
- package/bin/lean/docsgate.mjs +137 -0
- package/bin/lean/docsgate.test.mjs +78 -0
- package/bin/lean/effects.mjs +31 -2
- package/bin/lean/enumerating.mjs +39 -13
- package/bin/lean/enumerating.test.mjs +20 -0
- package/bin/lean/execution.test.mjs +3 -3
- package/bin/lean/fastforward.mjs +93 -0
- package/bin/lean/fastforward.test.mjs +73 -0
- package/bin/lean/guardgate.mjs +38 -7
- package/bin/lean/guardgate.test.mjs +39 -0
- package/bin/lean/issuewatch-install.mjs +92 -0
- package/bin/lean/issuewatch-install.test.mjs +31 -0
- package/bin/lean/issuewatch-parity.mjs +33 -3
- package/bin/lean/issuewatch-parity.test.mjs +30 -5
- package/bin/lean/issuewatch-reconcile.mjs +123 -0
- package/bin/lean/issuewatch-reconcile.test.mjs +30 -0
- package/bin/lean/issuewatch-verify.mjs +51 -9
- package/bin/lean/issuewatch.mjs +153 -33
- package/bin/lean/issuewatch.test.mjs +243 -22
- package/bin/lean/lean.mjs +381 -75
- package/bin/lean/lean.test.mjs +437 -20
- package/bin/lean/light.mjs +11 -3
- package/bin/lean/light.test.mjs +27 -0
- package/bin/lean/lightlane.mjs +8 -3
- package/bin/lean/lightlane.test.mjs +20 -0
- package/bin/lean/mechfix.mjs +21 -2
- package/bin/lean/mechfix.test.mjs +28 -1
- package/bin/lean/orchestrate-children.test.mjs +10 -0
- package/bin/lean/orchestrate-owned.test.mjs +73 -0
- package/bin/lean/orchestrate.mjs +28 -4
- package/bin/lean/overlap.mjs +20 -0
- package/bin/lean/overlap.test.mjs +49 -0
- package/bin/lean/pagegate.mjs +152 -0
- package/bin/lean/pagegate.test.mjs +77 -0
- package/bin/lean/parked-relabel.mjs +32 -0
- package/bin/lean/parked-relabel.test.mjs +45 -0
- package/bin/lean/phaseledger.mjs +17 -2
- package/bin/lean/postdeploy-check.mjs +27 -0
- package/bin/lean/postdeploy-check.test.mjs +13 -1
- package/bin/lean/postrun.mjs +32 -0
- package/bin/lean/postrun.test.mjs +41 -0
- package/bin/lean/preflight.mjs +46 -0
- package/bin/lean/preflight.test.mjs +30 -1
- package/bin/lean/prompts.mjs +36 -6
- package/bin/lean/recovery.test.mjs +16 -0
- package/bin/lean/release-review.mjs +12 -1
- package/bin/lean/release-review.test.mjs +14 -0
- package/bin/lean/release.mjs +23 -2
- package/bin/lean/release.test.mjs +28 -1
- package/bin/lean/render.mjs +17 -6
- package/bin/lean/reproquality.mjs +116 -0
- package/bin/lean/reproquality.test.mjs +85 -0
- package/bin/lean/review-trigger.mjs +8 -3
- package/bin/lean/sandbox-budget.test.mjs +27 -0
- package/bin/lean/schedd.mjs +40 -11
- package/bin/lean/schedd.test.mjs +12 -1
- package/bin/lean/testadequacy.mjs +97 -0
- package/bin/lean/testadequacy.test.mjs +92 -0
- package/bin/lean/testsandbox.mjs +202 -0
- package/bin/lean/testsandbox.test.mjs +157 -0
- package/bin/lean/toolplace.mjs +5 -2
- package/bin/lean/toolplace.test.mjs +6 -0
- package/bin/lean/verify.mjs +6 -1
- package/bin/lean/verify.test.mjs +18 -2
- package/bin/lean/warmtree.mjs +77 -0
- package/bin/lean/warmtree.test.mjs +81 -0
- package/bin/review-staging.mjs +51 -9
- package/bin/stats/conformance-outcomes.mjs +12 -2
- package/bin/stats/depth.mjs +24 -1
- package/bin/stats/depth.test.mjs +21 -1
- package/bin/stats/index.mjs +5 -2
- package/bin/stats/query.mjs +2 -1
- package/commands/cleanup.md +18 -0
- package/commands/fd-introspect.md +19 -0
- package/commands/milestone.md +5 -1
- package/commands/pipeline-health/phase-2-metrics.md +4 -0
- package/commands/recover-orphans.md +31 -1
- package/commands/review-pr-staging.md +9 -0
- package/commands/review-pr.md +2 -0
- package/docs/CONFIG.md +26 -1
- package/docs/EVENTS.md +1 -0
- package/docs/ISSUE-WATCH.md +12 -3
- package/docs/eval/adversarial-bench.md +1 -1
- package/docs/eval/published/adversarial-2026-11-11.md +58 -0
- package/package.json +1 -1
- package/scripts/bench-lightlane.mjs +3 -2
- package/scripts/hotspots.sh +7 -4
- package/scripts/hotspots.test.sh +12 -0
- package/scripts/recover-orphans-stateless.test.sh +79 -0
- package/scripts/transition-label.sh +2 -0
- package/templates/workflows/forgedock-reopen-clean.yml +33 -0
package/scripts/hotspots.test.sh
CHANGED
|
@@ -56,7 +56,19 @@ eq "attr generated" "$(q '[.files[] | .generated]')" '[true,false,false,false]'
|
|
|
56
56
|
OUT="$(bash "$S" hdr.py late.py)"
|
|
57
57
|
rm -f hdr.py late.py
|
|
58
58
|
eq "header generated" "$(q '[.files[] | [.generated,.excluded]]')" '[[true,true],[false,false]]'
|
|
59
|
+
# #5470: a `generated/` path segment marks the file generated; the same growth in a hand-written file does not
|
|
60
|
+
mkdir -p web/app/docs/generated/hands web/app/docs/hand generated notgenerated
|
|
61
|
+
lines web/app/docs/generated/hands/page.tsx 6607; lines web/app/docs/hand/page.tsx 6607; lines generated/top.ts 2500; lines notgenerated/x.ts 2500
|
|
62
|
+
OUT="$(bash "$S" --base main -- web/app/docs/generated/hands/page.tsx web/app/docs/hand/page.tsx generated/top.ts notgenerated/x.ts)"
|
|
63
|
+
eq "generated/ segment is generated" "$(q '[.files[] | [.generated,.excluded]]')" '[[true,true],[false,false],[true,true],[false,false]]'
|
|
64
|
+
eq "generated/ segment growth reported" "$(q '[.files[0].growth,.files[1].growth]')" '[6607,6607]'
|
|
65
|
+
rm -rf web generated notgenerated
|
|
59
66
|
if [ "$HAVE_YQ" = 1 ]; then
|
|
67
|
+
# #5470: maintenance.generated is an alias of generated_paths; both merge, duplicates drop
|
|
68
|
+
printf 'maintenance:\n generated: ["a.json", "b.json"]\n generated_paths: ["b.json", "c.json"]\n' > forge.yaml
|
|
69
|
+
OUT="$(bash "$S" big.py)"; eq "generated key merged" "$(q '.generated_paths')" '["b.json","c.json","a.json"]'
|
|
70
|
+
printf 'maintenance:\n generated: nope\n generated_paths: ["c.json"]\n' > forge.yaml
|
|
71
|
+
OUT="$(bash "$S" big.py)"; eq "bad generated key falls back" "$(q '.generated_paths')" '["c.json"]'
|
|
60
72
|
printf 'maintenance:\n hotspot:\n file_lines: 100\n growth_lines: 5\n exclude_globs: ["dist/*", "*.lock"]\n' > forge.yaml
|
|
61
73
|
OUT="$(bash "$S" dist/bundle.js small.py big.py)"
|
|
62
74
|
eq "config thresholds" "$(q '[.file_lines,.growth_lines]')" '[100,5]'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# recover-orphans-stateless.test.sh — the #5466 STATELESS branch in commands/recover-orphans.md Phase 2 must
|
|
3
|
+
# honour --dry-run and must not re-park an issue a human cleared (#5486). Runs the extracted block with gh mocked.
|
|
4
|
+
#
|
|
5
|
+
# Usage: bash scripts/recover-orphans-stateless.test.sh
|
|
6
|
+
# SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
|
|
7
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
8
|
+
|
|
9
|
+
set -uo pipefail
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
+
SPEC="$SCRIPT_DIR/../commands/recover-orphans.md"
|
|
12
|
+
TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT
|
|
13
|
+
PASS=0; FAILN=0
|
|
14
|
+
ok() { PASS=$((PASS+1)); echo "ok - $1"; }
|
|
15
|
+
bad() { FAILN=$((FAILN+1)); echo "FAIL - $1"; }
|
|
16
|
+
|
|
17
|
+
# Block: from the "#5466:" comment through the closing "fi" at two-space indent.
|
|
18
|
+
awk '/# #5466: a needs-human annotation/{f=1} f{print} f && /^ fi$/{exit}' "$SPEC" > "$TMP/block.sh"
|
|
19
|
+
[ -s "$TMP/block.sh" ] && ok "STATELESS block extracted" || { bad "STATELESS block extracted"; exit 1; }
|
|
20
|
+
|
|
21
|
+
mkdir "$TMP/bin"
|
|
22
|
+
cat > "$TMP/bin/gh" <<'MOCK'
|
|
23
|
+
#!/usr/bin/env bash
|
|
24
|
+
case "$1 $2" in
|
|
25
|
+
"api repos/o/r/issues/7/events") cat "$MOCK_EVENTS" ;;
|
|
26
|
+
"api graphql") echo "${MOCK_VIEWER:-}" ;;
|
|
27
|
+
"issue edit") echo "EDIT $*" >> "$MOCK_LOG" ;;
|
|
28
|
+
esac
|
|
29
|
+
exit 0
|
|
30
|
+
MOCK
|
|
31
|
+
chmod +x "$TMP/bin/gh"
|
|
32
|
+
|
|
33
|
+
ISSUE='{"labels":[],"comments":[{"body":"<!-- FORGE:NEEDS_HUMAN -->\nx","createdAt":"2026-01-01T00:00:00Z"}]}'
|
|
34
|
+
NOEV='[]'
|
|
35
|
+
CLEARED='[{"event":"unlabeled","label":{"name":"needs-human"},"created_at":"2026-01-02T00:00:00Z"}]'
|
|
36
|
+
OLDER='[{"event":"unlabeled","label":{"name":"needs-human"},"created_at":"2025-12-31T00:00:00Z"}]'
|
|
37
|
+
|
|
38
|
+
BOT_EV='[{"event":"unlabeled","label":{"name":"needs-human"},"created_at":"2026-01-02T00:00:00Z","actor":{"login":"the-bot","type":"User"}}]'
|
|
39
|
+
BOTTYPE_EV='[{"event":"unlabeled","label":{"name":"needs-human"},"created_at":"2026-01-02T00:00:00Z","actor":{"login":"app[bot]","type":"Bot"}}]'
|
|
40
|
+
HUMAN_EV='[{"event":"unlabeled","label":{"name":"needs-human"},"created_at":"2026-01-02T00:00:00Z","actor":{"login":"alice","type":"User"}}]'
|
|
41
|
+
|
|
42
|
+
# run <dry_run> <events-json> -> sets LOG (edit calls), ACTION, REASON
|
|
43
|
+
run() {
|
|
44
|
+
: > "$TMP/log"; echo "$2" > "$TMP/ev"
|
|
45
|
+
local out
|
|
46
|
+
out=$(PATH="$TMP/bin:$PATH" MOCK_LOG="$TMP/log" MOCK_EVENTS="$TMP/ev" MOCK_VIEWER="${VIEWER:-}" DRY_RUN="$1" ISSUE="$ISSUE" ISSUE_LABELS="" \
|
|
47
|
+
GH_REPO=o/r GH_FLAG="-R o/r" NUM=7 bash -c '
|
|
48
|
+
declare -A DIAG_ACTION DIAG_REASON
|
|
49
|
+
for _ in 1; do
|
|
50
|
+
source "$0"
|
|
51
|
+
echo "FELLTHROUGH"
|
|
52
|
+
done
|
|
53
|
+
echo "ACTION=${DIAG_ACTION[7]:-}"; echo "REASON=${DIAG_REASON[7]:-}"' "$TMP/block.sh" 2>&1)
|
|
54
|
+
LOG=$(cat "$TMP/log"); OUT="$out"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
run false "$NOEV"
|
|
58
|
+
echo "$LOG" | grep -q "add-label needs-human" && ok "live: stateless orphan restored" || bad "live: stateless orphan restored"
|
|
59
|
+
run true "$NOEV"
|
|
60
|
+
[ -z "$LOG" ] && ok "dry-run: no gh issue edit" || bad "dry-run: no gh issue edit"
|
|
61
|
+
echo "$OUT" | grep -q "would restore" && ok "dry-run: reports would-restore" || bad "dry-run: reports would-restore"
|
|
62
|
+
run false "$CLEARED"
|
|
63
|
+
[ -z "$LOG" ] && echo "$OUT" | grep -q "cleared by a human" && ok "human-cleared: not re-parked" || bad "human-cleared: not re-parked"
|
|
64
|
+
run false "$OLDER"
|
|
65
|
+
echo "$LOG" | grep -q "add-label needs-human" && ok "removal before annotation: still restored" || bad "removal before annotation: still restored"
|
|
66
|
+
|
|
67
|
+
VIEWER=the-bot run false "$BOT_EV"
|
|
68
|
+
echo "$LOG" | grep -q "add-label needs-human" && ok "#5494: bot-login removal (viewer) restored" || bad "#5494: bot-login removal (viewer) restored"
|
|
69
|
+
VIEWER="" FORGE_BOT_LOGIN=the-bot run false "$BOT_EV"
|
|
70
|
+
echo "$LOG" | grep -q "add-label needs-human" && ok "#5494: bot-login removal (FORGE_BOT_LOGIN) restored" || bad "#5494: bot-login removal (FORGE_BOT_LOGIN) restored"
|
|
71
|
+
unset FORGE_BOT_LOGIN
|
|
72
|
+
VIEWER=the-bot run false "$BOTTYPE_EV"
|
|
73
|
+
echo "$LOG" | grep -q "add-label needs-human" && ok "#5494: Bot-type removal restored" || bad "#5494: Bot-type removal restored"
|
|
74
|
+
VIEWER=the-bot run false "$HUMAN_EV"
|
|
75
|
+
[ -z "$LOG" ] && echo "$OUT" | grep -q "cleared by a human" && ok "#5494: human removal still skipped" || bad "#5494: human removal still skipped"
|
|
76
|
+
VIEWER="" run false "$BOT_EV"
|
|
77
|
+
[ -z "$LOG" ] && ok "#5494: unresolved bot login stays fail-closed" || bad "#5494: unresolved bot login stays fail-closed"
|
|
78
|
+
|
|
79
|
+
echo "passed=$PASS failed=$FAILN"; [ "$FAILN" -eq 0 ]
|
|
@@ -182,6 +182,7 @@ VALID_STATES=(
|
|
|
182
182
|
"building"
|
|
183
183
|
"in-review"
|
|
184
184
|
"merged"
|
|
185
|
+
"merged-unverified"
|
|
185
186
|
"invalid"
|
|
186
187
|
"decomposed"
|
|
187
188
|
"awaiting-merge"
|
|
@@ -294,6 +295,7 @@ ensure_label() {
|
|
|
294
295
|
"workflow:remediating") LBL_COLOR="C5DEF5"; LBL_DESC="Pipeline: autonomous remediation pending (no human action needed). Managed by ForgeDock." ;;
|
|
295
296
|
"workflow:awaiting-merge") LBL_COLOR="FF8C00"; LBL_DESC="Pipeline: remediated + re-reviewed, awaiting a human merge decision. Managed by ForgeDock." ;;
|
|
296
297
|
"workflow:merged") LBL_COLOR="0E8A16"; LBL_DESC="Pipeline: PR merged, issue closed. Managed by ForgeDock." ;;
|
|
298
|
+
"workflow:merged-unverified") LBL_COLOR="FBCA04"; LBL_DESC="Pipeline: PR merged but verification failed, needs a human decision. Managed by ForgeDock." ;;
|
|
297
299
|
"workflow:decomposed") LBL_COLOR="BFD4F2"; LBL_DESC="Pipeline: decomposed into sub-issues. Managed by ForgeDock." ;;
|
|
298
300
|
"workflow:invalid") LBL_COLOR="CCCCCC"; LBL_DESC="Pipeline: issue closed as invalid after investigation. Managed by ForgeDock." ;;
|
|
299
301
|
"needs-human") LBL_COLOR="E4E669"; LBL_DESC="Pipeline stalled — requires human intervention. Managed by ForgeDock." ;;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ForgeDock reopen cleanup — Workflow Template
|
|
2
|
+
#
|
|
3
|
+
# Copy this file to .github/workflows/forgedock-reopen-clean.yml in your repository.
|
|
4
|
+
# When an issue is reopened, remove the terminal labels workflow:merged and
|
|
5
|
+
# workflow:merged-unverified so the open issue does not look merged and the next
|
|
6
|
+
# lane starts from a clean state.
|
|
7
|
+
|
|
8
|
+
name: ForgeDock Reopen Cleanup
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
issues:
|
|
12
|
+
types: [reopened]
|
|
13
|
+
|
|
14
|
+
# Minimum permissions: edit labels on issues.
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
clean-labels:
|
|
20
|
+
name: Remove terminal labels
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Remove workflow:merged labels
|
|
24
|
+
env:
|
|
25
|
+
GH_TOKEN: ${{ github.token }}
|
|
26
|
+
GH_REPO: ${{ github.repository }}
|
|
27
|
+
ISSUE: ${{ github.event.issue.number }}
|
|
28
|
+
run: |
|
|
29
|
+
for L in "workflow:merged" "workflow:merged-unverified"; do
|
|
30
|
+
if gh issue view "$ISSUE" --json labels --jq '.labels[].name' | grep -qx "$L"; then
|
|
31
|
+
gh issue edit "$ISSUE" --remove-label "$L"
|
|
32
|
+
fi
|
|
33
|
+
done
|