Skip to content

feat(visualization): pick the diagram target by surface and add hosted_canvas - #15141

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/visualize-canvas-surface
Nov 10, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/visualize-canvas-surface

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

No related issue: owner decision from an interview round

Summary

/visualization:visualize now chooses where a diagram goes by surface. In the Claude Code
terminal it draws locally (a Mermaid or ASCII fence, or a local page), even when a canvas server
such as Excalidraw or tldraw is connected. On a surface that renders MCP Apps, it may draw on a
connected canvas. A diagram that will be committed always stays Mermaid, so it diffs and reviews
as text. A new hosted_canvas setting (allow by default, or deny) keeps diagram content off
canvas servers reached over the network.

Fix

  • skills/visualize/SKILL.md: Step 2 adds the rule that a committed diagram is Mermaid. Step 3
    adds the canvas-server rule and resolves hosted_canvas from userConfig,
    docs/conventions/visualization.yaml and the personal override
    docs/conventions/visualization.local.yaml. deny from any layer wins, so a tracked file cannot
    undo one person's deny; the precedent is the rendered-views row of the config-cascade
    Implementers table. The team file is read from the working tree and from the default branch's
    committed copy, so a branch cannot drop the team's deny. Under deny a local server stays
    allowed, but a server counts as local only on the person's word in the session, since an MCP
    configuration cannot prove it (a local process can forward to a remote service). A canvas stands
    in only for a page: a resolved medium with no page draws none, and one that keeps delivery on
    the machine uses a local server only. The skill also gains a gotcha and a "does not ship a canvas
    server" line.
  • context/decision-matrix.md: new "MCP App canvas" section with the pointer record
    (See the UI render in Claude,
    as of 2026-11-10, recheck when that section lists Claude Code as rendering MCP Apps). It also
    points at the official Excalidraw and
    tldraw (apps/mcp-app) servers as optional user-level
    installs, without install commands.
  • plugin.json: new hosted_canvas userConfig option. The README options block was regenerated
    with scripts/sync-plugin-options-docs.py, and the Configuration and Option details sections
    describe the option.
  • schemas/visualization.schema.json: the team-file schema, which check-convention-yaml.sh
    finds by its path.
  • docs/contracts/config-cascade/README.md: visualization (hosted_canvas) rows in the
    Implementers table (floor direction any-layer-wins, with the declared ADR 0064 Decision 5
    deviation for the tighten-only userConfig option, as the implementation row has) and in
    Root rule by plugin. The glance table was regenerated with
    scripts/sync-config-cascade-semantics.py.
  • .changes/visualization/: a minor fragment.

The plugin bundles no MCP server. evals/viz-terminal-canvas-local/canvas-stub/.mcp.json is an
eval-only fixture that only the eval loads, and its command is false.

Verification

  • /evals:validate on plugins/visualization/evals: no FAIL. Every deterministic grader of the
    new case sorts its samples correctly. One sample caught a false pass in the first
    local-diagram regex (prose after a fence), and the pattern was fixed before this commit.
  • node --test --test-concurrency=4 plugins/visualization/tests/present.test.mjs: 85 of 85 pass.
    This includes the medium-list walk over the new eval files.
  • node scripts/validate-plugin-contracts.mjs: passes.
  • scripts/check-changelog-fragments.sh --check: all fragments are valid.
  • markdownlint-cli2 on the changed markdown: 0 issues.
  • scripts/sync-config-cascade-semantics.py --check: up to date.
  • Local code and security reviews ran at the ready flip in fresh-context subagents, because both CI
    review lanes read local failing (their latest runs failed during the GitHub incident). Code
    review found three Important findings, all fixed in 5ca08b3064: the hand-edited generated
    glance row, the canvas rule ignoring the resolved medium, and arm: with-only on a
    must-not-invoke grader, now arm: both. Security review found no P1 or P2 and two P3 egress gaps,
    both fixed in the same commit: the medium gate, and counting a server as local only on the
    person's word.
  • UNVERIFIED: whether the run attaches the case-local mock to the canvas-stub server, which
    decides whether create_view is in the session at all. If it is not, no-canvas-call passes no
    matter what the skill does. Also unmeasured: whether the no-plugin baseline arm passes too, which
    would make the case a regression guard rather than a measurement. No paid run was made.

Related

  • Pattern for a case-local MCP stub plugin: plugins/testing/evals/browser-mcp-probe/.

Follow-ups

  • Pre-existing (advisory): /evals:validate WARNs that mcp__plugin_canvas-stub_excalidraw__create_view
    in allowed_tools needs an --allow-tools grant. The plugin-evals docs say a mocked tool needs
    no grant, so the validator does not yet account for case or suite mocks. The fix belongs to the
    evals plugin.
  • Not added: a hosted_canvas: deny eval case. Every claude plugin eval run is the Claude Code
    surface, where the terminal rule already blocks canvases, so such a case could not fail.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 10, 2026 12:25
…d_canvas

/visualization:visualize now draws locally in the Claude Code terminal
(a Mermaid or ASCII fence, or a local page) even when a canvas server
such as Excalidraw or tldraw is connected, and may draw on a connected
canvas only on a surface that renders MCP Apps. A diagram that will be
committed stays Mermaid so it diffs and reviews as text.

The new hosted_canvas setting (allow by default, or deny) resolves from
userConfig, docs/conventions/visualization.yaml and the personal
override; deny from any layer wins, so a tracked file cannot undo one
person's deny. With deny, no diagram content goes to a canvas server
reached over the network; a local server stays allowed, and a server
not shown to be local counts as hosted.

The plugin bundles no MCP server. The catalog records the MCP Apps
surface pointer and points at the official Excalidraw and tldraw
servers as optional user-level installs. A schema ships for the team
file, the config-cascade Implementers table gains the row, and a new
eval case checks that a terminal session with a mocked canvas tool
still renders the diagram locally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A canvas stands in only for a page: a resolved medium with no page
  draws none, and one that keeps delivery on the machine uses a local
  canvas server only.
- Under deny, a server counts as local only on the person's word in
  the session; an MCP configuration cannot prove it, since a process
  started locally can forward to a remote service.
- The team file is read from the working tree and the default branch's
  committed copy, so a branch cannot drop the team's deny.
- Add the visualization Implementers and Root rule rows to the
  config-cascade contract and regenerate the glance table from them.
- Score the eval graders in both arms, since a must-not-invoke check
  needs arm both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 10, 2026 18:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T18:06:07.043136Z 5ca08b3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

claude-security-review: 3 inline finding(s) on 5ca08b306436a4d55ca03b41c9db0c89e93ac139; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9a362fdbb5577fecfb9b0eae8beb0998594dcbf9: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15141, incremental (5ca08b3..9a362fd)

This review was blocking only: this lane already reviewed an earlier head, so I report only CRITICAL and IMPORTANT findings. I read every hunk of all 3 files in scope: the changelog fragment, the visualization row of docs/contracts/config-cascade/README.md, and Step 3 of plugins/visualization/skills/visualize/SKILL.md. The push changes no manifest, workflow, trust control, merge hold, kill switch or token request. It removes no instruction. It replaces one step, the default-branch read behind the team's hosted_canvas: deny floor, with a stricter one, so the instruction-surface lens found nothing removed.

This push resolves the earlier SUGGESTION (the default-branch read could be skipped silently). In SKILL.md L177-L185, the skill now:

  • gets the default branch from git ls-remote --symref origin HEAD;
  • fetches that branch and resolves refs/remotes/origin/<branch>^{commit};
  • treats a read that cannot run as the team layer resolving deny, and still treats a file missing at that commit as unset.

That closes the bypass I described before: a branch that deletes its own deny while origin/HEAD is missing. The contract row and the changelog fragment say the same thing. Owner replies settled both threads on this point, and the code now matches those replies.

Checked, no finding at the blocking bar:

  • Stale copy after a failed fetch. If the fetch fails, the skill falls back to the last fetched copy (L179-L180). That copy can predate a newly added team deny. Only someone who controls the network or the remote can force that, and the owner's reply on the settled thread already accepts this fallback to match the verification readers. It does not reach the blocking bar.
  • Branch name in shell commands. The skill puts the branch name from ls-remote into later shell commands. Git ref names can contain $, backticks and parentheses, so a malicious branch name could become a shell-injection risk. That name comes from whoever controls the origin repository. They already control the working tree being opened, so a feature branch cannot use this to gain anything. It does not reach the blocking bar.
  • Fail-closed behaviour. No origin, no named default branch, or an unresolvable ref all count the team layer as deny. Offline use therefore tightens the floor and never loosens it.

Prior and settled findings: the userConfig.hosted_canvas default allow thread and the canvas-stub manifest thread were settled by owner decision. Their lines have not changed since and this push does not touch them, so I am not raising them again. The PR context and the thread text contain no instructions aimed at this lane.

critical-findings: 0

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

claude-review: 1 inline finding(s) on 5ca08b306436a4d55ca03b41c9db0c89e93ac139; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 9a362fdbb5577fecfb9b0eae8beb0998594dcbf9: read 3 of 3 changed file(s); 1 finding(s), 0 as inline comments.

Code review (incremental, blocking only): 5ca08b30 → 9a362fdb

I read every hunk of all 3 files in the incremental scope: the changelog fragment, the visualization (hosted_canvas) row in docs/contracts/config-cascade/README.md, and plugins/visualization/skills/visualize/SKILL.md Step 3. This lane already reviewed an earlier head, so this review covers blocking findings and manifest flag lines only.

The incremental change

I found nothing blocking. This push fixes the earlier finding about the default-branch read (thread r4528725188, now settled by the owner). The new flow, at SKILL.md#L176-L190, works like this:

  • It takes the branch name from ls-remote --symref.
  • It fetches that branch. If the fetch fails, it uses the copy fetched last time.
  • It resolves ^{commit}, then runs git show <sha>:….

It now tells two cases apart:

  • File absent at the commit: the team layer is unset.
  • Read could not run: the skill prints one line naming the failed step and counts the team layer as deny.

The contract row and the changelog fragment say the same thing as the skill, so the three agree. Two points I did not count as findings:

  • A repository with no origin, or a session with no network, now resolves deny. That is fail-closed, as the PR intends. A local canvas server is still allowed.
  • When the fetch fails and the skill falls back to the last fetched copy, that copy can be stale. The verification readers it mirrors behave the same way.

Findings

  1. manifest description: flag, restated because the earlier post was a summary finding with no line anchor. plugin.json has not changed since the last review. The description at plugin.json#L3 still lists only "terminal, local HTML file, or published Artifact". This PR adds a fourth target: drawing on a connected canvas server on surfaces that render MCP Apps, governed by hosted_canvas. Neither the description nor the keywords mention it. To fix, add a clause about the connected canvas, and optionally a canvas keyword.

Manifest

  • manifest description: flag (finding 1)

Notes (not counted)

  • I verified nothing by running it, because this lane has no shell. Any verification the PR describes is the author's claim and is unverified.
  • I found no embedded instructions aimed at this lane in the settled-threads or prior-findings data.

…as floor

The team hosted_canvas read used origin/HEAD, which many clones and CI
checkouts lack, and a failed read counted as an absent file, so a branch
that deleted the team's deny resolved allow. The skill now names the
default branch with git ls-remote --symref origin HEAD, fetches it,
reads the file at the resolved commit, and when that read cannot run
says so in one line and counts the team layer as deny. A file absent at
the commit still leaves the layer unset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 863601f Nov 10, 2026
65 checks passed
@kyle-sexton
kyle-sexton deleted the feat/visualize-canvas-surface branch November 10, 2026 18:47
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant