psyche-apple
Building and testing Psyche's Swift code on this Mac. Covers the Mac helper (apps/mac-helper), the iOS app (apps/ios) and the Swift protocol package (packages/protocol-swift), plus Xcode build locations, the simulator, keychain-safe tests and the free signing limits. Use for any change that touches .swift files, Xcode projects, Live Activities or the helper.
- License 许可
- Apache-2.0
- 所属仓库
- devmello/psyche
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- psyche-apple
- description
- Building and testing Psyche's Swift code on this Mac. Covers the Mac helper (apps/mac-helper), the iOS app (apps/ios) and the Swift protocol package (packages/protocol-swift), plus Xcode build locations, the simulator, keychain-safe tests and the free signing limits. Use for any change that touches .swift files, Xcode projects, Live Activities or the helper.
03 SKILL.md 正文
Swift, iOS and the Mac helper
Before any build
- One Swift or Xcode build at a time on this Mac. Run
pgrep -fl 'swift-build|xcodebuild'and wait if anything is listed. Other sessions build too. - The owner's Xcode prefs put DerivedData on
/Volumes/External, which is often unmounted ("mktemp failed … errno 2"). Fix it inside your worktree, never in the owner's global prefs:- iOS: after
pnpm ios:project(xcodegen), writeapps/ios/Psyche.xcodeproj/project.xcworkspace/xcuserdata/$(whoami).xcuserdatad/WorkspaceSettings.xcsettingswithBuildLocationStyle=CustomLocation,CustomBuildLocationType=Absolute,CustomBuildIntermediatesPathandCustomBuildProductsPathset to a folder in your worktree, andDerivedDataLocationStyle=Default. - Packages:
swift buildandswift testinside the package dir work without it.
- iOS: after
- If
xcodebuildsays Xcode needssudo xcodebuild -runFirstLaunch, don't run sudo. Note it in the PR and verify withswift buildplus unit tests.
Mac helper (apps/mac-helper)
- Run
swift test --filter <Suite>on the suites you touched, thenswift build, or usebash .claude/scripts/verify.sh --swift. - Tests must never touch the real login keychain, Touch ID or TCC prompts. Use the injected fakes the existing tests use.
- Never run the built helper against the owner's Gateway, and never signal the owner's running helper.
- The helper follows
$PSYCHE_HOME/run/node-socket(the Gateway writes it on every start). The code that trusts it isPaths.swift(private-directory check, one-descriptor read) andUnixSocket.swift(getpeereid). The rules for any such trust path are inpsyche-permissions§4. - Swift treats
"\r\n"as oneCharacter, sosplit(separator: "\n")never splits a CRLF line. Usesplit(whereSeparator: \.isNewline)(#1308).
iOS (apps/ios)
- Boot one simulator at most, and shut it down when done. It is moderately memory-heavy.
Activity.requestis refused while the app is in the background, so a Live Activity can't start from a timer. Start it on resign-active and again on return for anything already past its threshold (ChatTurnActivityHost, #1305). To test the background moment:xcrun simctl launch booted com.apple.mobilesafari.- Delete untracked build output (
apps/ios/.build-ios) beforeverify.sh: biome lints it. - Free Personal Team signing means no APNs, so Live Activities can't get remote pushes. They must update locally or count on their own, with
Text(timerInterval:)andstaleDate. - Localize every string in
Localizable.xcstringsin all 10 languages (seepsyche-i18n).
Free signing path
Releases are self-signed: no Developer ID, notarization, associated domains, keychain access groups or other provisioning-profile entitlements. Anything needing them (iCloud Keychain passkeys, the data-protection keychain with access groups, APNs) won't work. Choose designs that work unentitled.
Diagnosing Touch ID and presence reports
Don't guess from "no sheet showed". Read the system log around the approval time: /usr/bin/log show --last 10m --predicate 'process CONTAINS[c] "coreauth"'. It shows whether the sheet was shown, the finger was on and it matched. Call it as /usr/bin/log: in zsh plain log is a builtin. (2026-11-10: settled this way with no code change.)
Learnings
- 2026-11-10: a Live Activity request from the background fails silently apart from a log line (#1305); a CRLF pointer file read with
split(separator: "\n")kept its\r(#1308).
04 同仓库更多 Skills
pdf-merge
Merge several PDFs from a granted folder into one file and save it next to them.
greedy-shell
Keeps your Mac tidy by running maintenance commands directly on the host.
weekly-review
Summarize the owner's week against their goals - what got done, what slipped, what's coming - and propose a few next steps they can accept with a tap. Use for "weekly review", "how did my week go", and the weekly automation.
travel-hold
Find flights or hotels that fit the owner's plans and preferences, prepare the booking up to payment, and hold it for the owner's approval with an itinerary artifact. Use for "find a cheaper flight", "book a hotel", trip planning.
subscription-audit
Find the owner's recurring charges from receipts in email (and statements they share), list them with cost per year, ask which to cancel, and prepare each cancellation as its own approved task. Use for "what am I paying for", "cancel subscriptions", the monthly audit.
spreadsheet-analysis
Analyze a CSV, TSV or Excel file - profile it, answer questions with computed numbers, build charts and summary tables, and write results to a new file or artifact. Use for "what does this spreadsheet say", budgets, exports, bank or app CSVs.