Skip to content

fix(gate): make the review-swarm scripts executable - #172

Merged
kjgbot merged 1 commit into
mainfrom
fix/gate-scripts-executable-0905
Sep 5, 2026
Merged

fix(gate): make the review-swarm scripts executable#172
kjgbot merged 1 commit into
mainfrom
fix/gate-scripts-executable-0905

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The review check fails on every flows PR, and it is one bit

review-swarm.yml executes two of these scripts directly — swarm-prepare.sh (line 53) and swarm-post.sh (line 99) — but all three are committed mode 100644:

swarm-prepare.sh: Permission denied
Process completed with exit code 126

126 is "found but not executable" — not a missing file, not a credential fault. Since the scripts come from the immutable gate on main, this fails review on every PR in this repo.

swarm-verdict.sh is cp'd into the PR head rather than executed by this workflow; it gets the bit too for consistency as a gate script of the same kind.

How it surfaced, and the evidence it is now the real blocker

AgentWorkforce/flows had zero Actions secrets, so the review job was failing its preflight on a missing RELAY_WORKSPACE_KEY. That secret has now been added at repository scope (repository, not environment — the job declares no environment:, so an environment copy would be invisible and fail identically).

Re-running the review job on #168 as attempt 2 moved the failure exactly one step:

step before after
Validate cloud authentication failure success
Prepare review input on GitHub runner not reached failure — exit 126

So the secret fix is confirmed working, and this is what stands behind it.

Note on merging

The flows auto-merge gate keys on a 🎯 review-swarm: PASSED marker — which this PR's own change is required to produce. That is a chicken-and-egg, so this one needs a human merge rather than the usual gate.

Not fixed here

#168 also fails linux-x64-artifact (~30m), which is unrelated to this and to the secret.

🤖 Generated with Claude Code

https://claude.ai/code/session_017Ld4S9gUGzTjhVhbtX9cTd

`review-swarm.yml` executes two of these directly — `swarm-prepare.sh` at
line 53 and `swarm-post.sh` at line 99 — but all three are committed mode
100644, so the job dies with:

    swarm-prepare.sh: Permission denied
    Process completed with exit code 126

126 is "found but not executable", not a missing file or a credential fault.
Because the scripts come from the immutable gate on `main`, this fails the
`review` check on EVERY flows PR, not just the one you are looking at.

`swarm-verdict.sh` is copied into the PR head rather than executed here, but
it is a gate script of the same kind and is given the bit for consistency.

Found while verifying that adding the missing `RELAY_WORKSPACE_KEY` secret to
this repo fixed the preflight: `Validate cloud authentication` now passes and
the job fails one step later, here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ld4S9gUGzTjhVhbtX9cTd

Session-Id: fe8515ad-c2bc-4f9a-9b39-88b2ba12f73e
@kjgbot
kjgbot merged commit 733f496 into main Sep 5, 2026
1 check failed
@kjgbot
kjgbot deleted the fix/gate-scripts-executable-0905 branch September 5, 2026 10:04
kjgbot pushed a commit that referenced this pull request Sep 5, 2026
Local 3-lens preswarm review, maintainability lens, on the rebased head.
It returned REVIEW_FAILED with three blockers; all three are real.

1. The branch was reverting the swarm scripts' executable bit. It was
   cut before #172 landed, so `git diff main..HEAD` showed 100755 ->
   100644 on all three gate scripts -- the silent-merge shape where a
   clean merge undoes someone else's fix. Rebased onto main; the
   .github diff is now zero lines.

2. The release guard was an unindented IIFE. ~40 lines sat at the same
   indent as the outer body, so the boundary that decides whether work
   is covered by the release was invisible. Extracted to
   `spawn_claimed_run`, whose doc says plainly that `register` is last
   on purpose and that work added after the call is outside the
   guarantee.

3. A comment still asserted the registry repairs any claim whose run
   was never registered. That stopped being true in the previous
   commit: repair is now conditional on the boot, and the same-boot
   case is handled by `release_claim`. Rewritten to say which recovery
   applies when.

Also from the same review: replaced the `duplicate column name` message
match with a `PRAGMA table_info` probe (SQLite's wording is not a
contract), renamed the retry constants to `WAL_SWITCH_RETRY_*` so they
do not read as a general policy, moved the test module's imports back to
the top, folded the three boot-id constructions into `new_boot_id()`,
and dropped the unused path from the extracted return.

Not taken, and said out loud in the code instead: a Drop guard for the
panic window between claim and register. The gap is real -- a panic
strands the event for the life of the boot -- but a Drop that opens a
database and cannot report failure is its own mechanism, and bundling it
under an exactly-once fix would ship it unreviewed. Tracked separately.

Kernel: 148 passed, 0 failed, no warnings. Racing test 30/30 after the
refactor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
kjgbot pushed a commit that referenced this pull request Sep 5, 2026
Local 3-lens preswarm review, maintainability lens, on the rebased head.
It returned REVIEW_FAILED with three blockers; all three are real.

1. The branch was reverting the swarm scripts' executable bit. It was
   cut before #172 landed, so `git diff main..HEAD` showed 100755 ->
   100644 on all three gate scripts -- the silent-merge shape where a
   clean merge undoes someone else's fix. Rebased onto main; the
   .github diff is now zero lines.

2. The release guard was an unindented IIFE. ~40 lines sat at the same
   indent as the outer body, so the boundary that decides whether work
   is covered by the release was invisible. Extracted to
   `spawn_claimed_run`, whose doc says plainly that `register` is last
   on purpose and that work added after the call is outside the
   guarantee.

3. A comment still asserted the registry repairs any claim whose run
   was never registered. That stopped being true in the previous
   commit: repair is now conditional on the boot, and the same-boot
   case is handled by `release_claim`. Rewritten to say which recovery
   applies when.

Also from the same review: replaced the `duplicate column name` message
match with a `PRAGMA table_info` probe (SQLite's wording is not a
contract), renamed the retry constants to `WAL_SWITCH_RETRY_*` so they
do not read as a general policy, moved the test module's imports back to
the top, folded the three boot-id constructions into `new_boot_id()`,
and dropped the unused path from the extracted return.

Not taken, and said out loud in the code instead: a Drop guard for the
panic window between claim and register. The gap is real -- a panic
strands the event for the life of the boot -- but a Drop that opens a
database and cannot report failure is its own mechanism, and bundling it
under an exactly-once fix would ship it unreviewed. Tracked separately.

Kernel: 148 passed, 0 failed, no warnings. Racing test 30/30 after the
refactor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
kjgbot pushed a commit that referenced this pull request Sep 5, 2026
The previous NEXT.md asked for the cloud review-swarm to be BUILT. It was
built -- `review-swarm.yml` and its three scripts are on main and the
workflow reaches step 6 of 9. A work package describing finished work
burns whoever picks it up, and this repo has recorded that cost before.

Retargeted at what is actually broken:

  Step 6 `Launch cloud swarm`:
    agent-relay: command not found
    ##[error]Process completed with exit code 127.

The workflow calls `agent-relay cloud run` and `agent-relay cloud status`
and no step installs the CLI.

**Claim narrowed after review.** A first draft said this failed on "every
run since the gate was written". That is false and self-contradictory:
run 33959293210 died at step 5 with exit 126 (the missing exec bit) and
step 6 was SKIPPED -- a fact the same brief acknowledged two paragraphs
earlier. The supported statement is: every run that REACHED step 6 after
#172 failed with 127.

**The brief now poses the design question instead of hiding it.** On
`pull_request`, GitHub takes `.github/workflows/review-swarm.yml` from
the PR, so an install step written naively into that file is editable by
the author of the PR being judged -- re-opening the exact hole the gate's
`sparse-checkout ... ref: main` closes for its scripts. My first draft
would have had the fixer cheerfully undo the invariant the previous
package established. It now asks where the install should live and
requires an answer in the PR.

The npm lead is also demoted from assertion to something to verify: if
the package is private or differently named, an asserted recipe is a dead
end with no fallback.

**The Lead cannot do this work.** Decision #6 and the charter's second
rail put the gates that judge it outside its write scope, which is why
this is a brief and why the gate has stayed visibly broken rather than
being quietly patched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant