feat: deterministic scheduler → real Now/Next/Later (P2 thin slice)
CommiTea now recommends its own next unit of work from the live backlog. - @commitea/core: `schedule()` — dependency topo-sort with priority + estimate tie-breaks, single serial capacity, cycle detection, and critical-path marking; `selectFocus()` takes the top three. Pure, deterministic; the LLM does none of this. +11 tests (39 in core). Client gains `getIssueDependencies`. - main: reconcile also fetches native issue dependencies for the open scope and returns edges. - renderer: `scheduleFocus()` maps real issues+deps→Now/Next/Later; Focus renders scheduler output (fixture fallback when unconfigured). v0 scope (each a later slice): single serial worker (per-person capacity #8), point durations (Monte Carlo cone #10), estimate-only (calibration #5). Verified: 14 e2e green (fixtures) + gated live spec — the board shows the real 25 open + 9 closed, and Focus picks #2 ChangeSource (critical path) as Now. Screenshots confirmed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -51,9 +51,15 @@ export function registerGiteaIpc(): void {
|
||||
ipcMain.handle('gitea:status', () => ({ configured: !!config, repo }))
|
||||
|
||||
ipcMain.handle('gitea:reconcile', async () => {
|
||||
if (!client) return { configured: false, issues: [], milestones: [] }
|
||||
if (!client) return { configured: false, issues: [], milestones: [], deps: [] }
|
||||
const [issues, milestones] = await Promise.all([client.listIssues(), client.listMilestones()])
|
||||
return { configured: true, issues, milestones }
|
||||
// dependency edges among the open scope (the scheduler only plans what's left)
|
||||
const open = issues.filter((i) => i.state === 'open')
|
||||
const perIssue = await Promise.all(
|
||||
open.map(async (i) => ({ issue: i.number, dependsOn: await client.getIssueDependencies(i.number) })),
|
||||
)
|
||||
const deps = perIssue.flatMap(({ issue, dependsOn }) => dependsOn.map((d) => ({ issue, dependsOn: d })))
|
||||
return { configured: true, issues, milestones, deps }
|
||||
})
|
||||
|
||||
ipcMain.handle('gitea:getIssue', async (_event, index: number) => {
|
||||
|
||||
Reference in New Issue
Block a user