Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled

Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11),
free to diverge. Tree copied sans upstream .git; upstream remote added for
future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19.
Preserves docs/ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
2026-07-05 09:36:54 +00:00
parent 3216769225
commit bedb527145
21108 changed files with 6010766 additions and 0 deletions

311
scripts/pr-lib/common.sh Normal file
View File

@@ -0,0 +1,311 @@
require_artifact() {
local path="$1"
if [ ! -s "$path" ]; then
echo "Missing required artifact: $path"
exit 1
fi
}
path_is_docsish() {
local path="$1"
case "$path" in
CHANGELOG.md|AGENTS.md|CLAUDE.md|README*.md|docs/*|*.md|*.mdx|mintlify.json|docs.json)
return 0
;;
esac
return 1
}
file_list_is_docsish_only() {
local files="$1"
local saw_any=false
local path
while IFS= read -r path; do
[ -n "$path" ] || continue
saw_any=true
if ! path_is_docsish "$path"; then
return 1
fi
done <<<"$files"
[ "$saw_any" = "true" ]
}
changelog_required_for_changed_files() {
# CHANGELOG.md is release-owned. Normal PRs carry release-note context in
# PR bodies and commit messages; release automation generates the file.
return 1
}
print_review_stdout_summary() {
require_artifact .local/review.md
require_artifact .local/review.json
require_artifact .local/pr-meta.env
# shellcheck disable=SC1091
source .local/pr-meta.env
local recommendation
recommendation=$(jq -r '.recommendation // ""' .local/review.json)
local finding_count
finding_count=$(jq '[.findings[]?] | length' .local/review.json)
echo "review summary:"
echo "pr_url=${PR_URL:-}"
echo "recommendation: $recommendation"
echo "findings: $finding_count"
cat .local/review.md
}
print_relevant_log_excerpt() {
local log_file="$1"
if [ ! -s "$log_file" ]; then
echo "(no output captured)"
return 0
fi
local filtered_log
filtered_log=$(mktemp)
if rg -n -i 'error|err|failed|fail|fatal|panic|exception|TypeError|ReferenceError|SyntaxError|ELIFECYCLE|ERR_' "$log_file" >"$filtered_log"; then
echo "Relevant log lines:"
tail -n 120 "$filtered_log"
else
echo "No focused error markers found; showing last 120 lines:"
tail -n 120 "$log_file"
fi
rm -f "$filtered_log"
}
print_unrelated_gate_failure_guidance() {
local label="$1"
case "$label" in
pnpm\ build*|pnpm\ check*|pnpm\ test*)
cat <<'EOF_GUIDANCE'
If this local gate failure already reproduces on latest origin/main and is clearly unrelated to the PR:
- treat it as baseline repo noise
- document it explicitly
- report the scoped verification that validates the PR itself
- do not use this to ignore plausibly related failures
EOF_GUIDANCE
;;
esac
}
run_quiet_logged() {
local label="$1"
local log_file="$2"
shift 2
mkdir -p .local
if "$@" >"$log_file" 2>&1; then
echo "$label passed"
return 0
fi
echo "$label failed (log: $log_file)"
print_relevant_log_excerpt "$log_file"
print_unrelated_gate_failure_guidance "$label"
return 1
}
bootstrap_deps_if_needed() {
if [ ! -x node_modules/.bin/vitest ]; then
run_quiet_logged "pnpm install --frozen-lockfile" ".local/bootstrap-install.log" pnpm install --frozen-lockfile
fi
}
wait_for_pr_head_sha() {
local pr="$1"
local expected_sha="$2"
local max_attempts="${3:-6}"
local sleep_seconds="${4:-2}"
local attempt
for attempt in $(seq 1 "$max_attempts"); do
local observed_sha
observed_sha=$(gh pr view "$pr" --json headRefOid --jq .headRefOid)
if [ "$observed_sha" = "$expected_sha" ]; then
return 0
fi
if [ "$attempt" -lt "$max_attempts" ]; then
sleep "$sleep_seconds"
fi
done
return 1
}
pr_contributor_allows_human_trailers() {
local contrib="${1:-}"
local normalized
normalized=$(printf '%s' "$contrib" | tr '[:upper:]' '[:lower:]')
case "$normalized" in
""|"null"|"app/"*|"codex"|"openclaw"|"clawsweeper"|"openclaw-clawsweeper"|"clawsweeper[bot]"|"openclaw-clawsweeper[bot]"|"steipete")
return 1
;;
esac
return 0
}
resolve_contributor_coauthor_email() {
local contrib="${1:-}"
if ! pr_contributor_allows_human_trailers "$contrib"; then
return 1
fi
local contrib_id
contrib_id=$(gh api "users/$contrib" --jq .id) || return 1
printf '%s+%s@users.noreply.github.com\n' "$contrib_id" "$contrib"
}
common_repo_root() {
if command -v repo_root >/dev/null 2>&1; then
repo_root
return
fi
local base_dir
base_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
git -C "$base_dir" rev-parse --show-toplevel
}
worktree_path_for_branch() {
local branch="$1"
local ref="refs/heads/$branch"
git worktree list --porcelain | awk -v ref="$ref" '
/^worktree / {
worktree=$2
next
}
/^branch / {
if ($2 == ref) {
print worktree
found=1
}
}
END {
if (!found) {
exit 1
}
}
'
}
worktree_is_registered() {
local path="$1"
git worktree list --porcelain | awk -v target="$path" '
/^worktree / {
if ($2 == target) {
found=1
}
}
END {
exit found ? 0 : 1
}
'
}
resolve_existing_dir_path() {
local path="$1"
if [ ! -d "$path" ]; then
return 1
fi
(
cd "$path" >/dev/null 2>&1 &&
pwd -P
)
}
is_repo_pr_worktree_dir() {
local path="$1"
local root
root=$(common_repo_root)
local worktrees_dir="$root/.worktrees"
local resolved_path
resolved_path=$(resolve_existing_dir_path "$path" 2>/dev/null || true)
if [ -z "$resolved_path" ]; then
return 1
fi
local resolved_worktrees_dir
resolved_worktrees_dir=$(resolve_existing_dir_path "$worktrees_dir" 2>/dev/null || true)
if [ -z "$resolved_worktrees_dir" ]; then
return 1
fi
case "$resolved_path" in
"$resolved_worktrees_dir"/pr-*)
return 0
;;
esac
return 1
}
remove_worktree_if_present() {
local path="$1"
if [ ! -e "$path" ]; then
return 0
fi
if worktree_is_registered "$path"; then
git worktree remove "$path" --force >/dev/null 2>&1 || true
fi
if [ ! -e "$path" ]; then
return 0
fi
if worktree_is_registered "$path"; then
echo "Warning: failed to remove registered worktree $path"
return 0
fi
if ! is_repo_pr_worktree_dir "$path"; then
echo "Warning: refusing to trash non-PR-worktree path $path"
return 0
fi
if command -v trash >/dev/null 2>&1; then
trash "$path" >/dev/null 2>&1 || {
echo "Warning: failed to trash orphaned worktree dir $path"
return 0
}
return 0
fi
echo "Warning: orphaned worktree dir remains and trash is unavailable: $path"
return 0
}
delete_local_branch_if_safe() {
local branch="$1"
local ref="refs/heads/$branch"
if ! git show-ref --verify --quiet "$ref"; then
return 0
fi
local branch_worktree=""
branch_worktree=$(worktree_path_for_branch "$branch" 2>/dev/null || true)
if [ -n "$branch_worktree" ]; then
echo "Skipping local branch delete for $branch; checked out in worktree $branch_worktree"
return 0
fi
if git branch -D "$branch" >/dev/null 2>&1; then
return 0
fi
if git update-ref -d "$ref" >/dev/null 2>&1; then
return 0
fi
echo "Warning: failed to delete local branch $branch"
return 0
}