| name | review |
| description | Run Hard Rules compliance review on changed code. Use when code has been written and needs review before commit, or when the user asks for a code review or self-review. |
| argument-hint | ["task-name"] |
| allowed-tools | Read, Grep, Glob |
I have written code for: $ARGUMENTS
Ref: .dev-context/claude-context.md for build constraints, architecture, coding conventions, and the Hard Rules.
SELF-REVIEW (before commit)
Run through each of the Hard Rules. For each rule, provide one of:
[N/A] - Not applicable to this change
[OK] - Compliant because: [brief reason]
[FIX] - Violation found at [file:line]: [description]
COMPLIANCE TABLE
| # | Rule | Status | Notes |
|---|
| 0 | No std::shared_ptr in Seastar code | | |
| 1 | No std::mutex in metrics/query methods | | |
| 2 | No co_await inside loops (use parallel_for_each) | | |
| 3 | Null-guard all C string returns | | |
| 4 | Every container has MAX_SIZE | | |
| 5 | Timer callbacks have gate guards | | |
| 6 | Metrics deregistered first in stop() | | |
| 7 | No validation in persistence layer | | |
| 8 | Per-shard state in ShardLocalState struct | | |
| 9 | Every catch block logs at warn+ | | |
| 10 | String-to-number uses std::from_chars | | |
| 11 | Global state uses call_once/atomic | | |
| 12 | Use Seastar file I/O (no std::ifstream) | | |
| 13 | Thread-local raw new has destroy function | | |
| 14 | Force local allocation for cross-shard data | | |
| 15 | Reallocate locally before FFI across boundaries | | |
| 16 | Wrap lambda coroutines with seastar::coroutine::lambda() | | |
| 17 | Insert preemption points in loops (>100 iterations) | | |
| 18 | Every future must be awaited or explicitly handled | | |
| 19 | Use with_semaphore()/get_units(), never raw wait()/signal() | | |
| 20 | Always use auto& in do_with lambdas; prefer coroutines | | |
| 21 | Coroutines take parameters by value, not reference | | |
| 22 | Wrap throws in futurize_invoke(); prefer coroutines | | |
| 23 | Clone temporary_buffer for long-lived data, don't share() | | |
ADDITIONAL CHECKS
Async Flow Integrity
Error Handling
Memory Safety
SKEPTICAL PASS (before sign-off)
The Hard Rules table catches known anti-patterns; this pass catches what the table doesn't. Re-read the diff as a hostile reviewer who assumes it is wrong:
- Weakest change: name the single change (file:line) most likely to break, and the realistic way it fails — under load, across shards, on restart, or on malformed input. Justify why it holds, or fix it.
- Not verified statically: state what you could not confirm by reading or
grep. Anything needing a real build or run is a Deferred Gate — give the developer the exact command and the pass/fail output to look for.
OUTPUT FORMAT
Compliance Summary
Compliant: #0, #1, #3, #7, #8, #10, #11
Not Applicable: #5, #6
Violations: #2, #4, #9
Violations Requiring Fix
For each [FIX]:
Rule #2 - src/services/router.cc:156
Issue: Sequential co_await in for loop over backends
Fix: Replace with seastar::parallel_for_each
Ready to Commit?
[YES] - All rules pass, ready for commit
[NO] - Fixes required (list above)
If violations found, fix and re-run this review. Only commit when all checks pass and the skeptical pass is clean.
Then run /doc for tests and documentation.