Skip to content

refactor: consolidate unique string list helpers - #99785

Merged
RomneyDa merged 1 commit into
mainfrom
refactor/unique-lists-consolidation
Jul 4, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
refactor/unique-lists-consolidation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 4, 2026

Copy link
Copy Markdown
Member

What Problem This Solves

OpenClaw had several local wrappers and raw Set conversions that duplicated the shared stable-order string dedupe helpers, making the same policy-free mechanics appear to have multiple owners.

Why This Change Was Made

This AI-assisted refactor removes three exact aliases of sortUniqueStrings in provider resolution and routes exec authorization reason-list dedupe through uniqueStrings. Sorting, trimming, casing, validation, precedence, source priority, and domain defaults remain local and unchanged.

User Impact

No user-visible behavior changes. Maintainers get one canonical implementation for these exact unique-list mechanics and nine fewer production lines.

Evidence

  • node scripts/run-vitest.mjs src/infra/exec-authorization-plan.test.ts src/plugins/capability-provider-runtime.test.ts src/plugins/providers.test.ts src/plugins/providers.runtime.consult-current-snapshot.test.ts — 146 tests passed across 2 shards.
  • Blacksmith Testbox through Crabbox changed gate — tbx_01kwnhjbqsc6hgt2eb4c8m4y93, Actions run 28693064957, exit 0.
  • .agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output — clean, 0 accepted/actionable findings, correctness confidence 0.99.
  • git diff --check — passed.
  • Build not required: no exports, package boundaries, or lazy imports changed.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:28 PM ET / 18:28 UTC.

Summary
The branch replaces private provider/capability unique-list wrappers and exec authorization Set-based reason dedupe with existing normalization-core unique string helpers.

PR surface: Source -9. Total -9 across 4 files.

Reproducibility: not applicable. this is refactor cleanup rather than a bug report. Source inspection and existing focused tests give high confidence that the replaced helpers have equivalent contracts.

Review metrics: none identified.

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

  • No repair lane is needed because there are no actionable findings; the protected maintainer-labeled PR should continue through normal maintainer review.

Security
Cleared: The diff only swaps internal helper calls and removes private wrappers; it adds no dependency, workflow, secret, package, or external code-execution surface.

Review details

Best possible solution:

Proceed through normal maintainer approval and merge if checks stay green, keeping the change limited to exact first-seen or sorted unique-string mechanics.

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

Not applicable; this is refactor cleanup rather than a bug report. Source inspection and existing focused tests give high confidence that the replaced helpers have equivalent contracts.

Is this the best way to solve the issue?

Yes. Directly calling uniqueStrings and sortUniqueStrings is the narrow maintainable refactor for exact delegate and Set patterns; broadly replacing unrelated Set or domain-specific normalization logic would be too risky.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6da5db21a633.

Label changes

Label justifications:

  • P3: This is a low-risk internal cleanup/refactor PR with no intended user-visible behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored, maintainer-labeled internal cleanup is not subject to the external contributor real-behavior proof gate.
Evidence reviewed

PR surface:

Source -9. Total -9 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 4 25 34 -9
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 25 34 -9

What I checked:

  • Repository policy read: Read the full root policy and the scoped plugin guide; the protected maintainer-item rule keeps this PR open, while the lean refactor guidance supports deleting exact private delegates when semantics match. (AGENTS.md:1, 6da5db21a633)
  • Scoped plugin policy read: The plugin guide requires preserving manifest/runtime boundaries; this PR only changes private helper calls inside existing provider resolution paths. (src/plugins/AGENTS.md:1, 6da5db21a633)
  • Live PR state: Live GitHub data shows the PR is open, mergeable, authored by RomneyDa, labeled maintainer, assigned to steipete, and has no non-success/non-skipped/non-neutral check runs in the queried rollup. (2955cfe4db17)
  • Shared helper contract: uniqueStrings is first-seen Set-backed dedupe, and sortUniqueStrings dedupes then applies stable ASCII ordering, matching the mechanics replaced here. (packages/normalization-core/src/string-normalization.ts:14, 6da5db21a633)
  • Current main still has exec Set dedupe: Current main still returns [...new Set(reasons)] in the exec authorization reason helpers that this PR changes to uniqueStrings, so the branch is not obsolete on main. (src/infra/exec-authorization-plan.ts:200, 6da5db21a633)
  • Current main still has provider alias wrappers: Current main still has private one-line wrappers around sortUniqueStrings in provider and capability resolution, matching the cleanup target. (src/plugins/providers.ts:521, 6da5db21a633)

Likely related people:

  • RomneyDa: Authored this PR and the merged related unique-list alias cleanup, and has recent adjacent provider/runtime cleanup history. (role: recent adjacent cleanup contributor; confidence: high; commits: 2955cfe4db17, 75fab4fbc6cd, 8c5f45fc36f1; files: src/plugins/providers.runtime.ts, src/plugins/providers.ts, src/infra/exec-authorization-plan.ts)
  • steipete: Authored the merged shared coercion/normalization refactor that introduced and propagated the canonical string dedupe helpers this PR now calls directly. (role: shared normalization helper introducer; confidence: high; commits: 77d9ac30bb8d; files: packages/normalization-core/src/string-normalization.ts, src/plugins/providers.ts, src/plugins/capability-provider-runtime.ts)
  • Jesse Merhi: Introduced the Tree-sitter exec authorization planner module and tests that own the reason-list code touched here. (role: exec authorization planner introducer; confidence: medium; commits: c9707ab635b9; files: src/infra/exec-authorization-plan.ts, src/infra/exec-authorization-plan.test.ts)
  • Masato Hoshino: Recent provider runtime snapshot work changed providers.runtime.ts and adjacent provider tests around the helper calls simplified by this PR. (role: recent provider runtime contributor; confidence: medium; commits: 3ef02ca81876; files: src/plugins/providers.runtime.ts, src/plugins/providers.runtime.consult-current-snapshot.test.ts, src/plugins/providers.test.ts)
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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-04T03:53:46.739Z sha 2e019d0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-04T18:21:26.588Z sha 2955cfe :: needs maintainer review before merge. :: none

@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 4, 2026
@RomneyDa
RomneyDa force-pushed the refactor/unique-lists-consolidation branch from ae1f641 to 2e019d0 Compare July 4, 2026 03:48
@RomneyDa

RomneyDa commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@RomneyDa
RomneyDa force-pushed the refactor/unique-lists-consolidation branch from 2e019d0 to 2955cfe Compare July 4, 2026 18:17
@RomneyDa
RomneyDa merged commit 1d839d3 into main Jul 4, 2026
97 checks passed
@RomneyDa
RomneyDa deleted the refactor/unique-lists-consolidation branch July 4, 2026 19:38
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants