Skip to content

Preserve expanded details blocks in safe-output bodies - #75380

Open
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-details-open-escaping
Open

pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-details-open-escaping

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Since v1.0.1, safe-output publishing escaped <details open> as text because the report parser recognized only <details>.

  • Parsing and rendering: Accept the boolean open attribute in inline and two-line summary forms; preserve it through AST normalization and rendering.
  • Compatibility: Keep plain <details> collapsed and continue rejecting other attributes.
  • Coverage and release: Add round-trip and attribute-rejection regressions, plus a patch changeset.

This input now remains an expanded details block:

<details open>
<summary>Open</summary>

body

</details>

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix escaping of <details open> in safe-output bodies Preserve expanded details blocks in safe-output bodies Nov 6, 2026
Copilot AI requested a review from pelikhan November 6, 2026 09:17
@pelikhan
pelikhan marked this pull request as ready for review November 6, 2026 13:59
Copilot AI auto review requested due to automatic review settings November 6, 2026 14:00
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: opus55 xhigh · ~12 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #75380

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~3 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #75380

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions github-actions 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.

Reviewed PR head 2464e80870bb35f294202832300855b34f6dfe96 (open, non-draft). Applicable contract: docs/src/content/docs/specs/safe-outputs-specification.md v1.29.18, §6.4 S4.

No blocking conformance violation found. The implementation and tests consistently add support for the boolean <details open> form while retaining collapsed plain <details> and escaping unsupported attributes; existing dangerous-tag and event-handler sanitization obligations remain intact.

I published one inline synchronization proposal: clarify S4 with the exact accepted <details> forms, rejection/escaping rules, v1.29.19 changelog/version update, and matching conformance cases. No specification files are changed by this PR, so the proposal remains unapplied.

Coverage: static review only; tests and conformance scripts were not run, per review instructions. No other directly applicable normative contract was identified.

Generated by PR Specification Reviewer for #75380 · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again

nodes.push(fromSource({ type: "heading", level: Math.max(minimumHeadingLevel, match[1].length), children: inline(match[2]) }));
index++;
} else if ((match = /^<details>\s*<summary>(.*)<\/summary>$/.exec(line.trim()))) {
} else if ((match = /^<details(\s+open)?>\s*<summary>(.*)<\/summary>$/.exec(line.trim()))) {

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.

Specification synchronization proposal (intentional compatible clarification): update docs/src/content/docs/specs/safe-outputs-specification.md §6.4 S4 (currently v1.29.18) to state that <details> and <details open> are the only accepted forms, including inline and next-line summaries; plain <details> remains collapsed; <details open> retains and renders the boolean open; valued, duplicate, event-handler, and other unsupported attributes MUST be rejected or escaped. Proposed replacement for the safe-tag bullet:

- For `<details>` elements, preserve only the exact forms `<details>` and `<details open>`, including when the summary is inline or appears on the following line.
  - `<details>` MUST remain collapsed.
  - `<details open>` MUST retain the boolean `open` attribute and render as `<details open>`.
  - Other `<details>` attributes, including valued `open` attributes, duplicate `open` attributes, event handlers, and mixed unsupported attributes, MUST be rejected or escaped rather than preserved.

Also add a v1.29.19 (2026-11-06) changelog entry and S4 conformance cases matching these tests. This preserves existing sanitization obligations and documents the behavior implemented here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated §6.4 S4 in 2655d49 to define the accepted <details> openings and attribute handling.

@github-actions github-actions 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.

Reviewed the changed parser, AST normalization, renderer, and regression coverage. No actionable correctness, security, performance, or maintainability issues found in the diff. The specialist pass produced only low-confidence concerns that are either normalized away or non-actionable; no inline comments were warranted. Static review only; tests were not run per review constraints.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the change preserving expanded details blocks through safe-output parsing and rendering.

No open issues 🎉

What changed in this PR

Fixes #75115 by preserving expanded <details open> blocks through gh-aw’s safe-output parsing and rendering pipeline.

Changes:

  • Recognizes open in inline and two-line details openings and preserves it through AST normalization and rendering.
  • Adds regression coverage for expanded blocks, unchanged collapsed behavior, and rejection of unsupported attributes.
  • Adds a patch changeset documenting the fix.
File Description
actions/​setup/​js/​report_markdown.cjs Parses supported details openings and records the open flag.
actions/​setup/​js/​report_html_fidelity.test.cjs Tests round-trip fidelity, collapsed defaults, and attribute rejection.
actions/​setup/​js/​report_ast.cjs Defines, normalizes, and renders the optional open flag.
.changeset/​fix-details-open-safe-output.md Documents the fix for a patch release.

Review effort: Balanced (auto)

@github-actions github-actions 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.

Skills-Based Review 🧠

Applied /tdd, /diagnosing-bugs, and /codebase-design. Approving: the fix is a targeted parser/renderer change with regression coverage for the expanded, collapsed, and rejected-attribute cases.

📋 Details

Verification

  • Traced open through parse (report_markdown.cjs), normalize and render (report_ast.cjs), redaction, sanitize, and sized render. It survives every step.
  • Ran the parse, AST-shape, render, and round-trip assertions directly with Node. All passed.
  • Could not run the vitest suite: npm ci failed on a registry TLS certificate error in this environment, so report_html_fidelity.test.cjs is unverified here. CI should cover it.

Notes

  • ✅ Plain <details> stays collapsed, and unsupported attributes (class, onclick, open="true") remain escaped.
  • ✅ Changeset added as a patch.
  • Optional: one inline nit on strict vs. truthy open checks.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread actions/setup/js/report_ast.cjs Outdated
return (node.type === "alert" ? `[!${node.kind}]\n` : "") + renderBlocks(node.children, node.type === "quote");
case "details":
return `<details>\n<summary>${typeof node.summary === "string" ? escapeSummaryText(node.summary) : renderInlines(node.summary, true)}</summary>\n\n${renderBlocks(node.children)}\n\n</details>`;
return `<details${node.open ? " open" : ""}>\n<summary>${typeof node.summary === "string" ? escapeSummaryText(node.summary) : renderInlines(node.summary, true)}</summary>\n\n${renderBlocks(node.children)}\n\n</details>`;

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.

[/codebase-design] Optional consistency nit: the normalizer gates open with a strict node.open === true (line 405), but this renderer uses a truthy check. They are equivalent after normalizeReport, but matching the strict check keeps both sides aligned if a caller ever renders un-normalized nodes.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed the renderer to emit open only when node.open === true in 2655d49, matching the normalizer.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/report_markdown.cjs:505): Specification synchronization proposal (intentional compatible clarification): update docs/src/content/docs/specs/safe-outputs-specification.md §6.4 S4 (currently v1.29.18) to state that <details> and <details open> are the only accepted forms, including inline and next-line summaries; plain <details> remains collapsed; <details open> retains and renders the boolean open; valued, duplicate, event-handler, and other unsupported attributes MUST be rejected or escaped. Proposed replacement for the safe-tag bullet: - Preserve expanded details blocks in safe-output bodies #75380 (comment)
  3. Review (actions/setup/js/report_ast.cjs:671): [/codebase-design] Optional consistency nit: the normalizer gates open with a strict node.open === true (line 405), but this renderer uses a truthy check. They are equivalent after normalizeReport, but matching the strict check keeps both sides aligned if a caller ever renders un-normalized nodes. - Preserve expanded details blocks in safe-output bodies #75380 (comment)

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 2464e80
Sous-chef requested-work: 1e594643bc58159cb25ab3d1e9bf0e461d5fb6a8a57725a602550d084b5a75a1 6f484eef834865f45f1b73fe90fddb423725b4bc78b3ee2dd6dbca42c7a0efd7
Sous-chef requested-state: 9e460ee9898c42b2687c69193f3abfa3e14a46941ec8bcc25d6315376556de12

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~8 AIC · ⌖ ~15 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

Copilot assignment requested for the following outstanding work:...

Sous-chef requested-head: 2464e80
Sous-chef requested-work: 1e594643bc58159cb25ab3d1e9bf0e461d5fb6a8a57725a602550d084b5a75a1 6f484eef834865f45f1b73fe90fddb423725b4bc78b3ee2dd6dbca42c7a0efd7
Sous-chef requested-state: 9e460ee9898c42b2687c69193f3abfa3e14a46941ec8bcc25d6315376556de12

Copilot AI and others added 2 commits November 6, 2026 14:52
…pen-escaping

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot November 6, 2026 15:02

This branch has not been deployed

No deployments
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.

<details open> in safe-output bodies renders as escaped text since v1.0.1

4 participants