feat: materialize open supervision topics as Focus Queue tasks - #282
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SupervisionItem(existing per-client supervision agenda model, with its own cross-client/supervision/queue atsupervision_queue) fits the same materialize-and-reconcile pattern already used for missing session logs and unpaid/unsent invoices.sync_focus_queue_tasksnow also creates oneTaskper open (status=offen)SupervisionItem, auto-closed when the item is markedbesprochen(existing toggle on the client detail page / supervision queue) — reusing the existing generic_sync_object_taskshelper, no new plumbing.related_object_urlgains asupervisionitembranch linking to the client detail page (client_detail), sinceSupervisionItemhas no page of its own.task_type=SUPERVISIONwas previously a dead enum value nothing ever assigned.RECURRING_REVIEWremains open, tracked separately (needs its own design — periodic case/progress review, not yet scoped).Design notes
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).SupervisionItem.statusback tobesprochen— 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 lintpasses🤖 Generated with Claude Code