Files
skills/skills/code-review/references/axes.md
T
kiskaadee d63e1c6f09 feat(tdd,code-review): add polyglot test-hardening invariants, Axis 3 binding, and soft-chaining
- build-skill & implement-slice: add single-owner Suggested Next Step chaining and subagent suppression to skeleton.md and handoff-contracts.md; clean en-dash in Steps 4-5 Log

- tdd: support Mode A (Red->Green) and Mode B (standalone test-suite hardening); add the 5 PR #7 invariants across Python, TypeScript, Bash, Rust, and Java

- code-review: bind Axis 3 directly to tdd/references/, isolate Axis 3 normatively in High-Assurance reviews, and add Suggested Next Step to finding-schema.md

- gitea-plan, implement-slice, gitea-pr, reconcile-docs: add outcome-matched Suggested Next Step routing in Hands off to within <= 76 lines

- tests: add test_polyglot_tdd_hardening_code_review_binding_and_soft_chaining
2026-11-15 21:23:17 -05:00

6.5 KiB

Review Axes and Risk Tiers

Reference for code-review. Inspects git diffs across four distinct evaluation dimensions without allowing strength on one axis to compensate for defects on another.

Derived and adapted from Matt Pocock's skills repository (github.com/mattpocock/skills), combining the multi-axis review discipline with empirical safety and verification invariants.

1. The Four Review Axes

Axis Primary Question Failure Mode Caught Core Inspection Questions
Spec & Scope Did we build what was requested, aligned with project direction, and only that? Scope creep, missing requirements, architectural or roadmap drift, leaky abstractions 1. Does the diff satisfy the originating issue or specification contract?
2. When canonical direction docs exist (ARCHITECTURE.md, ROADMAP.md, ADRs, or active milestone scope), does the change align with long-term boundaries and trajectory?
3. Is there unrequested functionality or premature generalization?
4. Are changes to shared entrypoints (e.g., routers, base config) minimal and additive?
Standards & Smells Is the implementation maintainable and consistent? Structural debt, friction with conventions 1. Does the code adhere to repo standards (CODING_STANDARDS.md, linter configs)?
2. Are code smells present that warrant refactoring? (See smell-heuristics).
3. Is naming clear and aligned with domain vocabulary?
Seam & Test Integrity Do tests prove actual contracts at public interfaces? Tautological tests, implementation coupling, boundary gaps, flaky waits Audit against seams-and-mocking and test-quality:
1. Public seams only; boundary mocks only; injected timing/clock callables instead of global runtime monkeypatching; deterministic waits and guaranteed teardown.
2. Non-tautological assertions with independent literals (no imported production value constants), exact+neighbor boundary points ([min-1, min, max, max+1]), and single-behavior test names (no vague buckets or _and_ chains).
Defensive Invariants Does the code preserve critical system properties under stress? Injection, state desync, unhandled crashes 1. Are untrusted inputs sanitized before reaching sinks? (See defensive-invariants).
2. Does state reconcile against authoritative sources rather than local heuristic drift?
3. Are failure semantics, timeouts, and resource limits explicit?

Non-Compensation Invariant

A strong pass on one axis never excuses a failure on another:

  • Clean abstractions and zero code smells cannot excuse an unescaped HTML sink or an unhandled conflict.
  • 100% test coverage cannot excuse unrequested feature drift, architectural direction drift, or broken domain invariants.
  • Strict spec compliance cannot excuse fragile code structure that breaks repository conventions.

2. Review Recommendations Matrix

The distinction between recommendations is clear: Needs Rework means an established defect requires implementation or test changes; Blocked means the review cannot establish sufficient confidence or scope to proceed safely.

Condition Observed Final Recommendation Action Required
Confirmed Critical or High Needs Rework Fix confirmed defects before release review.
Confirmed Medium or Low requiring changes Needs Rework Apply requested refactoring or test coverage fixes.
Unresolved Critical or High Blocked Resolve missing evidence or escalate to human owner before proceeding.
Unresolved Medium or Low Ready (Conditional) Human owner may adjudicate and accept trade-offs without blocking.
Scope Inability or Missing Base Ref Blocked Establish base commit and diff boundaries before reviewing.
No Blocking Findings Ready Implementation is structurally sound; proceed to verify-slice or release.

Ready Semantics and Downstream Reuse

Ready means the review completed across all four axes, no confirmed or unresolved blocking findings remain (Needs Rework or Blocked), and the report explicitly identifies the base revision, head revision, and relevant working-tree state it covered. Ready (Conditional) qualifies as Ready for downstream handshake reuse only after the human owner adjudicates the open Medium/Low items (Accepted Trade-off or Rejected). A Ready review establishes static provenance for that exact diff; it does not substitute for runtime verification or authorize release.

Documented Trade-Off Acceptance

When a human owner accepts a documented trade-off for a Medium or Low finding, record the finding disposition as Accepted Trade-off (distinct from Rejected). This preserves audit traceability without misclassifying an intentional compromise as a disproven defect.

3. Risk-Scaled Execution Tiers

To keep review overhead proportional to risk, execution mode reuses the tiers established in verify-slice:

Review Risk Tier Typical Change Review Execution Strategy
Lightweight Copy updates, styling adjustments, isolated bugfixes with no new state or untrusted data. Single-agent sequential pass inspecting all 4 axes in order.
Standard New UI components, regular API endpoints, database queries, or schema additions. Independent review passes over the diff. Subagents may be used when helpful to prevent bias.
High-Assurance Auth, permissions, payments, concurrent state reconciliation, destructive actions, or core shared libraries. Assign a dedicated isolated reviewer to Seam & Test Integrity (Axis 3, auditing test diffs against tdd/references/), separate from Spec & Scope + Defensive Invariants and Standards & Smells, followed by independent aggregation.

4. Aggregation and Anti-Silence Rules

When multiple passes or subagents inspect a change:

  1. Never silently resolve disagreements: If Reviewer A flags a pattern as a defect and Reviewer B considers it acceptable, record the finding under Unresolved with both perspectives cited. The human owner adjudicates.
  2. Preserve exact evidence: Every finding must include exact file paths, line numbers, and code snippets demonstrating the condition.
  3. Emit executable runtime checks: Where static analysis cannot verify dynamic timing, rendering, or network failure modes, formulate runnable Step 6 checks formatted per finding-schema and pass them to verify-slice.