feat: read the real gitea backlog into the app (P1 thin slice)

The app now displays its own live backlog instead of fixtures. First
end of the sync loop — the tap-root (#1) grows list reads and a read
path through the Electron main process.

- @commitea/core: client gains `listIssues` (paginated, PRs excluded)
  and `listMilestones`; a `lifecycle-v0` mapper (closed→done,
  labelled/milestoned→triage, bare→diagnosis — steeping/review await
  event inference in P1-5). +10 unit tests.
- main: gitea bridge over IPC (token stays in main, never the renderer);
  config from env / .env.local; gated off under COMMITEA_E2E so the
  committed e2e stays on fixtures. Preload exposes the typed bridge.
- renderer: useBacklog() reconciles once on mount; issuesToBoardColumns
  shapes real issues into The pot. Board takes optional real columns +
  a loading state, falling back to demo fixtures when unconfigured.

Verified: 14 e2e green (fixture mode) + a gated live spec that launches
against the real repo — the board renders the actual 25 open + 9 closed
issues (screenshot). SQLite mirror + reconcile-on-a-timer + lifecycle
event inference are the next slices (#2/#3/#5).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Croissant Le Doux
2026-07-08 16:57:57 -04:00
parent 0fc53d03be
commit 94199639f2
15 changed files with 422 additions and 15 deletions

View File

@@ -0,0 +1,29 @@
import { describe, expect, it } from 'vitest'
import { inferColumnV0 } from './lifecycle-v0.js'
const base = { state: 'open' as const, labels: [] as string[], milestone: null }
describe('inferColumnV0', () => {
it('closed issues are done', () => {
expect(inferColumnV0({ ...base, state: 'closed' })).toBe('done')
})
it('open + labelled is triage', () => {
expect(inferColumnV0({ ...base, labels: ['est/2d'] })).toBe('triage')
})
it('open + milestoned is triage', () => {
expect(inferColumnV0({ ...base, milestone: { id: 6, title: 'P1', dueOn: null } })).toBe('triage')
})
it('open + bare is diagnosis', () => {
expect(inferColumnV0(base)).toBe('diagnosis')
})
it('never guesses steeping or review in v0', () => {
// even a closed, labelled, milestoned issue resolves to a real column, never the event-only ones
const col = inferColumnV0({ ...base, labels: ['est/2d', 'p/1'], milestone: { id: 6, title: 'P1', dueOn: null } })
expect(['steeping', 'review']).not.toContain(col)
})
})