PBI-8: Sprint-flow MCP-orkestratie + verifier-fix
Schema sync vanaf upstream Scrum4Me (v77617e8): FAILED toegevoegd aan Task/Story/Pbi/SprintStatus, nieuw SprintRunStatus + PrStrategy enums, SprintRun model, ClaudeJob.sprint_run_id, Product.pr_strategy. T-18 — propagateStatusUpwards in src/lib/tasks-status-update.ts. Real-time cascade Task → Story → PBI → Sprint → SprintRun bij elke task-statuswijziging. Bij FAILED cancelt sibling-jobs in dezelfde SprintRun. PBI-status BLOCKED blijft handmatig. Houd deze helper bit- voor-bit synchroon met Scrum4Me/lib/tasks-status-update.ts. updateTaskStatusWithStoryPromotion blijft als BC-wrapper. T-19 — wait-for-job.ts claim-filter. Task-jobs worden alleen geclaimd als hun SprintRun status QUEUED of RUNNING heeft. Idea-jobs blijven ongefilterd. Bij eerste claim van een QUEUED SprintRun → RUNNING binnen dezelfde tx (race-safe). T-20 — update-job-status.ts roept propagateStatusUpwards aan na elke task DONE/FAILED. Bestaande cancelPbiOnFailure-aanroep blijft voor PR-cleanup; sibling-cancellation overlap is harmless (idempotent). T-21 — classify.ts (verifier) leest nu ook "--- a/<path>" zodat delete-only commits niet meer als EMPTY worden geclassificeerd. Bug had eerder geleid tot ten onrechte FAILED-status op cmotto5h en cmotto5i (06-05-2026); zou met cascade-flow een hele sprint laten falen. Cleanup: create-todo.ts en open_todos in get-claude-context.ts verwijderd (Todo-model is op main gedropt). Endpoint geeft nu open_ideas terug — ideeën die niet PLANNED zijn. Status-mappers (src/status.ts) uitgebreid met failed. Tests: 184/184 groen (180 → 184; vier nieuwe delete-only classify-tests en herwerkte propagate-status tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c63e2c6730
commit
5c5ae20f10
14 changed files with 627 additions and 238 deletions
|
|
@ -124,3 +124,42 @@ describe('classifyDiffAgainstPlan — DIVERGENT (scope creep)', () => {
|
|||
expect(r.reasoning).toMatch(/extra/i)
|
||||
})
|
||||
})
|
||||
|
||||
// Helper voor pure-delete diffs: +++ /dev/null betekent dat het bestand
|
||||
// volledig verwijderd is. Pad zit alleen nog in de "--- a/<path>" regel.
|
||||
function makeDeleteDiff(files: string[], linesPerFile = 5): string {
|
||||
return files
|
||||
.map(
|
||||
(f) =>
|
||||
`diff --git a/${f} b/${f}\ndeleted file mode 100644\n--- a/${f}\n+++ /dev/null\n` +
|
||||
Array.from({ length: linesPerFile }, (_, i) => `-removed line ${i}`).join('\n'),
|
||||
)
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
describe('classifyDiffAgainstPlan — delete-only commits', () => {
|
||||
it('herkent delete-only diff (geen +++ b/, wel --- a/) als ALIGNED bij matchend plan', () => {
|
||||
const plan = 'Verwijder `src/old-helper.ts` — niet meer gebruikt.'
|
||||
const diff = makeDeleteDiff(['src/old-helper.ts'])
|
||||
const r = classifyDiffAgainstPlan({ diff, plan })
|
||||
expect(r.result).toBe('ALIGNED')
|
||||
})
|
||||
|
||||
it('retourneert PARTIAL wanneer plan meer paden noemt dan zijn verwijderd', () => {
|
||||
const plan = 'Verwijder `src/a.ts` en `src/b.ts`.'
|
||||
const diff = makeDeleteDiff(['src/a.ts'])
|
||||
const r = classifyDiffAgainstPlan({ diff, plan })
|
||||
expect(r.result).toBe('PARTIAL')
|
||||
})
|
||||
|
||||
it('retourneert ALIGNED voor delete-only diff zonder plan-baseline', () => {
|
||||
const diff = makeDeleteDiff(['src/old.ts'])
|
||||
const r = classifyDiffAgainstPlan({ diff, plan: null })
|
||||
expect(r.result).toBe('ALIGNED')
|
||||
})
|
||||
|
||||
it('retourneert nog steeds EMPTY voor echt lege diff', () => {
|
||||
const r = classifyDiffAgainstPlan({ diff: '', plan: 'Verwijder `src/x.ts`.' })
|
||||
expect(r.result).toBe('EMPTY')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue