🐾 feat(library): per-app managed_by replaces hardcoded Daedalus badge #7
Reference in New Issue
Block a user
Delete Branch "feature/managed-by"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Mnemosyne only had a concept of a Daedalus-managed library: any
Librarywith a non-nullworkspace_idwas badged "Daedalus workspace" regardless of which app actually manages it — so Kairos mail libraries were mislabeled, and Spelunker's global libraries carried no managed marker at all.Library.managed_by(neomodel StringProperty, no Django migration): stamped at create time with the name of the UserToken used on the API call, on bothPOST /library/api/workspaces/andPOST /library/api/libraries/. Web-session creates stay null → unmanaged. Never changed by edits or token rotation; the idempotent workspace re-POST lazily fills it when null.managed_by_displaydrives the UI: falls back to inference for legacy rows (kairos-mail-*→ Kairos, other workspace → Daedalus) so badges are correct before and after backfill.workspace_idguards. Advisory only, as before.?scope=all|managed|unmanaged; legacydaedalus/globalvalues alias for existing bookmarks.name_conflict409 with the existing library'suidand manager.backfill_managed_bymanagement command (idempotent,--dry-run,--*-labeloverrides): labels workspace libraries by inference and Spelunker's global libraries viaIngestJob.source="spelunker"provenance.Testing
library.tests.test_managed_by(new), rewrittentest_viewsscope tests,request_token_labelcoverage intest_drf_auth— 54 tests green on the touched modules against a throwaway postgres:17.library+mcp_serversuite: 444 tests; the only failures (8F/1E intest_search_api/test_tasks.test_embed_item_failure) also fail on clean origin/main — pre-existing, unrelated.Deploy
python manage.py backfill_managed_by --dry-run, inspect, then run with--daedalus-label/--kairos-label/--spelunker-labelmatching real production token names.🤖 Generated with Claude Code