Skip to content

chore(plugins): sync SVG sanitizer caps with Rune and warn on animated colour icons - #273

Merged
Hona merged 1 commit into
devfrom
ws6/svg-caps-sync
Nov 20, 2026
Merged

Hona merged 1 commit into
devfrom
ws6/svg-caps-sync

Conversation

@Hona

@Hona Hona commented Nov 20, 2026

Copy link
Copy Markdown
Member

Syncs opencode-plugin-runtime's SVG sanitizer cap numbers 1:1 with Rune's defence-in-depth backstop caps (anomalyco/rune#1291, head 61a091d873d9958819d07fe43c9928d15a88e3b4) and adds a dev-build warning when a plugin's multi-colour icon declares ignored SMIL animation elements.

Shared Cap Table (crates/opencode-plugin-runtime/src/svg/mod.rs:21-46 ↔ rune-text::icon::anim::parse:13-34)

  • MAX_SVG_BYTES = 32 KiB, MAX_DEPTH = 16, MAX_ELEMENTS = 128, MAX_SHAPES = 64, MAX_LAYERS = 8, MAX_ANIMATIONS = 16
  • MAX_PATH_BYTES = 16 KiB, MAX_PATH_COMMANDS = 1024, MAX_POINTS_NUMBERS = 1024, MAX_KEYFRAMES = 64, MAX_TRANSFORM_OPS = 8
  • MIN_VIEW_DIM = 1.0, MAX_VIEW_DIM = 4096.0, MIN_DUR_SECS = 0.016, MAX_CLOCK_SECS = 3600.0, MAX_REPEAT_COUNT = 10_000.0
  • MAX_COORD = 4096.0, MAX_STROKE_WIDTH = 256.0, MAX_SCALE = 64.0, MAX_SKEW_DEG = 85.0, MIN_SPLINE_Y = -4.0, MAX_SPLINE_Y = 5.0

Deliberate Difference Diagnostic

  • Multi-colour icons (fill="#..." / stroke="#..." / stop-color="#...") render static in Rune even if they contain <animate> / <animateTransform> / <set> (recorded in notes/upstream-sync/status-ws6.md for ours.md).
  • In debug_assertions builds, icons::{replace_plugin,intern_svg} prints: plugin <id>: icons/<name>.svg is multi-colour; SVG animation elements are ignored and the icon renders static.

Checks

  • scripts/guardrails.ps1 (5/5), cargo check --workspace, and scripts/web.ps1 -Check green.

…d colour icons

- Sync all SVG cap constants in crates/opencode-plugin-runtime/src/svg/mod.rs 1:1 with Rune's backstop caps (rune-text::icon::anim::parse, anomalyco/rune#1291): MAX_SVG_BYTES=32 KiB, MAX_DEPTH=16, MAX_ELEMENTS=128, MAX_SHAPES=64, MAX_LAYERS=8, MAX_ANIMATIONS=16, MAX_PATH_BYTES=16 KiB, MAX_PATH_COMMANDS=1024, MAX_POINTS_NUMBERS=1024, MAX_KEYFRAMES=64, MAX_TRANSFORM_OPS=8, MIN/MAX_VIEW_DIM=1..4096, MIN_DUR_SECS=0.016, MAX_CLOCK_SECS=3600, MAX_REPEAT_COUNT=10000, MAX_COORD=4096, MAX_STROKE_WIDTH=256, MAX_SCALE=64, MAX_SKEW_DEG=85, MIN/MAX_SPLINE_Y=-4..5.
- Enforce opacity layer count (<= 8), transform arg bounds, keySpline y bounds, and signed begin/by validation in svg/validate.rs so hostile plugin icons are rejected first with plugin, icon, and attribute diagnostics.
- Emit a dev-build stderr warning in icons::{replace_plugin,intern_svg} when a plugin's multi-colour icon declares SMIL animation elements that Rune ignores and renders static.
@Hona
Hona merged commit e456830 into dev Nov 20, 2026
@Hona
Hona deleted the ws6/svg-caps-sync branch November 20, 2026 10:25
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

Hona added a commit that referenced this pull request Nov 20, 2026
…..UP-117 (#284)

- Fold verified fleet PRs #259, #267, #268, #269, #270, #271, #272, #273,
  #275, #276, #277, #279, and #282 (Rune e6deb869: #1297, #1298, #1299, #1300)
  into docs/upstream-sync/ledger.{json,md}
- Split UP-095 (#63002) transparently across active browser streams (WS-1,
  BROWSER-UI, PREVIEWS, BROWSER-TOOLS, WS-9), reassign UP-100 to BROWSER-UI
  and PRE-08 to BROWSER-TOOLS
- Track open tab-groups packaged-default regression on UP-062 (fix PR #278
  open) and record closure of Settings > Shortcuts hidden-command regression
  on UP-064 (#279)
- Audit upstream anomalyco/opencode 92d35f8e18..bfee96a859 (+11 commits:
  7 skipped, 4 added: UP-114..UP-117) and update radar routing
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