Skip to content

docs: additive-vs-reductive test change detection design spec (TC-4153)#78

Merged
mrizzi merged 1 commit intomainfrom
spike/TC-4153-additive-vs-reductive-detection
Apr 16, 2026
Merged

docs: additive-vs-reductive test change detection design spec (TC-4153)#78
mrizzi merged 1 commit intomainfrom
spike/TC-4153-additive-vs-reductive-detection

Conversation

@mrizzi
Copy link
Copy Markdown
Owner

@mrizzi mrizzi commented Apr 16, 2026

Summary

  • Design spec for adding test change classification to verify-pr's Step 12 (Test Quality)
  • Distinguishes additive test changes (new coverage) from reductive ones (weakened coverage) using a sub-agent with hybrid structural scan + semantic assessment
  • Validated against two real trustify PRs: #2325 (purely additive) and #2318 (mixed — predominantly additive with one relaxed assertion)

Closes spike TC-4153

Test plan

  • Spec self-review: no placeholders, no contradictions, no ambiguity, scoped for single implementation plan
  • Validated detection approach against real PR diffs
  • User reviews spec before implementation planning

🤖 Generated with Claude Code

Summary by Sourcery

Documentation:

  • Add a detailed design spec describing additive vs reductive test change classification for verify-pr, including architecture, classification logic, reporting, and SKILL.md integration.

Design for adding test change classification to verify-pr's Step 12,
distinguishing additive test changes (new coverage) from reductive
ones (weakened coverage). Uses a sub-agent with hybrid structural
scan + semantic assessment, validated against two real trustify PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 16, 2026

Reviewer's Guide

Adds a detailed design spec document describing how verify-pr will classify test changes as additive vs reductive using a dedicated sub-agent that performs a hybrid structural scan and semantic assessment, integrates its results into Step 12 (Test Quality) and Step 14 reporting, and outlines SKILL.md updates and future autonomous-mode escalation behavior.

File-Level Changes

Change Details Files
Document sub-agent architecture for additive vs reductive test change classification in verify-pr
  • Describe main verify-pr agent responsibilities for detecting test file changes and invoking a sub-agent
  • Specify sub-agent inputs (modified/deleted test paths and branch names) and outputs (classification, structural summary, semantic assessment, reductive findings)
  • Define how the main agent consumes sub-agent results without re-reading test contents
docs/specs/2026-04-16-additive-vs-reductive-detection-design.md
Define hybrid structural scan and semantic assessment approach for evaluating test changes
  • List structural signals to count per test file, including test functions, assertions, skip annotations, parameterized cases, and mock scope changes
  • Describe language-agnostic but framework-aware detection of assertions and related patterns
  • Detail semantic assessment process for comparing behaviors under test and using it to override misleading structural signals
docs/specs/2026-04-16-additive-vs-reductive-detection-design.md
Specify classification logic and how it affects verify-pr reporting and outcomes
  • Formalize criteria for ADDITIVE, REDUCTIVE, MIXED, NEUTRAL, and N/A classifications and the role of semantic assessment as tiebreaker
  • Describe how overall classification combines sub-agent output with new-file analysis
  • Outline how the new Test Change Classification row integrates into the Step 14 verification report and its advisory-only effect
docs/specs/2026-04-16-additive-vs-reductive-detection-design.md
Outline SKILL.md integration and step sequencing for the new test change classification behavior
  • Describe where in verify-pr/SKILL.md the new sub-steps land and how existing Step 12 sub-steps are renumbered
  • Define new sub-steps for identifying test file change types, spawning the sub-agent, running structural/semantic analysis, and recording findings
  • Clarify that no new runtime behavior is implemented yet; this document only specifies planned SKILL.md changes
docs/specs/2026-04-16-additive-vs-reductive-detection-design.md
Provide concrete real-world examples validating the design
  • Include a purely additive example PR demonstrating ADDITIVE classification and the expected report row
  • Include a mixed-change example PR showing MIXED classification, with one relaxed assertion and summarized reductive finding in the report row
docs/specs/2026-04-16-additive-vs-reductive-detection-design.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The Step 12 sub-step renumbering in the SKILL.md integration section is a bit confusing (existing steps 1–7 vs. new steps 8–13); it would help to explicitly map old → new step numbers so someone editing SKILL.md can apply the changes without ambiguity.
  • In the structural scan section, consider clarifying how the sub-agent identifies the test framework / language for a file (e.g., by extension, heuristics, or upstream metadata) and what it should do when it cannot confidently recognize assertions or skip annotations.
  • For the sub-agent interface, it might be worth specifying a more structured output format (e.g., JSON schema for classification, structural summary, and reductive findings) so that the main agent can consume the results reliably and avoid parsing free-form text.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Step 12 sub-step renumbering in the SKILL.md integration section is a bit confusing (existing steps 1–7 vs. new steps 8–13); it would help to explicitly map old → new step numbers so someone editing SKILL.md can apply the changes without ambiguity.
- In the structural scan section, consider clarifying how the sub-agent identifies the test framework / language for a file (e.g., by extension, heuristics, or upstream metadata) and what it should do when it cannot confidently recognize assertions or skip annotations.
- For the sub-agent interface, it might be worth specifying a more structured output format (e.g., JSON schema for classification, structural summary, and reductive findings) so that the main agent can consume the results reliably and avoid parsing free-form text.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mrizzi mrizzi merged commit 838a136 into main Apr 16, 2026
2 checks passed
@mrizzi mrizzi deleted the spike/TC-4153-additive-vs-reductive-detection branch April 16, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant