Skip to content

test: shorten ReDoS equivalence fixture - #282

Merged
ictechgy merged 1 commit into
mainfrom
codex/s027-redos-fixture-speed
Aug 3, 2026
Merged

test: shorten ReDoS equivalence fixture#282
ictechgy merged 1 commit into
mainfrom
codex/s027-redos-fixture-speed

Conversation

@ictechgy

@ictechgy ictechgy commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • shorten the three-level nested-call/tuple fixture used by the reconstructed vulnerable regex equivalence battery
  • keep the secret assignment, outer call, nested call, tuple parentheses, fixed/unfixed no-match verdict, and exact end-to-end redaction result
  • reduce the per-case SIGALRM budget from 20s to 1s so characterization inputs stay cheap; the two dedicated 5s ReDoS witnesses remain unchanged

Measured result

  • equivalence method: 11.668s before, <0.001s after
  • ReDoS module after: 19 tests in 10.018s (1 optional skip); its two intentional 5s vulnerable-pattern witnesses remain
  • full prepublish after: 1405 tests in 591.647s, 1 skipped
  • removes the fixture shape that exceeded 20s once on macOS CI for S026

Validation

  • TDD RED: old fixture exceeded the new 1s characterization budget
  • TDD GREEN: shortened same-shape fixture passes in <0.001s
  • release smoke, Gate-B proof, plugin sync, py_compile, and git diff --check passed
  • complete Q015 manifest recomputation is byte-identical; runtime overlap []

Classification

Test-speed only. No shipped runtime bytes change and no operational token-savings claim is created.

Summary by CodeRabbit

  • Tests
    • Refined regular-expression safety tests with a shorter nested-call scenario.
    • Reduced the timeout for representative unfixed-pattern checks while retaining dedicated coverage for slow pathological cases.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b170f4f8-3466-4ec4-a2a9-1ac478e0f5c4

📥 Commits

Reviewing files that changed from the base of the PR and between e85e4e4 and abc3f60.

📒 Files selected for processing (1)
  • tests/test_sanitize_output_redos.py

📝 Walkthrough

Walkthrough

The ReDoS tests now use a shorter equivalent nested-call fixture. The representative unfixed-regex timeout is reduced from 20 seconds to 1 second. Dedicated tests continue to cover slow pathological cases.

Changes

ReDoS test updates

Layer / File(s) Summary
Fixture and timeout updates
tests/test_sanitize_output_redos.py
Representative nested-call inputs use the shorter safe_int(f(...)) form. The unfixed-regex comparison uses a one-second timeout. The redaction golden input keeps the same expected result.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: shortening the ReDoS equivalence test fixture.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/s027-redos-fixture-speed

Comment @coderabbitai help to get the list of available commands.

@ictechgy
ictechgy merged commit d7e7606 into main Aug 3, 2026
4 checks passed
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