Add an opt-in simplicity review module - #2
Draft
joyzhzh wants to merge 1 commit into
Draft
Conversation
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.
What changes
Second-pass packets can now include focused simplicity questions without changing the default review.
python -m code_review_partner.modules.simplicityexports a fresh default policy extended with four principles; the existingreview-partner packet change.diff --policy simplicity-policy.jsoncommand consumes it.The questions cover demonstrated reuse, behavior-preserving replacements, present abstraction benefits, and concrete deferral triggers. The change adds five files: the optional module package, usage documentation, paired synthetic examples, and integration tests. Every pre-existing file remains unchanged.
Evidence and calibration
The module retains the base policy's thresholds, enabled rules, posture, finding contract, and principles. It requires evidence for equivalent behavior and asks for missing context instead of treating fewer lines or a single implementation as proof of a problem. It adds no deterministic detector, model call, or approval verdict.
Examples pair useful simplifications with justified structure: equivalent helpers versus different semantics, native date inputs versus booking requirements, redundant protocols versus vendor boundaries, and speculative queues versus durable payment processing. These are illustrative cases, not an accuracy benchmark. Documentation credits Ponytail as inspiration; implementation and examples are independently written.
Validation: all 56 unit tests passed locally on Python 3.12. All existing CI example commands also passed, including the byte-for-byte sample output check. End-to-end exports load through the existing policy loader and produce both packet formats; packets differ only in policy metadata and the additional principles. Existing package discovery includes the new module.
git diff --cached --checkpasses, and the diff contains only additions. Local test scratch directories were retained to comply with the machine's no-permanent-deletion policy; test assertions were unchanged.Risk review
The exported policy is a snapshot of the installed default and should be regenerated after upgrades. Version 1 does not merge custom base policies. The module guides a separate human or AI review; it cannot establish semantic equivalence or improved review accuracy itself.
Closes #1.