Skip to content

feat: materialize open supervision topics as Focus Queue tasks - #282

Merged
dholbach merged 1 commit into
mainfrom
feat/p050-materialize-supervision-tasks
Jul 29, 2026
Merged

feat: materialize open supervision topics as Focus Queue tasks#282
dholbach merged 1 commit into
mainfrom
feat/p050-materialize-supervision-tasks

Conversation

@dholbach

Copy link
Copy Markdown
Owner

Summary

  • SupervisionItem (existing per-client supervision agenda model, with its own cross-client /supervision/ queue at supervision_queue) fits the same materialize-and-reconcile pattern already used for missing session logs and unpaid/unsent invoices.
  • sync_focus_queue_tasks now also creates one Task per open (status=offen) SupervisionItem, auto-closed when the item is marked besprochen (existing toggle on the client detail page / supervision queue) — reusing the existing generic _sync_object_tasks helper, no new plumbing.
  • related_object_url gains a supervisionitem branch linking to the client detail page (client_detail), since SupervisionItem has no page of its own.
  • Closes the "supervision" half of Focus Queue: design recurring_review task type (periodic case/progress review) #280task_type=SUPERVISION was previously a dead enum value nothing ever assigned. RECURRING_REVIEW remains open, tracked separately (needs its own design — periodic case/progress review, not yet scoped).

Design notes

  • Task titles use the client code only, never SupervisionItem.content — that field is Fernet-encrypted specifically because it can hold sensitive clinical material, so it must stay out of a plaintext title (same rule the command already follows for the other materialized types).
  • Like the other three materialized types, completing the Task in the Focus Queue does not flip SupervisionItem.status back to besprochen — the sync only reconciles source → task, not the reverse. Pre-existing asymmetry, not new here.
  • /supervision/ (the dedicated cross-client queue) is untouched and stays as the detailed per-client view; the Focus Queue now just also surfaces the same open items in the unified "what needs doing" list.

Test plan

  • ./dev.py test my_practice.tests.test_sync_focus_queue_tasks my_practice.tests.test_practice_todo my_practice.tests.test_views_focus_queue — 63 tests pass
  • ./dev.py lint passes

🤖 Generated with Claude Code

SupervisionItem (the existing per-client supervision agenda model, with its
own cross-client /supervision/ queue) fits the same materialize-and-
reconcile pattern already used for missing session logs and unpaid/unsent
invoices. Adds a fourth _sync_object_tasks call: one Task per open
(status=offen) SupervisionItem, auto-closed when marked besprochen via the
existing supervision queue/client detail page.

This makes task_type=SUPERVISION a real, populated type instead of a dead
enum value never assigned anywhere (#280) — supervision topics now show up
in the single "what needs doing" surface alongside everything else, without
duplicating or replacing the dedicated /supervision/ page.

Task titles use the client code only, never SupervisionItem.content — that
field is Fernet-encrypted specifically because it can hold sensitive
clinical material, and titles must stay plaintext-safe like the other
materialized types.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dholbach
dholbach merged commit 9ae601a into main Jul 29, 2026
1 check passed
@dholbach
dholbach deleted the feat/p050-materialize-supervision-tasks branch July 29, 2026 15:52
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