refactor(scripts): share regexp literal escaping#99778
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 10:56 PM ET / 02:56 UTC. Summary PR surface: Other -10. Total -10 across 11 files. Reproducibility: not applicable. This PR is a refactor cleanup, not a reported runtime bug. The relevant check is source-level equivalence of the escaping helper across touched script call sites. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Keep the PR open for ordinary maintainer review and merge once required repository gates are satisfied, preserving the narrow literal-RegExp escape contract rather than broadening semantics. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR is a refactor cleanup, not a reported runtime bug. The relevant check is source-level equivalence of the escaping helper across touched script call sites. Is this the best way to solve the issue? Yes, for this cleanup: a scripts-owned AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5ea4b412a8e8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other -10. Total -10 across 11 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
What Problem This Solves
OpenClaw's maintainer scripts repeated the same RegExp-constructor literal escaping implementation across audit, release, E2E, and GitHub automation paths. Keeping those exact copies separate made the contract easier to drift and added unnecessary local helpers.
Why This Change Was Made
Add one scripts-owned
escapeRegExphelper for plain Node.mjsconsumers and reuse the existing core helper fromscripts/release-check.ts. The change intentionally preserves the existing escape set and does not combine character-class, slash-delimited source, replacement-string, or broaderRegExp.escapesemantics.User Impact
No user-visible behavior changes. Maintainer tooling now has one canonical regexp-literal escaping implementation per runtime boundary, with 10 fewer net lines and fewer duplicate helpers.
Evidence
oxfmt --check --threads=1passed for all 11 changed files.tbx_01kwng9w2cms5cd110qxm7s20q,corepack pnpm check:changed, exit 0..agents/skills/autoreview/scripts/autoreview --mode local --prompt-file /tmp/regexp-autoreview-context.md --stream-engine-output; clean with no accepted/actionable findings.