Skip to content

Fix #27: ScriptingBridge inspector uses sdef term names, works against live FCP - #30

Merged
leogdion merged 1 commit into
v0.1.xfrom
v0.1-fix27
Jul 31, 2026
Merged

Fix #27: ScriptingBridge inspector uses sdef term names, works against live FCP#30
leogdion merged 1 commit into
v0.1.xfrom
v0.1-fix27

Conversation

@leogdion

Copy link
Copy Markdown
Member

Fixes #27 so v0.1.0 ships with a working live inspector (pure Swift — no ObjC shim, per discussion).

What was wrong

FCPLibraryInspector passed the sdef cocoa keys (displayName, uniqueIdentifier, durationDict, URL, persistent ID) to value(forKey:) on SBObject proxies, which resolve the sdef term names. Against a running Final Cut Pro the first read raised NSUnknownKeyException — uncatchable from Swift — killing the whole test process. The mocks pinned the same wrong keys, so the suite stayed green.

What changed

  • FCPLibraryInspector now reads the live-verified term names: name, id, file, duration, frameDuration, startTime (children keys were already correct). Every key was probed individually against a running FCP in isolated child processes before adoption.
  • persistentID became optional on FCPScriptedLibrary/Event/Project: FCP declares persistent ID in its sdef but doesn't implement it (errors -1728 even in AppleScript), so it is read tolerantly and is always nil live.
  • Timecode format parser now decodes the OSType NSNumbers live proxies return (drop/ndrp/unsp four-char codes), with a regression test. Media-time records arrive as value/timescale dictionaries — the existing parser already handled that shape, confirmed live.
  • Mocks re-pinned to the term-name contract (with a comment explaining why they must not drift back), so they can no longer pass while the live path is broken.
  • Live test hardened: when FCP is running it now asserts non-empty libraries with non-empty names/ids instead of discarding the result.
  • Docs: known-issue callouts removed from README/AGENTS/NEXT_STEPS; AGENTS now states the term-name rule; repo memory updated with the verified live contract.

Verification

  • swift test with Final Cut Pro running: 12 tests / 6 suites pass, including the live test walking the real library tree (~7s of Apple-events traffic). This exact configuration crashed the test binary before the fix.
  • Full package suite exit 0; fcpxml-diff schema-completeness --fail-if-total-exceeds 0 clean; CI=1 LINT_MODE=STRICT lint: 0 violations in 241 files.
  • No package-structure changes, so cross-platform builds are unaffected.

Note for the release: after this merges, PR #29's body still lists #27 as a shipped known issue — I'll refresh it.

🤖 Generated with Claude Code

SBObject proxies resolve sdef term names (name, id, duration, file, ...)
through value(forKey:), not the sdef cocoa keys the inspector was passing
(displayName, uniqueIdentifier, durationDict, URL). The cocoa keys raised
NSUnknownKeyException against a running Final Cut Pro, and ObjC exceptions
are uncatchable from Swift, so the whole test process died.

Every key was probed individually against a live FCP in isolated child
processes before adoption:

- name/id/file/duration/frameDuration/startTime/timecodeFormat and the
  children keys all resolve live.
- persistent ID is declared in the sdef but unimplemented by FCP (errors
  -1728 even in AppleScript); persistentID is now optional on the scripted
  models and read tolerantly.
- media time records arrive as value/timescale/epoch/flags dictionaries,
  which the existing parser already handles.
- timecode format arrives as an OSType NSNumber (drop/ndrp/unsp); the
  parser now decodes four-char codes, with a regression test.

Mock tests re-pin the term-name contract so they can no longer pass while
the live path is broken, and the live test now asserts non-empty library
content when Final Cut is running (verified live: 12 tests, 6 suites pass
with FCP open). Docs known-issue callouts removed accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: afe3704e-68ca-4b26-a59f-d40f5c79715a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@leogdion
leogdion merged commit b45df3e into v0.1.x Jul 31, 2026
9 checks passed
@leogdion
leogdion deleted the v0.1-fix27 branch July 31, 2026 19:29
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