Review
Arguments
$0 (required): PR number, branch name, or diff spec (for example 1234, my-branch, HEAD~3..HEAD)
Gather the change first
If $0 is a PR number:
gh pr view "$0" --json title,body,baseRefName,headRefName,url
gh pr diff "$0"
If $0 is a branch name:
git diff origin/develop..."$0"
git log --oneline origin/develop.."$0"
If $0 is a diff spec:
git diff "$0"
git log --oneline "$0"
Read surrounding file context when the diff alone is insufficient.
Review priorities
- Correctness and safety
- Streaming semantics and state recovery
- Compatibility and user-visible behavior
- Performance and resource usage
- Maintainability
Proton-specific checklist
- Streaming mode semantics are preserved:
SELECT FROM stream remains continuous.
SELECT FROM table(stream) remains historical/batch.
- Stateful processors and materialized views preserve
hasState(), checkpoint(), and recover() invariants when touched.
_tp_time, _tp_delta, window columns, and EMIT behavior stay internally consistent.
- Proton fences are used only in upstream-synced code and never in
src/Storages/Stream/ or namespace DB::Streaming.
- Cluster dependency boundaries remain acyclic; read surrounding module context when touched code crosses modules.
- Parser, AST, serialization, metadata, and storage format changes include compatibility reasoning and tests.
- Query-plan or processor changes do not introduce hidden blocking work in
prepare() paths.
- Join/window/aggregation changes do not create obvious unbounded state growth or watermark regressions.
- User-visible SQL behavior changes include tests and docs updates when appropriate.
What to look for
Correctness
- Wrong query results, dropped rows, duplicate rows, or broken changelog semantics
- Incorrect watermark or window-close behavior
- Missing cleanup on error paths
- Lifetime bugs, invalid references, iterator invalidation, or ownership confusion
Concurrency and recovery
- Shared mutable state without synchronization
- Deadlock-prone lock ordering changes
- Checkpoint/recover mismatches
- State mutations hidden in code paths that should stay deterministic or replay-safe
Performance
- Allocations or copies in hot streaming paths
- New per-event work in
prepare()
- Unbounded maps/vectors keyed by user data
- Regressions in joins, windows, aggregation, or WAL/historical handoff
Maintainability
- Logic duplicated across streaming and historical paths
- New magic constants that should be settings
- Heavy includes or non-trivial implementations pushed into widely included headers
Tests expectation
For behavior changes, look for the smallest set that proves safety and the issue-specific regression path when an issue fix is claimed:
- Issue-specific regression test, or explicit justification if it is infeasible
- Positive path test
- Negative/error-path test
- Recovery or restart test when state/checkpointing is involved
- Streaming SQL regression test for user-visible semantics
Output format
Findings
List findings first, ordered by severity.
Blocker - correctness, corruption, crash, data loss, invalid recovery, major compatibility break
Major - realistic bug risk, missing important tests, strong performance regression
Minor - clarity or robustness issue that should be fixed but is not merge-blocking
Each finding should include:
- file and line
- concrete impact
- why it is a real problem
- smallest reasonable fix
Then include
- Missing context
- Test coverage assessment
- Proton-specific compliance notes
- Final verdict:
Approve, Request changes, or Block
Review rules
- Be strict on real bugs, not style noise.
- Ignore pure formatting-only diffs.
- Prefer no comment over a weak or speculative comment.
- When no meaningful findings exist, state that explicitly and mention residual risk or missing evidence.
1---2name: review3description: Review a Proton pull request or diff for correctness, streaming semantics, checkpointing, compatibility, and performance. Make sure to use this skill whenever the user mentions reviewing code, checking changes, PR feedback, or wants an opinion on a diff, even if they just say 'look at this PR' or 'is this change safe'.4---56# Review78## Arguments910- `$0` (required): PR number, branch name, or diff spec (for example `1234`, `my-branch`, `HEAD~3..HEAD`)1112## Gather the change first1314If `$0` is a PR number:1516```bash17gh pr view "$0" --json title,body,baseRefName,headRefName,url18gh pr diff "$0"19```2021If `$0` is a branch name:2223```bash24git diff origin/develop..."$0"25git log --oneline origin/develop.."$0"26```2728If `$0` is a diff spec:2930```bash31git diff "$0"32git log --oneline "$0"33```3435Read surrounding file context when the diff alone is insufficient.3637## Review priorities38391. Correctness and safety402. Streaming semantics and state recovery413. Compatibility and user-visible behavior424. Performance and resource usage435. Maintainability4445## Proton-specific checklist4647- Streaming mode semantics are preserved:48 - `SELECT FROM stream` remains continuous.49 - `SELECT FROM table(stream)` remains historical/batch.50- Stateful processors and materialized views preserve `hasState()`, `checkpoint()`, and `recover()` invariants when touched.51- `_tp_time`, `_tp_delta`, window columns, and EMIT behavior stay internally consistent.52- Proton fences are used only in upstream-synced code and never in `src/Storages/Stream/` or `namespace DB::Streaming`.53- Cluster dependency boundaries remain acyclic; read surrounding module context when touched code crosses modules.54- Parser, AST, serialization, metadata, and storage format changes include compatibility reasoning and tests.55- Query-plan or processor changes do not introduce hidden blocking work in `prepare()` paths.56- Join/window/aggregation changes do not create obvious unbounded state growth or watermark regressions.57- User-visible SQL behavior changes include tests and docs updates when appropriate.5859## What to look for6061### Correctness6263- Wrong query results, dropped rows, duplicate rows, or broken changelog semantics64- Incorrect watermark or window-close behavior65- Missing cleanup on error paths66- Lifetime bugs, invalid references, iterator invalidation, or ownership confusion6768### Concurrency and recovery6970- Shared mutable state without synchronization71- Deadlock-prone lock ordering changes72- Checkpoint/recover mismatches73- State mutations hidden in code paths that should stay deterministic or replay-safe7475### Performance7677- Allocations or copies in hot streaming paths78- New per-event work in `prepare()`79- Unbounded maps/vectors keyed by user data80- Regressions in joins, windows, aggregation, or WAL/historical handoff8182### Maintainability8384- Logic duplicated across streaming and historical paths85- New magic constants that should be settings86- Heavy includes or non-trivial implementations pushed into widely included headers8788## Tests expectation8990For behavior changes, look for the smallest set that proves safety and the issue-specific regression path when an issue fix is claimed:9192- Issue-specific regression test, or explicit justification if it is infeasible93- Positive path test94- Negative/error-path test95- Recovery or restart test when state/checkpointing is involved96- Streaming SQL regression test for user-visible semantics9798## Output format99100### Findings101102List findings first, ordered by severity.103104- `Blocker` - correctness, corruption, crash, data loss, invalid recovery, major compatibility break105- `Major` - realistic bug risk, missing important tests, strong performance regression106- `Minor` - clarity or robustness issue that should be fixed but is not merge-blocking107108Each finding should include:109110- file and line111- concrete impact112- why it is a real problem113- smallest reasonable fix114115### Then include116117- Missing context118- Test coverage assessment119- Proton-specific compliance notes120- Final verdict: `Approve`, `Request changes`, or `Block`121122## Review rules123124- Be strict on real bugs, not style noise.125- Ignore pure formatting-only diffs.126- Prefer no comment over a weak or speculative comment.127- When no meaningful findings exist, state that explicitly and mention residual risk or missing evidence.