GuideOpen

Canvas review evidence and review metrics

This guide covers phase 3 ("safe acceleration") of 4184:

Canvas review evidence and review metrics

This guide covers phase 3 ("safe acceleration") of #4184:

  1. [Canvas review evidence](#canvas-review-evidence): the canvas-smoke-test check.
  2. [Weekly operating metrics](#weekly-operating-metrics): .github/review-metrics.yml and .github/workflows/review-metrics.yml.
  3. [Deferred: auto-merge](#deferred-auto-merge).
  4. [Portability to MOS3](#portability-to-mos3).

Phase 1 owns reviewer routing (CODEOWNERS, .github/review-routing.yml, reviewer labels). Phase 2 owns the submission-gate check, merge-risk:* tiers, and state labels. This phase consumes those signals and falls back gracefully when they do not exist yet.

Canvas review evidence

What runs

.github/workflows/canvas-smoke-test.yml runs on PRs to main that change extensions/, plugins/, or the checker and its workflow. It first runs the checker's target detection without installing dependencies or the Copilot CLI; ordinary plugin-only changes that do not add, remove, or reference canvas extensions skip the expensive steps. Canvas extensions are still submitted only under extensions/, so validate-canvas-extensions.yml keeps its existing scope and is unchanged. The canvas-smoke-test job reports:

  • Skipped (success) when the PR changes no canvas extension or extension-bearing plugin paths, including ordinary plugin-only changes and checker/workflow-only changes.
  • Pass (removal accepted) when an extension directory and its plugin were both deleted. Deleting only extension.mjs, or leaving a plugin that still references or was the direct plugin for a deleted extension, fails.
  • Pass or fail otherwise, from .github/scripts/canvas/canvas-smoke-test.mjs.

For each affected extension, the checker:

AreaChecks
Module graphParses extension.mjs and every reachable local module without executing it (vm.SourceTextModule / vm.compileFunction). Reachability follows static imports, literal dynamic import() calls, and literal CommonJS require() calls (call-shaped text inside strings, templates, and regexes is ignored). package.json imports aliases (#name) resolve through the same checks; alias shapes the checker cannot analyze fail. Every reachable reference must resolve to a file inside the extension, a Node.js built-in, the host-provided @github/copilot-sdk, or a runtime dependency (dependencies, optionalDependencies, peerDependencies). Remote (http:/https:), data:, absolute, .., missing, devDependencies-only, and undeclared references fail. Modules not reachable from extension.mjs (often browser assets for the canvas webview) produce warnings instead.
FilesMissing referenced files, unsafe paths (.., absolute paths, file: URLs), symlinks, committed node_modules, native binaries (ELF, PE, Mach-O, .node, .dll, .so, WebAssembly), executable git modes, and files over 5 MB fail. Shell, batch, PowerShell, Python, Ruby, and Perl scripts, shebang files, and unrecognized binaries are reported as warnings for the reviewer.
Previewassets/preview.png must exist, decode as a real PNG (signature, chunk CRCs, IHDR, palette, IEND, inflated image data and filter bytes), be at most 5 MB, decode to at most 256 MiB of image data (checked before decompression), and meet the minimum dimensions.
PluginMaterializes the plugin with .github/scripts/catalog/materialize-plugins.mjs in a temporary copy, validates the served plugin.json against the Agent Plugins schema, and confirms com.github.copilot/extensions/<id>/extension.mjs exists.
InstallInstalls the materialized plugin with the GitHub Copilot CLI from an ephemeral local marketplace, in an isolated COPILOT_HOME with all tokens removed, and verifies it with copilot plugin list --json. CI uses --install require.
CapabilitiesSummarizes what an extension uses (for example filesystem, child processes, network, process.env, dynamic code) so reviewers can compare it with the stated purpose.

Preview minimum dimensions default to 400 × 160 px. Every existing preview meets this; the smallest are 475 × 440, 720 × 165, 544 × 306, and 657 × 270. Change the minimum with the repository variables CANVAS_PREVIEW_MIN_WIDTH and CANVAS_PREVIEW_MIN_HEIGHT, or with --min-preview-width and --min-preview-height locally.

Review artifact

The job writes a concise report to the job summary and uploads the canvas-smoke-test-results artifact (7-day retention) with report.md, results.json, and the preview images. The report includes plugin and extension metadata, changed files, capabilities, the preview, and every validation and smoke-test result.

.github/workflows/canvas-smoke-test-comment.yml follows the repository's reader/writer split. The reader (canvas-smoke-test.yml) runs untrusted PR content with a read-only token and no secrets. The writer runs from main on workflow_run and binds the artifact to the triggering run before writing: the PR must target this repository, its head repository, branch, and SHA must match the run, and it must appear in workflow_run.pull_requests or be the only open PR with that head. It also neutralizes @ mentions, and upserts one PR comment marked <!-- canvas-smoke-test -->. It does not comment on skipped PRs that never had a report.

Running locally

node .github/scripts/canvas/canvas-smoke-test.mjs --all --install never          # every extension, no CLI install
node .github/scripts/canvas/canvas-smoke-test.mjs --changed-files changed.txt   # only what a diff touches
node --test .github/scripts/canvas/canvas-smoke-test.test.mjs

Exit codes: 0 pass or skipped, 1 contribution problems, 2 infrastructure error.

Optional error handoff

Repository-local canvases under .github/extensions/ offer a Send to agent action for handled errors. The error tray is additive: existing messages, fallback UI, retries and recovery controls remain available. The tray uses normal document flow, moves into an active dialog/drawer's interaction scope, and does not overlay decision controls. Dismiss only removes the tray entry; it does not retry the operation or start an agent. Public canvases under extensions/ do not include this feature. Expected reconnect notices, local validation guidance and content-invalidation warnings keep their existing presentation without offering repair handoffs. Expected API notices carry handoff: false through the response and renderer so fetch capture cannot turn a recoverable conflict into a repair request. Actual partial failures, including failed local receipts after a GitHub action, remain eligible. Detail-view catches preserve this classification too, including stale items and resources changed since scanning. A failed reload after reset remains eligible; handoff never repeats the reset.

Clicking Send to agent requests one child project session in github/awesome-copilot to investigate and attempt a fix. The tray displays the bounded, redacted diagnostic text before sending. Context includes the extension source directory, canvas, operation and allow-listed repository/item identifiers, not request bodies, headers, environment variables, raw stacks, URL query strings or fragments. Common credentials, complete Authorization/Proxy-Authorization and Cookie/Set-Cookie fields, and private keys are redacted on both sides, with bounded input processing. Decoded JSON string fields are redacted before reserialization. JSON diagnostics, including prefixed JSON and JSON encoded inside string fields, are inspected with a bounded nesting depth before text redaction. Invalid or incomplete embedded JSON is conservatively replaced rather than forwarded. Review the displayed text before sending; do not include sensitive data in errors. The child is instructed not to commit, push, publish a PR, change credentials or repeat a destructive/remote operation.

The supported extension API joins the current session; it does not directly create app child sessions. Consequently the handoff sends a request to the parent agent using session.send, and the parent uses create_session and reports the actual returned child ID (or a creation error) through the canvas's record_error_handoff action. Message admission is not success. While the parent is busy or waiting for approval, the tray remains pending. After two minutes from the initial dispatch without confirmation (including stalled network requests or response bodies), it tells the user to inspect the parent conversation; it never automatically creates another child. Dispatch failures, child-creation failures and uncertain receipts remain visible rather than showing a successful handoff. A transport rejection is an uncertain dispatch, not a definitive creation failure: the tray keeps polling within the same deadline and accepts a matching child receipt without resending the prompt. Dispatch completion never blocks status polling, so a recorded receipt remains available even if the message transport does not settle. Closing the canvas invalidates its outstanding receipts. Receipts remain visible until explicitly dismissed; new diagnostics do not evict them. Handoff POSTs also require a random per-instance capability token delivered only in the canvas URL fragment, not HTTP-served HTML or scripts. Origin and Host headers alone cannot authorize a handoff, and one instance cannot read or submit another's requests. Registered 127.0.0.1 and localhost URLs are supported, with the Origin required to match the exact registered Host and the connection still restricted to loopback. The token is never included in diagnostic prompts and expires when the canvas closes.

Implementation lives in .github/scripts/canvas/error-handoff/runtime.mjs. Each applicable repository-local canvas includes a generated error-handoff.mjs copy so its extension remains self-contained. The synchronization script only targets .github/extensions/. Make changes in the canonical module, then regenerate:

node .github/scripts/canvas/sync-canvas-error-handoff.mjs
node .github/scripts/canvas/sync-canvas-error-handoff.mjs --check
node --test .github/scripts/canvas/canvas-error-handoff.test.mjs

Canvas entrypoints configure the helper with their supported SDK createCanvas and joinSession functions; HTTP servers use its createServer wrapper. Only registered canvas documents gain the client script. Other HTML, artifact previews, downloads, SSE and API responses retain their original delivery behavior. Existing CSPs, including nonce-only and inline-only script policies, are preserved.

The client detects failed same-origin fetches and explicitly marked board-owned error surfaces (including marked failure toasts), excluding rendered Markdown/file content. Missing-input prompts and other expected workflow notices are not marked for handoff. Cancellation and content-invalidation notices are not repair errors. Identical redacted messages share one handoff for the document lifetime, even after dismissal; the first operation is retained as context. For errors without a semantic error selector, mark only the failure state with data-agent-error (clear it on recovery), or call window.canvasErrorHandoff?.report(message, operation). Do not mark success toasts, entire documents, user content, or containers containing credentials. Additional error surfaces in these boards should use the marker or reporting API.

Weekly operating metrics

.github/workflows/review-metrics.yml runs every Monday at 14:00 UTC and on demand. .github/scripts/review/review-metrics.mjs collects read-only data and then:

  • writes the report to the job summary and uploads the review-metrics artifact (metrics.json and report.md, 90-day retention);
  • updates the body of the tracking issue labeled review-metrics, creating and pinning it the first time;
  • adds the week's report to that issue as a comment so trends stay visible.

Definitions

All times are UTC. The window is the previous window_days (default 7) days. PRs authored by bots are excluded from contribution counts and review timings. A maintainer review is a submitted review from a user with write access who is not the PR author and not a bot.

MetricDefinition
Open contributions by stateOpen, non-draft contribution PRs to main, grouped by phase 2 state label; PRs without one are unlabeled. Open external-plugin issues are grouped by their state labels.
Open contributions by risk tierThe same PRs grouped by merge-risk:*; PRs without one are unclassified.
Time to first reviewFor PRs whose first maintainer review landed in the window: first review time minus the later of creation and the last ready-for-review event. Reviews submitted before that start (for example before a PR went back to draft) are ignored. Median and p90 (linear interpolation), in wall-clock hours or days.
Time to mergeFor PRs merged in the window: merge time minus creation time. Median and p90.
Reviews per maintainerMaintainer reviews submitted in the window, and the distinct PRs each maintainer reviewed.
Reviewer concentrationBased on distinct PRs reviewed per maintainer. Top-reviewer share is the busiest maintainer's share. HHI (Herfindahl-Hirschman index) is the sum of squared shares × 10,000: 10,000 means one reviewer did everything, and above 2,500 is highly concentrated. Effective reviewers is 1 divided by the unscaled HHI.
Items past 2 and 4 business daysItems waiting on a maintainer longer than each target: open, non-draft PRs without a maintainer review since the clock started and without requires-submitter-fixes (the clock starts at creation or the last ready-for-review event), and external-plugin issues labeled ready-for-review or awaiting-approval (the clock starts when that label was last added). Business days count Monday through Friday only, with partial days counted fractionally.
Automation failure rateFor the configured automation_workflows: runs created in the window with conclusion failure, timed_out, or startup_failure, divided by completed runs excluding cancelled, skipped, neutral, action_required, and stale. Workflows that do not exist yet are listed as "not found".

.github/review-metrics.yml configures the window, targets, label sets, workflows, and tracking issue. Missing labels never cause errors.

Running locally

node .github/scripts/review/review-metrics.mjs --repo github/awesome-copilot --dry-run --output-dir ./metrics
node --test .github/scripts/review/review-metrics.test.mjs

Deferred: auto-merge

Safe auto-merge was proposed in this phase and removed before merge. Arming GitHub auto-merge from automation would codify workarounds to repository and organization policy (required reviewers and Copilot code review approvals), and its triggers widen the attack surface; this repository does not use pull_request_target (#2625). It is deferred until maintainers have reviewed the approach with GitHub security. Until then, maintainers merge PRs once submission-gate passes.

Portability to MOS3

The #4184 automation is driven by repository-local configuration and self-contained scripts, so another repository such as MOS3 can adopt it by copying files and editing configuration rather than code.

ArtifactPhaseHow to portRepository-specific settings
CODEOWNERS with team owners1Copy the structureTeam names and path patterns
.github/review-routing.yml1Copy and editReviewer pools, targets, escalation
.github/risk-tiers.yml2Copy and editPath and risk classification rules
submission-gate check2Copy the workflow and scriptRequired checks per tier; include canvas-smoke-test only where canvas extensions exist
canvas-smoke-test (.github/scripts/canvas/canvas-smoke-test.mjs, canvas-smoke-test.yml, canvas-smoke-test-comment.yml)3Copy as-is where the repository ships canvas extensions and .github/scripts/catalog/materialize-plugins.mjsCANVAS_PREVIEW_MIN_WIDTH and CANVAS_PREVIEW_MIN_HEIGHT variables
.github/review-metrics.yml, .github/scripts/review/review-metrics.mjs, .github/workflows/review-metrics.yml3Copy as-isState and risk labels, automation workflow list, tracking issue title
.github/scripts/review/lib/review-automation-github.mjs3Copy as-isNone (uses GITHUB_TOKEN or the gh CLI)

The phase 3 scripts depend only on Node.js 22 and js-yaml. Workflows gate automatic runs on github.repository_owner == 'github'; update that condition when porting. .github/workflows/setup-labels.yml creates the review-metrics label.

Other marketplaces: microsoft/azure-dev-tools

microsoft/azure-dev-tools is another Copilot plugin marketplace (copilot plugin marketplace add microsoft/azure-dev-tools, marketplace ID azure-dev-tools). It ships canvas plugins such as azure-functions-hosted-skills, azure-resources-query, azure-cost-health-check, and azure-sre-agent, plus the skill-only canvas-authoring plugin. It can reuse the same review model: CODEOWNERS teams, review-routing.yml, risk tiers, submission-gate, canvas-smoke-test, and the metrics workflow.

  • Maps directly:
  • Canvas smoke-test and preview evidence: module graph, capability summary, unsafe paths, binaries, and assets/preview.png checks.
  • Risk tiers and submission-gate rules.
  • Weekly metrics.
  • Differences:
  • The plugins are first-party and Microsoft-owned, so resource ownership comes from CODEOWNERS teams more than contributor front matter. Contributor-history signals matter less there.
  • Releases are pinned to immutable per-plugin tags, while awesome-copilot materializes plugins from the default branch. Point the smoke test's install step at the plugin source for the release tag. Treat release-tag or version bumps as their own risk tier that always needs maintainer review.
  • Plugins with no canvas extension, such as canvas-authoring, report canvas-smoke-test as skipped. The check's layout detection (extensions/<id>/ plus a matching plugins/<id>/plugin.json) may need adjusting to that repository's structure.

Source: https://github.com/github/awesome-copilot/blob/main/docs/maintainers/canvas-evidence-and-metrics.md

Author: github, GitHub awesome-copilot. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The GitHub Copilot library holds 3,059 entries. Members can search all of them by meaning and read every one in full.