Skip to content

feat(ci): agent-zero-release-watch — automated upstream release bump PRs via GitHub App - #3424

Open
POWERFULMOVES wants to merge 5 commits into
mainfrom
feat/agent-zero-release-watch
Open

POWERFULMOVES wants to merge 5 commits into
mainfrom
feat/agent-zero-release-watch

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

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.

  • Daily cron 06:23 UTC + workflow_dispatch
  • Probes upstream latest release → compares against our pinned gitlink SHA → opens a bump PR under the GitHub App identity (GH_APP_ID/GH_APP_SEC, per the in-repo _app-token.yml pattern — never the shared user PAT)
  • Fail-closed probes: upstream probe failure = failed job (visible, not silent)
  • Merge remains gated per closeout flow — automation opens, humans reconcile

Context

  • v2.13→v2.14 update was done manually this week (PR chore(agent-zero): bump upstream to v2.14 #3371) — this workflow prevents the next one from being manual
  • Upstream org note: frdel/agent-zero → agent0ai/agent-zero (moved); workflow pins the new canonical repo

Testing

  • YAML structure verified; probe logic mirrors the manually-executed steps this session (release probe + gitlink containment)
  • Same secret names as existing repo secrets (GH_APP_ID, GH_APP_SEC — both present since 2026-03-10)
  • Fail-closed: probe failure exits nonzero = visible red, not silent green

…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-bot

kilo-code-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized keys: "branches", "excluded_branches" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T15:11:41.802915Z e0d63ff PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the workflows GitHub Actions workflows label Oct 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +67 to +69
- uses: actions/checkout@v4
with:
fetch-depth: 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +89 to +91
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +82 to +84
git fetch --depth=50 https://github.com/agent0ai/agent-zero.git "$TAG"
NEW_SHA=$(git rev-parse FETCH_HEAD)
git checkout --detach "$NEW_SHA"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +53 to +55
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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.
@github-actions github-actions Bot added the docs Documentation label Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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 }}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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 }}';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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

Comment thread scripts/runbook_drift.py
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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:

Suggested change
ROOT = Path(__file__).resolve().parent.parent
ROOT = Path(os.environ.get("RUNBOOK_DRIFT_ROOT") or Path(__file__).resolve().parents[1]).resolve()

📏 Severity: suggestion

Comment thread scripts/runbook_drift.py
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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:

Suggested change
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

Comment thread scripts/runbook_drift.py
msg += f" ({register_skipped} AGNOTE4482PHI register file(s) matched and skipped)"
print(msg, file=sys.stderr)
sys.exit(2)
run_digest = seal(records)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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

Comment thread scripts/runbook_drift.py
# 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 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:

Suggested change
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

@kilo-code-bot

kilo-code-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Roast 🔥

Verdict: 9 Issues Found | Recommendation: Address before merge

Overview

Severity Count
🚨 critical 2
⚠️ warning 4
💡 suggestion 1
🤏 nitpick 2
Issue Details (click to expand)
File Line Roast
.github/workflows/agent-zero-release-watch.yml 80 Critical: upstream-controlled tag templated directly into bash (TAG='${{ ... }}') — shell-injection vector via Git ref names
.github/workflows/agent-zero-release-watch.yml 98 Critical: same tag interpolated into a JS string literal in github-script — second injection path in the second language
.github/workflows/agent-zero-release-watch.yml 53 Ancestry check on a 50-commit shallow fetch — false bumped=true on truncated history; fetch failures fall into the bump branch, un-verified tag
.github/workflows/agent-zero-release-watch.yml 99 No idempotency: no open-PR dedup, so daily runs re-push divergent branches or double-fire pulls.create
.github/workflows/agent-zero-release-watch.yml 34 Unauthenticated GitHub API probe rides the 60 req/hr anonymous rate-limit pool on shared runner IPs — probes will fail with red jobs from rate limiting
scripts/runbook_drift.py 38 "Portability" rewrite removed the working RUNBOOK_DRIFT_ROOT override (old code was already script-relative) — sidecar deployments now silently audit the wrong tree
scripts/runbook_drift.py 422 Jev UNDECIDED (abstention and exception path) unconditionally overwrites the filename-derived doc class — the deleted guard existed for this exact reason
scripts/runbook_drift.py 431 Removed empty-scan guard: a globs typo produces a sealed, hash-chained report verifying zero claims and exits 0
scripts/runbook_drift.py 335 JEV_MODEL_PATH override removed — nodes can no longer keep the 1 GB model off the checkout

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.

Fix these issues in Kilo Cloud


🏆 Best part: The research analysis docs are surprisingly coherent for prose shipped alongside a CI workflow — and runbook_drift.py's provenance-comment discipline (every v3 fix documents which real failure created it) is exactly the culture this review exists to protect. Oh wait, that's the part that makes the new regression so painful — the deleted guards were the good stuff.

💀 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)
  • .github/workflows/agent-zero-release-watch.yml - 5 issues
  • scripts/runbook_drift.py - 3 issues
  • research/analyses/2026-10-22_SOURCE_CORRECTION_ARK_COLEMEDIN_REVIEW.md - no code findings (docs)
  • research/analyses/2026-10-30_FIVE_LANE_REVIEW_AND_UPSTREAM_CHECK.md - no code findings (docs)

Reviewed by glm-5.3-flash · Input: 83.8K · Output: 20.6K · Cached: 245.6K

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

PMOVES automation treadmill (operator-authorized API automation): folding this branch onto current main via update-branch so CI re-evaluates against the latest base. Merge stays gated on all required checks green; no manual action needed.

@github-actions

Copy link
Copy Markdown
Contributor

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

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

PMOVES automation park - #3424 (first failure)

CI window verdict RED_REQUIRED[merge-decision=failure,python-tests=failure] at 2026-11-12T20:33:26Z on head 8c2c1b1 (artifact w3424_ci_1112d.json). Required checks at break: {"merge-decision": "failure", "python-tests": "failure", "hardening-validation": "success", "verify": "success", "submodule-gitlink-gate": "success"}. Nonparked failures: [].

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).

@github-actions

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation workflows GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant