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
2 changes: 1 addition & 1 deletion .github/cursor-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ the consolidated review's panel table. See [Panel integrity](#panel-integrity).
| [`prompt-edge-case.md`](prompt-edge-case.md) | Prompt for the correctness/logic review pass. |
| [`prompt-judge.md`](prompt-judge.md) | Prompt the judge model uses to consolidate panel findings into one review. |
| [`review-output-mcp.py`](review-output-mcp.py) | Dependency-free stdio MCP server. Reviewers record individual findings and finish; the judge submits the final findings array. It validates and atomically writes the normalized records consumed by later jobs. |
| [`stop-on-submit.py`](stop-on-submit.py) | Wraps each panel cell's `cursor-agent` and polls its `findings.json`. Once the file parses as a JSON object with `"status": "ok"`, the agent gets 15s to exit by itself, then SIGTERM to its process group, then SIGKILL 10s later, so a cell that has submitted exits **within 30 seconds** of submitting instead of idling to the 15-minute step cap. It only reads the file, so the artifact is byte-for-byte what the MCP tool wrote, and the stop exits 0, so the leg stays green. A missing, partial, unparseable or non-`ok` file never triggers a stop, so a cell that never submits still runs to the cap and fails its leg as before. The step cap's and a run cancel's signals reach it through the step shell's traps and are forwarded to the agent's group, which is SIGKILLed at most 5s later (exit 128+signal). Every exit path, including an agent that exits by itself, ends with SIGKILL to the group, so nothing it left running can rewrite the findings after the upload. Only a regular file of at most 8 MiB is read (no FIFO/symlink/device). |
| [`stop-on-submit.py`](stop-on-submit.py) | Wraps each panel cell's `cursor-agent` and polls its `findings.json`. Once the file parses as a JSON object with `"status": "ok"`, the agent gets 15s to exit by itself, then SIGTERM to its process group, then SIGKILL 10s later, so a cell that has submitted exits **within 30 seconds** of submitting instead of idling to the 15-minute step cap. It only reads the file, so the artifact is byte-for-byte what the MCP tool wrote, and the stop exits 0, so the leg stays green. A missing, partial, unparseable or non-`ok` file never triggers a stop, so a cell that never submits still runs to the cap and fails its leg as before. The step cap's and a run cancel's signals reach it through the step shell's traps and are forwarded to the agent's group, which is SIGKILLed at most 5s later (exit 128+signal). Every exit path, including an agent that exits by itself, ends with SIGKILL to the group, so nothing it left running can rewrite the findings after the upload. Only a regular file of at most 8 MiB is read (no FIFO/symlink/device). It also retries Cursor's transient capacity error: an agent that exits non-zero with `[resource_exhausted]` / `RetriableError` in the tail of its stderr (never its stdout, the model's own text, which the PR under review can steer) is re-run after `--retry-delays` (30s, then 90s in the workflow), each retry logged as one `::warning::` on a line of its own, naming the cell. Every attempt reads the whole prompt: the wrapper puts its stdin (`< /tmp/prompt.txt`) back at its starting offset before each retry, so the prompt must arrive as a file redirect; a stdin that cannot seek (a pipe, a tty) rules retries out. A retry needs the findings file to still be an unsubmitted record with **no** recorded findings (the MCP tool appends, so a re-run would duplicate them) and must start within `--retry-window` (300s), so the last attempt still fits the step cap. Exit 0, any other error, a signal death and a forwarded signal are never retried. |
| [`post-review.py`](post-review.py) | Reads the judge's consolidated findings and posts **one** PR review with line-anchored inline comments and severity badges. |
| [`auto-approve.py`](auto-approve.py) | Opt-in auto-approve (`approve_max_severity`): `decide` (in `post-review`) approves / requests changes / reaches no decision (withdrawing its own earlier approvals and leaving one standing REQUEST_CHANGES with the reasons and the next step, replaced by the next no-decision round and dismissed by the next approving one; none on a `capped` round, which withdraws the earlier one) per its fail-closed rules, then writes cursor-approve's status card for the outcome (via [`../cursor-approve/card.py`](../cursor-approve/card.py); no card for an author `approve_authors` does not list); `dismiss-stale` (the **Dismiss stale auto-approval** job) withdraws the bot's own approvals that are stale against the PR's live head and base (a push, a reopen, a retarget) — and every one of them while the PR carries `skip-cursor-review` or `needs-human-review` — plus its own standing REQUEST_CHANGES while the PR carries either label (re-read after the reviews are listed) or `approve_max_severity` is empty (then only once none of its approvals still stands), on every event of an open PR, whether or not `approve_max_severity` is still set; `round-cap` (the **Round cap** job, ahead of the panel) enforces `max_rounds`. On an APPROVE that survived its post-write re-check, `decide` also resolves (re-reading each first) and then replies on the posting identity's own at-or-below-threshold threads nobody else commented in (nothing, if any live thread is above the threshold); [`build-ledger.py`](build-ledger.py) never counts that reply as an answer. `decide` also writes the `approve_gate` output, and `round-cap` feeds the `round` and `max_rounds` outputs. Reads open-thread severity through `gate-unresolved.py`'s query. See [`docs/callers/cursor-review.md`](../../docs/callers/cursor-review.md#auto-approve). |
| [`gate-unresolved.py`](gate-unresolved.py) | The opt-in blocking gate (`blocking: true` → the **Blocking gate** job): queries the PR's review threads and exits non-zero while any cursor-review finding thread is unresolved and non-outdated. Dropped from `cursor-review.yml` by accident in #31 and restored by BE-4691 — see [the blocking section](#optional-make-the-review-blocking). Double-billed: [`build-ledger.py`](build-ledger.py) also imports it for `CONSOLIDATED_MARKER`, the paging `reviewThreads` GraphQL query and the `iter_threads` / `is_cursor_thread` helpers, so the gate and the ledger can never disagree about which threads are ours. |
Expand Down
Loading
Loading