Use this as the single source of truth for Claude/Codex/Gemini/Copilot reviews.
- Review only the PR diff plus any code directly referenced by the diff.
- Do not propose large refactors unless a P0 blocker requires it.
- Prefer smallest changes that preserve existing public contracts.
Every review must output, in this order:
- MERGE: YES/NO
- Blockers (P0) — must fix
- Majors (P1) — should fix before merge unless explicitly waived
- Minors (P2) — optional/nits
- Missing evidence — tests/profiling/threat note required
- DB impact notes — only if SQL/dialect/DDL/transaction behavior changed
- Minimal patch guidance — concrete steps, no handwaving
- Any new behavior or bug fix must include unit tests.
- Any change affecting DB behavior, SQL generation, transactions, pooling, or dialects must include integration coverage (testbed / IntegrationTests).
- No skipped tests.
Block if behavior changed but tests did not change.
Block if any of these occur:
- Unvalidated input crosses a trust boundary (SQL, file paths, serialization, network calls, logging).
- Authentication/authorization logic changes without explicit tests.
- Secrets or sensitive values can appear in logs or exception messages.
- Custom crypto/token schemes introduced or modified without clear invariants + tests.
-
If PR claims perf improvement, includes optimization, or touches known hot paths: require evidence.
- Acceptable evidence: BenchmarkDotNet output, profiler summary, or before/after timing numbers.
-
Block “optimization by belief”.
- Public API surface must remain stable unless explicitly intended.
- All public APIs live in
pengdows.crud.abstractions. - Changes to interfaces require baseline verification updates (or should fail).
- TransactionScope is forbidden (must use
BeginTransaction). - No string interpolation for SQL values.
- No unquoted identifiers in custom SQL: use
WrapObjectName.
- ValueTask in hot paths: execution methods return
ValueTask/ValueTask<T>(do not regress toTask). - No public constructors on implementation types except
DatabaseContext. - Interface-first: consumers depend on abstractions, not implementation types.
- TableGateway extension rule: extend TableGateway; do not wrap it with service layers.
- [Id] vs [PrimaryKey]: never apply both to the same property; preserve documented upsert key priority.
- Dispose readers promptly (
ITrackedReaderis a lease). - No async leaks, no undisposed containers/readers/transactions.
- No long-lived transactions stored as fields.
-
Changes to dialects/SQL generation must consider:
- quoting rules
- parameter marker rules
- upsert behavior per DB
- transaction/isolation semantics
-
If a change risks a specific DB family, call it out and require a targeted integration test.
- Naming, local clarity, consistent style with the repo.
- Minor allocations or micro-optimizations in non-hot paths.
- Small simplifications that do not alter behavior.
A reviewer must request the following when applicable:
- Unit tests for behavior changes.
- Integration tests for DB-facing changes.
- Regression tests for bug fixes.
Required when:
- PR claims perf improvement
- PR changes pooling, container execution, mapping, or dialect hot paths
Required when touching:
- authn/authz
- token handling
- SQL building
- deserialization
- filesystem paths
- logging
Threat note format (5 bullets):
- entry points
- trust boundaries
- assets
- attacker goals
- mitigations + tests
-
Waiving a P1 major requires:
- explicit written justification in PR description
- a follow-up issue link
-
P0 blockers cannot be waived.
If SQL/dialect behavior changes, reviewers must state:
- affected DBs (at least by family: Postgres-like, MySQL-like, SQL Server-like, embedded, warehouse)
- expected behavior differences
- which integration tests cover it (or what new test is required)
- Security: assume hostile inputs, insist on invariants + tests.
- Performance: measure first, optimize last.
- Design/Testability: if it’s hard to test, design is wrong.
- Clarity: code should read like an executable spec.
This policy aligns with existing repo mandates:
- TDD required, integration suite required, ValueTask hot paths, TransactionScope ban, interface-first, and multi-dialect correctness constraints.