Repository navigation
Fix false strikethrough from stray ~ by upgrading marked (GitHub GFM parity) - #578
Conversation
Implementation PlanProblem analysisAll three dreb markdown surfaces use marked v15. The TUI and the dashboard use I checked this with throwaway probes in
The fix is to upgrade Deliverables
Acceptance criteria
Files to create or modify
No code changes are needed in No user-facing docs change. No README or docs page mentions marked's version or strikethrough semantics. The TUI README's Testing approachTUI (
Dashboard (vitest + jsdom, the
HTML export (vitest,
Buddy speech bubble (
Repository checks: Risks and open questions
Plan created by mach6 |
Vitest coverage
|
marked v15's single-tilde strikethrough ignored GFM flanking rules and could close on a `~` inside a code span, so "~7 percent vs ~12 percent" rendered as strikethrough. Upgrade marked to ^18.2.0 (flanking fix landed in 17.0.2) in tui, coding-agent and dashboard, and replace the HTML export's vendored marked v15.0.4 with a verbatim copy of marked 18.2.0's lib/marked.umd.js. Add regression tests on every markdown surface (TUI, dashboard transcript, HTML export, buddy speech bubble), a drift guard that pins the vendored export bundle to the installed marked package, and share the export template harness between the image and markdown tests.
Progress UpdateThe full plan is implemented. Every markdown surface now follows GitHub's GFM strikethrough rules. Changes
TestsEach new strikethrough regression test was checked against marked v15 (or the old vendored v15.0.4 bundle): it fails there and passes on v18. The buddy test is the exception; its v15 failure was confirmed by simulating its token handling against v15, not by running it.
Verification
Commit: Progress tracked by mach6 |
Unverified Review Candidates — Pending AssessmentReview round: 1
CriticalFinding 1 — Numeric character references now become raw terminal control characters in the TUI and the buddy bubble (code-reviewer 100, error-auditor 88)
ImportantFinding 2 — A bare
Finding 3 — Indented code blocks gain a spurious trailing blank row in the TUI (code-reviewer 100)
Finding 4 — Link reference definitions now add visible blank rows in the TUI (code-reviewer 100)
Finding 5 — TUI list tests never exercise the marked 17 loose-list and task-list token shapes (test-reviewer 82)
SuggestionsFinding 6 — The shared harness exposes
Finding 7 — The export markdown test couples its case tables by array index (simplifier 83)
Finding 8 — The assistant-text surface is tested twice, and two assertions are implied by the exact match (simplifier 85)
Finding 9 — Pre-existing, not introduced by this PR:
Finding 10 — Pre-existing, not introduced by this PR:
Strengths
Agents run: code-reviewer, error-auditor, test-reviewer, completeness-checker (no gaps found), simplifier Reviewed by mach6 |
Review AssessmentFindings: #578 (comment) Round 1: Mechanism behind findings 1 and 2: marked 18's inline
marked's own HTML renderer accounts for this, so the dashboard is unaffected. dreb's TUI and buddy renderers write Classifications
Action Plan
The useful follow-ups (finding 5's four list-token-shape tests and finding 6's dead harness member) are cheap and can go in the same implementation pass, but they do not block the merge. Assessment by mach6 |
… HTML export - Strip terminal control characters from markdown source and from text tokens after marked decodes numeric character references ( etc.), and undo marked's & encoding of bare ampersands (TUI Markdown + buddy bubble) - Drop the export template's text renderer override so text is escaped once - Do not render the terminating newline of indented code blocks as a row - Drop link reference definitions together with their blank-line separator
Progress UpdateFixed the four merge blockers from the round 1 assessment: findings 1, 2, 3 and 4. Every new regression test fails on the previous commit and passes on this one. Findings 1 and 2: marked 18's text-token contract
Finding 3Indented code blocks no longer turn their terminating newline into an extra empty row. This applies both at the top level and inside list items, with or without Finding 4
Tests
Verification
Pre-existing issue found during the fix (not changed here)The HTML export passes raw HTML in messages through unchanged. For example, Commit: Progress tracked by mach6 |
Unverified Review Candidates — Pending AssessmentReview round: 2
Round-1 merge blockers, re-checked independently:
CriticalFinding 1 — Export: removing the
ImportantFinding 2 — TUI: a trailing link reference definition still adds a blank row after a heading or a code block (code-reviewer 100)
Finding 3 — TUI: an indented continuation merged into a list paragraph gains an extra blank row (code-reviewer 100)
Finding 4 — Buddy tests omit cases that the plan and the round-1 action plan list (completeness-checker 100)
SuggestionsFinding 5 —
Finding 6 — Root and coding-agent READMEs don't mention the new terminal-control stripping (completeness-checker 98)
Finding 7 — The harness still exposes
Finding 8 — The export test couples
Finding 9 — The export test runs the assistant-text surface twice, and two assertions are implied by the exact match (simplifier 84)
Finding 10 — The dashboard test's backtick assertion is implied by its exact-text assertion (simplifier 82)
Strengths
Agents run: code-reviewer, error-auditor, test-reviewer (retried after the first attempt was terminated), completeness-checker, simplifier Reviewed by mach6 |
Review AssessmentFindings: #578 (comment) Round 2:
Round-1 merge blockers:
Classifications
Action Plan
Useful follow-ups (finding 4's buddy Assessment by mach6 |
Progress UpdateFixed the three merge blockers from the round 2 assessment: findings 1, 2 and 3. Each new regression test fails on the previous commit ( Finding 1: export escapes text after an inline raw tag
Finding 2: no trailing blank row from link definitions
Finding 3: no empty row after a deeply indented list continuation
Verification
Discoveries during the fix (not changed here; for the next review round)
Commit: Progress tracked by mach6 |
Unverified Review Candidates — Pending AssessmentReview round: 3
The full PR was reviewed against merge base Previous merge blockers, independently re-checked:
CriticalNone reported. ImportantFinding 1 — Export: raw HTML inside list items now becomes live markup and can hide subsequent content (error-auditor, confidence 88)
Finding 2 — TUI: mixed-indentation list continuations gain an internal blank row (code-reviewer, confidence 100)
Finding 3 — TUI: trailing blank lines after some block types now add a visible EOF row (code-reviewer 100; test-reviewer 82; completeness-checker 82)
SuggestionsFinding 4 — Sanitizer tests sample ranges instead of pinning every intended control code point (test-reviewer, confidence 92)
Finding 5 — The shared harness exposes unused
Finding 6 — Block and list-item code rendering duplicate the same fence/highlighting skeleton (simplifier, confidence 85)
Finding 7 — List-continuation comments allegedly describe the wrong marked mechanism (simplifier, confidence 90)
Finding 8 — New TUI tests repeat the same plain-render helper (simplifier, confidence 90)
Finding 9 — Export test fixtures are coupled by array index (simplifier, confidence 88)
Finding 10 — Export assistant cases and exact-match implications are tested redundantly (simplifier, confidence 85)
Finding 11 — A dashboard backtick assertion is implied by exact text equality (simplifier, confidence 85)
Finding 12 — Boolean string comparison loses useful failure diagnostics (simplifier, confidence 90)
Finding 13 — The
Finding 14 — Consecutive-definition
Strengths
Agents run: code-reviewer, error-auditor, test-reviewer, completeness-checker, simplifier. All five completed. Explicit agent routing used multiple model families; distinct roles alone were not treated as model diversity. Reviewed by mach6 |
Review AssessmentFindings: #578 (comment) Review round: 3 Phase two used Result: no merge blockers under the round-3 factual, scope, and practical gates. All previous blocker acceptance probes pass. The explicit strikethrough/code-span criteria, vendoring guards, and required repository checks are met. Green tests do not imply exhaustive protection against all HTML-export behavior; finding 1 below is a verified behavior change, not a false positive. Classifications
Counter-pressure and acceptance evidenceFinding 1 received genuine disagreement, not an averaged confidence score. The independent assessor and developer's advocate found it non-blocking; the acceptance critic argued that the content-swallowing portion is material. The concrete sequence is:
A fix would materially preserve the visible remainder of that entry for this input; that is why it merits a concrete follow-up, not a false-positive dismissal. The non-blocking judgment rests on the existing raw-HTML interpretation policy, the lack of a new attacker capability or a list-only supported surface, and the now-correct common list-formatting behavior—not on a claim that the list change is imaginary or that finding 1 cannot cause content loss. Neither required practical-impact assessor found grounds to block this PR, and none of the explicit strike-parity acceptance criteria fails. The acceptance critic identified useful minimal evidence for that follow-up: render tight and loose lists containing unclosed content-swallowing tags, then inspect the parsed DOM for the later items/final text. Merely asserting that the HTML string contains For finding 2, a future normalization test must also preserve an intentionally authored internal blank line. For finding 4, exhaustive helper tests are hardening evidence; there is no current leak to repair. Action PlanNone — no merge blockers. Do not automatically implement the useful follow-ups or start another review round. Follow-up tracking requires the requester's choice. Counts: 0 merge blockers; 5 useful follow-ups; 7 nitpicks; 1 false positive; 1 discarded observation; 0 deferred candidates in this round. Previously recorded export HTML-policy, replacement-string inlining, and binary-asset packaging work remains separate; no issues were created during this review. No tracked code was changed. HEAD and the remote PR SHA remained identical and the working tree stayed clean. Assessment by mach6 |
Publication preparation — v2.83.1
Final pre-merge commit: f703e3e Next: the final CI gate, then squash merge and tag v2.83.1. GitHub release creation and release notes remain requester checkpoints. |
Published v2.83.1
Publication validation: built TUI banner reports 2.83.1; 7,473 offline tests passed; build leaves the lockfile unchanged; workspace links are healthy. Non-blocking limitations are recorded in the release notes and documentation. |
Closes #576
Fix false strikethrough from stray
~(e.g.~7 percent vs ~12 percent) and match GitHub GFM strikethrough rules on every dreb markdown surface. The plan is to upgrademarkedfrom v15 to^18.2.0in tui, coding-agent and dashboard. Upstream fixed the strikethrough flanking rules in 17.0.2. The plan also replaces the vendored v15.0.4 copy used by the HTML session export, and adds regression tests for each surface.Implementation plan posted as a comment below.