kanban-dev-webapp/scripts
Dave b3aac9ba4f feat(plan): Plan Puzzle v1 backend — proposal fields, server actions, Done-column guards
Adds the three proposal fields (proposed_target_date, proposed_by,
proposed_at) to the cards collection with a partial index that backs
the 'pending proposals' query, plus two new ActivityAction values
(date_proposed, date_proposal_resolved) and column_changed for
return-to-scheduled.

New server actions under src/app/actions/:
  - client-proposal.ts: client-manager drag creates a proposal (not
    a target_date write); 404 (not 403) on cross-tenant failures and
    Done-column cards, matching the rest of /api/client/*.
  - owner-plan.ts: accept and dismiss clear the three proposal
    fields together and emit the audit rows; returnToScheduledAction
    moves a Done card back to the first working column.

Server-side Done-column guards added to:
  - src/app/actions/reschedule.ts (was UI-only)
  - src/app/api/client/cards/[id]/route.ts (was UI-only)

Both pass through the new writeCardWithAudit helper at
src/lib/cards/write-with-audit.ts — single source of truth for
'patch card + emit activity rows', replacing the inline copies in
the PATCH route and rescheduleCardAction.

Adds src/lib/roadmap/slot-date.ts (slot <-> target_date mapping)
consumed by Pixel's puzzle UI; named SlotId API rather than the
plan's numeric indices for self-documenting callers.

CLIENT_EDITABLE_CARD_FIELDS stays at priority + target_date per
the brief; proposals go through the dedicated action so they get
their own audit row type.
2026-09-19 18:35:33 +02:00
..
_dbg.ts feat(dashboard): remove session-clustering paragraph from methodology 2026-09-16 15:30:46 +02:00
backfill.ts fix(commits): set source on ingest/backfill writes, tidy Task 1 review findings 2026-09-19 10:22:26 +02:00
compute.ts feat(dashboard): remove session-clustering paragraph from methodology 2026-09-16 15:30:46 +02:00
relink.ts chore(relink): CLI helper for off-server relink runs 2026-09-16 13:36:42 +02:00
seed-demo.ts feat(linking): idempotent relink engine preserving manual links 2026-09-16 13:23:33 +02:00
setup-remote.ts feat(plan): Plan Puzzle v1 backend — proposal fields, server actions, Done-column guards 2026-09-19 18:35:33 +02:00