feat(release): add opt-in beta provider cohort#537
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ethenotethan
left a comment
There was a problem hiding this comment.
Automated Code Review — Layr-Labs/d-inference#
Verdict: REQUEST_CHANGES
Security — ✅ No issues found
Performance — 1 finding(s) (1 blocking)
- 🟡 [MEDIUM]
console-ui/src/app/providers/semver.ts:36— O(n) array iteration in hot path semver comparison- Suggestion: Cache left.length and right.length to avoid repeated property access in the loop
Type_diligence — ✅ No issues found
Additive_complexity — 2 finding(s) (1 blocking)
- 🟡 [MEDIUM]
coordinator/store/memory.go:2830— validReleaseVersion function duplicates semver.IsValid logic- Suggestion: Remove validReleaseVersion and call semver.IsValid directly at call sites
- 🔵 [INFO]
coordinator/api/release_handlers.go:194-196— Redundant semver validation after regex check- Suggestion: Remove the regex pattern check since semver.IsValid provides comprehensive validation
3 finding(s) total, 2 blocking. Verdict: REQUEST_CHANGES.
🤖 Automated review by Centaur · DAR-186
| const comparison = comparePrereleaseIdentifier(leftPart, rightPart); | ||
| if (comparison !== 0) return comparison < 0; | ||
| } | ||
| return left.length < right.length; |
There was a problem hiding this comment.
🟡 [MEDIUM] ⚡ O(n) array iteration in hot path semver comparison
💡 Suggestion: Cache left.length and right.length to avoid repeated property access in the loop
📊 Score: 3×4 = 12 · Category: inefficient_data_structures
| if release.Version == "" || release.Platform == "" { | ||
| return errors.New("version and platform are required") | ||
| } | ||
| if !validReleaseVersion(release.Version) { |
There was a problem hiding this comment.
🟡 [MEDIUM] 🧩 validReleaseVersion function duplicates semver.IsValid logic
💡 Suggestion: Remove validReleaseVersion and call semver.IsValid directly at call sites
📊 Score: 3×4 = 12 · Category: over-abstraction
| if !semver.IsValid(canonicalVersion) { | ||
| return fmt.Errorf("version must be valid semver") | ||
| } |
There was a problem hiding this comment.
🔵 [INFO] 🧩 Redundant semver validation after regex check
💡 Suggestion: Remove the regex pattern check since semver.IsValid provides comprehensive validation
📊 Score: 2×3 = 6 · Category: over-abstraction
|
This PR introduces a beta release channel and Trust boundaries touched
Per-threat assessmentT-025 (SEC-021) — Stale release cache serves revoked binary hashes T-004 / T-024 (SEC-009) — Release key compared non-constant-time T-007 / T-012 / T-027 (SEC-007) — Weight hash enforcement fail-open T-006 — Unauthenticated WebSocket floods provider registry T-015 / T-034 / T-036 — Trust/routing gate integrity T-011 — X25519 key in TOML T-002 — Unbounded request body T-038 — HTTP server config New attack surface not covered by an existing threat
Beta channel channel-conflict check race ( Open findings resolved by this PR
🔐 Threat model: |
Summary
darkbloom beta enable/disable, persisted inprovider.tomland mirrored into coordinator provider recordsdarkbloom beta enable <feature>form for independent local experiments; beta release builds carry their intended defaults instead of requiring fleet operators to toggle every featureBefore
flowchart LR subgraph BeforeBehavior[Behavior] O[Provider operator] --> F[Enable each beta feature manually] F --> R[Restart provider] P[Every auto-updating provider] --> L[One global latest release] L --> U[Same update target for whole fleet] B[Prerelease rollout] --> M[Manual feature flags or global latest replacement] end subgraph BeforeCode[Code] BC[BetaCommand] --> BF[BetaFeatures config fields] SU[SelfUpdater call sites] --> EP[GET /v1/releases/latest] EP --> GS[GetLatestRelease platform] RW[release-swift workflow] --> RP[releases/latest pointer] endAfter
flowchart LR subgraph AfterBehavior[Behavior] O2[Provider operator] --> BE[darkbloom beta enable] BE --> CFG[Persist beta channel and enable auto-update] CFG --> BP[Beta provider checks beta channel] SP[Stable provider] --> SL[Stable-only latest] BP --> BL[Highest stable or beta SemVer] BL --> V[Existing verify, stage, drain, restart, quarantine and rollback path] SL --> V V --> T[Provider continues serving normal traffic] end subgraph AfterCode[Code] BC2[BetaCommand] --> PS[ProviderSettings.releaseChannel] PS --> SU2[All SelfUpdater constructors] PS --> REG[RegisterMessage.release_channel] SU2 --> API[handleLatestRelease platform plus channel] API --> STORE[ReleaseStore channel-aware selection] REG --> PREC[ProviderRecord.release_channel] STORE --> HASH[Binary and accepted metallib hash policies] WF2[release-swift workflow] --> PTR[Separate stable and beta R2 pointers] endSafeguards
stable; beta discovery must be explicitX.Y.ZsupersedesX.Y.Z-beta.N-betaversions cannot be registered as stable, stable versions cannot be registered as beta, and a stored release cannot change channelsVerification
go test ./coordinator/...npm test -- src/app/providers(21 tests)npx eslint src/(0 errors; existing warnings only)swift build --product darkbloombash -n scripts/admin.shactionlint .github/workflows/release-swift.ymlwith the repository's established custom-runner/baseline ShellCheck warnings ignoredgit diff --checkRollout
Deploy the coordinator first, then ship this capability in one stable provider release. The first beta must use a newer SemVer core than that bootstrap stable release, for example stable
0.7.9followed by0.7.10-beta.1.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.