Skip to content

Build the device helper without the generation engine - #194

Merged
lynnswap merged 2 commits into
mainfrom
refactor/device-helper-without-core
Nov 20, 2026
Merged

lynnswap merged 2 commits into
mainfrom
refactor/device-helper-without-core

Conversation

@lynnswap

@lynnswap lynnswap commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

privateheaderkit-device-helper no longer depends on PrivateHeaderKitCore. Target discovery, the device source snapshot, and running-application resolution move to a new target, PrivateHeaderKitSourceInspection, which the helper and PrivateHeaderKitCore both use. The helper stops linking the generation engine and GRDB.

Details

  • PrivateHeaderKitSourceInspection depends on PrivateHeaderKitHelperProtocol and PrivateHeaderKitExecutableResolution. The code did not go into PrivateHeaderKitHelperProtocol because that target holds only message types and reads neither the file system nor the process table.
  • The moved types are now top-level: TargetDiscovery, TargetCandidate, TargetKind, DeviceSourceSnapshot, and RunningApplicationResolver. They were nested in PrivateHeaderGeneration, which Core declares.
  • Core keeps the code that interprets a snapshot: DeviceSourceSnapshot.source() and catalog(), the target query and resolver, and ArtifactPath.
  • DiscoveredTarget.artifactRoot is a String, so the catalog does not need Core's ArtifactPath. Its JSON encoding is the same string as before. Core validates the root when it reads the catalog of a device snapshot and when it builds each artifact path under the root.
  • One behavior changes. A device snapshot whose catalog contains an unsafe artifact root now fails with StateError.invalidArtifactPath from the existing check in catalog(). Before this change, decoding that catalog stopped the CLI on the precondition in ArtifactPath.init(rawValue:) and never reached the check. No test is added for this case, following the decision on Reduce the generation pipeline and CLI to what header generation needs #179 not to harden against a hostile peer.
  • The tests for the moved code stay in PrivateHeaderKitCoreTests. The discovery tests also exercise Core's resolver, and the iOS and watchOS compile checks build that test target.
  • Package.resolved changes only in originHash. A plain swift package resolve after the manifest change also removes the opencombine pin; this PR keeps the reviewed pins.

Testing

  • swift test: all six test bundles pass (493 tests).
  • scripts/build-release.sh --version dev --platform iphoneos --test passes. The staged privateheaderkit-device-helper contains no PrivateHeaderKitCore or GRDB symbols.
  • A macOS build of the device helper ran __device-source on macOS 27.2.1 before and after this change. Both runs report the same catalog (3,927 groups, 4,482 targets) and the same metadata apart from producerVersion.
  • With Xcode 26.6, 27.1, and 27.2, swift package resolve succeeds with and without --force-resolved-versions and leaves Package.resolved unchanged.
  • Local Codex review: no findings.
  • Not verified: SSH generation against a device.

🤖 Generated with Claude Code

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T00:34:08.986919Z 437c196 Manual request
🔒 Security Review ✅ Completed 2026-11-20T00:30:15.247119Z 1183b5a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 437c196135

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap
lynnswap merged commit eafce4d into main Nov 20, 2026
7 checks passed
@lynnswap
lynnswap deleted the refactor/device-helper-without-core branch November 20, 2026 01:04
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.

Build the device helper without the generation engine

1 participant