Repository navigation
Add kickstart.sh for first-install walkthroughs - #836
Conversation
… a signed test DMG
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
| note "signed with: $([[ "$signing_identity" == "-" ]] && echo "ad-hoc" || echo "$signing_identity ($team_id)")" | ||
|
|
||
| # dmgbuild lives in an isolated venv because Homebrew Python is externally managed (PEP 668). | ||
| [[ -x "$VENV_DIR/bin/python3" ]] || python3 -m venv "$VENV_DIR" |
There was a problem hiding this comment.
Untrusted temporary interpreter If another local user creates
/tmp/Cotabby-dmg-venv/bin/python3 first, this executable-only check accepts it and the build step runs it with the kickstart user's privileges. Use a user-owned environment or verify ownership before executing an existing interpreter.
How this was verified: The fixed /tmp interpreter path is checked only for executability before the script invokes it.
| rm -rf "$archive" "$DMG_PATH" | ||
| "$REPO_ROOT/scripts/prepare_cotabby_workspace.sh" | ||
|
|
||
| marketing_version="$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')" |
There was a problem hiding this comment.
Tagless clones abort after reset If the clone has no reachable Git tag,
git describe fails and pipefail exits the script before the 0.0.0 fallback runs. By then, the app bundles and preferences have been removed, leaving the Mac reset without a replacement DMG. Handle the failed lookup within this assignment.
| elif security find-identity -v -p codesigning | grep -q '"Developer ID Application'; then | ||
| signing_identity="Developer ID Application" | ||
| team_id="$(security find-identity -v -p codesigning | sed -n 's/.*"Developer ID Application: .*(\([A-Z0-9]\{10\}\))".*/\1/p' | head -1)" |
There was a problem hiding this comment.
Signing identity can be ambiguous If the Mac has multiple Developer ID Application certificates, this code takes the first listed team ID but gives Xcode and
codesign only the generic identity name. Signing can fail as ambiguous or use a certificate from another team, so the DMG does not reliably reproduce the release identity. Select one certificate and use it throughout.
| if tccutil reset All "$id" >/dev/null 2>&1; then | ||
| note "reset $id" | ||
| else | ||
| note "skipped $id (no registered app; retried after the build for the release id)" |
There was a problem hiding this comment.
Dev permissions can survive reset If a previously deleted Cotabby Dev app cannot be resolved for this reset, the script skips it. The later retry registers and resets only the release app, so a subsequent Dev launch can retain an old permission grant instead of starting from the promised first-install state for both identities.
Knowledge Base Used: Permissions and user guidance
| "$lsregister" -f "$app_path" | ||
| tccutil reset All com.jacobfu.tabby >/dev/null && note "reset com.jacobfu.tabby against the new build" | ||
| "$lsregister" -u "$app_path" |
There was a problem hiding this comment.
Failed reset leaves app registered If the post-build
tccutil reset fails, errexit stops the script before it unregisters the archived app. That leaves a throwaway copy registered under the release bundle ID, so later app resolution can point to the archive instead of the installed app. Unregister it on the failure path as well.
…anchor Brings in FuJacob/cotabby through 7724926 (FuJacob#825, FuJacob#827, FuJacob#834, FuJacob#835, FuJacob#836, FuJacob#837, FuJacob#838): ghost text matched to the host's own rendering plus finishing the word being typed, Obsidian/Electron accessibility priming, rapid Tab accepts kept owned while the overlay presents, Apple Intelligence greyed out when unavailable, a new llama-recall eval fixture, the installer artwork and kickstart script, and a CI test-flakiness fix. Resolution, where both sides changed the same thing: - Suppression reasons: upstream's `CompletionContentPolicy` rejects any completion without a letter or digit (`noWordContent`), which subsumes this fork's `periodOnly`, so that case and its helper are removed and the bare-dot test now asserts the broader reason. Behaviour change worth knowing: a lone closing bracket or question mark is now withheld too, where this fork deliberately let those through; its test records that. - Prompt renderer: upstream's `personaLine(_:prefix:)` (the name only appears at a sign-off) wins; this fork's learned-phrases section is unchanged beside it. - Eval case schema: upstream added `visualContextSummary` and `clipboardContext` for its recall fixture; this fork's `screenText` and `learnedPhrases` stay alongside them. The harness prefers the pre-rendered summary and still puts raw `screenText` through the live local passes. Both scorer helpers kept. - Kept from this fork: the separate test host, the 2-4 word eval preset, phrase memory, the clock-time rule, the debug-artifact gate. Full suite: 2,724 tests, 16 skipped, 0 failures; the installed app's defaults byte-identical afterwards and no debug artifacts written. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
Adds
scripts/kickstart.sh, which resets this Mac to a first-install state for both Cotabby identities (releasecom.jacobfu.tabbyand devcom.jacobfu.tabby.dev) and builds a Developer ID signed Release DMG the same wayrelease.ymldoes, so the real new-user path (DMG, drag to Applications, onboarding, permission prompts) can be walked end to end.defaults, caches, logs, and saved state; keeps downloaded models unless--wipe-models.--wipe-models,--clean-only,--no-open,--adhoc,-y.Validation
bash scripts/kickstart.sh -ylocally againstmainat 0641e0d: apps stopped, bundles/prefs/logs cleared with models kept, DMG built and signed with Developer ID, and opened.This PR is not safe to merge until the untrusted interpreter path and the reset, signing, and failure-cleanup paths are addressed.
Summary
Adds a Mac first-install walkthrough script that resets both Cotabby identities, optionally preserves downloaded models, builds and signs a release-style DMG, and opens it for onboarding. The reset and build paths need safeguards for tagless clones, signing-certificate selection, permission-reset coverage, and cleanup after failures.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Confirm reset] --> B[Stop apps and clear local state] B --> C{Clean only?} C -- Yes --> D[Finish] C -- No --> E[Archive and sign release app] E --> F[Build and sign DMG] F --> G[Register app and reset release TCC] G --> H[Unregister app] H --> I[Optionally open DMG]Reviews (1) · Last reviewed commit: "Add kickstart.sh to reset this Mac to a ..."