Skip to content

refactor(providers): use shared random suffix helper - #2140

Merged
steipete merged 1 commit into
mainfrom
refactor/provider-random-suffix-native-20260912
Sep 12, 2026
Merged

refactor(providers): use shared random suffix helper#2140
steipete merged 1 commit into
mainfrom
refactor/provider-random-suffix-native-20260912

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Several provider adapters duplicated the same random suffix wrapper, making naming behavior harder to audit consistently.

Why This Change Was Made

Use the shared internal shared.RandomSuffix helper at the existing call sites and remove equivalent provider-local wrappers. Generation behavior and call timing are unchanged.

User Impact

No user-visible behavior changes. Random suffix generation now uses one shared implementation across the updated providers.

Evidence

  • Race tests passed across all five changed provider packages and the shared package in two independent runs.
  • go vet ./...
  • go build -trimpath ./cmd/crabbox

@clawsweeper

clawsweeper Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 9:11 AM ET / 13:11 UTC (Revision 6).

ClawSweeper review

What this changes

Five provider adapters call the shared random suffix generator directly and remove their equivalent local wrappers.

Merge readiness

Ready for maintainer review

Keep open as a useful, behavior-preserving cleanup with no actionable findings. The wrappers remain on the reviewed main revision, and the related merged cleanup addresses a different helper.

Priority: P3
Reviewed head: eea65a0c0bdf8faee518eebdc6815e080cb5b881

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with reported validation and no concrete correctness or security blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored forwarding-wrapper cleanup is exempt from contributor runtime proof; it changes neither the shared generator nor authority, and the reported race tests, vet, and build are supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored forwarding-wrapper cleanup is exempt from contributor runtime proof; it changes neither the shared generator nor authority, and the reported race tests, vet, and build are supplemental validation.
Evidence reviewed 7 items Pinned introduced change: The complete base-to-head diff changes five call sites and removes five wrappers whose entire implementation returned shared.RandomSuffix(); evaluation locations and surrounding expressions remain unchanged.
Unchanged generator and naming contract: The shared generator still reads three random bytes and hex-encodes them, retaining its existing fallback. Provider-specific prefixes, truncation, and normalization remain in their adapters; existing OpenComputer tests cover prefixes and maximum name length.
Main and release context: The reviewed main still contains the wrappers shown on the removed side of the diff. The shared generator itself already exists unchanged in v0.57.0; this establishes existing generator behavior, not that this wrapper-removal cleanup has shipped.
Findings None None.
Security None None.

How this fits together

Crabbox provider adapters translate CLI run requests into remote sandbox operations. The shared suffix generator supplies randomness for sandbox names and Crownest creation request identifiers.

flowchart LR
  A[CLI run request] --> B[Provider adapter]
  B --> C[Shared suffix generator]
  C --> D[Sandbox name]
  C --> E[Creation request identifier]
  D --> F[Provider API]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Wrapper reduction 5 wrappers removed; production net −20 lines; tests unchanged The cleanup reduces indirection without adding a competing generator or expanding production behavior.

Technical review

Best possible solution:

Use the existing shared generator directly while preserving each adapter's naming rules and request timing.

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

Not applicable: this refactor reports no broken runtime behavior, and the complete diff shows equivalent helper calls.

Is this the best way to solve the issue?

Yes. Removing trivial forwarding wrappers is a narrow simplification that retains the existing implementation and provider boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b26f057a6cf2.

Labels

Label justifications:

  • P3: This is a small internal cleanup with unchanged user-visible behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored forwarding-wrapper cleanup is exempt from contributor runtime proof; it changes neither the shared generator nor authority, and the reported race tests, vet, and build are supplemental validation.

Evidence

What I checked:

  • Pinned introduced change: The complete base-to-head diff changes five call sites and removes five wrappers whose entire implementation returned shared.RandomSuffix(); evaluation locations and surrounding expressions remain unchanged. (internal/providers/crownest/backend.go:233, eea65a0c0bdf)
  • Unchanged generator and naming contract: The shared generator still reads three random bytes and hex-encodes them, retaining its existing fallback. Provider-specific prefixes, truncation, and normalization remain in their adapters; existing OpenComputer tests cover prefixes and maximum name length. (internal/providers/shared/naming.go:40, eea65a0c0bdf)
  • Main and release context: The reviewed main still contains the wrappers shown on the removed side of the diff. The shared generator itself already exists unchanged in v0.57.0; this establishes existing generator behavior, not that this wrapper-removal cleanup has shipped. (internal/providers/shared/naming.go:40, baa6c9a783f5)
  • Related merged work: GitHub confirms refactor(providers): use shared blank fallback helper #2136 merged as a782412. Its body describes blank-string fallback wrappers, so it is adjacent cleanup rather than a replacement for random-suffix wrapper removal. (a782412125cd)
  • Area history: Blame associates the shared generator lines with the earlier cross-provider helper consolidation. Recent merged provider history also includes Vincent Koc's blank-fallback cleanup. These support routing candidates without establishing causal responsibility or original feature authorship. (internal/providers/shared/naming.go:40, 76573df26db8)
  • Discussion, validation, and review continuity: The supplied complete body reports two race-test runs across the five providers and shared package, plus vet and build. The previous completed review has no findings or published rank-up moves. Historical comparison against its head and some deeper history/release blobs failed because required objects could not be fetched; the complete current introduced diff was inspected successfully. No tests were executed during this read-only review. (eea65a0c0bdf)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-12T09:22:43.150Z sha 832ce8a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T09:57:13.181Z sha 2e49acf :: needs changes before merge. :: none
  • reviewed 2026-09-12T10:27:24.070Z sha ab7ad91 :: needs changes before merge. :: none
  • reviewed 2026-09-12T10:51:31.905Z sha ab7ad91 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T11:13:41.738Z sha f2abd6c :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the refactor/provider-random-suffix-native-20260912 branch 2 times, most recently from 2e49acf to ab7ad91 Compare September 12, 2026 10:24
@vincentkoc
vincentkoc marked this pull request as ready for review September 12, 2026 10:49
@vincentkoc
vincentkoc force-pushed the refactor/provider-random-suffix-native-20260912 branch from ab7ad91 to f2abd6c Compare September 12, 2026 11:10
@vincentkoc
vincentkoc force-pushed the refactor/provider-random-suffix-native-20260912 branch from f2abd6c to eea65a0 Compare September 12, 2026 13:08
@steipete
steipete merged commit 3babe1c into main Sep 12, 2026
25 checks passed
@steipete
steipete deleted the refactor/provider-random-suffix-native-20260912 branch September 12, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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