Files
Croissant Le Doux 9370c04ac5 Wire the offline write-queue into the desktop write path
The offline write-queue (packages/core/src/queue/write-queue-v0.ts, #33) was a
tested pure module that nothing imported. Approving a change while gitea was
unreachable made gitea:applyChange call the client directly and throw, losing
the write. Now it's wired end to end:

- queue-store.ts persists the queue next to the snapshot store (same
  degrade-to-empty-on-corruption discipline; injectable path for tests).
- applyChange extracts the guarded write into applyChangeLive and, on
  unreachability (any error that is NOT a GiteaApiError rejection), enqueues the
  intent — coalesced by (issue, axis) — instead of throwing, returning
  { ok, queued, pending }. A genuine GiteaApiError still surfaces (a doomed
  write must not replay forever).
- reconcile drains the queue once a successful read proves gitea is reachable,
  re-reading so the board reflects the replays; replays are idempotent
  (label plan.noop, assignee/milestone re-set). boot + stale reconcile report
  the pending count so the badge shows immediately offline.
- Renderer: use-backlog threads `pending`; the OfflineBanner shows "N queued";
  the chat approve message distinguishes a queued (offline) approval from an
  applied one.

Also wires vitest into the desktop workspace (was missing, so the main-process
suite couldn't run via `yarn test`) and fixes a stale Capture copy assertion
left by the earlier posh-copy pass.

Tests: queue-store.test.ts (persist/reload/coalesce/replay-drain, real core fns);
9 main-process + 169 core green; 12 demo e2e green. A one-off GITEA_LIVE smoke
verified an online write lands+reverts and an offline approve queues+drains
against the real repo (not committed, per the repo's no-mutating-test convention).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 19:55:45 -04:00
..

CommiTea (desktop)

An AI project manager for Gitea, as an Electron desktop app. The token stays in the main process (OS keychain via safeStorage); the renderer never sees it.

Develop

yarn dev          # electron-vite dev, HMR renderer + main (logs → desktop.log)
yarn typecheck
yarn e2e          # builds, then Playwright against the built main (fixtures/demo)

For a live pass against a real Gitea, put a token in .env.local (GITEA_TOKEN=…) and run GITEA_LIVE=1 yarn e2e live-onboarding.

Package (shareable macOS .dmg)

yarn pack         # unpacked .app for the host arch (fast sanity check) → dist/
yarn dist         # arm64 + x64 .dmg → dist/CommiTea-<version>[-arm64].dmg

Config is electron-builder.yml. Builds are unsigned (no Apple certs, by decision) — electron-builder ad-hoc signs so the app can run, but it is not notarized. Bump version in package.json for a new release; keep electronVersion in electron-builder.yml in sync with the electron devDependency.

Installing a shared build (teammates)

macOS Gatekeeper blocks unsigned apps on first launch. To open:

  1. Open the .dmg and drag CommiTea to Applications.
  2. In Applications, right-click CommiTea → Open, then confirm Open in the dialog. (Double-clicking the first time just shows "cannot be opened".)
  3. It opens to the connection screen — enter your Gitea base URL, owner/repo, and a personal access token (repo scope). Each teammate uses their own token, so activity is attributed correctly. A model URL is optional; chat is disabled until one is configured, everything else works without it.

Grab the -arm64 dmg on Apple Silicon, the plain one on Intel.