Skip to content

feat(planning): render both interview pages' markdown through one renderer in question-shape.js - #10924

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10210-40838393027-1
Oct 29, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-10210-40838393027-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #10210

Summary

Opened by the work-resolve-issue lane. The run's own summary:

question-shape.js now holds one safe DOM markdown renderer (QuestionShape.markdown and QuestionShape.inline) for the union dialect #8633 recorded. From the 1:1 page it takes headings and quotes, plus its emphasis, [text](url) and owner/repo#N. From the shared page it takes mentions and bare links. It links #N and repository paths when the session names a repository. Each page passes its own plain-text hook: the shared page its mention chips, the 1:1 page its question-id chips, Q ranges and glossary terms. The 1:1 page builds its HTML as strings, so it serializes the renderer's elements. The page-local md/inline (surface/index.html) and rich/inline/links (shared/web/app.js) are removed.

Not verified

  • Browser suites (plugins/planning/shared/tests/ui_.js, plugins/planning/surface/tests/ui_.js) and the Python server tests were not run: this lane runs no node, Playwright or Python. Left to the PR's CI.
  • tidy skipped: the change is 320 changed lines (tracked diff 313 plus the 7-line fragment), over the 300-line tidy cutoff
  • Known ambiguity left as is: a two-segment path followed by #N (plugins/x.py#12) now reads as an owner/repo#N issue link, the form GitHub uses (a real repo can be named next.js). Paths take :line, not #N, in this dialect.
  • Behavior changes a reviewer should see: on the 1:1 page a paragraph's line breaks now stay as <br> (they used to join with a space) and bare URLs now link; on the shared page headings, quotes, emphasis, [text](url) and owner/repo#N now render. On the shared page headings stay bold lines; o
  • No lint or build tool ran over the changed JS, CSS or HTML beyond check-affected: none is wired for these files here

Fix

  • plugins/planning/shared/web/question-shape.js: new markdown renderer (blocks: paragraphs with kept line breaks, # headings as a bold line or as real headings from a page-chosen level, bullet and numbered lists, > quotes with paragraphs; inline: code, bold, emphasis, markdown and bare links, owner
  • plugins/planning/shared/web/app.js: removed inline, link, links, REPO/SHA/REF, repoOf, refs and rich; setRich renders through QuestionShape.markdown with Core.state as the repository and withMentions as the plain-text hook
  • plugins/planning/shared/web/app.css: spacing between and inside blockquotes, plus a blockquote style for the shared page's rich text
  • plugins/planning/surface/index.html: removed the page's md and inline; added qText/idsAndTerms (question-id chips, Q-range chips, glossary abbr) as DOM builders for the renderer's text hook, and lineHtml/mdHtml, which serialize the renderer's output into the page's HTML strings; every call site rena
  • plugins/planning/surface/README.md: /question-shape.js row names the markdown renderer
  • plugins/planning/shared/README.md: web/ row names the markdown renderer among what question-shape.js shares
  • .changes/planning/work-resolve-issue-issue-10210-5e3a8c17.md: minor changelog fragment for the planning plugin

Verification

The runner ran each check from the base copy against f613005:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //github.com/melodic-software/claude-code-plugins/issues /8633: the recorded union dialect is 'headings and quotes from the page; mentions and bare links from the shared page; issue refs when the session names a repo', one safe DOM renderer in question-shape.js, owner-confirmed 2026-10-2
  • check-changelog-fragments: all 8 fragments valid (run before and after the review fixes)
  • check-affected: 11 passed, 7 skipped (shellcheck, ruff, typos not installed, three validate-plugins steps that run checked-tree code, changed-skills) over 7 changed files (run before and after the review fixes)
  • fresh-context review subagent over the whole diff: traced ui_reflinks.js, ui_a.js (lines 62-65 and 123), ui_journey.js:568 and ui_page.js:44-61 by hand against the fixtures and found them still passing, found the serialize path XSS-safe and found no use before initialization; it reported 4 low findi
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40838393027

Left out: the items under Not verified.

Related

#10210

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed f613005de2e2729f7931d890377c2365202d28e6: 0 finding(s), 0 as inline comments.

No security findings in this pull request.

critical-findings: 0

I read the whole diff and the PR context. The change replaces two page-local markdown renderers with one DOM-based renderer in plugins/planning/shared/web/question-shape.js. It also re-routes the 1:1 page (surface/index.html) through that renderer. No changed file matches the trusted-path globs, and there are no plugin manifest changes. The diff touches no instruction surface, so there is no manifest <field> line. The instruction-exception register was not needed.

What I checked:

  • XSS in the new renderer. Every node is built with createElement, textContent or append(string), which makes a text node. No innerHTML takes untrusted text anywhere in the renderer.
  • Link schemes. Both link forms are limited to http(s). The [text](url) regex requires https?://. The URL then goes through web(), which parses it with new URL and allows only the http: and https: protocols. A javascript: or data: URL cannot reach a.href. Links carry target=_blank and rel="noopener noreferrer".
  • Issue and path links. The generated GitHub URLs use repo only after it passes REPO.test, and commit only after it passes SHA.test. The owner/repo#N form uses [\w.-] segments and digits, so it is confined to github.com paths.
  • The 1:1 page's serialization path. The page builds HTML strings, so lineHtml and mdHtml build elements in a detached div and read back innerHTML. The browser's serializer escapes text nodes and attribute values (a.href, title, data-q). The question-id and glossary hooks (refNode, idsAndTerms, qText) also use DOM properties and text nodes. The old string-based inline ran its own escaping and \u0000 placeholders, and the new path no longer depends on them. mdBox is a shared scratch node, but the text hooks never re-enter serialize, so there is no clobbering.
  • Glossary regex. Terms are regex-escaped before they are joined into the pattern. The defs lookup only runs on strings the pattern matched.
  • Behavior change. Quote and heading handling changed, but output stays element-built and escaped.

I found no demonstrated path to a security impact, and no ReDoS-class input that an attacker could use against anything beyond a local page.

Spend: no billable change. The change is page-rendering JavaScript, CSS and docs only.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed f613005de2e2729f7931d890377c2365202d28e6: 1 finding(s), 0 as inline comments.

Code review: PR #10924 (planning: one markdown renderer in question-shape.js)

I read the full diff and .claude-lane/pr-context.md. I ran no code, so the browser suites and the Python tests are unverified. The author's description says they were not run either.

Closing issue #10210

  • The one done-when criterion is: "Both pages render markdown through one renderer in plugins/planning/shared/web/question-shape.js using the union dialect, and the page-local md/inline and rich/inline/links are gone."
  • The diff meets it. Both pages call QuestionShape.markdown and QuestionShape.inline. A grep of app.js and surface/index.html found no remaining callers of the removed functions.
  • Gap: no test in the PR or the repository could fail if the renderer broke, as the finding below describes.

Finding (1, advisory)

  • No test covers the new renderer. A grep of plugins/planning/**/tests/ui_*.js for blockquote, QuestionShape.markdown and <em> found nothing. The PR touches no test files. Nothing asserts the new behaviors it adds:
    • the shared page now renders quotes, *emphasis*, [text](url) and owner/repo#N;
    • the 1:1 page now keeps <br> and links bare URLs;
    • the 1:1 page's quote paragraph splitting and the heading levels h3–h6 changed.
  • Breaking any of these would pass the existing suites, which the author only traced by hand.

Checked, no finding

  • Serialization safety: the 1:1 page's serialize path builds only elements and text nodes. href is gated by web() to http(s), and innerHTML escapes attribute values and text.
  • Initialization order: question-shape.js loads before the page scripts in surface/index.html (line 559) and in the shared index.html, so the QuestionShape.markdown calls resolve.
  • The SPAN split has a single capture group, so the odd-index logic in inline is sound.
  • The idsAndTerms precedence (a question id wins over a glossary term spelled like it) holds.
  • The changelog fragment uses bump: minor. This is a user-visible rendering change with no API removal, so the level fits.

Not a finding, noted for the owner

  • The author flags that plugins/x.py#12 now reads as an owner/repo#N issue link. I agree it is a small ambiguity. The first REF alternative also accepts .. as an owner (for example ../foo#3). The result resolves to a GitHub URL and is harmless.

Spend: none; this change has no cost implications.

critical-findings: 1

Findings not posted inline (their lines are not in the diff):

  • plugins/planning/shared/web/question-shape.js:204 (RIGHT): No test covers the new markdown/inline renderer, and the PR touches no test files. A grep of plugins/planning/**/tests/ui_*.js for blockquote, QuestionShape.markdown and <em> found nothing. The renderer adds behavior that no existing suite asserts:

  • On the shared page, > quote, *emphasis*, [text](url) and owner/repo#N now render.

  • On the 1:1 page, paragraph line breaks become <br> (they used to join with a space) and bare URLs link.

  • Quote paragraphs split on an empty > line, and #..##### map to h3..h6.

If any of these broke, the existing suites would still pass. For example, a regression that drops the blockquote branch would leave every current ui_*.js green. The author's description says the browser suites were not run, so there is also no hand-run evidence for these paths. Add one fixture-driven case per page that renders a string with a quote, emphasis, a [text](url) link and a bare URL, and asserts the resulting elements.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head f613005de2e2729f7931d890377c2365202d28e6.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit bd37cee Oct 29, 2026
52 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-10210-40838393027-1 branch October 29, 2026 10:45
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 0, timeout 0, no coverage 0, invalid 0, not run 7.
Covered-code score n/a; mutation score n/a.

File Killed Survived Timeout No coverage Invalid Not run
plugins/guardrails/hooks/block-cross-domain.sh 0 0 0 0 0 4
plugins/planning/shared/web/app.js 0 0 0 0 0 1
plugins/planning/shared/web/question-shape.js 0 0 0 0 0 2

The run's summary has the full report.

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.

feat\(planning\): bring the one-on-one interview page in line with the shared page - part 2 of 4

0 participants