native: register works.oficina.sheets in the Sparkle Mac bundle
Human
Prompt
Phase 0 of the Oficina native level-up for Sheets (native-levelup/BRIEF.md): repin rastrillo/native, works.oficina.sheets bundle IDs on every build (review = works.oficina.sheets.review), "Oficina Sheets" outside / "Sheets" inside, URL scheme registered in the Sparkle Mac bundle, gates, push, describe, don't merge. Update from the coordinator: rastrillo/native native/levelup-phase0-tools has LANDED on rastrillo main as b6a4067 (merge commit). It adds url_schemes support in mac-updates.json / --url-scheme. (1) redo the pin commit to b6a4067 (all six places); (2) delete native/scripts/mac-url-types.py and its call in build-mac.sh, and add "url_schemes": ["works.oficina.sheets"] to native/mac-updates.json instead (keep test-mac-bundle.py's new scheme/ID/name checks); (3) fix test-mac-bundle.py's "No SwiftPM fallback paths found" check for Swift 6.4.2 if it's a small, clearly-correct change; (4) rebuild Mac (with --updates-config) + iOS simulator, verify the scheme is registered, run the gates, push, update the hub description/tasks, report tip. Don't merge.
From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.
Summary
mac-updates.json now lists url_schemes [works.oficina.sheets], which rastrillo's bundle-mac.py (b6a4067) writes to CFBundleURLTypes, so the direct-download build receives the sign-in callback (audit 4.7). test-mac-bundle.py now asserts the bundle ID, the .app/display name 'Oficina Sheets', CFBundleName 'Sheets' and the scheme. Its SwiftPM-fallback guard no longer requires a .build path in the binary: Swift 6.4.2's resource accessor embeds none (it looks only in Bundle.main, Bundle(for:) and the bundle URL), so it always denies this checkout's apple/.build as well as any path an older toolchain embedded.
Agent notes
The scheme comes from mac-updates.json, so a plain build-mac.sh with no --updates-config builds without it, the same as before this branch; release builds always pass the config.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+18
−2
native/mac-updates.json+4 −1native/scripts/test-mac-bundle.py+14 −1
CI passed — run details
diff --git a/native/mac-updates.json b/native/mac-updates.json| index e1a0bfc..91b73c2 100644 |
| --- a/native/mac-updates.json |
| +++ b/native/mac-updates.json |
| @@ -2,5 +2,8 @@ |
| "bundle_id": "works.oficina.sheets", |
| "feed_url": "https://raw.amadan.net/oficina/native-releases/main/sheets/appcast.xml", |
| "public_ed_key": "/FxO7cZnM7P5c9ZrUPUJvpCnR65sNmrzte+I5vHarE8=", |
| - "keychain_account": "oficina" |
| + "keychain_account": "oficina", |
| + "url_schemes": [ |
| + "works.oficina.sheets" |
| + ] |
| } |
diff --git a/native/scripts/test-mac-bundle.py b/native/scripts/test-mac-bundle.py| index 3096f67..5d6894e 100644 |
| --- a/native/scripts/test-mac-bundle.py |
| +++ b/native/scripts/test-mac-bundle.py |
| @@ -22,11 +22,24 @@ with tempfile.TemporaryDirectory(prefix="oficina-sheets-launch-") as directory: |
| assert len(apps) == 1, "Expected one application in release archive" |
| app = apps[0] |
| info = plistlib.loads((app / "Contents/Info.plist").read_bytes()) |
| + # Paul, 2026-11-14: works.oficina.* on every build, "Oficina Sheets" where |
| + # Finder looks, plain "Sheets" in the menu bar, and the sign-in scheme |
| + # registered so the browser's callback reaches the app. |
| + assert info["CFBundleIdentifier"] == "works.oficina.sheets", info["CFBundleIdentifier"] |
| + assert app.name == "Oficina Sheets.app" and info["CFBundleDisplayName"] == "Oficina Sheets", app.name |
| + assert info["CFBundleName"] == "Sheets", info["CFBundleName"] |
| + assert any("works.oficina.sheets" in entry.get("CFBundleURLSchemes", []) |
| + for entry in info.get("CFBundleURLTypes", [])), "works.oficina.sheets URL scheme not registered" |
| executable = app / "Contents/MacOS" / info["CFBundleExecutable"] |
| strings = subprocess.check_output(["strings", str(executable)], text=True).splitlines() |
| + # Before Swift 6.4 the resource accessor fell back to the absolute .build |
| + # path it was compiled in; deny every such path the binary names. Swift |
| + # 6.4.2's accessor names none (Bundle.main, Bundle(for:), the bundle URL), |
| + # so the scan finds nothing there. This checkout's own build directory is |
| + # denied either way, which keeps the test denying something real. |
| fallbacks = {line.split("/.build/", 1)[0] + "/.build" for line in strings |
| if line.startswith("/") and "/.build/" in line and line.endswith(".bundle")} |
| - assert fallbacks, "No SwiftPM fallback paths found; review test coverage" |
| + fallbacks.add(str(Path(__file__).resolve().parents[1] / "apple/.build")) |
| profile = '(version 1)(allow default)' + ''.join( |
| f'(deny file-read* (subpath {json.dumps(path)}))' for path in sorted(fallbacks)) |
| probe = root / "windows.swift" |