Skip to content

fix(review): widen fix-handoff code-span delimiter for backtick paths(#9289) - #9407

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9289-fix-handoff-backtick-codespan
Jul 27, 2026
Merged

fix(review): widen fix-handoff code-span delimiter for backtick paths(#9289)#9407
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9289-fix-handoff-backtick-codespan

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

  • Closes review: fix-handoff-render's markdownPathCodeText backslash-escapes backticks, which markdown code spans don't honor #9289
  • Rewrites markdownPathCodeText to use a longest-backtick-run-plus-one delimiter (with surrounding spaces), matching markdownPathCode in unified-comment-bridge.ts, instead of backslash-escaping backticks.
  • Updates buildFixHandoffBlock and fixHandoffAggregateItem to consume the function's own delimiter-wrapped output (no hardcoded single-backtick re-wrap).
  • Preserves existing | / <> / \ escaping; only backtick handling changes.
  • Adds regression tests for single- and double-backtick paths plus entity-escape preservation.

Why prior linked PRs failed

Prior attempts (#9339, #9347, #9353) had correct #9289 code and a passing gate review (no blockers). They were auto-closed solely because CI validate / validate-tests failed on unrelated pre-existing flakes in test/unit/selfhost-pg-retention.test.ts (not on the fix-handoff change). Those retention failures are fixed on current main (#9285 / follow-ups); this branch is based on that tip.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npx vitest run test/unit/fix-handoff-render.test.ts test/unit/fix-handoff-collapsible.test.ts — 36 passed
  • npx vitest run test/unit/queue-4.test.ts -t "Fix handoff|fix-handoff|handoff" — 1 passed
  • npx vitest run test/unit/selfhost-pg-retention.test.ts — 7 passed (the failure mode that closed prior PRs)
  • npm run test:ci (full gate; run before push)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

Implementation + targeted regressions green; the historical CI killer (selfhost-pg-retention) also green on this tip. Full test:ci left for the opener.

Safety

  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or root CHANGELOG.md.

UI Evidence

N/A — markdown rendering in review comments only; no product UI surface.

Notes for reviewers / gate

  • Precedent: src/review/unified-comment-bridge.ts markdownPathCode / markdownChangedFilePath.
  • Did not modify unified-comment-bridge.ts (issue forbids it).
  • Location string (path:line / path-only) is wrapped as one span, matching the previous single-span shape, with padding spaces per CommonMark/markdownPathCode.

…JSONbored#9289)

markdownPathCodeText backslash-escaped backticks before callers wrapped the
location in a single-backtick span, but CommonMark/GFM code spans do not honor
backslash escapes. Mirror markdownPathCode: longest backtick run + 1 delimiter
(with padding spaces), and consume that span directly at both call sites.

Co-authored-by: Cursor <cursoragent@cursor.com>
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 16:36:20 UTC

4 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR replaces backslash-escaping of backticks (which markdown ignores inside code spans) with a longest-backtick-run-plus-one delimiter approach in markdownPathCodeText, mirroring the existing markdownPathCode helper in unified-comment-bridge.ts. Callers (buildFixHandoffBlock, fixHandoffAggregateItem) now consume the full delimiter-wrapped span directly instead of re-wrapping in a hardcoded single backtick, which is correct since the old code would have produced a broken double-wrap otherwise. Tests are updated consistently across all three affected test files and add real regression cases for single-, double-backtick, and pipe/angle-bracket paths, and CI is green on this commit.

Nits — 4 non-blocking
  • The new markdownPathCodeText always adds a space after/before the delimiter even when the value contains no backticks at all, producing `` ` src/a.ts:12 ` `` instead of the tighter `` `src/a.ts:12` `` from before — cosmetic, but worth confirming this matches the intended visual style since every existing rendered location now has extra padding.
  • fix-handoff-render.ts's doc comment says callers 'must not re-wrap' but relies only on comment discipline, not a type distinction between a raw path and a wrapped span — a future caller could easily reintroduce the double-wrap bug this PR just fixed.
  • Consider a lint/test assertion that greps for any remaining `` `${...}` `` re-wrap pattern around markdownPathCodeText output to guard against regression.
  • The delimiter-with-spaces convention could be extracted into a shared helper if unified-comment-bridge.ts's markdownPathCode is meant to converge with this one, per the doc comment's own claim of mirroring it.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9289
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 178 registered-repo PR(s), 115 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 178 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The diff rewrites markdownPathCodeText to compute a delimiter longer than the longest backtick run (mirroring markdownPathCode), updates both call sites to consume the function's own delimiter-wrapped output instead of re-wrapping in a fixed backtick, preserves |/<> escaping, and adds new tests covering single- and double-backtick paths asserting an unbroken code span.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 178 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.47%. Comparing base (b4064b6) to head (e069f59).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9407      +/-   ##
==========================================
+ Coverage   75.46%   75.47%   +0.01%     
==========================================
  Files         275      276       +1     
  Lines       58030    58060      +30     
  Branches     6199     6212      +13     
==========================================
+ Hits        43790    43820      +30     
  Misses      13970    13970              
  Partials      270      270              
Flag Coverage Δ
backend 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/fix-handoff-render.ts 100.00% <100.00%> (ø)

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 4ad619f into JSONbored:main Jul 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review: fix-handoff-render's markdownPathCodeText backslash-escapes backticks, which markdown code spans don't honor

2 participants