Skip to content

refactor: split oversized session and apple app files#1061

Merged
thymikee merged 2 commits into
mainfrom
codex/split-agent-tax-files
Jul 4, 2026
Merged

refactor: split oversized session and apple app files#1061
thymikee merged 2 commits into
mainfrom
codex/split-agent-tax-files

Conversation

@thymikee

@thymikee thymikee commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Split the 5.7k-line session handler test into focused scenario files backed by a shared mock harness, so each touched session file stays under 800 lines.

Split Apple app operations out of core/apps.ts into focused launch, install, resolution/inventory, settings, device I/O, and simctl helper modules while keeping core/apps.ts as the stable facade.

Closes #1044

Touched-file count: 20.

Validation

Ran the newly split session-handler suites: 11 files, 124 tests passed.

Ran Apple app-focused unit coverage for open/close/install/reinstall/resolve/deep-link/settings cases: 47 tests passed.

Ran provider lifecycle scenarios for iOS and macOS open/apps/appstate behavior: 2 files, 5 tests passed.

Ran pnpm format and pnpm check:quick.

Residual risk: the full src/platforms/apple/core/tests/index.test.ts suite still contains unrelated screenshot/status-bar cases that timed out or attempted xcrun outside the app split. The app-focused subset above passed.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.5 MB 1.5 MB -195 B
JS gzip 484.1 kB 484.1 kB -6 B
npm tarball 586.0 kB 586.2 kB +225 B
npm unpacked 2.1 MB 2.1 MB -195 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 29.5 ms 29.5 ms -0.1 ms
CLI --help 51.4 ms 51.3 ms -0.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/9722.js -202 B -11 B
dist/src/apps.js +7 B +1 B

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: LGTM. The monolith actually dissolved: session.test.ts is gone (12+ scenario files, all under 800 lines, sharing one mock harness module) and apps.ts is now a 24-line barrel over launch/install/resolution/settings/device-io concerns — public import sites unchanged. 961 tests across handler + apple core suites and typecheck green locally. Note for the record: session-replay-vars.test.ts (2339 lines) still exceeds the bar but was NOT touched by this PR — pre-existing debt outside #1044's scope, fine to leave for its own pass. History tracing via --follow is inherently limited for one-into-many splits; the scenario file names are self-indexing, which matters more for agents anyway.

@thymikee thymikee force-pushed the codex/split-agent-tax-files branch from 45c9cd5 to 399bcc6 Compare July 3, 2026 10:48
@thymikee

thymikee commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Coordinator re-review: no actionable blockers on current head 399bcc6. CI is green (21/21). The post-review CI fix only adjusts exported/internal split details, Android test timeout budget, and the fallow baseline after the session/apps split; it does not change the command surface or runtime routing intent. Merge-readiness is for maintainer judgment.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 3, 2026
@thymikee thymikee force-pushed the codex/split-agent-tax-files branch from 399bcc6 to 5dc3e98 Compare July 3, 2026 11:11
@thymikee

thymikee commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Coordinator re-check after rebase: current head 5dc3e98 is clean and CI is green (21/21). The PR remains ready-for-human; no new actionable blockers found after the base picked up #1057/#1058.

@thymikee thymikee merged commit e833de4 into main Jul 4, 2026
21 checks passed
@thymikee thymikee deleted the codex/split-agent-tax-files branch July 4, 2026 00:02
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-04 00:02 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split oversized files that tax agent contributors (session.test.ts, apps.ts)

1 participant