From b6249a41c0b73be582fb6f35535820b4f9ff0bdb Mon Sep 17 00:00:00 2001 From: Janpeter Visser <30029041+madhura68@users.noreply.github.com> Date: Thu, 14 May 2026 15:59:27 +0000 Subject: [PATCH] feat(PBI-67): IDEA_REVIEW_PLAN + geconsolideerde WIP-fixes (#203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(ci): docs:check-links groen — exclude docs/old/ + archiveer stale plans CI faalde sinds #191 (docs cleanup) op pre-existing broken links: - docs/old/ bevat archief-docs met by-design stale paden - docs/plans/PBI-79*, M9*, M11* hadden geprojecteerde paden naar ../backlog/index.md (verplaatst naar docs/old/backlog/) en naar app-bestanden die nooit met de juiste relatieve prefix waren geschreven - docs/adr/0000* verwees naar docs-restructure-ai-lookup.md (verplaatst) - docs/glossary.md verwees naar /docs/backlog/index.md (verplaatst) Fixes: - scripts/check-doc-links.mjs: skip docs/old/ recursief - Move docs/plans/{PBI-79,M9,M11}*.md → docs/old/plans/ (allemaal merged PBIs; plans waren historisch) - docs/adr/0000-record-architecture-decisions.md: update pad naar archief - docs/glossary.md: verwijder dode "backlog index"-link Verificatie: `npm run docs:check-links` → ✓ All doc links valid (105 files) Co-Authored-By: Claude Opus 4.7 (1M context) * fix(sprint-conflicts): stories uit CLOSED/ARCHIVED/FAILED sprints zijn weer eligible Bug: bij sprint-aanmaken (en story-toevoegen aan een actieve sprint) gaf de backend "Geen eligible stories voor deze sprint" zodra je stories aanvinkte die ooit in een sprint hadden gezeten — ook als die sprint allang gesloten of gearchiveerd was. partitionByEligibility checkte alleen story.sprint_id, nooit sprint.status, terwijl getBlockingSprintMap in dezelfde file wél al filterde op sprint: { status: 'OPEN' }. Inconsistent. Fix: partitionByEligibility en isEligibleForSprint wegen nu sprint.status mee. Een story blokkeert alleen als hij in een ANDERE sprint zit DIE NOG OPEN is. Stories uit CLOSED/ARCHIVED/FAILED sprints worden weer vrij voor planning — story.sprint_id blijft als historische referentie staan tot de volgende updateMany hem overschrijft naar de nieuwe sprint. Neveneffect: een DONE story in een gesloten sprint krijgt nu reason='DONE' i.p.v. het misleidende reason='IN_OTHER_SPRINT'. Tests: 3 nieuwe scenario's in __tests__/lib/sprint-conflicts.test.ts (CLOSED/ARCHIVED/FAILED → eligible, DONE-in-CLOSED → reason=DONE). De oude test 'does NOT mark crossSprint for stories in CLOSED other sprint' is vervangen omdat hij het bug-gedrag vastlegde. Co-Authored-By: Claude Opus 4.7 (1M context) * test(sprint-switcher): repareer mock om CI te unblocken Twee pre-existing mock-bugs die op main al rood waren maar geen gevolgen hadden tot de CI-monitor erop sloeg in deze PR: 1. Mock-state miste `entities.settings`. Sinds PBI-79 (commit d587be2) selecteert SprintSwitcher ook `s.entities.settings.workflow?.pendingSprintDraft?.[productId]?.goal`, maar de testmock leverde alleen `{ context }`. → undefined-crash op `entities.settings` reading. 2. Mock factory exporteerde alleen `setActiveSprintAction`, maar de productie roept `switchActiveSprintAction` aan. Door `vi.mock` werden alle andere exports `undefined`, waardoor `actionMock` nooit kon triggeren. Out-of-scope-fix t.o.v. de sprint-eligibility-fix in dit PR — apart commit zodat reviewer dit als losse cleanup kan zien. CI is nu groen lokaal: 3/3 sprint-switcher tests + 839/839 full suite. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(ideas): upload-plan knop — short-circuit van Make-Plan AI-flow Voegt een 'Upload plan' knop toe in idea-row-actions (verschijnt in zowel list als idea-detail). Klik → file picker → kies .md → server-side parse + opslaan; idea-status springt naar PLAN_READY. Vandaaruit de bestaande 'Maak PBI' knop voor materialize. Server (uploadPlanMdAction): - Toegestaan vanuit DRAFT, GRILLED, PLAN_FAILED, PLAN_READY - DRAFT → skip-grill: status gaat direct naar PLAN_READY - PLAN_READY overschrijft het bestaande plan (consistent met updatePlanMdAction, geen confirmation) - Geblokkeerd in GRILLING/PLANNING (job loopt), PLANNED (al gematerialiseerd) - Parse-failure → 422 + details (NIET opslaan, zodat een onparseerbaar plan nooit in de DB belandt) - Empty / >100k chars → 422 - Schrijft IdeaLog NOTE met from_status + length - Rate-limit + demo-guard + ownership-check via loadOwnedIdea (zelfde patroon als updatePlanMdAction) UI (idea-row-actions.tsx): - Hidden - FileReader → text → action - Toast bij success + router.refresh() - Blocked-tooltip in andere statussen Tests: 10 nieuwe in __tests__/actions/ideas-crud.test.ts dekkend voor: happy paths (DRAFT/GRILLED/PLAN_READY-overwrite/PLAN_FAILED), blocks (PLANNED/GRILLING), validation (empty/oversized/parse-fail), 404. Full suite groen: 849/849. Co-Authored-By: Claude Opus 4.7 (1M context) * Add reviews for Bootstrap-wizard plans v3.2 to v3.4 - Review v3.2: Addressed executor model, fire-and-forget issues, and PAT handling. - Review v3.3: Improved transaction handling, stale recovery, and ID generation. - Review v3.4: Finalized GitHub permissions, catalog versioning, and E2E verification queries. - Updated recommendations for each version to enhance implementation readiness. * fix(ideas): respecteer YAML-volgorde bij plan-materialize Tasks erven nu story-priority i.p.v. eigen task.priority bij materializeIdeaPlanAction. Worker sorteert op `priority ASC, sort_order ASC`; gemixte task-priorities binnen één story zouden anders de YAML-volgorde verstoren (e.g. tasks met priority 1/1/1/2/1/2 → worker-volgorde 1,2,3,5,4,6 i.p.v. 1,2,3,4,5,6). - actions/ideas.ts: priority = s.priority bij task-create - lib/schemas/idea.ts: task.priority optional (geaccepteerd, genegeerd) - lib/idea-prompts/make-plan.md: documenteer dat task.priority genegeerd wordt - __tests__/lib/idea-schemas.test.ts: test dat omitted task.priority slaagt Co-Authored-By: Claude Opus 4.7 (1M context) * docs(make-plan): documenteer backtick-format voor implementation_plan-paden verify_task_against_plan extraheert paden uit implementation_plan via twee regex-patronen (backticks + bullet). Paden inline in genummerde tekst-stappen worden niet herkend → planPaths.length=0 → bij diff >50 regels DIVERGENT. Voeg sectie "Bestandspaden in implementation_plan — verplicht format" toe die uitlegt welke formats werken (backticks, bullets) en welke niet (inline). Plus verband met verify_required-keuze: default ALIGNED_OR_PARTIAL behouden voor ADR-stubs en multi-file edits. Voorkomt herhaling van T-963 cancelled_by_self-symptoom waar implementatie slaagde maar verifier DIVERGENT teruggaf. Co-Authored-By: Claude Opus 4.7 (1M context) * docs(plans): M8 bootstrap-wizard upload-variant v1.4 — backtick-paden Upload-variant van het volledige technische plan (docs/plans/M8-bootstrap-wizard.md), bedoeld voor de "Upload plan"-functie. Genereert 1 PBI + 4 Stories + 22 Tasks via materializeIdeaPlanAction. v1.4-aanpassingen tov eerdere generatie-iteratie: - Alle bestandspaden in implementation_plan in backticks (path-extractor matchen) - Expliciete "Bestanden:" blok per task vóór de stappen - Alle tasks op verify_required: ALIGNED_OR_PARTIAL (was deels ALIGNED — te strict voor ADR-stubs en multi-file edits) Fixt forward-only: T-963 cancelled_by_self door DIVERGENT verifier-verdict. Re-upload van dit bestand produceert tasks die door verify_task_against_plan als ALIGNED of PARTIAL geclassificeerd kunnen worden. Co-Authored-By: Claude Opus 4.7 (1M context) * PBI-67: Add review-plan support to Idea model and job config - Add plan_review_log and reviewed_at fields to Idea model - Add REVIEWING_PLAN, PLAN_REVIEW_FAILED, PLAN_REVIEWED to IdeaStatus enum - Add IDEA_REVIEW_PLAN to ClaudeJobKind enum - Add IDEA_REVIEW_PLAN config to job-config.ts with model=opus, thinking_budget=6000 - Create migration record for schema changes (applied via db push) Co-Authored-By: Claude Haiku 4.5 * PBI-67 Phase 2: Add update-idea-plan-reviewed MCP tool - Create src/tools/update-idea-plan-reviewed.ts: saves review-log and transitions idea status to PLAN_REVIEWED - Add PLAN_REVIEW_RESULT to IdeaLogType enum (both repos) - Register tool in src/index.ts - Update Prisma schemas (both repos): add plan_review_log and reviewed_at fields to Idea model - Add REVIEWING_PLAN, PLAN_REVIEW_FAILED, PLAN_REVIEWED to IdeaStatus enum (MCP schema) - Add IDEA_REVIEW_PLAN to ClaudeJobKind enum (MCP schema) - Tool includes transaction safety and convergence metrics logging Co-Authored-By: Claude Haiku 4.5 * feat(PBI-67): IDEA_REVIEW_PLAN Phases 3-6 — server actions, UI components, prompt & tests - Phase 3: startReviewPlanJobAction, cancelIdeaJobAction, status transitions (REVIEWING_PLAN / PLAN_REVIEWED / PLAN_REVIEW_FAILED), status colors, job-card/jobs-column filters, idea-list status tabs - Phase 4: review-plan-job.md prompt (multi-model orchestration with codex injection + active plan revision via update_idea_plan_md after each round), runbook, 13 unit tests - Phase 5: ReviewLogViewer component (rounds, convergence, approval, issues), idea-detail integration, proper ReviewLog TypeScript types exported from component - Phase 6.1: wait-for-job discriminator wired (IDEA_REVIEW_PLAN), plan-revision step made mandatory in prompt (was previously optional/missing) Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Opus 4.7 (1M context) --- docs/INDEX.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/INDEX.md b/docs/INDEX.md index 91a3b27..fa30fbe 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -126,6 +126,7 @@ Auto-generated on 2026-05-14 from front-matter and headings. | [Review — M8 bootstrap-wizard plan v3.4](./recommendations/bootstrap-wizard-plan-v3-4-review-2026-05-14.md) | `recommendations/bootstrap-wizard-plan-v3-4-review-2026-05-14.md` | — | — | | [Aanbeveling — Claude VM jobflow en gitstrategie](./recommendations/claude-vm-job-flow-git-strategy.md) | `recommendations/claude-vm-job-flow-git-strategy.md` | draft | 2026-05-09 | | [Load/render implementatie review](./recommendations/load-render-implementation-review-2026-05-10.md) | `recommendations/load-render-implementation-review-2026-05-10.md` | review | 2026-05-10 | +| [Review — code als bindende volgorde voor stories en taken](./reviews/onderzoek-wat-er-gedaan-quirky-mist-review.md) | `reviews/onderzoek-wat-er-gedaan-quirky-mist-review.md` | — | — | | [Agent-flow: open issues & decision log](./runbooks/agent-flow-pitfalls.md) | `runbooks/agent-flow-pitfalls.md` | active | 2026-05-03 | | [Auto-PR flow: van story-DONE naar gemergde PR](./runbooks/auto-pr-flow.md) | `runbooks/auto-pr-flow.md` | active | 2026-05-06 | | [Branch, PR & Commit Strategy](./runbooks/branch-and-commit.md) | `runbooks/branch-and-commit.md` | active | 2026-05-03 |