Skip to content

feat(studio): dual-source roadmap — local Postgres layer (CS-76 phase A) - #36

Merged
RudneyForti merged 1 commit into
mainfrom
feature/76-roadmap-local-layer
Jul 20, 2026
Merged

feat(studio): dual-source roadmap — local Postgres layer (CS-76 phase A)#36
RudneyForti merged 1 commit into
mainfrom
feature/76-roadmap-local-layer

Conversation

@RudneyForti

Copy link
Copy Markdown
Collaborator

Summary

Phase A of CS-76: the Studio roadmap becomes dual-source. Postgres now owns the editable pre-PR layer (Backlog / Bloqueado / Em andamento); the git board (docs/cs-board.json) remains the authoritative done archive, written only by the roadmap-sync Action. The UI never rewrites the git board — the two writers stop fighting.

Changes

  • RoadmapCard model (Prisma): local layer keyed by csNumber (the upsert/join identity)
  • assembleBoard (lib/kanban.ts, pure + tested): merges git done cards with local cards, git-wins precedence when a CS was promoted
  • getKanbanBoard: reads git file + Postgres in parallel and assembles
  • saveKanbanBoard: persists only local-column cards to Postgres (upsert by CS + prune removed); git file untouched
  • UI locks: git-owned cards are non-draggable, drop into/out of git columns is cancelled, card modal opens read-only for git-owned cards regardless of assisted mode
  • Card creation: CS number now required (blank numbers collided on the upsert key); duplicate CS rejected
  • Backfill script scripts/roadmap-backfill-local.mjs (idempotent, ON CONFLICT DO NOTHING) — already run on dev: 17 cards seeded
  • Board subtitle now states both sources: "N planejados Postgres · M concluídos git"

Checklist

  • Link to feature/issue: CS-76
  • Description of changes included above
  • List of additions documented
  • All existing tests are passing (92)
  • New tests were added for this change (assembleBoard, isLocalColumn, local persistence routing)
  • Agent Smith validated behavior (browser round-trip: edit persisted to Postgres, git file untouched, git status clean)
  • No regressions observed

References

CS-76 (phase A of 3 — phase B adds the GitHub source + Revisão column, phase C server-side enforcement + AGENTS.md)

- add RoadmapCard model: the editable pre-PR layer (backlog/blocked/in-progress)
- getKanbanBoard assembles git (done archive) + Postgres (local), git-wins precedence
- saveKanbanBoard persists only local cards to Postgres; git board never rewritten from UI
- lock git-owned cards in the UI: non-draggable, read-only modal, drop-guard
- require a CS number on card creation (identity/upsert key); reject duplicates
- one-time backfill script to seed the local layer from cs-board.json
- unit tests for assembleBoard, isLocalColumn, and the local persistence routing
@RudneyForti
RudneyForti merged commit 71747e1 into main Jul 20, 2026
3 checks passed
@RudneyForti
RudneyForti deleted the feature/76-roadmap-local-layer branch July 20, 2026 00:39
@RudneyForti RudneyForti mentioned this pull request Aug 3, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant