Repository navigation
feat(ci): agent-zero-release-watch — automated upstream release bump PRs via GitHub App - #3424
POWERFULMOVES wants to merge 5 commits into
Conversation
…PRs via GitHub App Daily cron: probes agent0ai/agent-zero latest release vs our PMOVES-Agent-Zero gitlink; opens a bump PR under the GitHub App identity (GH_APP_ID/GH_APP_SEC per _app-token.yml pattern) when upstream advances. Fail-closed probes (probe failure = failed job, visible); merge remains gated per closeout flow. Closes the automation gap: v2.13->v2.14 was manual.
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0d63ff30f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
Initialize the submodule in the bump job
When a stale release reaches this job, this checkout leaves PMOVES-Agent-Zero uninitialized because actions/checkout documents that its submodules input defaults to false, unlike the checkout in check-release. Consequently cd PMOVES-Agent-Zero fails before the gitlink can be updated; enable submodule checkout here or explicitly initialize this path.
Useful? React with 👍 / 👎.
| git commit -m "chore(submodule): bump PMOVES-Agent-Zero to upstream $TAG" \ | ||
| -m "Automated by the Agent-Zero Release Watch workflow (GitHub App identity). Release notes: https://github.com/agent0ai/agent-zero/releases/tag/$TAG" | ||
| git push origin "HEAD:refs/heads/chore/agent-zero-bump-$TAG" |
There was a problem hiding this comment.
Authenticate the branch push with the App token
When the job reaches this push, Git still uses the credential persisted by the earlier checkout, which is the workflow GITHUB_TOKEN restricted to contents: read; minting the App token afterward does not replace that credential, so the push is denied and the PR step never runs. The checkout action documents that it persists its input token for subsequent Git commands, while the App-token action demonstrates passing its output to checkout; configure the App token for this push or perform checkout with it.
Useful? React with 👍 / 👎.
| git fetch --depth=50 https://github.com/agent0ai/agent-zero.git "$TAG" | ||
| NEW_SHA=$(git rev-parse FETCH_HEAD) | ||
| git checkout --detach "$NEW_SHA" |
There was a problem hiding this comment.
Sync the hardened fork before moving the gitlink
When the latest tag is absent from the fork—the condition that starts this job—these lines point the gitlink directly at the raw agent0ai/agent-zero release commit. .gitmodules defines this submodule as POWERFULMOVES/PMOVES-Agent-Zero on PMOVES.AI-Edition-Hardened, so the resulting checkout omits the PMOVES integration and hardening commits even though the PR text claims they are reapplied. Sync and land the release in the hardened fork first, then update the parent gitlink to that fork commit.
AGENTS.md reference: AGENTS.md:L231-L233
Useful? React with 👍 / 👎.
| if git -C PMOVES-Agent-Zero merge-base --is-ancestor "$TAG" origin/main; then | ||
| echo "bumped=false" >> "$GITHUB_OUTPUT" | ||
| echo "upstream $TAG already contained in fork main — nothing to do" |
There was a problem hiding this comment.
Compare the release against the pinned gitlink
When the fork's main has already imported a release but the parent repository still pins an older hardened commit, this condition emits bumped=false and never opens the required gitlink bump. The extracted PINNED SHA is used only for a warning above, so the workflow does not actually implement its stated check that the pinned submodule contains the tag; test whether $TAG is an ancestor of $PINNED (after the hardened fork has been synced) rather than whether it is present on origin/main.
Useful? React with 👍 / 👎.
… finding) + five-lane review doc + source-correction ark review ROOT was hardcoded to the sidecar path — broke Windows host runs. Now derives from script location. 5090 parity run: 152 claims -> 114 V / 37 D / 1 U (host clone corpus diverged from sidecar — real parity signal). Cole Medin RAG review + source correction ark review included.
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 7 files / VERIFIED 99 / UNDECIDED 61 / digest aa25aa6766c2 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest d3e1d78ecc7b Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
|
|
||
| - name: Update submodule gitlink to release commit | ||
| run: | | ||
| TAG='${{ needs.check-release.outputs.tag }}' |
There was a problem hiding this comment.
🔥 The Roast: TAG='${{ needs.check-release.outputs.tag }}' injects an upstream-controlled release tag straight into a bash script with single quotes as the only body armor. Git refs legally allow $(, ;, backticks and quotes, so a future upstream release — or a compromised upstream repo — with a creative tag name executes arbitrary code inside this workflow. The PR body cites an "upstream trust rule" while the script performs unquoted, untrusted-input interpolation; that's exactly how trust rules die.
🩹 The Fix: Set env:\n TAG: ${{ needs.check-release.outputs.tag }} on the step and consume it as "$TAG" — never template the tag into the script text.
📏 Severity: critical
| with: | ||
| github-token: ${{ steps.app-token.outputs.token }} | ||
| script: | | ||
| const tag = '${{ needs.check-release.outputs.tag }}'; |
There was a problem hiding this comment.
🔥 The Roast: const tag = '${{ needs.check-release.outputs.tag }}' — same injection, JavaScript edition. A tag containing a single quote smashes out of the string literal and the remainder executes in the github-script runner context. Two jobs, two languages, one identical mistake: templating untrusted remote data into executable code. The sequel is never the good one.
🩹 The Fix: const tag = process.env.TAG; with env:\n TAG: ${{ needs.check-release.outputs.tag }} on the step.
📏 Severity: critical
| # upstream tag contained in fork main? | ||
| git -C PMOVES-Agent-Zero fetch --depth=50 origin tag "$TAG" 2>/dev/null || \ | ||
| git -C PMOVES-Agent-Zero fetch --depth=50 https://github.com/agent0ai/agent-zero.git "$TAG" | ||
| if git -C PMOVES-Agent-Zero merge-base --is-ancestor "$TAG" origin/main; then |
There was a problem hiding this comment.
🔥 The Roast: merge-base --is-ancestor "$TAG" origin/main after fetch --depth=50 is an ancestry verdict rendered from truncated history: if the merge base is older than the 50 fetched commits, --is-ancestor reports false and you emit a false bumped=true — daily bump PRs forever. And because both fetches are swallowed (2>/dev/null) and the tag is never verified to exist, a failed fetch still falls into the bumped=true branch of a workflow billing itself as "fail-closed". Impressive commitment to the bit.
🩹 The Fix: After fetching, verify the object resolves (git -C PMOVES-Agent-Zero rev-parse -q --verify "$TAG^{commit}" || exit 1) and unshallow enough history (or drop --depth) before trusting any ancestry result.
📏 Severity: warning
| github-token: ${{ steps.app-token.outputs.token }} | ||
| script: | | ||
| const tag = '${{ needs.check-release.outputs.tag }}'; | ||
| await github.rest.pulls.create({ |
There was a problem hiding this comment.
🔥 The Roast: The workflow checks whether upstream advanced, but never checks whether it already opened the PR for it. No query for an existing open PR with head chore/agent-zero-bump-${tag} — so while PR #1 sits open (or after it merges, since the fork never advances), tomorrow's run re-pushes a divergent branch (non-fast-forward → red job) or double-fires pulls.create (422 → red job). An automation that can't recognize its own work products is a subscription to daily failures.
🩹 The Fix: Before creating, call github.rest.pulls.list({ owner, repo, head: ${context.repo.owner}:chore/agent-zero-bump-${tag} }) and exit the no-op path when an open PR already exists.
📏 Severity: warning
| - name: Latest upstream release | ||
| id: latest | ||
| run: | | ||
| TAG=$(curl -sf https://api.github.com/repos/agent0ai/agent-zero/releases/latest | jq -r '.tag_name') |
There was a problem hiding this comment.
🔥 The Roast: An unauthenticated api.github.com probe from a shared runner IP rides the 60-requests-per-hour unauthenticated pool — shared with every stranger on that IP range. When it 403s, the "fail-closed" design dutifully paints the daily job red. So the first scheduled outage of this workflow will be GitHub's rate limiter, not anything you can fix by staring at it.
🩹 The Fix: Pass -H "Authorization: Bearer ${{ github.token }}" on the curl (fine for public-data reads, ~1000 req/hr).
📏 Severity: nitpick
| ROOT = Path(os.environ.get("RUNBOOK_DRIFT_ROOT") or Path(__file__).resolve().parents[1]).resolve() | ||
| # portable: derive from script location (works on any node's clone; parity wave 10-26 | ||
| # caught the hardcoded sidecar path breaking Windows host runs) | ||
| ROOT = Path(__file__).resolve().parent.parent |
There was a problem hiding this comment.
🔥 The Roast: Plot twist: the old default was already script-relative (parents[1]). This "portable" rewrite fixes nothing and deletes a working feature — RUNBOOK_DRIFT_ROOT, the documented mechanism the A0 sidecar uses to audit a different tree. Any deployment still setting that override now silently audits the wrong directory, with no error and no hint. The commit message says the hardcoded sidecar path broke Windows; the sidecar path was never hardcoded — it was an optional override. You've fixed a bug that lives only in the commit message.
🩹 The Fix:
| ROOT = Path(__file__).resolve().parent.parent | |
| ROOT = Path(os.environ.get("RUNBOOK_DRIFT_ROOT") or Path(__file__).resolve().parents[1]).resolve() |
📏 Severity: suggestion
| jdc = jev_classify_doc(jev[0], jev[1], text) | ||
| if jdc != "UNDECIDED": | ||
| dc = jdc | ||
| dc = jev_classify_doc(jev[0], jev[1], text) # model replaces heuristic when live |
There was a problem hiding this comment.
🔥 The Roast: jev_classify_doc returns "UNDECIDED" on abstention and on any internal exception, and this line now assigns that unconditionally — overwriting doc_class(rel), which correctly tagged a DRAFT file from its filename milliseconds earlier. The deleted comment said it perfectly: "an abstention must not erase what the filename already says." You removed the guard, the comment, and the reason in one stroke. Efficiency.
🩹 The Fix:
| dc = jev_classify_doc(jev[0], jev[1], text) # model replaces heuristic when live | |
| jdc = jev_classify_doc(jev[0], jev[1], text); dc = jdc if jdc != "UNDECIDED" else dc |
📏 Severity: warning
| msg += f" ({register_skipped} AGNOTE4482PHI register file(s) matched and skipped)" | ||
| print(msg, file=sys.stderr) | ||
| sys.exit(2) | ||
| run_digest = seal(records) |
There was a problem hiding this comment.
🔥 The Roast: The files_scanned == 0 guard was deleted, so a --globs typo now produces a cryptographically sealed, hash-chained report that verifies zero claims and exits 0. An audit that audits nothing but arrives notarized. In a repository whose own doctrine declares "confident-wrong is the only unacceptable failure," this is a confident-empty.
🩹 The Fix: Re-add the check before seal(records): when files_scanned == 0, print the globs and ROOT to stderr and sys.exit(2) so the empty scan is visible, not sealed.
📏 Severity: warning
| # JEV_MODEL_PATH lets a node keep the 1 GB model off the checkout (SPARK: 4TB drive). | ||
| JEV_MODEL = Path(os.environ.get("JEV_MODEL_PATH") | ||
| or ROOT / "research/models/agentjev/agentjev_0.6b_int8.onnx") | ||
| JEV_MODEL = ROOT / "research/models/agentjev/agentjev_0.6b_int8.onnx" |
There was a problem hiding this comment.
🔥 The Roast: JEV_MODEL_PATH is gone, so nodes can no longer keep the 1 GB ONNX model off the checkout — the exact SPARK 4TB-drive trade-off the deleted comment documented. The lookup now silently insists the model live inside the repo, on every node.
🩹 The Fix:
| JEV_MODEL = ROOT / "research/models/agentjev/agentjev_0.6b_int8.onnx" | |
| JEV_MODEL = Path(os.environ.get("JEV_MODEL_PATH") or ROOT / "research/models/agentjev/agentjev_0.6b_int8.onnx") |
📏 Severity: nitpick
Code Review Roast 🔥Verdict: 9 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
Note: four independent P1 findings from another reviewer (submodule init in bump job, App-token git push auth, hardened-fork sync before gitlink move, compare-vs-pinned-SHA logic) are already active on this PR at the same lines and are not duplicated here — they stand as valid. 🏆 Best part: The research analysis docs are surprisingly coherent for prose shipped alongside a CI workflow — and 💀 Worst part: An automation workflow whose entire purpose is security-hygiene automation injects an upstream-controlled release tag into bash and JavaScript without any input validation — the workflow is the attack surface it watches for. 📊 Overall: The intent (automate the bump, gate the merge) is genuinely sound; the execution trusted the internet exactly once too often. Fail-open probes in a self-described fail-closed workflow — the irony is load-bearing. Files Reviewed (4 files)
Reviewed by glm-5.3-flash · Input: 83.8K · Output: 20.6K · Cached: 245.6K |
|
PMOVES automation treadmill (operator-authorized API automation): folding this branch onto current |
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 87a69e177fb5 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
|
PMOVES automation park - #3424 (first failure) CI window verdict Main-inheritance check on anchor 6b0fcdb: python-tests=ABSENT_on_main; merge-decision=ABSENT_on_main -> main-inheritance undetermined (no completed python-tests on main anchor). Compose tripwire scan: CLEAR. Parked without merge; no fix attempted (zero-discretion park rule; operator-authorized API automation campaign, board t_8a012804). |
ORGSIM-MIRROR drift check (advisory, fail-soft)vv3 / 8 files / VERIFIED 124 / DRIFTED 10 / UNDECIDED 29 / digest 3c5ccc9da520 Zero-LLM deterministic audit - unreachable = UNDECIDED, never dead - scripts/runbook_drift.py |
What
Closes the automation gap the operator flagged ("update to latest release was to be automated via github app"): a daily workflow that watches agent0ai/agent-zero releases and auto-opens a submodule bump PR when upstream advances past our PMOVES-Agent-Zero pin.
Context
Testing