Repository navigation
Description
Purpose
Define shared session-view profiles so CLI, web, MCP/API, and exports render large sessions consistently. A view profile declares what a view includes, what it omits, whether it is lossy, what raw/evidence refs it carries, and which formats are supported.
Current implementation reality
polylogue read --view already exposes multiple views through polylogue/cli/query_verbs.py and adjacent command modules:
- public/current views include
summary,transcript,messages,raw,context,context-pack,recovery,neighbors, andcorrelation; - recovery uses
polylogue.insights.transforms.compile_recovery_digest(session)on demand and exposescontinue/blamereport presets; messageshas typed JSON/NDJSON payloads and generated schemas;context-pack,neighbors, andcorrelationhave separate command modules and output behavior;- web/API ambitions need the same semantics but should not invent another view vocabulary.
The problem is not that views are missing. The problem is that their semantics are scattered across renderers, Click options, docs, payload schemas, and future web/API plans. A caller cannot inspect one profile record to learn whether a view is lossy, evidence-linked, raw, redacted, browse-only, or suitable for agent handoff.
Rationale
Polylogue sessions can be huge. Different users need different readings: raw transcript, compact handoff, forensic drilldown, tool audit, neighbor sessions, GitHub correlation, or a browser preview. These views should be honest about lossiness and evidence.
A summary-like view without raw refs is fine if labeled as a browse aid. It is not fine if later agents treat it as complete evidence. Conversely, a raw view should be explicit about privacy/access posture.
Profile fields
A SessionViewSpec or equivalent live model should include:
- stable view id and human label;
- owning module/renderer;
- purpose and primary user workflow;
- required input: session id, query set, project scope, archive root, external repo, or daemon/API context;
- included object kinds: messages, blocks, tools, files, subagents, assertions, events, refs, raw payload;
- lossiness: raw, normalized, filtered, summarized, sampled, derived, or browse-only;
- raw/evidence-ref policy: required, optional, unavailable, or intentionally omitted;
- privacy/redaction policy: path redaction, raw payload gating, secret handling;
- supported output formats and destinations;
- machine payload/schema when available;
- degraded/unsupported states and the exact caveat exposed to callers;
- whether the view is suitable for successor-agent handoff.
Initial profile inventory
The first implementation should profile existing views before adding new ones:
raw: raw provider/archive record where available; unambiguously raw and access-gated.messages: normalized message/block view with filters for role/type/prose/tool/file-read suppression; typed JSON/NDJSON schemas already exist.summary/transcript: human-readable query/read outputs; define whether these are browse aids, normalized transcripts, or evidence-bearing views.context: seed-session preamble plus related sessions; lossy handoff aid.context-pack: project/query-scoped bundle; lossy and redacted by default.recovery: deterministic on-demand transform over a hydrated session; lossy but evidence-linked and intended for successor-agent handoff when caveats are explicit.neighbors: time-window related-session view; relationship evidence rather than content summary.correlation: Git/issue/check/span correlation; explicitly external-observation-backed.
Future names such as tool-audit, subagents, forensic, resume, digest, and work-packet should be added only when backed by concrete renderers and acceptance fixtures.
Implementation plan
Implement profiles as live surface metadata, not a documentation inventory.
- Add a profile/spec model close to the read/render surface, not a new archive tier.
- Inventory existing
read --viewimplementations against the profile fields and make every public view declare its contract. - Route CLI help/docs/profile listing through the same profile records where practical.
- Ensure recovery/work-packet profiles cite Transform raw agent sessions into on-demand recovery views #1880/Render work packets as on-demand evidence bundles #1838 and describe raw-ref/lossiness semantics honestly.
- Add explicit degraded/unsupported markers for views whose current implementation cannot satisfy a promised profile.
- Add fixtures comparing representative CLI and API/web JSON semantics where a machine payload exists.
- Make docs/help/profile listings derive from or check against the profile records so stale view names disappear automatically.
Acceptance criteria
- Every public read view has a profile that declares lossiness, input requirements, supported formats, and raw-ref policy.
- Lossy views that make claims include
ObjectRef/EvidenceRef/raw-ref links or explicitly state that they are browse-only. - Recovery and work-packet outputs declare whether they are successor-agent handoff views and what caveats/missing-evidence markers mean.
- CLI and web/API render or expose the same profile semantics for representative fixtures.
- Unsupported/degraded views say so explicitly instead of implying completeness.
- Docs and help text are generated from or checked against the profile inventory so view names do not drift.
Non-goals
- No new storage tier.
- No LLM summary as truth.
- No deletion of raw transcript/drilldown.
- No separate renderer ontology beyond what real views consume.
- No view names that are only parser/help vocabulary without execution.
Activity
[-]feat(rendering): SessionViewSpec and evidence-linked render profiles[/-][+]Define evidence-linked session view profiles[/+]feat(cli): complete read views from profiles
feat(read): profile executable session views (#1997) (#2021)
feat(cli): expose read view profiles (#1997) (#2022)
feat(api): expose read view profiles (#1997) (#2023)
feat(daemon): expose read view profile metadata (#1997) (#2041)
Sinity commentedon Jun 17, 2026
Closing after #2041 completed the remaining web/API exposure for the shared read-view profile registry.
AC matrix
SessionViewProfiledeclaresinput_scope,lossiness,evidence_policy,formats,privacy_policy, anddegraded_statesinpolylogue/archive/viewport/profiles.py:23-35. The current executable views are enumerated inREAD_VIEW_PROFILESatpolylogue/archive/viewport/profiles.py:57-187. Registry coverage is pinned bytests/unit/archive/test_view_profiles.py:8-25.ObjectRef/EvidenceRef/raw-ref links or explicitly state that they are browse-only.evidence_policyandprivacy_policy(polylogue/archive/viewport/profiles.py:47-52). Derived/handoff profiles explicitly mark optional/required evidence and privacy/caveats: context/context-pack/recovery atpolylogue/archive/viewport/profiles.py:114-158; neighbor/correlation evidence policies atpolylogue/archive/viewport/profiles.py:159-186.successor_handoff=True,evidence_policy="required", and degraded stateinsufficient evidence for a sectionatpolylogue/archive/viewport/profiles.py:144-158. Current handoff profiles are asserted as context/context-pack/recovery intests/unit/archive/test_view_profiles.py:28-34. Work packets are not yet an executable read view; that implementation remains tracked by open #1838, and this issue's non-goal forbids adding view names that are only help vocabulary without execution.read --viewand read-format choices derive fromREAD_VIEW_PROFILESinpolylogue/cli/query_verbs.py:60-96and thereadoption uses those choices atpolylogue/cli/query_verbs.py:206-214. CLIread-viewsemitsread_view_profile_payloads()atpolylogue/cli/commands/read_views.py:23-31. Python API exposeslist_read_view_profiles()atpolylogue/api/archive.py:1098-1102; MCP exposeslist_read_view_profilesatpolylogue/mcp/server_tools.py:678-688; daemon/web exposesGET /api/read-view-profilesatpolylogue/daemon/http.py:830-831andpolylogue/daemon/http.py:2156-2162. API/MCP/web representative tests aretests/unit/api/test_facade_contracts.py:653-667,tests/unit/mcp/test_tool_contracts.py:797-809, andtests/unit/daemon/test_web_reader.py:983-996.degraded_statesin the model and payload (polylogue/archive/viewport/profiles.py:34,polylogue/archive/viewport/profiles.py:52), and the profile registry test requires every profile to declare degraded states (tests/unit/archive/test_view_profiles.py:15-25).read_view_choices()returns profile ids directly (polylogue/archive/viewport/profiles.py:192-195). CLI choices/completion/format completion are checked against the registry intests/unit/cli/test_query_verbs_runtime.py:135-164. The CLIread-viewscommand renders the same profile registry (polylogue/cli/commands/read_views.py:11-31).Verification
Recent PRs covering this issue:
GET /api/read-view-profilesover the same profile registry.Commands from the final web/API slice:
nix develop --command devtools test tests/unit/daemon/test_web_reader.py -k 'read_view_profiles or query_completions'— 3 passed.nix develop --command devtools verify --quick— exit_code 0.Adversarial check: the only plausible gap is work-packet profile coverage. I am not counting that as unfinished #1997 work because no executable work-packet view exists yet, #1997 explicitly forbids non-executable view vocabulary, and open #1838 owns implementing that surface. Once #1838 creates an executable work-packet view, it should add its own
SessionViewProfilerow and tests in the same registry.