Skip to content

ios-simulator.js part 2: seven seams into create<Seam>(ctx) modules (#1447 pass V2) - #1474

Merged
currentbits merged 8 commits into
mainfrom
coder/refactor-v2-ios-simulator-seams-e9f58b
Oct 5, 2026
Merged

currentbits merged 8 commits into
mainfrom
coder/refactor-v2-ios-simulator-seams-e9f58b

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Pass V2 of #1447, the second half of the ios-simulator.js split (part 1 was #1473). Following section 3 of docs/superpowers/specs/2026-10-05-ios-simulator-split.md, seven seams of createIOSSimulatorService move into flat create<Seam>(ctx) modules, one commit each, in the plan's order.

Module Lines Seam
ios-simulator-input.js 278 device input
ios-simulator-recording.js 269 recorder I/O
ios-simulator-recovery.js 257 crash-recovery helpers
ios-simulator-journal.js 209 preferences and lease journal I/O
ios-simulator-app-bundle.js 165 app bundle validation
ios-simulator-devices.js 153 device and toolchain discovery
ios-simulator-helper.js 135 helper session I/O

ios-simulator.js: 2,781 → 1,697 lines (3,244 before #1473).

Checked

  • Same API: module.exports is identical (6 keys). The object createIOSSimulatorService returns has the same 32 keys as main.
  • Pure move, ignoring indentation: the only non-move lines are ctx construction, the seven factory calls, and the late-binding lines (Object.assign(ctx, …), ctx.helperRpcWithSession = …, ctx.selectedDeveloperDirectory = …).
  • Eager deps: for all 7 factories, every key a seam destructures eagerly from ctx is on ctx at its call (checked by script).
  • No leaked closure state: ESLint no-undef over the new modules and ios-simulator.js reports 0 errors, so no seam reads a closure let (recording, helper, …) it can't see. No seam writes them either, so no getters or setters were needed.
  • Tests:
    • electron/test/ios-simulator*.test.js 327/327.
    • Full electron suite (CI-like env) 4126/4126; npm run typecheck clean.
    • npx vite build and npm run test:smoke pass A–E.

🤖 Generated with Claude Code

Willem and others added 8 commits October 5, 2026 18:40
…s-simulator-journal.js

Seam 1 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of readPreferences, syncParentDirectory, atomicWriteJson,
writePreferences, enqueueJournalOp, writeJournal, removeJournal,
readLeaseJournalRecord, quarantineJournalLocked, quarantineJournal and
removeJournalStrict. The seam owns journalTail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…imulator-devices.js

Seam 2 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of selectedDeveloperDirectory, discoverRaw, discoverDevices,
discoverCapabilities, validate(AndPersist)DeveloperDirectory,
getCapabilities, selectDeveloperDirectory, listDevices,
discoverToolchains, fingerprintToolchain and ensureHelper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…app-bundle.js

Seam 3 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of resolveExecutionRoot, validateBundleWithinRoot and
prepareAppBundle, plus BUNDLE_WALK_LIMIT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-recovery.js

Seam 4 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of the helpers recover() drives: resolveRecoveryTempPath, the
recorder/helper process matching and signalling, removeRecoveredTempFile,
trustedRecoveryDeveloperDir, shutdownRecoveredDevice, quarantineSummary
and retainJournalWithoutRecording, plus RECOVERY_SIGNAL_GRACE_MS,
DEVICE_ALREADY_OFF_RE, isTrustedSimctlPath and isTrustedRecorderPrefix.
recover() stays: it writes lease, recording and lastGeneration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Seam 5 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of observeRecordingClose, clearRecordingTimers,
scheduleRecordingPoll, recordedVideoSize, pollRecordingSize,
killRecording, waitForRecordingClose, runRecordingFinalization and
beginFinalization, plus the recorder constants, interruptRecording and
recordingFinalizeFailed. finalizeRecording stays (it retires the
recording slot) and calls runRecordingFinalization back through the
seam's return. Also restores two blank-line separators the seam 4 cut
dropped from the module constants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…per.js

Seam 6 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of currentStreamBroker, disconnectHelperSession, waitForHelperReady
and helperRpcWithSession, plus the helper ready/RPC timeouts. The helper
slot and its lifecycle stay; helperSessionWritable comes through ctx.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Seam 7 of the createIOSSimulatorService split (#1447 pass V2). Verbatim
move of tap, swipe, typeText, pressButton, sendInput, accessibility and
scrollTo, plus their limits, HARDWARE_BUTTONS, SIMULATOR_KEY_USAGE and
requireCoord.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

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

@currentbits
currentbits merged commit a665aa3 into main Oct 5, 2026
11 of 12 checks passed
@currentbits
currentbits deleted the coder/refactor-v2-ios-simulator-seams-e9f58b branch October 5, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant