wg-html-chat

wg html: --chat flag to include chat transcripts (visibility-respecting)

Metadata

Statusdone
Assignedagent-1131
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-29T16:41:34.425071987+00:00
Started2026-04-29T16:58:04.640827289+00:00
Completed2026-04-29T17:08:46.039027508+00:00
Tagsfix,html,viz,chat, eval-scheduled
Tokens10844941 in / 18785 out
Eval score0.90
└ blocking impact0.90
└ completeness0.90
└ coordination overhead0.83
└ correctness0.95
└ downstream usability0.90
└ efficiency0.82
└ intent fidelity0.85
└ style adherence0.90

Description

Description

The wg-html-v2 viewer surfaces per-task data but doesn't render chat transcripts (the JSONL conversation history at ~/.wg/chat/<ref>/*.jsonl). Add a --chat flag to opt into rendering chat content, with visibility-aware defaults so a casual wg html --chat doesn't accidentally publish the user's conversations.

Spec

Flag matrix

CommandTasks renderedChat transcripts
wg html (default)all tasksnone — chat task nodes rendered but transcript omitted
wg html --chatall tasksonly chats with visibility = public
wg html --chat --allall tasksall chats regardless of visibility
wg html --chat --public-onlyonly public tasksonly public chats

The single visibility field on the chat task drives transcript inclusion. No separate chat.share field — overkill for a single-user codebase.

Rendering

  • Chat task's per-page or side-panel section adds a 'Conversation' block when transcript is included
  • Render messages role-by-role with timestamps; code blocks get the same syntax/theme treatment as task descriptions
  • Preserve order from the JSONL
  • Light sanitization layer: redact obvious secret patterns in transcript text (api-key-shaped strings, absolute paths under ~/.wg/secrets etc.) with [redacted] markers. NOT a security guarantee — just a safety net against accidental shell-history leaks.
  • If transcript is OMITTED due to visibility filter, render a single line: 'Chat transcript hidden (visibility: internal). Use --all to include.'

Footer / header note

Page header should say 'Showing N chat transcripts' when --chat is active. If 0 chats are shown but --chat was passed (because all chats are internal), say so explicitly so the user isn't confused.

Validation

  • Failing tests written first
  • wg html (no --chat) — no transcript content in output, but chat task nodes still appear in the viz
  • wg html --chat on a project with mixed-visibility chats — only public chats' transcripts in output; internal chats show 'transcript hidden' message
  • wg html --chat --all — all chat transcripts in output
  • wg html --chat --public-only — only public tasks AND only public chats
  • Sanitization layer redacts at least: sk-[a-zA-Z0-9]{20,} (api-key shape), OPENAI_API_KEY=..., paths under ~/.wg/secrets. Document the regexes; this is best-effort, not a security guarantee.
  • Live smoke: wg html --chat on this project, open a few chat task pages in browser, confirm conversation renders with role/timestamp/code-block formatting
  • Counter footer accurate (N chat transcripts shown / M omitted by visibility)
  • cargo build + cargo test pass
  • Permanent smoke scenario added with this task id in owners
  • cargo install --path . was run before claiming done

Depends on

Required by

Log