Skip to content

fix: harden native i18n identifier filtering - #99098

Merged
clawsweeper[bot] merged 1 commit into
mainfrom
feature/codeql-native-i18n-redos
Jul 3, 2026
Merged

clawsweeper[bot] merged 1 commit into
mainfrom
feature/codeql-native-i18n-redos

Conversation

@hxy91819

@hxy91819 hxy91819 commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves an edge case where native i18n inventory filtering needed more predictable handling for unusually shaped conditional-branch identifiers.

Why This Change Was Made

The conditional-branch identifier check now uses a small linear ASCII scanner that preserves the existing filtering behavior without relying on a complex regular expression.

User Impact

Maintainer tooling remains responsive and deterministic when scanning native app source text. There is no product UI behavior change.

AI-assisted: yes, implemented with Codex.

Evidence

  • pnpm format:fix -- scripts/native-app-i18n.ts test/scripts/native-app-i18n.test.ts
  • node scripts/run-vitest.mjs test/scripts/native-app-i18n.test.ts
  • .agents/skills/autoreview/scripts/autoreview --mode local
  • Autoreview result: autoreview clean: no accepted/actionable findings reported
  • git diff --check

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed. Reviewed July 3, 2026, 11:26 AM ET / 15:26 UTC.

Summary
The PR replaces native i18n conditional-branch regex filtering with an exported linear ASCII scanner and adds focused coverage.

PR surface: Tests +9, Other +36. Total +45 across 2 files.

Reproducibility: yes. from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Review metrics: 1 noteworthy metric.

  • Regex backtracking surface: 1 replaced. The changed predicate is on a CI path that scans PR-controlled native source strings.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🌊 off-meta tidepool
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P2] No repair job is needed; the automerge path can rely on exact-head review, CI, and mergeability gates.

Security
Cleared: The diff removes a possible native-i18n CI ReDoS surface and adds no dependencies, workflows, lockfile changes, secret handling, or new code-execution source.

Review details

Best possible solution:

Land the linear scanner through the existing exact-head automerge lane once CI and mergeability gates remain clean.

Do we have a high-confidence way to reproduce the issue?

Yes, from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Is this the best way to solve the issue?

Yes: replacing the exact ASCII identifier regex with an equivalent linear scanner is the narrowest maintainable fix for this backtracking class.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 235a5c4d744e.

Label changes

Label changes:

  • add status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The external-contributor proof gate is not applicable because this is a MEMBER, maintainer-labeled script hardening PR with command and CI evidence.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 🚀 automerge armed.

Label justifications:

  • P2: This is a focused native i18n maintainer-tooling hardening fix with limited blast radius and no product UI behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Not applicable: The external-contributor proof gate is not applicable because this is a MEMBER, maintainer-labeled script hardening PR with command and CI evidence.
Evidence reviewed

PR surface:

Tests +9, Other +36. Total +45 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 9 0 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 37 1 +36
Total 2 46 1 +45

What I checked:

  • Current main behavior: Current main still uses the conditional-branch identifier regex inside isTranslatableCandidate; addCandidate calls that filter before emitting native i18n entries. (scripts/native-app-i18n.ts:186, 235a5c4d744e)
  • PR implementation: The PR replaces the regex call with isConditionalBranchIdentifier, a linear ASCII scanner with the same lowercase-prefix, uppercase-transition, trailing-alphanumeric contract. (scripts/native-app-i18n.ts:216, 97464c96358d)
  • Regression coverage: The added test covers accepted camelCase-style identifiers, rejected nonmatching identifiers, and a long adversarial uppercase run ending in punctuation. (test/scripts/native-app-i18n.test.ts:13, 97464c96358d)
  • Live PR state: GitHub reports the PR open, non-draft, MERGEABLE/CLEAN at head 97464c96358d50445861fe325cb1609e68430989, with maintainer and clawsweeper:automerge labels. (97464c96358d)
  • CI proof: Live checks include passing native-i18n, broad CI checks, security checks, Opengrep, and Socket checks for this PR head; skipped jobs are routine scope skips. (97464c96358d)
  • Feature provenance: The merged native inventory PR introduced this generator surface and includes commits for conditional native label inventory and non-translatable literal filtering. (scripts/native-app-i18n.ts:186, 740cc5b7323f)

Likely related people:

  • vincentkoc: Merged native app locale inventory PR metadata shows they authored the generator and commits that added conditional native label filtering and non-translatable literal filtering. (role: feature introducer and likely area owner; confidence: high; commits: f23f507d9341, bb1fe616e223, 0abca4ef9716; files: scripts/native-app-i18n.ts, test/scripts/native-app-i18n.test.ts)
  • steipete: Recent merged native i18n inventory work refreshed the generated inventory on current main, adjacent to this tooling surface but not the predicate itself. (role: recent adjacent repair contributor; confidence: medium; commits: 2b22fc44ad46, 3e50f41dd6ea; files: apps/.i18n/native-source.json)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 2, 2026
@hxy91819 hxy91819 changed the title fix: avoid native i18n branch regex backtracking fix: harden native i18n identifier filtering Jul 3, 2026
@hxy91819

hxy91819 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=97464c96358d50445861fe325cb1609e68430989)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-07-03T15:28:18Z
Merge commit: f3eccb0dfdec

What merged:

  • The PR replaces native i18n conditional-branch regex filtering with an exported linear ASCII scanner and adds focused coverage.
  • PR surface: Tests +9, Other +36. Total +45 across 2 files.
  • Reproducibility: yes. from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Automerge notes:

  • No ClawSweeper repair was needed after automerge opt-in.

The automerge loop is complete.

Automerge progress:

  • 2026-07-03 15:20:13 UTC review queued 97464c96358d (queued)
  • 2026-07-03 15:27:44 UTC review passed 97464c96358d (structured ClawSweeper verdict: pass (sha=97464c96358d50445861fe325cb1609e68430...)
  • 2026-07-03 15:28:20 UTC merged 97464c96358d (merged by ClawSweeper automerge)

@clawsweeper clawsweeper Bot added clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 3, 2026
@clawsweeper
clawsweeper Bot merged commit f3eccb0 into main Jul 3, 2026
152 of 159 checks passed
@clawsweeper
clawsweeper Bot deleted the feature/codeql-native-i18n-redos branch July 3, 2026 15:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
Summary:
- The PR replaces native i18n conditional-branch regex filtering with an exported linear ASCII scanner and adds focused coverage.
- PR surface: Tests +9, Other +36. Total +45 across 2 files.
- Reproducibility: yes. from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 97464c9.
- Required merge gates passed before the squash merge.

Prepared head SHA: 97464c9
Review: openclaw#99098 (comment)

Co-authored-by: Mason Huang <[email protected]>
Approved-by: hxy91819
zeekay pushed a commit to hanzoai/bot that referenced this pull request Sep 11, 2026
Summary:
- The PR replaces native i18n conditional-branch regex filtering with an exported linear ASCII scanner and adds focused coverage.
- PR surface: Tests +9, Other +36. Total +45 across 2 files.
- Reproducibility: yes. from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 97464c96358d50445861fe325cb1609e68430989.
- Required merge gates passed before the squash merge.

Prepared head SHA: 97464c96358d50445861fe325cb1609e68430989
Review: openclaw/openclaw#99098 (comment)

Co-authored-by: Mason Huang <[email protected]>
Approved-by: hxy91819
zeekay pushed a commit to hanzoai/bot that referenced this pull request Sep 11, 2026
Summary:
- The PR replaces native i18n conditional-branch regex filtering with an exported linear ASCII scanner and adds focused coverage.
- PR surface: Tests +9, Other +36. Total +45 across 2 files.
- Reproducibility: yes. from source inspection: current main routes conditional-branch native literals through the backtracking-prone regex before inventory output. I did not run a timing benchmark against current main.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 97464c96358d50445861fe325cb1609e68430989.
- Required merge gates passed before the squash merge.

Prepared head SHA: 97464c96358d50445861fe325cb1609e68430989
Review: openclaw/openclaw#99098 (comment)

Co-authored-by: Mason Huang <[email protected]>
Approved-by: hxy91819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: XS status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant