The cache is a rebuildable index over gitea, never a source of truth (D4). Two tests lock that invariant where the durable cache actually lives: - packages/core: cache-purity-v0.test.ts — file-backed node:sqlite. Build the SQLite mirror from a gitea snapshot, capture every re-derived field, delete the .sqlite file, rebuild from the same snapshot, assert byte-identical. Plus a structural D4 guard: every issues-table column must map to a gitea field, so a future user-authored column can't silently break rebuild-ability. - apps/desktop: snapshot-store.test.ts — the shipped durable cache is the JSON snapshot-store. Delete the file → loadSnapshot returns null (degrades to no-cache, never throws), which is what forces the next getSnapshot to reconcile fresh from gitea. Corrupt/partial files are likewise treated as no-cache. Stands up vitest for the desktop main process (first unit tests there); electron is mocked, snapshot path is injected. No native better-sqlite3 shipped: the SQLite mirror has no consumer on any hot path yet, so wiring it into main (native module + asarUnpack + dmg re-verify) would add packaging risk for no runtime benefit. The purity invariant is proven at the seam for both caches; the native driver migration is deferred until SQLite becomes load-bearing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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:
- Open the
.dmgand drag CommiTea to Applications. - In Applications, right-click CommiTea → Open, then confirm Open in the dialog. (Double-clicking the first time just shows "cannot be opened".)
- 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.