deslop(main): defer serve-sim materialization, dedupe reload flags, guard gate validators#7318
deslop(main): defer serve-sim materialization, dedupe reload flags, guard gate validators#7318nwparker wants to merge 1 commit into
Conversation
…uard gate validators Quality pass on main-process/build PRs merged 2026-07-03: - ios-emulator-backend: resolve the serve-sim executable via a lazily-cached getter instead of eagerly in the constructor. The bridge is built before the main window is shown, so the one-time recursive copy + xattr subprocess (first launch after each version bump) no longer blocks macOS startup for a feature that may go unused (#7174). - index: collapse the two near-identical `{webContentsId, until}` reload flags (expectedRendererReload / recoveryReloadInFlight) into one `createWebContentsTimedFlag` primitive; behavior preserved, including consume-on-read for the recovery reload (#7290). - check-reliability-gates: coerce gate.commands/testFiles/platforms/providers with an `asArray` helper before `.includes`, so a hand-edited manifest with a missing/mistyped field reports a validation failure instead of throwing an uncaught TypeError; extract `hasCompleteRedGreenEvidence` for the duplicated status check (#7295). - claude-pty: derive FABLE_WEEKLY_LABEL_RE from WEEKLY_RE.source so a future weekly- wording change stays in one place and can't reopen the parsing gap it just closed. - macos-tcc-login-shell: trim the 30-line flag-by-flag JSDoc to the two non-obvious whys (TCC identity, env(1) SHELL re-assertion) per the repo comment guidance (#7003). Typecheck, oxlint, oxfmt, `check:reliability-gates`, and touched unit suites all pass.
📝 WalkthroughWalkthroughChangesThis PR makes five unrelated changes: reliability-gates manifest validation now coerces potentially non-array fields via a new Sequence Diagram(s)sequenceDiagram
participant MainIndex as main/index.ts
participant TimedFlag as recoveryReloadInFlight
MainIndex->>TimedFlag: markRecoveryReloadInFlight(webContentsId)
TimedFlag-->>TimedFlag: mark({webContentsId, until})
MainIndex->>TimedFlag: isRecoveryReloadInFlight(webContentsId)
TimedFlag-->>TimedFlag: matches(webContentsId, {consume:true})
TimedFlag-->>MainIndex: boolean match result
TimedFlag-->>TimedFlag: clear() on successful match
Related issues: None found in the provided context. Related PRs: None found in the provided context. Suggested labels: main-process, refactor, validation Suggested reviewers: None specified. Poem 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/index.ts (1)
473-475: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant duplicate default duration.
createWebContentsTimedFlag'smarkalready defaultsdurationMstodefaultDurationMs(10_000, set at line 442's factory default). Re-specifyingdurationMs = 10_000in both wrapper functions duplicates that magic number in three places, risking drift if one is changed without the others.♻️ Proposed simplification
-function markExpectedRendererReload(webContentsId: number, durationMs = 10_000): void { +function markExpectedRendererReload(webContentsId: number, durationMs?: number): void { expectedRendererReload.mark(webContentsId, durationMs) }-function markRecoveryReloadInFlight(webContentsId: number, durationMs = 10_000): void { +function markRecoveryReloadInFlight(webContentsId: number, durationMs?: number): void { recoveryReloadInFlight.mark(webContentsId, durationMs) }Also applies to: 491-493
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b0592c84-d0af-422e-9d09-d233467a86ac
📒 Files selected for processing (5)
config/scripts/check-reliability-gates.mjssrc/main/emulator/backends/ios-emulator-backend.tssrc/main/index.tssrc/main/providers/macos-tcc-login-shell.tssrc/main/rate-limits/claude-pty.ts
|
Superseded by #7321 (same changes, renamed to |
Deslop pass — main process & build (2 of 3)
Code-quality follow-ups on main-process / build-script PRs merged 2026-07-03. Surfaced by an automated multi-agent review; every finding adversarially verified before fixing.
ios-emulator-backend: resolve serve-sim executable lazily (cached getter) instead of eagerly in the constructorindex: collapse the two near-identical{webContentsId, until}reload flags into onecreateWebContentsTimedFlagprimitivecheck-reliability-gates: coerce array fields before.includesso a malformed manifest reports a failure instead of throwingcheck-reliability-gates: extracthasCompleteRedGreenEvidencefor a duplicated checkclaude-pty: deriveFABLE_WEEKLY_LABEL_REfromWEEKLY_RE.source(one source of truth)macos-tcc-login-shell: trim the 30-line flag-by-flag JSDoc to its two non-obvious whysNotable details
cpSync+xattrsubprocess (first launch after each version bump) on the main thread. Deferring it to first emulator use keeps that work off the boot path for a feature that may go unused in a session.validateEvidenceRun/validateAssertionRef/validateCoveredScopecall.includesongate.commands/testFiles/platforms/providers. Earlier type checks onlypusha failure without returning, so a hand-editedreliability-gates.jsoncwith a missing/mistyped field threw an uncaughtTypeErrorinstead of the intended structured report.Verification
pnpm run typecheck·oxlint·oxfmt·pnpm run check:reliability-gates(27 gates pass) · touched unit suites — all green.🤖 Generated with Claude Code
Made with Orca 🐋