Repository navigation
Description
Problem
#848 gives Polylogue the first dynamic local reader shell, but the reader product is still browse-oriented. The MK2 reader direction also needs durable user state and recall workflows: stars, pins, annotations, saved views, and packs that can be handed to agents or revisited later.
Tags and delete semantics are covered by #862, query/status envelopes by #859, and surface routing by #860. None of those issues owns reader marks, annotations, saved views, or recall-pack semantics.
Scope
Define typed reader product models for:
- marks such as star, pin, important, or read-later;
- annotations/notes;
- saved views backed by canonical
ConversationQuerySpec/ shared query contracts; - recall packs constructed from pinned items and saved views, either in this issue or as an explicit phase split once the model is clear.
Support stable targets at least for:
- conversations;
- messages.
Content-block, thread, action-event, and artifact targets may be implemented if the target identity model is ready, or explicitly deferred with a follow-up.
Expected implementation shape:
- Add typed storage/read/write contracts for marks, annotations, saved views, and recall packs instead of using opaque frontend-only metadata.
- Expose shared archive operations / Python API first, then daemon HTTP and reader UI.
- MCP and CLI parity should be implemented where cheap or explicitly deferred to a linked follow-up.
- Preserve user state across reimport/reset through identity mapping where possible.
- Ensure user metadata remains excluded from content hashes.
Likely files/modules:
- storage DDL near identity/user metadata tables, possibly
polylogue/storage/sqlite/schema_ddl_identity.pyor a focused user-state DDL module; - repository metadata/tag write paths;
polylogue/operations/archive.py;polylogue/api/;polylogue/daemon/http.py;polylogue/daemon/web_shell.py;polylogue/mcp/server_mutation_tools.py;polylogue/mcp/payloads.py;polylogue/cli/query_actions.py;polylogue/archive/query/spec.pyfor saved-view serialization.
Non-goals
- Do not build the whole feat(reader): finish interactive reader and unified surface shell #848 reader shell here.
- Do not redefine refactor(api): define shared query/status contracts for all read surfaces #859 query/status/facet contracts.
- Do not use this issue for broad refactor(surfaces): route read adapters through shared archive APIs #860 surface cleanup.
- Do not implement saved views only in browser
localStorage. - Do not add cloud sync, multi-user auth, or generic dashboard scope.
- Do not treat tags as equivalent to pins, stars, annotations, or saved views.
Dependencies
- feat(reader): finish interactive reader and unified surface shell #848 for the first dynamic reader shell.
- refactor(api): define shared query/status contracts for all read surfaces #859 for shared query/list/detail/facet envelopes.
- refactor(surfaces): route read adapters through shared archive APIs #860 for routing surfaces through shared archive APIs.
- refactor(mutations): centralize tag metadata and delete contracts #862 for tag/metadata/delete mutation conventions.
- test(reader): add local web reader visual smoke harness #865 for reader visual smoke coverage.
- feat(context): build project/date/query context packs for agent analysis #838 if recall packs consume context-pack compression.
- feat(topology): materialize session identity and lineage graph #866 if marks or recall packs need topology/thread targets beyond conversations/messages.
Acceptance criteria
- Typed mark, annotation, saved-view, and recall-pack contracts exist with idempotent create/update/delete behavior.
- Conversation and message targets work.
- Other target kinds are implemented or explicitly deferred with concrete follow-up issues.
- Saved views roundtrip canonical query specs without web-only filters.
- Reader APIs can list, create, update, and delete marks/annotations/saved views with deterministic JSON.
- Reader UI can display/toggle marks and show notes/saved views through daemon APIs.
- User metadata survives reimport where identity evidence is available and remains excluded from content hash.
- Visual smoke covers populated and degraded states once test(reader): add local web reader visual smoke harness #865 exists.
Verification
Focused checks should include:
- storage/repository tests for idempotency, target validation, not-found behavior, and content-hash exclusion;
- daemon HTTP contract tests for marks, annotations, saved views, and recall-pack endpoints;
- MCP/CLI contract tests if those surfaces are exposed;
- reader visual/DOM smoke through the test(reader): add local web reader visual smoke harness #865 harness;
devtools render-all --checkwhen generated docs or help change;devtools verify --quick, then fulldevtools verifybefore PR readiness.
Activity
Sinity commentedon May 7, 2026
Reconnaissance Report -- #867: reader marks, annotations, saved views, recall packs
Status: BLOCKED by deep dependency chain
This issue has the longest dependency chain in the gap-audit group: depends on #848/#859/#860/#862/#865 and may consume #838/#866. Current state:
ConversationQuerySpecsemantics because the query spec doesn't yet have a stable serialization contract for all surfaces.Wave placement: Wave 5/6 per #852. Earliest start: after #848, #859, #862, and #865 are all landed.
Build this
Typed mark model:
Marktype: mark_id, target_type (conversation/message), target_id, mark_kind (star/pin/important/read_later), created_at, updated_atTyped annotation model:
Annotationtype: annotation_id, target_type, target_id, note_text (or structured note), created_at, updated_atSaved view model:
SavedView: view_id, name,ConversationQuerySpecserialized, created_at, updated_atRecall pack model (phase-split if needed):
RecallPack: pack_id, name, description, items (pinned conv_ids + saved view refs), created_at, updated_atStorage: New tables in
schema_ddl_identity.pyor a dedicatedschema_ddl_user_state.py:user_marks(target_type, target_id, mark_kind, user_id=None for now)user_annotations(target_type, target_id, note_text)user_saved_views(name, query_spec_json)user_recall_packs(name, description, items_json)API exposure: Archive operations first, then daemon HTTP endpoints:
GET/POST/PUT/DELETE /api/marksGET/POST/PUT/DELETE /api/annotationsGET/POST/PUT/DELETE /api/saved-viewsGET/POST/PUT/DELETE /api/recall-packsIdentity preservation: Link marks/annotations through
identity_ledgerso reimport of same conversation preserves user state.Do NOT build this
Files to touch
polylogue/storage/sqlite/schema_ddl_user_state.py(NEW)polylogue/storage/sqlite/schema_ddl_identity.pypolylogue/storage/sqlite/schema_bootstrap.pypolylogue/operations/archive.pypolylogue/api/archive.pypolylogue/daemon/http.pypolylogue/daemon/web_shell.pypolylogue/mcp/server_mutation_tools.pypolylogue/mcp/payloads.pypolylogue/cli/query_actions.pypolylogue/archive/query/spec.pytests/unit/storage/test_user_state.py(NEW)tests/unit/daemon/tests/visual/Coordination
/api/user/marks,/api/user/annotationsvs/api/marks).Focused tests
Acceptance matrix
Ambiguities / Risks
ConversationQuerySpeccontainsdatetimeandProviderenum fields. Needs explicit JSON serialization/deserialization contract (or Pydanticmodel_dump_json/model_validate_jsonroundtrip test).identity_ledgeralready maps (provider, source, source_path, provider_conversation_id, raw_hash) -> current_conversation_id. Marks should be keyed by identity_key through this mapping.Can it start?
No. Earliest viable start is when #859 lands (query spec serialization contract), #862 lands (mutation conventions), and #848 has at least the web shell framework so there is a consumer to verify against. In the current graph, this is Wave 5/6.
feat: cost query tests, session lineage, reader marks (#803/#866/#867)
feat: cost query tests, session lineage, reader marks (#942)
feat: cost query tests, session lineage, reader marks (#942)
Sinity commentedon May 8, 2026
Reopened from the closed-issue audit. #944 does not explicitly include reader marks, annotations, saved views, or recall-pack mutation scope.
Current code has storage/API substrate for marks, saved views, and recall packs, but annotations and daemon/reader API/UI integration are not visibly complete or proven. #955 covers advanced web UI functionality, but it explicitly keeps archive mutations out of scope, so it should not be treated as the owner for this mutation/product-state contract.
Close only after the issue acceptance criteria are satisfied, or after remaining target kinds/surfaces are split into named follow-ups.
Sinity commentedon May 8, 2026
Closing: core implementation landed. Remaining edges are incremental.
11 remaining items
feat: expose reader user state through MCP (#1052)
Sinity commentedon May 15, 2026
Implementation note: starting target-aware user-state substrate slice on
feature/feat/user-state-annotations-targets. Scope: migrate durable marks from conversation-only rows to target-aware conversation/message rows while preserving existing conversation marks, add first-class annotations with idempotent create/update/delete/list behavior, expose the contract through daemon/api/user/*and MCP tools, and add focused storage/daemon/MCP tests. Non-goals for this slice: reader layout polish, CLI parity, full recall-pack export redesign, and non-conversation/message target kinds.feat: add target-aware reader user state (#1053)
feat: add typed recall-pack target evidence (#1054)
Sinity commentedon May 15, 2026
Implementation update after #1053 and #1054
The durable reader-state scope is now substantially further along:
Satisfied in #1053:
user_marksfor conversation/message targets, including migration from legacy conversation-only marks;user_annotationsfor conversation/message targets;/api/user/marksand/api/user/annotationslist/create/update/delete routes;Satisfied in #1054:
conversation_idsand explicititemsinto a typedschema_version: 1payload;statusanddisabled_reasoninstead of disappearing;polylogue user-state recall-packs list/save/delete;list_recall_packs,save_recall_pack,delete_recall_pack, with envelope classification and regenerated tool-schema witness.Verification recorded in the PRs:
Remaining before this issue should close:
feat: show reader annotations in notes panel (#1055)
Sinity commentedon May 15, 2026
Additional update after #1055
Reader annotation workflow is now implemented:
/api/user/annotationswith marks and saved views;Verification in #1055:
pytest -q -n0 tests/visual/test_reader_dom_smoke.py tests/unit/daemon/test_web_reader.py::TestReaderUserState::test_annotations_roundtrip_conversation_and_message_targets-> 5 passed;ruff check ...andpython -m mypy ...on touched files -> passed;devtools verify --quickand PR CodeQL/GitGuardian -> passed.Remaining before close remains narrower now:
feat(reader): persist reader workspaces (#1056)
feat(reader): add workspace shell modes (#1057)
Sinity commentedon May 17, 2026
Acceptance criteria audit (post #1057)
Surfaces present today
Verification
```
pytest -q tests/unit/cli/test_user_state_command.py tests/unit/mcp/test_user_state_tools.py tests/unit/storage/test_user_state_contracts.py
27 passed in 8.91s
```
Remaining before close
This issue's substrate, surfaces, and conversation/message-target acceptance are met. Recommend close with explicit cross-references once #1113 and #1114 are accepted as the durable owners of the deferred scope.
Sinity commentedon May 17, 2026
Closing per agent audit (AC matrix posted above): the user-facing reader products (marks, annotations, saved views, recall packs, reader workspaces) all shipped via PRs #1050–#1057 — substrate (user_marks/annotations/saved_views/recall_packs/reader_workspaces tables), facade methods, MCP tools, CLI subgroups in user_state.py, and 28 daemon HTTP handlers. 27 tests pass.
Remaining real-world gaps split into focused follow-ups:
feat(reader): saved queries and named views UI (#1118) (#1152)
feat(reader): support non-conversation target kinds for marks (#1113) (…
feat(reader): identity-preserving marks across reimport (#1114) (#1188)