Skip to content

v1.94.12.0 fix(review-depth): character references and HTML comment ends no longer hide SVG style CSS (GST-940) - #3866

Merged
capy-ai[bot] merged 11 commits into
mainfrom
gsta249/gst-940-style-charref
Nov 3, 2026
Merged

capy-ai[bot] merged 11 commits into
mainfrom
gsta249/gst-940-style-charref

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3866,
  "head": "ff1282df3190c15040aed3072bcc5b469b8ece80",
  "version": "1.92.77.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "1d213a14a4d5117b94ccdf1e5f12f896ea0c612a",
  "product_patch_id": "213c3420a12607ae7fcf7e64416cb14e2b7afec9",
  "gstack_version": "1.92.66.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 55,
    "rules": "18dcd562316f56ed",
    "base": "5f705f367ae396aff143080a8eafd9951f32f70c",
    "registry": "5f705f367ae396aff143080a8eafd9951f32f70c",
    "gate_scan": {
      "tagged": 0,
      "head": "ff1282df3190c15040aed3072bcc5b469b8ece80"
    },
    "reasons": [
      "gate-class",
      "runtime=55"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @1d213a14a4d5 (7 checks, current for ff1282df3190)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41579900532/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41579900540/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=1d213a14a4d5 tests=34601 skipped=71 runs=41579900532/1 profiles=ci-reuse/free-tests heads=ff1282df3190 verified=2026-11-03T04:54:06.254Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, docs/ and the selected changelog.d fragment"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder (GSTA-36)",
    "date": "2026-11-02",
    "via": "GSTA-36 message to GSTA-249",
    "reason": "R51 grant after round 2: one scoped fix-check for red-team#1 and targeted#1 plus the native rebind; findings ship as open notes",
    "fix_check": {
      "head": "ee3908a18fb9fa0fb693ba35f231c6539075b1cf",
      "findings": 1,
      "files": [
        "lib/review-depth.ts",
        "docs/review-policy.md",
        "changelog.d/gst-940-style-charref.md",
        "test/review-planner-misreads.test.ts",
        "test/review-packets-removed.test.ts"
      ]
    }
  },
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "3b9ceac1d1c41bdc108a415c3a5adc67e33bad69",
    "status": "failed",
    "findings": 0,
    "raised_by": "targeted"
  },
  "carry": {
    "from": "ee3908a18fb9fa0fb693ba35f231c6539075b1cf",
    "reason": "base merge + test-only change + release metadata + base merge + base context moved (scoped review by anthropic/claude-opus-5-5: docs/review-policy.md) + test-only change + release metadata",
    "product_patch_id": "213c3420a12607ae7fcf7e64416cb14e2b7afec9",
    "changed_paths": [
      "product:.gstack/pregate.json",
      "product:BROWSER.md",
      "metadata:CHANGELOG.md",
      "product:CONTRIBUTING.md",
      "product:TODOS.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:autoplan/SKILL.md",
      "product:autoplan/shadow-decider.md",
      "product:bin/gstack-artifact",
      "product:bin/gstack-autoplan",
      "product:bin/gstack-capy-install",
      "product:bin/gstack-clean",
      "product:bin/gstack-codex-probe",
      "product:bin/gstack-codex-session-import",
      "product:bin/gstack-config",
      "product:bin/gstack-developer-profile",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-eval-plan",
      "product:bin/gstack-evidence",
      "product:bin/gstack-flaky",
      "product:bin/gstack-pregate",
      "product:bin/gstack-question-log",
      "product:bin/gstack-question-preference",
      "product:bin/gstack-redact-prepush",
      "product:bin/gstack-render-claude.sh",
      "product:bin/gstack-review-plan",
      "product:bin/gstack-ship-receipt",
      "product:bin/gstack-skill-start",
      "product:bin/gstack-tree-receipt",
      "product:browse/SKILL.md",
      "product:browse/sections/command-list.md",
      "product:browse/src/browse-client.ts",
      "product:browse/src/browser-manager.ts",
      "product:browse/src/cli.ts",
      "product:browse/src/commands.ts",
      "product:browse/src/cookie-import-native-job.ts",
      "product:browse/src/cookie-import-native-worker.ts",
      "product:browse/src/cookie-import-native.ts",
      "product:browse/src/device-emulation.ts",
      "product:browse/src/meta-commands.ts",
      "product:browse/src/routes/commands.ts",
      "product:browse/src/server.ts",
      "product:browse/src/session-name.ts",
      "product:browse/src/session-tabs.ts",
      "product:browse/src/snapshot.ts",
      "product:browse/src/tab-session.ts",
      "product:browse/src/terminal-agent.ts",
      "product:browse/src/token-registry.ts",
      "product:browse/src/touch-commands.ts"
    ],
    "merge_commits": 2,
    "range_diff": "1:  ac0fa9ec2 = 1:  ac0fa9ec2 test(review-depth): style-body character references and HTML comment ends keep an SVG code (GST-940, failing)\n2:  11222c267 = 2:  11222c267 fix(review-depth): walk SVG style bodies as written and read their comments as CSS (GST-940)\n3:  8ad07db12 = 3:  8ad07db12 test(review-depth): a quoted > on the style tag keeps an SVG code; plain style comments stay a drawing (GST-940, failing)\n4:  2c8d13960 = 4:  2c8d13960 fix(review-depth): read the SVG style tag quote by quote (GST-940 red-team#1)\n5:  078e2bdaa = 5:  078e2bdaa docs(changelog): GST-940 lead names the three shapes\n6:  6abe506d7 = 6:  6abe506d7 test(review-depth): non-ASCII spaces in </style> and non-ASCII name prefixes keep an SVG code (GST-940 fix-check, failing)\n7:  ee3908a18 = 7:  ee3908a18 fix(review-depth): ASCII whitespace in SVG style tags, refuse non-ASCII element and attribute names (GST-940 fix-check)\n8:  8fdb64438 = 8:  8fdb64438 test(review-packets-removed): repin lib/review-depth.ts on GST-940 after the main merge",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "b0ec0f2e23237684dc72808ed25e0b493d5b9339",
      "bfc5442493160f92d96192d7aea485d485bb5aea"
    ]
  }
}

Why

An SVG chart counts as data, and gets a light review, only when its whole text is a drawing. Six markup shapes let an SVG that loads remote content or runs script pass as a drawing (GST-940 plus four that review found). Three hid CSS from the style walker: &#60;/style> faked a closing tag and &#60;!-- a comment, because the walker read decoded text, and a comment that only an HTML parser ends early (<!-->, --!>) exposed CSS the walker dropped. Review found three more: a > inside a quoted attribute on <style>, a Unicode space (U+00A0, U+000B) before the > of </style>, and a non-ASCII namespace prefix (<gé:script>, xé:href) that read as an allowed name or was never read.

What changed

  • lib/review-depth.ts svgDrawing: walks each style element over the raw text and refuses any & in its body. It reads comments and CDATA as CSS. It reads the opening tag as quoted name="value" pairs and accepts only the ASCII whitespace XML and HTML share in the opening and closing tags. Element names must end at ASCII whitespace, / or >, and any name= holding a non-ASCII character refuses. Every scan is still linear, and DEPTH_RULES hashes the new patterns.
  • test/review-planner-misreads.test.ts: twelve new "keeps the SVG code" rows plus a positive control (a style comment, CDATA and quoted attributes keep a chart a drawing). Each batch failed on its parent commit and passes after its fix (ac0fa9e, 8ad07db, 6abe506).
  • No-loss entry GST-940 repins lib/review-depth.ts. On 62,805 unique SVG files (21,658 with a style element), every verdict matches main at 4bbad24. The planner over the last 100 first-parent main commits changes no depth, class or risk class.
  • docs/review-policy.md and a changelog fragment describe the rules.

Proof

On main at 4bbad24, svgDrawing returns true for each shape (~/.capy/work/gstack/gst940-repro.ts, ~/.capy/work/gstack/gst940-r2.ts). The test commits fail before each fix and pass after it.

Issues

Fixes GST-940 (Capy issue). Follow-up: GST-997 (a prefixed </q:style> still ends the walk early in inline SVG, and non-ASCII chart text before = now over-refuses).

Review

Two rounds, then the granted fix-check and native rebind. Pass 1's red-team finding (the quoted >) was fixed in pass 1. Round 2's red-team#1 (Unicode space) and targeted#1 (non-ASCII prefix) were fixed under the grant.

Review-loop exception: accepted by GStack Minder (GSTA-36) 2026-11-02 via GSTA-36 message to GSTA-249: R51 grant after round 2: one scoped fix-check for red-team#1 and targeted#1 plus the native rebind; findings ship as open notes (fix-check at ee3908a, 1 finding)

Open notes (none blocks):

  • fix-check#1 and rebind refactor: reorganize codebase into modular structure #2 (Low, fails closed): SVG_ATTR scans the whole text, so chart text like <text>α=0.05</text> or aria-label="Größe=10" now keeps a chart SVG code. No corpus file changed. Tracked in GST-997.
  • rebind docs: add README and CLAUDE.md #1 (Medium, inline SVG in HTML only, older than this PR): SVG_STYLE_CLOSE accepts any </prefix:style>, so a mismatched </q:style> ends the walk while an HTML parser keeps reading CSS. A standalone .svg is a fatal XML error. Tracked in GST-997.
  • round 2 adversarial-native#1 (Low, fails closed): <style scoped> and unquoted attributes on the style tag now refuse. No corpus file changed.
  • The targeted reader ran at tree 8c439ef8. The fix-check moved the patch after it, so its record reads failed (stale patch id), not a finding.

garrytan and others added 2 commits November 2, 2026 13:08
…ends keep an SVG code (GST-940, failing)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…mments as CSS (GST-940)

No-loss replay GST-940: 62,805 unique SVG files give the same verdict as main at 4bbad24, and the planner over the last 100 first-parent main commits changes no depth, class or risk class. Repins lib/review-depth.ts on GST-940.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 9 commits November 2, 2026 13:20
…ain style comments stay a drawing (GST-940, failing)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-team#1)

No-loss replay GST-940 rerun: 62,805 unique SVG files keep main's verdict and the planner over 100 main commits changes nothing. Repins lib/review-depth.ts on GST-940.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…refixes keep an SVG code (GST-940 fix-check, failing)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…II element and attribute names (GST-940 fix-check)

Fixes round-2 red-team#1 and targeted#1 under the Captain's scoped fix-check grant. No-loss replay GST-940 rerun: 62,805 unique SVG files keep main's verdict; the planner over 100 main commits changes nothing. Repins lib/review-depth.ts on GST-940.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…gst-940-style-charref

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	test/review-packets-removed.test.ts
…ter the main merge

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…gst-940-style-charref

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	test/review-packets-removed.test.ts
@github-actions github-actions Bot changed the title fix(review-depth): character references and HTML comment ends no longer hide SVG style CSS (GST-940) v1.94.12.0 fix(review-depth): character references and HTML comment ends no longer hide SVG style CSS (GST-940) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 03900fc into main Nov 3, 2026
49 checks passed
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.

1 participant