feat: shelf lifecycle — completion harvest, cancel prune, copy-from — PR 2 of 2 (#254) #256

Merged
claude-bot merged 2 commits from feat/shelf-lifecycle into main 2026-07-24 17:42:03 +00:00
Contributor

PR 2 (lifecycle) of the Session Reference Shelf carry-forward feature (#254), completing the design signed off earlier. No migration (reuses PR 1's notes_harvested_at).

Completion harvest

When a session completes — both the GM complete_session path and the auto-complete Beat task — each wiki card's tonight-notes are copied into that entry's GM notes (tagged with the session), once per card (idempotent via notes_harvested_at). The shelf's live scratch notes become durable canon.

Cancel prune

Cancelling a session (GM cancel + series bulk-cancel) drops carried-forward cards that have no notes, while keeping session-specific work: manually-added cards, any card with notes, and cards pinned from that session. So a cancelled session doesn't retain a shelf it never used, but real prep is never lost.

Copy-from-session

POST /api/sessions/{id}/shelf/copy-from/{source} pulls another session's cards onto this one as one-off cards (same campaign, respecting the one-wiki-card rule) — for rescheduling or reviving a cancelled session's work. Surfaced as a "Copy from…" picker in the shelf header and empty state.

Verified

  • 16 new backend tests; 67 across shelf + sessions, no regressions (the completion/cancel hooks don't affect sessions without a shelf).
  • ruff clean; frontend eslint + palette tests clean.

Closes #254. Part of #235.

🤖 Generated with Claude Code

PR 2 (lifecycle) of the Session Reference Shelf carry-forward feature (#254), completing the design signed off earlier. No migration (reuses PR 1's `notes_harvested_at`). ## Completion harvest When a session **completes** — both the GM `complete_session` path and the auto-complete Beat task — each wiki card's tonight-notes are copied into that entry's **GM notes** (tagged with the session), once per card (idempotent via `notes_harvested_at`). The shelf's live scratch notes become durable canon. ## Cancel prune **Cancelling** a session (GM cancel + series bulk-cancel) drops carried-forward cards that have no notes, while keeping session-specific work: manually-added cards, any card with notes, and cards pinned *from* that session. So a cancelled session doesn't retain a shelf it never used, but real prep is never lost. ## Copy-from-session `POST /api/sessions/{id}/shelf/copy-from/{source}` pulls another session's cards onto this one as one-off cards (same campaign, respecting the one-wiki-card rule) — for rescheduling or reviving a cancelled session's work. Surfaced as a **"Copy from…"** picker in the shelf header and empty state. ## Verified - 16 new backend tests; **67 across shelf + sessions, no regressions** (the completion/cancel hooks don't affect sessions without a shelf). - ruff clean; frontend eslint + palette tests clean. Closes #254. Part of #235. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PR 2 (lifecycle) of the carry-forward feature. No migration (reuses PR 1's
notes_harvested_at column).

- Completion harvest: when a session completes — GM `complete_session` and the
  auto-complete Beat task both — each wiki card's tonight-notes are copied into
  the entry's GM notes (tagged, once per card).
- Cancel prune: cancelling a session (`cancel_session` + series bulk-cancel)
  drops carried-forward cards with no notes, keeping manual cards, noted cards,
  and cards pinned from that session.
- Copy-from: POST /api/sessions/{id}/shelf/copy-from/{source} pulls another
  session's cards in as one-off cards (same campaign, dedup-respecting) — for
  rescheduling / reviving a cancelled session's work.
- 16 new tests (67 across shelf + sessions, no regressions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(frontend): "Copy from another session" control on the shelf (#254)
All checks were successful
CI / Docker image build (pull_request) Successful in 22s
CI / Backend lint (ruff) (pull_request) Successful in 1m2s
CI / Frontend tests, audit, and build (pull_request) Successful in 2m14s
CI / Bot tests and audit (pull_request) Successful in 2m20s
CI / Backend migration, tests, and audit (pull_request) Successful in 4m37s
cb96d0d710
A placeholder "Copy from…" picker in the shelf header and empty state pulls a
chosen session's cards onto this one (backend returns the merged shelf, so the
board is replaced with it). Rounds out PR 2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-bot deleted branch feat/shelf-lifecycle 2026-07-24 17:42:04 +00:00
Sign in to join this conversation.
No description provided.