feat(rewrite): encode humanize benchmark finding with warning and regression guards - #324
poorvith-mp wants to merge 4 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: guillaumemeyer/watermarks-remover/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds warnings and documentation for the ChangesHumanize tactic guidance
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The recommended strategy is executable, and no actionable regression from this change is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5fa9203 to
e8d755c
Compare
e8d755c to
9d8783e
Compare
Summary
Encodes the empirical benchmark finding regarding prompt-based humanization into
rewrite_text.pyandtest_clean_strategy.py. Emits a runtime warning whenhumanizeis used in a strategy, guards the default configuration against regressing tohumanize, and documents the detector mechanics.Context
On the 8-doc watermarked benchmark corpus (02–04 Sep 2026),
paraphrase@0.4alone scored a Pangramhuman_likeof 0.44. Appendinghumanize@0.2collapsed it to ~0.02.Prompting an LLM to "write like a human" forces it into formulaic transitions, uniform pacing, and clichéd conversational registers that modern AI detectors (e.g. Pangram) easily identify. Meanwhile, masked-LM infill (
mlm@0.2viaroberta-large) perturbs token distributions bidirectionally without adopting an LLM conversational cadence, holdinghuman_likeat ~0.42 while improving the removal margin.While
config/clean_strategy.jsonwas updated toparaphrase@0.8,mlm@0.2, this critical institutional memory was not encoded in code or test assertions.Changes
rewrite_text.py:parse_strategy()emits aUserWarningwhen thehumanizetactic is present in a parsed strategy, warning about the 0.44 → 0.02 collapse and suggestingparaphrase + mlm.--tactic humanizeand the module docstring.test_parse_strategy_humanize_warning: asserts that parsinghumanize@0.2warns with the empirical score citation.test_default_strategy_has_no_humanize: asserts thatconfig/clean_strategy.jsonnever includes ahumanizestep.skills/remove-ai-marks/references/removal-matrix.mdwith the empirical caution onhumanizeand documentedmlm.Verification
python -m pytest tests/test_clean_strategy.py -v(23 passed in 0.39s)python -m ruff check service/scripts/rewrite_text.py tests/test_clean_strategy.py(All checks passed)python -m ruff format --check service/scripts/rewrite_text.py tests/test_clean_strategy.py(2 files already formatted)Summary by CodeRabbit
New Features
mlmas a Layer B rewording option.Documentation
humanizeandmlm.paraphrase + mlmas an alternative tohumanize.Warnings
humanizenow displays a runtime warning with performance guidance.