feat(agent-chat): detect complete HTML writes from every harness
Completed HTML writes from every harness use the existing artifact preview. A full recorded ACP diff or a whole-file write input opens the document; a replacement-only edit snippet does not masquerade as an entire HTML file.
Leo asked: "the /side thing i heard somebody really liked in codex... and i think html/html artifacts and that kinda good viewing and good support for it would be cool" and "like the claude.ai artifacts but imagien you didnt need to only have it on claude.ai...".
This builds on #25190. It preserves that PR's HTML/SVG/JSX aliases, preview surface, and exports, and replaces its detector with one pure helper shared by all harnesses. The helper accepts completed edit/fileChange records, keeps canonical file identity, recovers complete Write inputs even when the old contents are unknown, and excludes failed/running calls, shell commands, and partial or legacy unmarked Edit/replace snippets. It never reads a file or reconstructs a patch.
Each immutable completed tool update is parsed once through a weak cache. This adds no timer, scroll handling, storage, or per-token transcript walk. Recovered from the earlier nx-artifact-detect-1025 work at ddd36312a415dd59fae66b3038122a529ca46de9.
A fresh Astra review found that Codex adoption labels multi-file changes “Edit N files,” including complete added HTML files. The final repair verifies per-file whole-add provenance through normalized tool records, preserving legacy snippet rejection. Final head, focused red→green and independent re-review receipts are pending; no SHIP is claimed yet.
Observed / Not run
- Recovered detector run40486752560: red9pass/13fail, then30/30head and full web check including typecheck pass.
- Recovered final capture run40487775047:10/10cases pass for Claude/Codex/pi/Gemini/legacy partial Edit, in light and dark. The final provenance regression will run at the stacked head; the older fixtures missed Codex adopted multi-file additions.
- No disk reads, tool execution, storage, polling or per-token transcript walk are introduced.
Agent session: agent session