Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/cursor-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ jobs:
| Kind | Name | Required | Purpose |
|---|---|---|---|
| Secret | `CURSOR_API_KEY` | **yes** | Bills the panel + judge `cursor-agent` calls. |
| Secret | `OPENAI_API_KEY` | no | Only with `openai_direct_model`: bills the optional direct-OpenAI cell. Use a project-scoped service-account key with a spend limit. |
| Secret | `SLACK_BOT_TOKEN` | no | Enables start/complete DMs to the triggerer. |
| Variable | `CURSOR_REVIEW_DM_EMAIL_MAP` | no | Maps GitHub logins → emails for Slack DM lookup. |

Expand Down Expand Up @@ -362,6 +363,8 @@ All optional except `workflows_ref` (required, no default) — pass them under
|---|---|---|
| `judge_model` | `claude-opus-5-5-xhigh` | Model that consolidates panel findings. |
| `panel_models` | `''` (built-in list) | JSON array of Cursor model ids that **replaces** the panel list; each still runs both review types and is validated against the live catalog by preflight. For per-repo experiments (e.g. `-xhigh` vs `-max` tiers). |
| `openai_direct_model` | `''` (off) | OPT-IN. An OpenAI model id reviewed through the OpenAI API directly (pinned Codex CLI, `package.json` here) as ONE **adversarial** cell on GitHub-hosted runners, by default **replacing** the Cursor `gpt-*` cell (next row). Needs the `OPENAI_API_KEY` secret and a plain id (`[A-Za-z0-9._-]`); without either, preflight warns and leaves the cell off and the panel unchanged. Not part of `panel_models` (not in the Cursor catalog); advisory — the leg never fails the run and is not counted in `Panel integrity` / the auto-approve gate. |
| `openai_direct_replaces_cursor_openai` | `true` | When the direct cell is in effect, drop the Cursor `gpt-*` cell(s) so the OpenAI lane is reviewed once. `false` runs both for a side-by-side backend comparison. Preflight fails rather than leave the Cursor panel empty. |
| `skip_bot_branch_prefixes` | `ci/bump- chore/refresh- auto/refresh-` | Skip the panel when the PR author is a Bot **and** the head branch starts with one of these prefixes (machine pin bumps / catalog refreshes). `''` reviews every bot PR. |
| `diff_size_cap` | `5000` | Max counted changed lines (after generated-file exclusion and comment discounting); larger PRs are skipped. |
| `ignore_comments` | `true` | Discount blank/comment-only lines from the size count (count-only; the panel still sees them). |
Expand Down
8 changes: 8 additions & 0 deletions .github/cursor-review/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "comfy-cursor-review-direct-cli",
"private": true,
"description": "Manifest whose ONLY job is to be the single, Dependabot-visible source of truth for the @openai/codex CLI version that cursor-review.yml's optional direct-API review cell installs. Nothing is ever `npm install`ed from this directory: the job reads the pin out of this file and runs `npm install -g @openai/codex@<pin>`. It is a real npm manifest rather than a workflow `env:` constant purely so Dependabot's npm ecosystem can see the pin and open a bump PR — an inline `npm install -g pkg@1.2.3` inside a `run:` step is invisible to every ecosystem, which is how the groom CLI pin silently rotted (see .github/groom/package.json, the precedent this mirrors). Keep the version EXACT (no ^ or ~): the agent CLI is executable supply chain for a step that reads untrusted repo content, and the job rejects a non-exact pin at run time.",
Comment thread
mattmillerai marked this conversation as resolved.
Resolved
"dependencies": {
"@openai/codex": "0.162.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# The guard steps. `.strip()`-compared so the assertion is about the step name,
# not about the indentation of whichever job happens to hold it.
GUARD_STEP_NAME = "- name: Require a pinned workflows_ref"
EXPECTED_GUARDS = 11
EXPECTED_GUARDS = 12

# The ledger's exempt resolver, addressed by its step id rather than its name so
# a comment rewrite above it cannot move the anchor.
Expand Down
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ updates:
default-days: 7
semver-major-days: 14

# Same pattern, same reasons, for the @openai/codex pin behind
# cursor-review.yml's opt-in direct-API cell. Its manifest installs nothing;
# the job reads the version out of it and rejects a non-exact pin at run
# time, hence `increase`. Without this entry the pin rots unwatched.
- package-ecosystem: "npm"
directory: "/.github/cursor-review"
schedule:
interval: "monthly"
labels: ["dependencies"]
versioning-strategy: "increase"
open-pull-requests-limit: 5
cooldown:
default-days: 7
semver-major-days: 14

# The PyYAML + jsonschema pins the .coderabbit.yaml validator installs
# (BE-7757). This is the repo's only Python dependency set, and it is
# hash-pinned with `--require-hashes` — which is exactly why it needs watching:
Expand Down
17 changes: 14 additions & 3 deletions .github/groom/tests/test_claude_code_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,23 @@ def test_npm_entry_watches_the_groom_manifest(self):
# checks would still pass if the npm block were moved off the manifest
# while some other ecosystem entry happened to point at
# `/.github/groom`, masking exactly the regression this guards.
self._assert_one_exact_npm_entry("/.github/groom")

def test_npm_entry_watches_the_cursor_review_manifest(self):
# The same contract for cursor-review.yml's direct-API cell pin
# (`@openai/codex`), whose manifest mirrors groom's.
self._assert_one_exact_npm_entry("/.github/cursor-review")

def _assert_one_exact_npm_entry(self, directory):
entries = _dependabot_entries(_read(_DEPENDABOT))
npm = [e for e in entries if e.get("package-ecosystem") == "npm"]
npm = [
e for e in entries
if e.get("package-ecosystem") == "npm" and e.get("directory") == directory
]
self.assertEqual(
1, len(npm), f"expected exactly one npm entry, found {len(npm)}"
1, len(npm),
f"expected exactly one npm entry for {directory}, found {len(npm)}",
)
self.assertEqual("/.github/groom", npm[0].get("directory"))
# The workflow guard rejects a range at run time, so the updater must be
# told to keep an exact requirement exact rather than widening it.
self.assertEqual("increase", npm[0].get("versioning-strategy"))
Expand Down
8 changes: 6 additions & 2 deletions .github/workflow-pins/tests/test_check_workflow_pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3504,7 +3504,7 @@ def test_this_repos_own_workflows_guard_every_ref_checkout(self):
self.assertEqual(cwp.find_unguarded_ref_checkouts(lines), [], name)
self.assertEqual(
seen,
22,
23,
"expected the 12 guarded sites BE-5546 fixed + pr-size.yml's (BE-5858) "
"+ cursor-review.yml's preflight (hard guard) site picked up merging "
"main + cursor-review.yml's diff-size job's check-pr-size-tool "
Expand Down Expand Up @@ -3535,7 +3535,11 @@ def test_this_repos_own_workflows_guard_every_ref_checkout(self):
"byte-identical copy of cursor-review.yml's guard. The 22nd is "
"cursor-review.yml's `auto-retry` job (BE-19526): the round's "
"relabel runs last, loads auto-approve.py from `workflows_ref` in "
"its own job, and carries its own copy of the guard.",
"its own job, and carries its own copy of the guard. The 23rd is "
"cursor-review.yml's opt-in `review-openai-direct` job (BE-19639): "
"the direct-OpenAI cell loads its prompt, fence-diff.py and "
"review-output-mcp.py from `workflows_ref` in its own job and "
"carries its own copy of the guard.",
)

WORKFLOWS_DIR = os.path.normpath(
Expand Down
Loading
Loading