Repository navigation
fix(exec): rewrite empty-output wrapper regex without repartitionable quantifiers - #5774
Conversation
… quantifiers Adjacent \n+/\s* quantifiers in EMPTY_EXEC_OUTPUT_REGEX could repartition a newline block combinatorially — 'Script completed\n' + 200k newlines + '!' takes ~34s to reject on the old pattern. Each wildcard run is now pinned to its maximal match via the lookahead-capture idiom; acceptance is unchanged (25 tests incl. section combinations and a pathological whitespace case pass, mutation-checked against the old pattern). Co-Authored-By: Epinephrine <luvs01@hanmail.net>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.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; 2 remain after this review. 📝 WalkthroughWalkthrough
ChangesExec output wrapper detection
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established by the reviewed changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
리뷰 · 우선순위 58 / 80이 풀리퀘스트는 바탕이 빈 결과는 새 식은 각 자리를 가장 길게 한 번만 먹게 고정해요. 헤더, 라인 - 라인 - 같은 파일 148–152행 — 20만 줄바꿈이 끝나기만 하면 통과예요. 걸린 시간은 안 재요. 거절 두 줄( 메인테이너의 판단이 필요한 지점 성공 쪽도 실패 쪽 끝 줄바꿈만 있는 너의 추천 방향은 맞아요. 바탕은 테스트를 보태면 더 좋아요. 123행 예시는 이 댓글은 grok-bot이 작성했습니다 |
|
유지관리자 권고(선택 사항)를 둘 다 반영했습니다 (head: 4a2f450).
검증: exec-tool-result-normalize 26/26 통과, tsc --noEmit 클린. |
Ingwannu
left a comment
There was a problem hiding this comment.
Reviewed exact head 4a2f450e9132f159ed265b1b0e87f7dbaf9b65f7. Atomic lookahead/backreference runs preserve the accepted wrapper language while preventing adjacent whitespace quantifiers from repartitioning pathological newline input. The callable trim-before-match divergence is explicitly pinned. Focused bounded suite passed 26/26; the 200,000-newline adversarial cases completed in ~1.6 ms under CPUQuota=200%, MemoryMax=4G, swap disabled.
Summary
EMPTY_EXEC_OUTPUT_REGEXinsrc/adapters/exec-tool-result-normalize.tswrapped every optional section in plain quantifiers ([^\n]*\n+,\s*). Adjacent wildcard runs can repartition a newline/whitespace block combinatorially — the ReDoS shape the pattern had before.Each wildcard run is now pinned to its maximal match with
(?=(X))\1lookahead-and-backreference, so the engine cannot redistribute characters between neighbouring quantifiers. The accepted language is unchanged.Verification
bun test tests/adapters/exec-tool-result-normalize.test.ts— 25 pass, including the linear-time pathological-whitespace case.Checklist
devSummary by CodeRabbit