Skip to content

refactor(move): move the recording Swift helpers into packages/host-swift - #4742

Merged
thymikee merged 2 commits into
mainfrom
refactor/colocate-native-sources
Nov 19, 2026
Merged

thymikee merged 2 commits into
mainfrom
refactor/colocate-native-sources

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Behavior unchanged. Moves the recording Swift helpers out of capture-kit and the iOS runner tree into a new private host-tool package, packages/host-swift. Reason: 0.22 extracts providers and some platforms into plugins, so the core must stay lean, and shared packages must not carry native sources.

The touch overlay, the frame decoder and the video validator are macOS host tools. Android, HarmonyOS, Apple and provider recordings all compile them on the daemon host. So they do not belong in platform-apple. host-swift owns the .swift files, the generated embedding, the validator source and the Swift compile cache. capture-kit keeps its cross-platform drivers and depends on host-swift. The Swift bytes, the cache keys and the lazy import do not change.

Validation

  • Head 8ed876a18c: pnpm check:affected --run --head 8ed876a18c passed with exactCommit=true. 42 checks passed. The full set ran (fail-open on manifest changes). 25 checks were skipped as CI-only or device lanes, including swift-runner, coverage and replay.
  • pnpm check:native-dupes and pnpm check:native-dupes:test passed.
  • I ran the focused vitest suites for packages/host-swift, capture-kit/src/recording and the repo guard on darwin. They passed.
  • CI still has to run: the macOS smoke darwin proof (swift-cache-recording-scripts), coverage, and the device lanes.
  • One independent review found a gap in the clone scan. It is fixed.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

…wift

The touch overlay, the contact-sheet frame decoder and the video validator
are macOS host tools: recording post-processing for every device platform
(Android, HarmonyOS, Apple, provider transports) compiles them on the daemon
host. They sat in the iOS runner tree and in capture-kit only by location.

packages/host-swift now owns the .swift sources, the generated embedding,
the validator source and the Swift compile cache. capture-kit keeps its
cross-platform drivers and calls host-swift. Same Swift bytes, same cache
keys, same lazy import: behavior is unchanged.
… moved Swift files

The layering model, the R11 dependency expectations and the examples/sdk
project references list host-swift with the other workspace packages.
The trailing-comma scan, the Apple bridge-proof trigger, the darwin helper
proof, the native clone scan and the device-lane ownership follow the
.swift files to packages/host-swift/swift. The clone-gate model test
creates every configured scan root instead of a fixed list.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.40 MB 6.40 MB +47 B
Package (unpacked) 6.40 MB 6.40 MB +47 B
Package (download) 1.94 MB 1.94 MB +13 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 23.9 ms 25.2 ms +1.4 ms
CLI --help 50.1 ms 51.3 ms +1.1 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 8ed876a

No open findings.

Not in the reviewers' prompt (1 file)
  • pnpm-lock.yaml: generated or a lockfile, so its lines were left out

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (8804ce24cc1d).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This is ready to merge at 8ed876a: the Swift sources move byte-for-byte into packages/host-swift, with no problems found. CI is green on that commit, including Repo Guards & Compatibility, Lint/Typecheck/Package, Coverage, Integration Tests and the macOS smoke run with the darwin proof, and there are no conflicts. The clone-scan config now covers the moved path.

Not blocking, and fine to take or leave: host-swift keeps local copies of two test fixtures that match the capture-kit ones, which the package cycle requires, so a later test-support entry in host-kit could remove them; ADR 0019 could name host-swift in its package direction with one sentence; and the bridge-proof trigger in scripts/apple-ci-impact.ts now matches all of packages/host-swift/, so a TS-only change there also runs the darwin proof, which you could narrow to the swift/ directory and recording-swift-sources.ts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee merged commit 83328f1 into main Nov 19, 2026
25 checks passed
@thymikee
thymikee deleted the refactor/colocate-native-sources branch November 19, 2026 13:30
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.

1 participant