feat(tooling): canvas-shots — screenshot design-prototype routes and gate on a render verdict#778
Open
rickylabs wants to merge 2 commits into
Open
feat(tooling): canvas-shots — screenshot design-prototype routes and gate on a render verdict#778rickylabs wants to merge 2 commits into
rickylabs wants to merge 2 commits into
Conversation
The canvas-shots tool landed without its lock entry, so its `npm:playwright` import would not resolve for anyone else checking out the branch. Verified the delta is scoped: playwright + playwright-core + fsevents added; the three removed lines are a re-organization within a member's dependency list, not a drop — `jsr:@std/path@1` is still present (deno.lock:76 → 1.1.5) and `deno check` on the tool passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HTiQfrNFCVhjQFqbLKm5xo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deno task canvas:shots— a reusable Deno tool that screenshots every route of a Claude Design prototype in both themes and returns a verdict, not just a PNG.Why a verdict, not a screenshot
A screenshot of a broken page is still a valid PNG. This tool exists because a render can look fine while being defective, so it reports per shot:
unresolvedHoles— occurrences of{{ … }}surviving into the rendered DOM. The Design Components runtime does not fill template holes inside SVG subtrees, so<path d="{{ k.fill }}">reaches the browser verbatim and throwsExpected moveto path command. Found live in the current prototype (ns-kpi's sparkline,ns-stackmap's edge layer).consoleErrors,failedRequests— deduped.windowNSOne— reported, not asserted (see below).It exits non-zero on a defective render unless
--allow-defectsis passed. A screenshot tool that always exits 0 is a tool that lets broken screens through review.Theme handling
Light is the unthemed default; dark is
data-theme="dark"on the root. The tool sets bothcolorSchemeand the attribute — it does not rely onprefers-color-schemealone, because NS One does not.Browser resolution
Playwright's bundled-browser version and the installed build disagree on this machine (
chromium-1232cached, npmplaywrightwants1228). Resolution order:CANVAS_SHOTS_CHROMIUMenv → newest cachedchromium-*→ Playwright's own, with an actionable error naming the mismatch. It never silently downloads a browser.Security
A
serve_urlis a*.claudeusercontent.comURL carrying a project-scoped token and it expires. The tool redacts it — never logged in full, never written to a file, never baked into a fixture.A correction, recorded
My first review of this branch asserted
window.NSOnemust be defined. That was wrong. The prototype renders rawns-*CSS classes rather than React components — deliberately, because class markup round-trips into@netscript/fresh-uiPreact source unchanged, which is the entire point of the sync-back loop. Sowindow.NSOnebeing undefined is architecture, not a defect, and the tool reports it rather than asserting on it. Enforcing my assertion would have damaged the sync-back path.Validation
deno test .llm/tools/canvas-shots/→ 9 passed, 0 failed (pure parts: arg parsing, slugging, theme script, defect classifier, browser-path resolver — no network, no live canvas)deno check/ lint / fmt cleanci.ymlonly triggers on PRs intomain;check-test/qualitydo not run here.Harness
Codex slice. Its first attempt (Sol · low) died silently after adding the dependency — zero code, no
task_complete, 52 minutes. The identical brief succeeded on Sol · medium. Recorded as a routing data point: "fully specified" and "mechanically easy" are different axes — this slice integrates an npm dependency, resolves a version-mismatched browser binary, and designs a defect classifier.The lock commit is included: the tool shipped without it initially, so its
npm:playwrightimport would not have resolved for anyone else. The three lines that vanish fromdeno.lockare a re-organisation within a member's dependency list, not a drop —jsr:@std/path@1remains (deno.lock:76→ 1.1.5) anddeno checkpasses.Run dir:
.llm/runs/beta10--orchestrator/, slicecanvas-shots-tool. Not self-certified.🤖 Generated with Claude Code
https://claude.ai/code/session_01HTiQfrNFCVhjQFqbLKm5xo