Repository navigation
skills: add /pr-review, the house-invariant diff review - #777
Merged
Merged
Conversation
Four questions `make check` cannot answer, because each is a judgment about code that compiles and passes every test: whether a new path owes a span or a metric, whether a statement should have been a declared entity pair, whether the work landed in the right execution tier, and whether it re-rolled a helper that carries an invariant. The pipeline is the part that keeps it usable — one read-only reviewer per dimension in fresh context, a separate verifier scoring every finding against a verbatim rubric, and a hard cutoff. Both subagents are tool-restricted, so "the producer never grades its own finding" is structural rather than advised. Most of the skill is the exclusion list, which is the ratio the open-source review prompts converge on. Its backbone is generated: `review-gates` derives every test that scans this workspace's own Rust source and asserts the offender list is empty, so the "already a red test, do not report it" inventory cannot drift from the tests. A bare `spawn_blocking`, an `eprintln!` in `er-server` and an undeclared `lake.main.*` relation are each a build failure, and reporting one is worse than silence — it is noise that arrives with evidence. Routing added both ways: `land-pr`, `security` and `rust-conventions` each name it back. `security`'s "what" clause was trimmed to pay for its clause rather than drop it, per the standard. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
/pr-review: the pre-merge diff review for the four invariantsmake checkcannot judge, plus two tool-restricted subagents and a generated exclusion
backbone.
Why these four, and why a review rather than a gate
The brief was "enforce observability, declared SQL, correct work routing, and
reuse". Probing what the gates already hold turned most of that into already
enforced, which is the finding that shaped the skill:
span_boundaries.rs,structured_logging.rs,collector_allowlist.rs,cardinality.rsandno_pii_in_exported_spans.rsalready fail the build on abare
spawn_blocking, aneprintln!iner-server, an unallowlisted spanattribute, a forbidden metric dimension, and PII on the wire.
freeform_sql.rsanddeclared_names.rsclose the lake half of SQLgovernance completely;
er-entity verifyowns E0xx and the V-rules.control_tasks_no_engine.rsanddispatch_coverage.rshold the structuralhalf of routing.
A reviewer enforcing any of those is re-reporting a red test — noise that
arrives with evidence, which is worse than silence because it teaches the author
to skim the next report. So the skill reviews the un-gated residue, verified
by grep rather than assumed:
span.recordon a field the callsite never declared (a silent no-op); aprocess::exitpath with noforce_flush; a new metric whose declaredseriesproduct is simply wrongaccepted_values, which a later CHECK can never land on a live table; two writes that must share onetransaction();Catalog::load_dirwhereload_lintedis requiredapply_correctionserrfmt::chainvsto_string(), generateder_entities::vs an inline string,common::fresh_dbvs a hand-rolled drop listShape
SKILL.md, 162 lines,disable-model-invocation: true— a review is somethinga human starts, and it can post to GitHub.
## Contents..claude/agents/pr-reviewer.mdandpr-verifier.md, read-only, so theproducer never grades its own finding is structural rather than advised —
the same mechanism
/pentestuses forsecurity-verifier.evals.mdwith six scenarios. Three check that it fires and reports the rightthing; three check that it stays out of the way of
/code-review,observabilityandland-pr.The generated part
not-a-finding.mdis the largest file by design — the open-source review promptsconverge on that ratio. Its backbone is a new
review-gatesgenerator: everyrust/crates/*/tests/*.rsthat reads.rssource withread_to_stringandasserts
is_empty(), each row carrying the first sentence of its own module docas the claim, plus whether a tier variable makes it self-skip in
make check.Twelve rows today. Nobody maintains the list, so nobody can forget it. Two
narrowings came from watching it produce nonsense first: the wider "module doc
says gate" scan returns every golden tier (a reviewer told
golden_em.rsis agate learns nothing), and cutting the claim at a bare period produced rows
reading
any qualified \lake.` — a table that looks maintained and says nothing.Three deviations from the brief
REVIEW.md. It would be a fourth rule location nothing gates, besideCLAUDE.md, the skills and the gates themselves. The base-branch property —a PR cannot loosen the rules it is judged by — comes from reading the
references at
$BASEinstead./code-review. It is complementary, notwrong here, so an override entry would tell a session to discard claims that
are fine. Routed in prose; the override registry is untouched.
infra-platform,frontend-bffandducklake-lakehouseown those, and asecond copy is the drift the standard exists to prevent.
Routing, both ways
land-pr,securityandrust-conventionseach namepr-reviewback.securityandrust-conventionshad their what clauses trimmed to pay forit rather than dropping the routing, per the standard's documented fix — both
now sit with more headroom than the median routing clause needs.
Gates
make skills-check,scripts-home-checkandworkflow-shell-checkall green,tree clean.
Both halves of the new gate were observed failing, from a source mutation
rather than a hand-edited block, since the standard notes a hand-edit proves
nothing:
er-schema/tests/→checkexits 1,naming the stale reference and showing the exact row it would have added.
review-gatesrow removed from the standard's generator table →generatorsexits 1 with`review-gates` is wired into run_regen but absent from the generator table.Both reverted clean.
Not covered by any gate here
Whether the model picks this skill at runtime. That needs the eval scenarios
posed in a fresh session by hand — scenario 1 (does it stay silent on a bare
spawn_blocking?) and 4–6 (does it decline in favour of the right neighbour?)are the ones worth running before trusting it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MFnHDWdSvJoDtZLCg5dyyv