forgedock 1.11.0 → 1.12.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/engine/phases-args.test.mjs +112 -0
- package/bin/engine/phases.mjs +152 -45
- package/bin/engine/runlog.mjs +9 -0
- package/bin/engine-cli.mjs +13 -2
- package/bin/engine.mjs +144 -18
- package/bin/forgedock.mjs +2 -2
- package/bin/runner.mjs +89 -12
- package/commands/orchestrate/phase-4-execution.md +26 -7
- package/commands/orchestrate/phase-6-report.md +29 -0
- package/commands/quality-gate.md +96 -12
- package/commands/review-pr.md +75 -12
- package/commands/work-on/build/validate.md +58 -7
- package/commands/work-on/remediate.md +87 -7
- package/commands/work-on/review.md +56 -18
- package/commands/work-on.md +13 -5
- package/docs/WORK-ON-RUNTIME.md +2 -2
- package/package.json +1 -1
- package/packages/protocol/src/phases.js +6 -1
- package/scripts/check-branch-ancestry.sh +82 -0
- package/scripts/check-branch-ancestry.test.sh +78 -0
- package/scripts/check-spec-markers.sh +2 -0
- package/scripts/forge-root.test.sh +1 -1
- package/scripts/spec-no-worktree-script.test.sh +46 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# spec-no-worktree-script.test.sh — guard/gate scripts named in specs must resolve from ForgeDock's
|
|
3
|
+
# install root only. A candidate under {WORKTREE_PATH}/scripts, {REPO_PATH}/scripts or a cwd-relative
|
|
4
|
+
# scripts/ is author-controlled (the PR branch under audit) and would let a branch supply the script
|
|
5
|
+
# that gates it. Read-only data uses (grep of a file's contents, JSON manifest reads) are not matched.
|
|
6
|
+
# Usage: bash scripts/spec-no-worktree-script.test.sh
|
|
7
|
+
# SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios
|
|
8
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
9
|
+
set -uo pipefail
|
|
10
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; ROOT="$HERE/.."
|
|
11
|
+
PASS=0; FAILN=0
|
|
12
|
+
ok() { PASS=$((PASS+1)); }
|
|
13
|
+
bad() { FAILN=$((FAILN+1)); echo "FAIL: $1"; }
|
|
14
|
+
|
|
15
|
+
# Execution-resolution patterns: a fallback assignment or candidate list pointing at a repo-controlled scripts dir.
|
|
16
|
+
PATTERNS=(
|
|
17
|
+
'\|\| [A-Za-z_]+="\{(WORKTREE_PATH|REPO_PATH)\}/scripts/[A-Za-z0-9_.-]+\.sh"'
|
|
18
|
+
'for _d in [^;]*\{(WORKTREE_PATH|REPO_PATH)\}/scripts'
|
|
19
|
+
'\$\{FORGEDOCK_SCRIPTS:-scripts\}'
|
|
20
|
+
'\|\| [A-Za-z_]+="scripts/[A-Za-z0-9_.-]+\.sh"'
|
|
21
|
+
)
|
|
22
|
+
FILES=$(cd "$ROOT" && find commands -name '*.md' | sort)
|
|
23
|
+
for p in "${PATTERNS[@]}"; do
|
|
24
|
+
hits=$(cd "$ROOT" && grep -nE "$p" $FILES 2>/dev/null || true)
|
|
25
|
+
[ -z "$hits" ] && ok || bad "repo-controlled script resolution matches /$p/: $hits"
|
|
26
|
+
done
|
|
27
|
+
|
|
28
|
+
# Representative swept instances must each carry the install-root-only resolution.
|
|
29
|
+
chk() { grep -qF "$2" "$ROOT/$1" && ok || bad "$1 lacks: $2"; }
|
|
30
|
+
chk commands/work-on/build/validate.md 'ANCESTRY_SCRIPT="${FORGE_ROOT:+$FORGE_ROOT/scripts/check-branch-ancestry.sh}"'
|
|
31
|
+
chk commands/quality-gate.md 'VALIDATOR="${FORGE_ROOT:+$FORGE_ROOT/scripts/validate-spec-graph.sh}"'
|
|
32
|
+
chk commands/quality-gate.md 'CONFLICT_CHECKER="${FORGE_ROOT:+$FORGE_ROOT/scripts/check-native-conflicts.sh}"'
|
|
33
|
+
chk commands/quality-gate.md 'SPEC_BASH_CHECKER="${FORGE_ROOT:+$FORGE_ROOT/scripts/check-spec-bash.sh}"'
|
|
34
|
+
chk commands/quality-gate.md 'CLASSIFIER="${FORGE_ROOT:+$FORGE_ROOT/scripts/flaky-quarantine.sh}"'
|
|
35
|
+
chk commands/review-pr.md 'CLASSIFIER="${FORGE_ROOT:+$FORGE_ROOT/scripts/flaky-quarantine.sh}"'
|
|
36
|
+
# validate.md must not name the worktree scripts dir at all (ac-1)
|
|
37
|
+
grep -qF '{WORKTREE_PATH}/scripts' "$ROOT/commands/work-on/build/validate.md" && bad "validate.md references {WORKTREE_PATH}/scripts" || ok
|
|
38
|
+
|
|
39
|
+
# Behavioral: the validate.md ancestry resolver with FORGE_ROOT unset/empty must resolve to nothing (never /scripts or ./scripts).
|
|
40
|
+
for fr in "" "/nonexistent-root"; do
|
|
41
|
+
out=$(FORGE_ROOT="$fr" bash -c 'ANCESTRY_SCRIPT="${FORGE_ROOT:+$FORGE_ROOT/scripts/check-branch-ancestry.sh}"; [ -f "$ANCESTRY_SCRIPT" ] || ANCESTRY_SCRIPT=""; printf %s "$ANCESTRY_SCRIPT"')
|
|
42
|
+
[ -z "$out" ] && ok || bad "resolver yielded '$out' for FORGE_ROOT='$fr'"
|
|
43
|
+
done
|
|
44
|
+
|
|
45
|
+
echo "spec-no-worktree-script tests: pass=$PASS fail=$FAILN"
|
|
46
|
+
[ "$FAILN" -eq 0 ]
|