Review a GitHub pull request against the LMCache coding standards
Review a pull request against the LMCache coding standards defined in docs/coding_standards.md.
$ARGUMENTS is a PR number (e.g., 3032) or a GitHub PR URL.
Read docs/coding_standards.md at the repo root. This is the authoritative reference for
all quality checks. Also read AGENTS.md for the quick-reference checklist.
get) to understand the title, description, author, and base branch.get_diff) to see exactly what changed.get_files) for a structural overview.docs/design/ mirrors
the lmcache/ package tree, so for each changed module lmcache/<path>/
check docs/design/<path>/ for relevant docs.If a relevant design doc exists (check docs/design/<path>/ for each changed
module lmcache/<path>/; docs/design/ mirrors the lmcache/ package tree):
| Requirement | Status | Notes |
|---|---|---|
| ... | pass/fail | ... |
If no design doc is relevant, state that and skip this section.
Review the diff against these standards (from docs/coding_standards.md):
Typing (Section 2):
Any or bare generic containers (list, dict, tuple).assert used for runtime validation -- must use if/raise ValueError.Docstrings (Section 3):
Function and Interface Design (Section 4):
None meaning two different things).New Functionality (Section 5):
Modifications (Section 6):
Code Organization (Section 7):
import torch before native C extensions.init_logger(__name__) from lmcache.logging, not bare logging.getLogger().Resource Management (Section 7.5-7.6):
This step is what distinguishes a real review from a diff-reader. For each changed public symbol identified in Step 1, verify the change is safe for every unchanged caller.
Triggers -- run this step whenever the PR:
None to accepted values, narrows a type)None means)How to find callers:
Grep with the symbol name across the repo (do not filter to only changed files).
Include tests/, benchmarks/, lmcache/integration/, and docs/ in the search.Grep with
-A 2 -B 2 to see context, or use the Agent (Explore) tool with a focused
prompt (e.g., "find all callers of L1Manager.is_key_evictable and summarize
what they do with the return value").class \w+\(<BaseName>).For each caller, check:
Flag as error severity:
Flag as warning severity:
Report findings as part of the issues list, with the path:line of the affected caller and a one-line explanation of the impact.
One paragraph describing what the PR does.
Table (if applicable) or "No relevant design doc."
Group issues by severity, following the calibration from docs/coding_standards.md Section 9.2:
error (must fix before merge):
assert for
runtime validation, docstring that misrepresents behavior.warning (should fix):
strict=True on zip of
parallel lists, log level too high for operational messages.info (suggestion, non-blocking):
For each issue, include:
| Severity | Count | Key Items |
|---|---|---|
| error | N | ... |
| warning | N | ... |
| info | N | ... |
info, not error.