/create_plan @thoughts/shared/research/2026-04-23-codex-vs-lightfast-desktop-production-gap.md let's select the next batch of things to implement right now pre release to production. and also tell me what to setup: e.g sentry/apple dev/blah/blah
User
create_plan
/create_plan
@thoughts/shared/research/2026-04-23-codex-vs-lightfast-desktop-production-gap.md let's select the next batch of things to implement right now pre release to production. and also tell me what to setup: e.g sentry/apple dev/blah/blah
Assistant· claude-opus-4-7
I'll read the research doc and check existing context before proposing the next batch. Let me gather everything in parallel.
Assistant· claude-opus-4-7
Got the existing quick-wins plan. Now let me check current state of the relevant files to understand what's been implemented vs pending, and what the gap is to actual production release.
Assistant· claude-opus-4-7
Let me check current state of sentry, entitlements, and related files.
Assistant· claude-opus-4-7
User
what are you best suggestion here for 1.
Assistant· claude-opus-4-7
Let me check one thing before recommending — whether the monorepo is public, which changes the calculus completely.
Assistant· claude-opus-4-7
Recommendation: (a) monorepo tags
Monorepo is public (lightfastai/lightfast, confirmed via gh repo view) — that removes the only real reason to split: Sparkle feed URLs and download links work without auth for end users.
Why (a) over (b):
Zero extra auth plumbing. The workflow's GITHUB_TOKEN already has contents:write on this repo. A dedicated repo needs a fine-grained PAT stored as a new secret, which is one more thing that can expire/rotate.
Source + tag + artifact live together. tag points directly at the commit it was built from. No cross-repo commit hash dance when debugging "which commit shipped in 0.1.0."
User
a) makes sense. but i think maybe we should use a better naming convention instead of desktop-v. what is industry standard.
Assistant· claude-opus-4-7
Recommendation: @lightfast/desktop@<version>
Matches the exact name in apps/desktop/package.json:2 and the changesets convention already used in this repo (release.yml produces and tags). One tagging rule across the whole monorepo beats two.
User
good job. agreed one these proceed.
Assistant· claude-opus-4-7
Locking Q2–Q5 to my best-call defaults and writing the plan. Quick note on each so nothing gets encoded silently:
Q2 — both arm64 + x64. Matrix already does it; Intel Macs are still a non-trivial install base; ~30min extra CI.
Q3 — bake DSN at CI build time via npm pkg set sentryDsn=... (same pattern as buildNumber). DSN is a public identifier; env-at-launch is hard on macOS.
Q4 — tag-only releases for desktop. Add apps/desktop/** to changesets ignore; don't touch verify-changeset.yml. Desktop version cadence ≠ npm cadence.
Q5 — punt file logger. Sentry + breadcrumbs covers v0.1.0.
Let me verify a couple of things before writing the plan.
Assistant· claude-opus-4-7
Writing the plan now.
Assistant· claude-opus-4-7
Plan written to thoughts/shared/plans/2026-04-23-desktop-pre-release-batch.md.
Six phases:
A — External setup checklist (Apple Dev + Sentry + 10 GitHub secrets, 2 variables). Human-only, runs in parallel with B–F.
B — Forge config + build-info cleanup. Hardcode monorepo as release target, drop unused sparklePublicKey, add sentryDsn to schema. ~6 small edits.
C — + devDep. Uploads both and with .
I have enough context. Here's my read on current state and a proposed next batch.
What's Already Done (since the research was written)
All four quick-win phases from 2026-04-23-desktop-codex-gap-quick-wins.md have been applied:
Phase 1 — entitlements diet: build/entitlements.mac.plist now has only 5 keys (no disable-library-validation/device.camera/network.server). ✅
Phase 3 — Sentry tags + RewriteFrames: src/main/sentry.ts:14-55 has SESSION_ID, rewriteFramesIntegration({root, prefix: "app:///"}), dist=buildNumber, and bundle/host/sessionId tags. ✅
Phase 4 — dead code: showContextMenu gone from ipc.ts, silentRefresh/protocol.ts deleted, OAuth was reworked to a cleaner loopback HTTP server flow (auth-flow.ts:70-141) that obsoletes the deep-link dispatcher entirely. ✅
What Still Blocks Production Release
Real code/CI gaps (things I can plan)
Sentry source-map upload in CI — rewriteFramesIntegration is already wired with app:/// prefix but no CI step uploads the maps. First crash report from a packaged build will be minified garbage. @sentry/cli is in pnpm-workspace.yaml:82onlyBuiltDependencies (installed, never invoked).
desktop-release.yml.disabled → enabled — needs rename + these hardening edits: no cancel-in-progress, no Sentry release step, no source-map upload, no artifact attestation, static "Automated release" notes.
CI coverage for desktop — ci-core.yml:45,105explicitly excludes desktop from typecheck + build. ci.yml only runs desktop typecheck via turbo --affected. Nothing builds/packages desktop on every PR — packaging regressions reach main.
verify-changeset.yml:51 — allowlist blocks a @lightfast/desktop changeset. Need a decision: allow changesets, or commit to tag-only (desktop-v*) releases.
Release host repo — forge.config.ts:43-54 reads LIGHTFAST_DESKTOP_RELEASE_REPO (dedicated repo) but desktop-release.yml.disabled:54 passes ${{ github.repository }} (monorepo). The two are in conflict; first release will fail-closed until resolved.
Build-metadata stamping in the workflow — the workflow stamps version/buildFlavor/buildNumber/sparkleFeedUrl but misses sparklePublicKey (stays "", which is fine since we're on Electron autoUpdater not Sparkle-native — but worth a comment or removing the field entirely to avoid confusion).
Developer ID Application certificate → export .p12 with password
App Store Connect API key → .p8 file + key ID + issuer UUID
Add these 8 secrets to the GitHub repo hosting the workflow:
APPLE_SIGNING_IDENTITY (e.g. Developer ID Application: Lightfast AI Inc (TEAMID))
APPLE_TEAM_ID (10-char)
APPLE_CERT_BASE64 (base64 < cert.p12)
APPLE_CERT_PASSWORD (the p12 password)
APPLE_API_KEY_ID (10-char)
APPLE_API_ISSUER (UUID)
APPLE_API_KEY_CONTENT (contents of AuthKey_XXX.p8)
KEYCHAIN_PASSWORD (any strong random string; CI-local only)
Sentry — 4 things:
Create lightfast-desktop project in your Sentry org
Grab the DSN → stored as SENTRY_DSN secret (CI) + shipped via env at runtime
Create a Sentry auth token with project:releases scope → SENTRY_AUTH_TOKEN secret
Note SENTRY_ORG and SENTRY_PROJECT values for the CLI commands
GitHub release repo decision — pick one:
(a) Ship from the monorepo itself (simpler, tag desktop-v* on main). Requires dropping LIGHTFAST_DESKTOP_RELEASE_REPO logic in forge.config.ts.
(b) Dedicated public repo lightfastai/lightfast-desktop-releases (cleaner public artifact URLs, no need to make monorepo releases public). Requires a cross-repo PAT for the workflow.
Proposed Next Batch
In scope (pre-release, ~1–2 days code):
Phase A — Release-repo resolution (tiny, unblocks everything)
Phase B — Source-map upload to Sentry (new script in apps/desktop/scripts/, Sentry release step in workflow)
Phase C — Harden & enable desktop-release.yml (rename off .disabled, add cancel-in-progress, attestation, real release notes, Sentry release step, fix sparklePublicKey placeholder)
Phase D — Desktop CI coverage (add desktop to ci-core.yml typecheck, add ci.yml job that runs electron-forge package on macos for PRs touching desktop)
Phase E — Contributor ergonomics (.env.example, lint script, fix or rename dev:desktop-stack, changeset allowlist decision)
Explicitly deferred (not blocking v0.1.0):
File-backed main-process logger (big lift; Sentry breadcrumbs cover most of the need if properly wired)
Sparkle-native Ed25519 auto-update (Squirrel.Mac is fine for v0.1.0)
Release repo: (a) monorepo tags, or (b) dedicated lightfast-desktop-releases repo? This is the highest-leverage decision — affects download URLs, workflow auth, and public-vs-private of the monorepo.
First release arch: arm64-only (matches Codex, ~half the CI time), or both arm64+x64 from day one (what the disabled workflow already does)?
Sentry DSN delivery: bake into package.json/build-info.ts at CI time (simplest, DSN is public anyway), or keep injecting via SENTRY_DSN env at launch (requires an entry in the .app bundle's env somehow — hard on macOS; usually means a wrapper)?
Changeset policy for desktop: allowlist @lightfast/desktop in verify-changeset.yml so it participates in the changeset flow, or commit to tag-only releases for desktop (no changeset entries needed)?
File logger: in-scope for first release or genuinely punt? My read: punt — Sentry + breadcrumbs is enough for v0.1.0, and adding a file logger is a full sub-phase by itself. Confirm?
Once you answer 1–5 I'll write the detailed plan to thoughts/shared/plans/2026-04-23-desktop-pre-release-batch.md.
desktop-v0.1.0
No namespace collision with release.yml. Changesets produces lightfast@x.y.z / @lightfastai/mcp@x.y.z tags; desktop would use desktop-v*. Different prefixes, one release page — users actually benefit from seeing everything in one place.
Artifact size isn't a problem. GitHub release asset storage is unmetered. ~200MB per release (arm64+x64 zip+dmg) is fine.
apps/desktop/forge.config.ts:43-54 reads LIGHTFAST_DESKTOP_RELEASE_REPO — remove that indirection, hardcode { owner: "lightfastai", name: "lightfast" } in the PublisherGithub config. One less env var, one less way to misconfigure.
Sparkle feed URL becomes the stable https://github.com/lightfastai/lightfast/releases/latest/download/latest-mac-${arch}.json — which is what the workflow already stamps.
The one tradeoff you're accepting: monorepo release page gets desktop binaries alongside npm release entries. I think that's a feature, not a bug — it's the honest shape of what you ship.
Ready for your call on 2–5 and I'll write the plan.
lightfast@x.y.z
@lightfastai/mcp@x.y.z
The landscape:
Convention
Example
Used by
<package>@<version>
@lightfast/desktop@0.1.0
Changesets, Lerna, Nx, Turborepo, Tauri, Expo — the de facto standard for pnpm/npm monorepos
<product>/v<version>
desktop/v0.1.0
Some ad-hoc monorepos (git treats / as namespace)
<shortname>-v<version>
desktop-v0.1.0
Older setups — what the disabled workflow currently has
v<version>
v0.1.0
Single-product repos (VS Code, Signal, Obsidian, Electron itself) — not appropriate in a monorepo
Why @lightfast/desktop@<version> wins here specifically:
Consistency — your repo already tags npm packages this way via changesets/action. Users scanning git tag -l see one pattern.
Future-proof for changesets — if you ever allowlist @lightfast/desktop in verify-changeset.yml (my Q4), changesets will produce this exact tag format. Pre-adopting it means no migration later.
Self-documenting — the tag IS the package identifier. You can paste it anywhere and it's unambiguous which artifact it points to.
Concrete edits for the plan:
desktop-release.yml.disabled:6 — change trigger from desktop-v* to '@lightfast/desktop@*' (the quotes matter in YAML because of the @).
desktop-release.yml.disabled:23-26 — change the version extraction from ${tag#desktop-v} to ${tag#@lightfast/desktop@}.
Document the convention in apps/desktop/README.md so contributors know how to cut a release (git tag @lightfast/desktop@0.1.0 && git push origin @lightfast/desktop@0.1.0).
The one caveat:@ needs shell-quoting in some contexts (git push origin "@lightfast/desktop@0.1.0"). Tolerable — it's the same caveat that already applies to @lightfastai/mcp@* tags. If you ever find it annoying, desktop@<version> (no scope) is the fallback that keeps changesets-compat but avoids the leading @. But I wouldn't preemptively pick that — stay consistent with the existing tags.
Ready for 2–5.
scripts/upload-sourcemaps.mjs
@sentry/cli
.vite/build
.vite/renderer/main_window
--url-prefix "app:///"
D — Rename desktop-release.yml.disabled → .yml, switch trigger to '@lightfast/desktop@*', add cancel-in-progress, stamp sentryDsn, call Phase C script, add attest-build-provenance, generate release notes from commit range.
E — New desktop job in ci.yml (macos-14, paths-filtered to apps/desktop/**, runs typecheck + unsigned electron-forge package). ci-core.yml deliberately left alone.
F — .env.example, lint/clean scripts, rename dev:desktop-stack → dev:desktop-api, @lightfast/desktop into changesets ignore.
Locked-in decisions (encoded in plan):
Monorepo as release host (lightfastai/lightfast).
Tag convention: @lightfast/desktop@<version>.
Both arm64 + x64 from v0.1.0.
Sentry DSN baked at CI build time via npm pkg set sentryDsn="$SENTRY_DSN"; runtime env override preserved for dev.
Tag-only releases; desktop added to changesets ignore; verify-changeset.yml stays as-is.
File logger deferred.
External setup you need to do before Phase D can be validated end-to-end (the full checklist is in Phase A):
Apple Developer Program enrollment + Developer ID cert + App Store Connect API key → 8 GitHub secrets