feat(web): canonical Markdown, Mermaid, and headless acceptance - #1519
Merged
Conversation
Progressively enhance sanitized Mermaid fences, keep the browser assets local, and add real headless BAT/UAT coverage for desktop and phone-sized flows. Co-authored-by: Codex <[email protected]>
hartsock
force-pushed
the
feat/newt-web-mermaid
branch
from
August 1, 2026 21:01
87980d2 to
f8e91a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased directly onto
main; this PR is independent of the draft Psyche integration branch #1492.What this PR does
Test plan
Out of scope
Note
Medium Risk
Touches untrusted model HTML rendering and third-party diagram JS in the browser, plus new CI dependencies (Playwright/Chromium); mitigations include ammonia sanitization, Mermaid strict mode, and deterministic simulated-backend tests.
Overview
Codifies GFM Markdown as the shared transcript contract and treats newt-web as a presentation adapter: server-side rendering stays sanitized HTML, with fenced
mermaidblocks marked for browser-only enrichment.Adds local Mermaid support via a pinned 11.15.0 vendored bundle,
markdown.js(newtEnhanceMarkdownwithsecurityLevel: "strict"), and re-enhancement after HTMX swaps and SSE transcript updates. Invalid diagrams keep readable source with an error affordance; non-Mermaid fences stay normal code.Introduces Playwright headless acceptance (BAT on PRs/main, UAT on
release/**and manual dispatch) wired intonewt-web.ymlwith Node/Chromium install and report artifacts. Repo hygiene updates un-ignore the harness (package.json, tests) and markmermaid.min.jsbinary in.gitattributes.Documentation expands
newt_web_htmx.md,bat-uat.md, and addsnewt-web/README.mdplus asset README/license notes.Reviewed by Cursor Bugbot for commit 87980d2. Configure here.