Repository navigation
review-pr: add D11 and D12, and make complexity above 20 a gate - #1811
Conversation
…inside one consumer #1797's first version made --extra-env pins visible by re-merging the CLI handoff blob inside agentx_env_for_conc. The review passed it: the body's stated cause matched the data flow, and V3 exempts a fix that is merely narrower than the reviewer would have written. But every other reader kept its bare os.environ.get, so a pinned HYPERLOOM_AGENTIC_BACKEND selected the MLPerf client while the grading axis, the persisted backend identity and the benchmark timeout still resolved aiperf -- a session that REVERTed every round. The producer fix, exporting each pin, corrected all of them without changing a reader. D11 is D10's dual: D10 is a concern copied beside its caller while an owner exports it, D11 is an owner that exists but does not publish, compensated for downstream. V3's exemption now names the boundary so narrowness stays taste while a second resolution point blocks.
…nits
The three size numbers were review triggers only, so a reviewer could ask for
a split but not require one. 20 is the point where the trigger's accepted
answer ("this is one dispatch table") stops being checkable by reading. The
gate compares head against the merge base so the 124 units already above 20
stay backlog rather than becoming the next PR's debt.
review-pr carries it as D12; AGENTS.md and the style guide carry the rule it
cites, since blocking findings must name a bullet the repo states outright.
chaojhou
left a comment
There was a problem hiding this comment.
Thanks @xiaofei-zheng. D11 reads well: the trigger, the producer-versus-consumer test and the exceptions are clear, and the V3 boundary now points at it. The AGENTS.md, style guide, SKILL.md and Copilot edits agree with each other, and the rule count is right.
Requesting changes for one must-fix, in D12.
D12 keys the head/base comparison on the function name within the same path
rules.md:755 measures "the same paths at base.txt" and matches "per function name", and :768 fires on "present at head and absent at base". Ruff's C901 message carries only the bare name, with no class, so two cases go wrong:
- A move or rename reads as a new function, and blocks.
- Moving an existing complexity-25 function into another module, or renaming it, leaves it absent at that path in the base. So D12 fires on a change that added no branch at all.
- With 124 units above 20 in the tree, that blocks exactly the splits the style guide asks for (§ Size and complexity: structure the split along the boundaries the code already has).
- It also contradicts the rule's own premise that the backlog is not the next PR's debt.
- Same-named functions in one file can't be told apart.
- Two classes that each have a
run, an__init__or a nested_innerproduce C901 lines that look the same. - So a new
B.runat 22 can be matched to an existingA.runat 25 and stay silent, or the other way round.
- Two classes that each have a
Suggested fix:
- Find the base side by the function's origin, not its head path. Follow
git diff -Mrenames, or grep the base tree for thedef, before calling it absent. - Key the match on the class-qualified name (or the name plus its order of occurrence), not on the bare name.
- Add the same exemption in two places, Not a finding when (
:778) and the style guide's Complexity ceiling (docs/contributing/style-guide.md:82): a function that was moved or renamed without raising its number.
Withdrawn: approving instead; the D12 points are follow-up suggestions, not blockers.
chaojhou
left a comment
There was a problem hiding this comment.
Approving. The strict bar is the point of D12, so I'm withdrawing my change request. The two points below are suggestions for a follow-up, not blockers:
- Moves and renames.
- The comparison looks up the same path at the base, so a function that is moved or renamed without a new branch reads as added.
- Either state that moving a function above 20 requires splitting it, or exempt a move that does not raise the number.
- As written, the measurement and the text ("not this PR's debt") disagree, and an automated reviewer will follow the measurement.
- Same-named functions. Ruff's C901 line carries only the bare name, so two
runmethods in one file can be matched to each other. Keying on the class-qualified name closes that gap.
Resolve the docs conflicts with #1811's complexity ceiling: the review ceiling stays, and the code-metrics gate is described as stricter inside its scope. Co-Authored-By: Claude <noreply@anthropic.com>
Description: two review rules, plus the authority the second one cites.
D11 -- fix(cli): export every --extra-env pin so all readers resolve it alike #1797's first version made
--extra-envpins visible by re-merging theINFERENCE_OPTIMIZER_EXTRA_ENVblob insideagentx_env_for_conc, one consumer. The review passed it with no blocking issues: the body's stated cause matched the data flow, and V3 explicitly exempts a fix that is only narrower than the reviewer would have written. Every other reader kept its bareos.environ.get, so a pinnedHYPERLOOM_AGENTIC_BACKENDselected the MLPerf client while the seeded grading axis, the persisted backend identity and the benchmark timeout all still resolvedaiperf-- MLPerf publishes no interactivity series, so that session REVERTed every round. Fixing the producer instead, exporting each pin in_export_operator_launch_shape, corrected every reader without changing one. D11 makes that shape blocking: a value repaired where it is consumed while the single place that publishes it is untouched. It is D10's dual -- D10 is a concern copied beside its caller while an owner exports it, D11 is an owner that exists but does not publish, compensated for downstream. V3's exemption now names the boundary, so narrowness stays taste while a second resolution point blocks.D12 -- cyclomatic complexity above 20 blocks, for a function the diff adds or whose complexity the diff raises. The tree holds 124 units above 20, so the rule compares the head against the merge base and stays silent when the number did not move; the backlog is not the next PR's debt. This needed the authority to change with it:
AGENTS.mdand the style guide both said the size numbers are "review triggers, not gates", which left a blocking finding nothing to cite. The style guide gains aComplexity ceilingsection carrying the two cases and the measurement,AGENTS.mdseparates the three triggers from the one gate,SKILL.md's contract-violation row stops demanding an owner module for a bullet that is not about ownership, and.github/copilot-instructions.mdnames which of the size cases blocks.Linked issue(s): none
Tests: none -- rules, docs and skill prose only, no executable code. For D11: checked by hand that every rule resolves to an index row and no row names an undefined id, and that D11 sits on three rows a reviewer can match from
files.txtand a diff skim. For D12: both Ruff invocations in the rule body were run against this tree ----output-format concisereports the number,--force-excludehonoursextend-exclude(remote_client.pystays silent), andgit show <base>:<path>piped toruff --isolatedmeasures the base side. The SKILL.md rule count moved 53 -> 55 across the two commits.Size/complexity triggers crossed: none
If this simplifies or refactors: n/a
Observable effect: a reviewer running
review-prnow blocks on a value repaired at one consumer while its producer is untouched, where the fix(cli): export every --extra-env pin so all readers resolve it alike #1797 review returned "no blocking issues"; and on complexity above 20 in code the PR adds or makes worse, where before it could only ask. Nothing in CI changes --C901stays out of[tool.ruff.lint] selectand Pylint stays--errors-only.Breaking changes: no
PR addresses single concern: no -- two review rules land together. D11 was already on the branch and pushed when the D12 work started; splitting them now costs a rebase for no reviewer benefit.
Root cause is upstream: no