Skip to content

feat(one-chat): Phase C — markdown adoption, gate-only routing, honest counts, retirement#586

Merged
HomenShum merged 6 commits into
mainfrom
feat/one-chat-phase-c
Jul 18, 2026
Merged

feat(one-chat): Phase C — markdown adoption, gate-only routing, honest counts, retirement#586
HomenShum merged 6 commits into
mainfrom
feat/one-chat-phase-c

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

Summary

Final phase of docs/design/ONE_CHAT_INTERFACE.md — the unification is complete (A #583 · B #584 · C this PR):

  1. Markdown prose adoptable — additive proseFormat="markdown" renders via the previously-zero-consumer streamdown renderer; the fit gate stops refusing fences/headings/tables/lists/links. Flagship default-plain path untouched. Still refused honestly: streaming, hierarchy, domain parts, {{cite:}}/@@entity: tokens, bare [N] (no cite binding), user turns.
  2. Delete + read-aloud ported as stroke-SVG MessageActions (emoji guard green).
  3. "0 steps" fixed honestly — trace-first count, count span omitted at zero. The orchestrator's stages-length instruction was disproven by the mandated equivalence check (only 3 of 6 fixture trace rows template-match); implemented the variant that keeps the flagship byte-identical. Deviation documented.
  4. Adoption is the defaultpreferCanonicalAnswer deleted; describeCanonicalAnswerFit alone routes. Unreachable duplicates retired with per-item unreachability justifications in the doc's removal ledger; reachable legacy paths (refused shapes) deliberately kept.
  5. 8 legacy contract pins rewritten to canonical markup, same intent; +1 net-new regression pin (markdown table must not re-inflate the structured block).

The look-at-it step caught a real P1 green tests missed: markdown tables tripped isStructuredAnswer's pipe heuristic → escaped raw text. Root-caused (branch precedence), fixed, regression-pinned, re-shot.

Verification (orchestrator-independent)

  • tsc 0 · build clean · 505 tests green (baseline 499 before edits, +6, 0 new failures; 148-suite redesign guards untouched)
  • Evidence: docs/design/ui-contract/20260718-one-chat-phase-c/ (harness captures; CSS-fidelity caveat honestly recorded — polish pass upgrades harness before final presentation photos)

🤖 Generated with Claude Code

HShuM and others added 5 commits July 18, 2026 13:44
…s, honest step count, gate-only routing

Decision 1: ChatAssistantMessage gains additive proseFormat="plain"|"markdown"
(default plain — flagship/receipt callers unchanged). Markdown prose renders
through the shared ai-elements streamdown renderer (MessageResponse →
streamdown-renderer.tsx, consumed not edited) with no [N] cite interactivity.
The adapter's fit gate stops refusing block-level markdown (fence/heading/
table/list/link) and instead adopts with proseFormat="markdown"; still
refused: think tags, {{cite:}}/{{entity:}}/@@entity: tokens, gallery markers,
bare [N] references.

Decision 2: additive onDelete/onReadAloud props render as MessageActions with
stroke-SVG ActionGlyphs (no emoji); the panel passes its existing
handleDelete/handleReadAloud through PanelCanonicalAnswer.

Decision 3: Reasoning trigger count is now honest — trace-backed turns keep
packet.trace.length (buildResearchStages template-matches and can ground
fewer stages than trace rows, so pure stages-length would have changed
flagship output); trace-less turns fall back to researchStages.length; zero
renders no count at all instead of "0 steps".

Decision 4 (part 1): preferCanonicalAnswer opt-in prop removed — the fit gate
alone routes every turn (compact sidebar included). Routing-predicate mirrors
(getNormalizedToolName / isFusionSearchToolName / isMemoryPlanningToolName)
collapsed into adapters/convexToUIParts.ts, imported by both the bubble and
the adoption gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… ported actions

Rewrites every contract that pinned re-routed behavior to pin the canonical
markup with the same intent (never delete a guard without replacing it):
- adoption is default (no opt-in prop), compact sidebar adopts too
- markdown-rich turns adopt with proseFormat="markdown" via the streamdown
  prose row; bare-[N] markdown still refused (no fabricated cite binding)
- ordered text-part fallback feeds the canonical packet prose
- plain tools re-house in ONE canonical Tool disclosure with honest result
  previews (falsy-but-present outputs surface; empty output invents nothing)
- sources re-house in the canonical Sources collapsible without badges
- model provenance surfaces exactly once via the honest receipt line
- assistant-authored JS still never executes (canonical markdown row)
- read-aloud/delete port into the canonical toolbar; "0 steps" never renders

Refusal contracts unchanged: streaming, hierarchy, fusion, memory, media,
domain parts, token answers ({{cite:}}/@@entity:), bare [N], user turns.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… harness shows markdown-adopted turn

Doc records the Phase C removal ledger (what died and why, what was
deliberately kept because refused shapes still reach it) and the binding
markdown-prose decision. Dev-only harness now renders BOTH a plain and a
markdown adopted turn through the real adapter chain, with the ported
read-aloud/delete toolbar actions, for screenshot evidence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…+ evidence

Root cause (caught by LOOKING at the harness screenshot, not the green
tests): isStructuredAnswer's plain-packet heuristic treats >=2 pipe lines as
a structured table, so a markdown TABLE re-inflated the raw .rd-answer-
structured mono block and the adopted turn rendered as escaped text. The
markdown branch now takes precedence; flagship plain callers (proseFormat
default) hit the unchanged structured check. Regression pinned in the
adoption contract. Harness gains the app's .sr-only utility so MessageAction
labels don't leak visually outside the app stylesheet. Evidence screenshots
in .oneshot-evidence/ (plain + markdown adopted turns, collapsed + expanded).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… CSS caveat)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodebench-ai Ready Ready Preview, Comment Jul 18, 2026 9:03pm

Request Review

@HomenShum
HomenShum enabled auto-merge (squash) July 18, 2026 21:01
@github-actions

Copy link
Copy Markdown

PR size advisory

This PR adds 622 lines of substantive change. CONTRIBUTING.md defines a soft limit of ~400 LOC.

If the PR is genuinely cohesive (e.g. an architecture map, a generated migration, a deletion of a dead module), no action is needed. Otherwise consider:

  • splitting into 2-3 PRs along independent concerns
  • pre-discussing the architecture change in a GitHub Discussion before merge

This is advisory — it does not block the merge.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

✅ Dogfood Visual QA Gate: PASSED

Check Status
Screenshots 7 captured (pass)
Walkthrough 9 chapters (pass)
Key Frames 9 extracted (pass)
Scribe Steps 8 how-to steps (pass)
Build success
Artifacts

Download the dogfood-evidence-3ec0460 artifact from the Actions tab for full screenshots, frames, and walkthrough video.


Generated by Dogfood QA Gate

@HomenShum
HomenShum merged commit 7cf1ef7 into main Jul 18, 2026
17 checks passed
@HomenShum
HomenShum deleted the feat/one-chat-phase-c branch July 18, 2026 21:07
@github-actions

Copy link
Copy Markdown

Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact (pr-demo-586) at https://github.com/HomenShum/NodeBenchAI/actions/runs/29661027730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants