Fix #27: ScriptingBridge inspector uses sdef term names, works against live FCP - #30
Merged
Conversation
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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #27 so v0.1.0 ships with a working live inspector (pure Swift — no ObjC shim, per discussion).
What was wrong
FCPLibraryInspectorpassed the sdef cocoa keys (displayName,uniqueIdentifier,durationDict,URL,persistent ID) tovalue(forKey:)on SBObject proxies, which resolve the sdef term names. Against a running Final Cut Pro the first read raisedNSUnknownKeyException— uncatchable from Swift — killing the whole test process. The mocks pinned the same wrong keys, so the suite stayed green.What changed
FCPLibraryInspectornow 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.persistentIDbecame optional onFCPScriptedLibrary/Event/Project: FCP declarespersistent IDin its sdef but doesn't implement it (errors -1728 even in AppleScript), so it is read tolerantly and is alwaysnillive.NSNumbers live proxies return (drop/ndrp/unspfour-char codes), with a regression test. Media-time records arrive asvalue/timescaledictionaries — the existing parser already handled that shape, confirmed live.Verification
swift testwith 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.fcpxml-diff schema-completeness --fail-if-total-exceeds 0clean;CI=1 LINT_MODE=STRICTlint: 0 violations in 241 files.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