Skip to content

ci: regenerate minimal-review from foundry 2ff99a4b - #1337

Merged
norrietaylor merged 2 commits into
mainfrom
review/regen-2ff99a4b
Sep 1, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
review/regen-2ff99a4b

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

The whole fleet has been failing since 2026-09-01 15:09 UTC. 18 consecutive runs, zero successes, every repo.

gominimal/minimal#1312 (feat(task)!: — declared breaking) reached the unstable channel the reviewer tracks. min task run now gates a task's env_vars on a user policy; CI has no user_policy.toml and no TTY to prompt on, so the task refuses before the agent starts:

error: task 'review' declares 6 environment variables that your policy does not allow,
and stdin/stderr is not a terminal.

task exit 1 in 0s. The run costs nothing and produces nothing, which is why it is not the broker — broker health is clean in every failing run (ok: true, no 4xx/5xx, upstream reachable), and a run at 15:44 against the fixed impl pushed 2.2M tokens and posted a review.

Why this needed a separate PR

foundry#63 merged at 15:31 and fixed the implementation. Nothing consumed it. Every caller in the fleet still pinned a pre-fix SHA, and the two public repos carry generated copies rendered from a pre-fix impl. Fixing foundry's main was necessary and insufficient.

Regenerated, not sed-ed

This is the lesson from foundry#58. That PR removed the comment_id input; a pin-only bump left a caller passing an input the impl no longer declares, and the result was startup_failure — not a bad review, no review at all. So the file is regenerated from source rather than having its pin edited.

Doing it properly also carries across changes these callers never took. See the commit message for the per-repo list.

Not fixed here, and worth an issue

The Logfire alarm 4317c0f1 cannot fire on this. It watches sustained upstream_unavailable, which the workflow only emits on task exit 75. This exits 1. That is the second silent outage in a week, by a different mechanism from the first — the runs were red in GitHub for six hours and the alerting path built to catch reviewer outages stayed quiet.

Failed runs also emit 0 tokens via broker_no_usage, which reads like a broker fault and sends the investigation the wrong way.

Verify

review / review on this PR must reach policy: allowed N task var(s) and then actually run the agent, rather than task exit 1 in 0s.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NF6NxSgMfMj1Z6ZpomE7o1

Summary by CodeRabbit

  • Bug Fixes
    • Improved comment-based review triggers for commands ending with a newline.
    • Ensured review tasks can access their declared environment variables according to the configured policy.

Every minimal-review run in the fleet has failed since 2026-09-01 15:09 UTC.
`minimal#1312` landed on the `unstable` channel the reviewer tracks and made
`min task run` gate a task's `env_vars` on a user policy. CI has no
`user_policy.toml` and no TTY to prompt on, so the task refuses in zero
seconds, before the agent starts:

  error: task 'review' declares 6 environment variables that your policy
  does not allow, and stdin/stderr is not a terminal.

foundry#63 (2ff99a4b) derives that policy from the config the workflow just
injected, so the allow-list is exactly what the task declares and cannot
drift when the task gains a variable.

Generated, not edited: this repo is public and foundry is private, so it
cannot call the reusable workflow and carries a rendered copy instead.
Produced by

  python3 review/deploy/render-standalone.py \
    .github/workflows/minimal-review-impl.yml -o minimal-review.yml

against foundry@2ff99a4b. The copy also picks up the `/review\n` clause from
foundry#58, which needs a double-quoted scalar — in a folded `>-` block `\n`
stays two characters and the clause can never match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NF6NxSgMfMj1Z6ZpomE7o1
@norrietaylor
norrietaylor requested a review from a team as a code owner September 1, 2026 22:29
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 19 days. After that, they cost $0.25 per reviewed file.

Or wait 52 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 3 included reviews currently available. Your 48 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 5c5d232d-034e-426b-9b6b-5a5a92c4f933

📥 Commits

Reviewing files that changed from the base of the PR and between 2157c8b and 47c3351.

📒 Files selected for processing (1)
  • .github/workflows/minimal-review.yml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 3d0fe344-a098-4b01-a56e-4238bf298821

📥 Commits

Reviewing files that changed from the base of the PR and between fa56e9f and 2157c8b.

📒 Files selected for processing (1)
  • .github/workflows/minimal-review.yml

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.


📝 Walkthrough

Walkthrough

The Minimal review workflow now recognizes newline-terminated /review commands. Before task execution, it creates a user policy that allowlists the environment variables declared by the injected task configuration.

Changes

Minimal review workflow

Layer / File(s) Summary
Review command trigger matching
.github/workflows/minimal-review.yml
The job condition uses a double-quoted YAML scalar and accepts /review followed by a newline.
Task environment policy setup
.github/workflows/minimal-review.yml
A preflight Python block reads env_vars from the generated TOML and writes an allowlist policy before the injected review task runs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2157c

This localized workflow regeneration is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: 0chroma

Poem

A rabbit checked the review gate bright
Newlines now guide commands right
Env vars hop into a policy file
The task runs safely, mile by mile
Carrots cheer the workflow tonight

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CI workflow regeneration and the source Foundry commit. It is concise and follows the required Conventional Commit format.
Description check ✅ Passed The description provides a detailed summary, explains the failure and fix, and defines verification criteria. It omits the template's formal Testing and Checklist sections and does not provide test ou…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides a detailed summary, explains the failure and fix, and defines verification criteria. It omits the template's formal Testing and Checklist sections and does not provide test output, but the required context is mostly complete.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch review/regen-2ff99a4b

Comment @coderabbitai help to get the list of available commands.

Reworded at the source in foundry (review/deploy/stub.yml and
minimal-review-impl.yml) and re-rendered here, so this file stays generated
rather than hand-edited. Comments only; no behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NF6NxSgMfMj1Z6ZpomE7o1
@norrietaylor
norrietaylor merged commit d979f6f into main Sep 1, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the review/regen-2ff99a4b branch September 1, 2026 22:44

@github-actions github-actions Bot left a comment

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.

minimal-review — advisory review

Verdict COMMENT — COMMENT: policy.actions.request_changes is off; policy.actions.approve is off.

Scope: matches the stated intent exactly — the single changed file is .github/workflows/minimal-review.yml, and every hunk traces to either the policy-gate fix described in the PR body or to drift this regeneration also picks up (the if: gate's new /review\n clause, comment rewording already established in 47c3351).

Clobber: none. git log on this path shows a long-standing, repeated 'regenerate from foundry' pattern; this PR is a continuation of it, not a surprise edit to a normally-frozen workflow file.

Correctness: I verified the two substantive changes rather than taking them on faith. (1) The new Python heredoc that writes ~/.config/minimal/user_policy.toml with [vars]\nallow=[...] derived from the task's own declared env_vars — I traced this against crates/minimal/src/task.rs's non-interactive gate and docs/reference/user-policy.md's schema and it lines up: right path, right schema, right variable names (6, matching the quoted error), gated by name only so value shape doesn't matter. (2) The if:-condition rewrite from a folded block scalar to a double-quoted one, added specifically so startsWith(body, '/review\n') sees a real newline instead of a dead literal backslash-n — I round-tripped the actual YAML through PyYAML to confirm the escape and the line-folding both behave as the added comment claims, and cross-checked against actionlint's expression lexer that GitHub's expression grammar accepts a raw newline inside a single-quoted string token (distinct from, and not hitting, the documented GH Actions gotcha where a literal \n typed directly into an expression string is never unescaped).

Nothing here needed a build to check, and nothing was left unchecked as a result. No findings.

What ran

6 probe(s), all self-reported — every entry below is the model's own account of what it ran. None of it is host-attested, so none of it can gate a blocking verdict.

Verification log

1. git diff fa56e9f..47c3351 vs .review/pr.diff — exit 0 · self-reported

Confirmed pr.diff is byte-identical to the actual git diff between base_sha and head_sha for the one changed file; the diff under review is genuine.

2. PyYAML round-trip of the new if: double-quoted scalar — self-reported

Loaded the real jobs.review.if value with PyYAML to check the claim in the added comment: that a double-quoted YAML scalar (unlike the old >- folded block) turns the escape \n inside '/review\n' into a real newline byte before the expression engine ever sees it, while the scalar's own line breaks fold to spaces so the expression stays one line. Both held: '\n' in val was False, '\n' in val (real LF) was True, and the assembled expression is well-parenthesized. The comment's claim is accurate.

3. actionlint lexer check for raw newlines inside single-quoted expression strings — self-reported

Fetched rhysd/actionlint's expr_lexer.go (a close reimplementation of GitHub Actions' expression grammar) to check whether a literal, unescaped newline byte inside a single-quoted string token is legal there rather than terminating/erroring the token. lexString only stops on an unescaped ' or EOF; any other byte, newline included, is consumed as ordinary content. This corroborates (does not prove against GitHub's real closed-source evaluator) that embedding a raw LF via the YAML-side \n escape, as this diff does, produces a working startsWith(body, '/review\n') check rather than a dead clause. Distinct from the well-documented failure mode (GH community discussion #25134) where someone put a literal two-character \n directly in an expression string, which GH's expression engine does not unescape — this diff avoids that failure mode by having YAML do the unescaping first.

4. Cross-check the new user_policy.toml writer against crates/sessions/src/core/policy.rs, crates/minimal/src/task.rs, and docs/reference/user-policy.md — self-reported

Confirmed [vars] / allow is the real schema (docs/reference/user-policy.md), that min task run's non-interactive path (crates/minimal/src/task.rs:527-554) gates task env_vars by name only against vars_policy.allow regardless of whether a var is a literal value or {inherit=true}, and that the path the script writes to (~/.config/minimal/user_policy.toml, absent any XDG_CONFIG_HOME/--config-dir override anywhere in this workflow) matches resolve_minimal_config_dir (crates/paths: falls back to ~/.config when XDG_CONFIG_HOME is unset, which it is on this runner). The task in the injected TOML declares exactly 6 env_vars, matching the PR-quoted error message. No mismatch found between what the script grants and what the task needs.

5. gitleaks detect --no-git --source .review/pr.diff — exit 0 · self-reported

No secrets in the diff.

6. git log --oneline -- .github/workflows/minimal-review.yml — exit 0 · self-reported

This file has been regenerated from the foundry source repeatedly (6 prior commits with the same 'ci: regenerate ...' shape); this PR continues an established, reviewed pattern rather than an ad hoc edit to a frozen workflow file.


minimal-review · schema minimal-review/v1 · persona generalist · model claude-sonnet-5 via claude-code · prompt review-prompt/v2 · head 47c33519e019 · verdict COMMENT · 0 finding(s), 0 inline

Findings are validated model output, not instructions; anything that failed validation was dropped, not repaired.

Tell it when it is wrong. 👎 on a comment marks it as noise, 👍 marks one worth keeping, and a reply saying why is better than either. During the tuning period this feedback is collected and read directly — it is how the noise threshold gets set, and silence reads the same as "nobody looked".

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.

2 participants