Skip to content

Add an opt-in simplicity review module - #2

Draft
joyzhzh wants to merge 1 commit into
mainfrom
feat/optional-simplicity-module
Draft

Add an opt-in simplicity review module#2
joyzhzh wants to merge 1 commit into
mainfrom
feat/optional-simplicity-module

Conversation

@joyzhzh

@joyzhzh joyzhzh commented Sep 10, 2026

Copy link
Copy Markdown
Owner

What changes

Second-pass packets can now include focused simplicity questions without changing the default review. python -m code_review_partner.modules.simplicity exports a fresh default policy extended with four principles; the existing review-partner packet change.diff --policy simplicity-policy.json command 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 --check passes, 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

  • Tests cover policy isolation, actual module export and CLI integration, unchanged deterministic findings, preserved no-signals limitations, and failed policy loading without partial JSON.
  • No proprietary code, personal data, real credential, or copied third-party text is included.
  • Privacy and threat-model effects are documented: no source reads, network calls, or activation state; packets still include the full unredacted diff.
  • No new dependencies or network behavior.
  • Usage and paired examples are added; existing schemas remain compatible and unchanged.

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.

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.

Add an opt-in simplicity review module

2 participants