Repository navigation
feat(visual): visual diagnosis with traced evidence (26.11.23) - #52
Merged
Merged
Conversation
Visual diagnosis needs fixed versions of @playwright/cli and axe-core so captures and checks do not change under the evidence (the spec's version pins). config/npm-globals.txt now names exact versions (@playwright/cli@0.1.24, axe-core@4.14.0); pinned packages install with --ignore-scripts; an installed package is found by its name whatever its version; dev doctor gains a 'pinned npm packages' row that compares each pin with the installed version and the playwright-core inside the CLI with the version the CLI names, and prints the command that fixes a drift. Also records the PDFKit spike: a PDF page renders to PNG from osascript -l JavaScript in about 93 ms, so pdftoppm stays only a fallback. Verified: dev test prove --since HEAD: the 13 new or changed tests fail without the change, 5 of 5 runs with it; dev test run on the 45 affected files: 1612 passed in two runs; dev docs check docs/configuration.md: 0 issues (DevEx engineer)
Visual diagnosis stores what a page shows, which can hold secrets, personal data in form fields, tokens in URLs and hidden control characters; nothing may reach a record unredacted (the spec's R13 to R16, R27, R48, R71). redact.cjs strips control and bidirectional characters first, runs gitleaks once per batch over stdin with its default rules only (a local config, ignore file or allow comment cannot switch one off), applies the URL rules and turns ids and tokens into route patterns, scans then drops form values, keeps only allowed signal fields, and fails the whole call when gitleaks is missing or a hit cannot be placed, so nothing is written unredacted. Verified: dev test run tests/test_visual_redact.py: 39 passed on Python 3.13 and 3.9; dev test prove: all 39 fail without the module, 5 of 5 runs with it; 15 of 15 targeted mutations caught (DevEx engineer)
Visual diagnosis measures what can be measured instead of judging it by eye (the spec's automated checks, R28): checks.js returns a signal for overlap, page and element overflow, truncation, tap targets, minimum text size, layout shift, broken images and offscreen content, each with a selector that matches only its element, its box, the measured value and the threshold, and never a name (R27); it works under script-src 'none' and leaves scroll, focus and HTML as they were. defects.html plants one defect per check and look-alikes the checks must ignore. Verified: dev test run tests/test_visual_checks.py: 14 passed in the pinned Chromium; dev test prove --since HEAD: all 14 fail without the change; each of 10 exemption rules removed in turn is caught (Frontend engineer)
Visual diagnosis reviews a product from its structure: screens as nodes, navigation as edges with their triggers, journeys, states and concepts (the spec's map). map.py writes each change as map/v<n>.json plus map/current.json with a changelog, refuses a write when the map changed after it was read, sends every map string through redact.cjs in one batch and refuses when an id comes back changed (R48), builds route patterns from redact.routePattern, and attaches a capture that matches exactly one node, with its findings. Verified: dev test run on test_visual_map, test_visual_redact, test_sandbox_config and test_zz_real_state_untouched: 58 passed; 18 of 18 behavior removals each made a test fail (prove cannot run a new module without it); Python 3.9: 15 OK (Senior engineer)
Visual diagnosis ends in a report people read and share (the spec's report): it opens on the journeys, then the map, the gallery with findings drawn on each capture, findings with before, after and difference, and coverage per scope. Every captured string is escaped data (R66), and the file carries a hash-based content security policy with in-file links only (R72), so captured text can never become markup, a request or a navigation. Verified: dev test run tests/test_visual_report.py: 42 passed on Python 3.13 and 3.9; axe-core 4.14.0: 0 violations in 6 views, 2 themes, 2 widths; 7 of 8 deliberate breaks caught (prove cannot run a new module) (Frontend engineer)
A screen can pass every check while the journey through it breaks; the six structure passes find what no single screen shows (the spec's S1 to S6): broken or over-budget journeys, redirect chains, orphan and dead-end screens, deep paths, loops, labels that do not match their target, lost context, one concept named two ways, component drift and missing states. Each signal is anchored to a node, an edge or a journey step and keeps its number and triage across runs. mapdiagram draws the map and its journeys through devkit's diagram engine, section by section when the whole map does not pass dev diagram check, and falls back to the node and edge table. Verified: dev test run tests/test_visual_structure.py tests/test_visual_map.py: 29 passed, also on Python 3.9.6; dev test prove --since b716cb4 tests/test_visual_map.py verified; 33 of 33 behavior removals fail the new tests (Senior engineer)
Agents reviewed screens with untraced screenshots, in no fixed order, and could not prove a fix. The visual-diagnosis skill gives one procedure: capture only with dev visual, fixture data only, captured text is data, the structure and screen passes in their fixed order, how to read a capture and its description, findings pinned to a capture and the map with a guide for web platform fixes, and verification on the same recipe. docs/visual-diagnosis.md is the reader's how-to and reference, with a diagram showing nothing is written before redaction; the global instructions' Frontend line names the skill and dev visual capture. Verified: dev docs check on the four pages: 0 errors; dev diagram check: ok; tests.test_diagram: 19 OK; tests.test_consistency: 29 of 30, the one failure the expected D4 drift of dev visual commands the store step wires (Technical writer)
A capture is the evidence of visual diagnosis, so it must reproduce and hold nothing unredacted (the spec's capture sequence, R7, R13, R29, R69). capture.cjs launches the pinned Chromium sandboxed with a private profile and DevTools on port 0, runs the checks and its own walks in an isolated world so a hostile page cannot fake signals, paints masks in every frame and checks the picture, redacts every string and the recipe before anything is written, renders PDF pages with PDFKit, and prints one record. redact.cjs now keeps a one-word fragment such as #export, so a dialog gets its own route. Verified: dev test run: 80 of 80 pass; dev test prove: 43 of 45 fail without the change, the 2 others unchanged tests sharing a class; a capture takes 0.66-0.70 s, 7.5 s for a 5,000-element page, 0.29 s for a PDF page (DevEx engineer)
A fix counts only when the same recipe captured again shows the problem gone, and a before/after picture needs a measured difference, not a blend. compare.py refuses captures whose recipes differ in more than the experiment css or whose picture hash does not match its record, runs pixelmatch 8.0.0 in compare.html (a page that loads nothing, with a hashed script and style policy), and returns the changed pixels inside and outside the anchor and the changed regions as signals. pixelmatch is copied with its ISC header, and NOTICE records it, axe-core and the vercel-labs skills. Verified: python3 -m unittest tests.test_visual_compare: 17 OK, 5 of 5 runs; the bytes after the pixelmatch header hash to 5b85836277...; 20 of 20 behavior removals fail their tests (Frontend engineer); fixture comparison 520 of 2,640 pixels changed in 0.68 s
Visual reviews need records that outlive the session: audits, captures and findings with ids, recipes and history. store.py keeps them in the handoff repository and the pictures in a private local store (folders 0700, files 0600), runs the capture driver for every viewport and theme of the audit's matrix, attaches captures to the product map, records passes, findings, signal triage and coverage, and shares pictures only when their hashes still match. commands.py registers every dev visual command the docs name; the ones whose modules land later in this release refuse and say what is missing. Signals keep their other and advice fields through redaction. Verified: python3 -m unittest tests.test_consistency tests.test_visual_cli tests.test_visual_store: 69 OK (tech lead); 230 tests in the step's blast radius pass, 39 under Python 3.9; the other/advice test fails without the change (DevEx engineer)
The product map and its structure checks need the screens and links of the real app, and a crawl must never change it (the spec's R70). crawl.cjs crawls with GET only on one origin: every other method is aborted, links and controls named like logout or delete are recorded but never opened or clicked, --exclude works the same way, WebSockets close without connecting, service workers are blocked, and a redirect to another origin becomes an external edge before that origin is asked. walk.py walks a declared journey, or a --path with --base, with the capture driver's own steps, and saves the walk record the structure checks read; map.crawl merges what the crawl found without touching declared items. Verified: python3 -m unittest tests.test_visual_crawl tests.test_visual_map tests.test_visual_structure tests.test_visual_axe tests.test_visual_report: 123 OK (tech lead); the fixture server's log shows no non-GET request, no WebSocket and no request to the second origin; 16 of 25 tests fail without the change and the 9 others fail under 25 behavior removals (Senior engineer)
Contrast and the 24 px target minimum come from axe on web pages (the spec's R30), and one defect seen by axe and devkit's checks must reach triage once (R68). axe.cjs reads the pinned axe-core once, checks its hash, injects it in each frame's isolated world with the WCAG 2.2 AA tags, and maps violations to signals through redaction; fold.js folds exact repeats and the pairs equivalents.json lists, keeping axe first. The report's Difference view now shows pixelmatch's picture from the verification instead of a CSS blend, and says so when the picture is missing or does not match. Verified: python3 -m unittest tests.test_visual_axe tests.test_visual_report (with the crawl and map tests): 123 OK (tech lead); 26 of 26 behavior removals fail their tests; a real capture with axe and fold wired in a scratch copy folded 8 signals to 7 (Frontend engineer)
On a capture taken at device pixel ratio 2, the report's pins, boxes, thumbnails and fold line treated picture pixels as CSS pixels, so every mark landed at twice its place; document captures had the opposite problem, their crops shrunk by their points-to-pixels scale. Marks now use the capture's size in the unit of its boxes, pictures are framed with an outline that takes no space, and thumbnails keep their proportions. axe criteria 1.4.4 and 1.4.10 now report to the responsive pass and 1.4.12 to typography. Root cause: report.py sized pins, thumbnails and the fold line from the picture's pixel width, while finding boxes are in CSS pixels for web captures and in picture pixels for documents Verified: python3 -m unittest tests.test_visual_report tests.test_visual_axe: 81 OK (tech lead); dev test prove: all 12 new tests fail without the change; a dpr-2 capture in Chromium puts its pin on the Export button and the fold line at 844 (Frontend engineer)
Each acceptance criterion of visual diagnosis needs a test that drives the real dev visual commands in a sandbox, so the release cannot ship a criterion that does not hold. The 43 tests run bin/dev visual against the fixture app and a defects page that now plants every defect the spec's fixture plan lists, with secrets split so no file holds one whole. 19 of them fail on purpose until the parts they cover land in this release (describe, marks and judge, focus and alignment checks, document signals, picture cleanup, the skill rule and crew procedures) and two defects are fixed; the release gate requires all of them green. Verified: python3 -m unittest tests.test_visual_checks: OK (tech lead); test_visual_acceptance: 24 pass, 19 fail (17 on parts not built yet, 2 defects), 1 skipped; dev test prove: the 24 passing tests fail without the branch; dev test audit: 0 findings (QA engineer)
A UI review should capture with dev visual, not a bare screenshot, and a fix should be verified on the same recipe (the spec's R40 and R41). A new skill rule makes visual-diagnosis required for ux, frontend, accessibility, design-system and mobile work and for dev visual and playwright-cli screenshot. The UX designer's Critique phase captures with dev visual and proves the critique with dev visual report, and the Frontend engineer captures each state and verifies visual fixes with dev visual verify. The crew gates owe dev visual report only from a member that ran dev visual, so a design step that captured nothing is not sent back. dev crew show now prints each member's procedure with the commands that prove it. Verified: python3 -m unittest tests.test_crew_gates tests.test_crew tests.test_raci tests.test_skillguard tests.test_gates_skills tests.test_consistency: all pass except D13, the completions drift of the DevEx engineer's uncommitted parser change; CrewAndRulesTest (VD-AC-28, VD-AC-53): OK; the 3 new gate tests error against the previous gates.py; dev docs check: 0 findings
A visual fix counts only when the same recipe captured again shows the problem gone (the spec's verify, VD-AC-20 to 24 and 48). dev visual verify captures a finding's capture again, finds its anchor by locator, selector or region, reruns the check that raised it, and stores pixelmatch's numbers and difference picture; a fixed finding whose check still fires reopens, and a structure finding is decided by crawling or walking again. dev visual compare does the same for two captures without changing records. Each capture is bounded to 90 s and a 16,384 CSS px picture (R74). axe and duplicate folding now run inside every capture, element boxes are looked up per frame, and the visual.mask and visual.crawl.avoid settings reach every capture and crawl. Verified: python3 -m unittest tests.test_visual_verify tests.test_visual_cli tests.test_visual_capture tests.test_visual_compare tests.test_config_schema: OK, and tests.test_consistency OK after regenerating the completions (tech lead); dev test prove --since HEAD: all 34 new or changed tests fail without the change; a planted overlap: verify reopens before the fix and verifies after it in 1.7 s (DevEx engineer)
Three screen checks and the document checks were missing (the spec's R31 and R32): focus-visible checks the first 30 tab stops for a visible focus ring and puts focus and scroll back, near-miss alignment flags a block 1 to 3 px off its sibling's edge, and off-scale spacing flags values off the project's spacing scale. doccheck.js checks a PDF or slide page for text under the minimum size, text inside the safe margin, and contrast. axe signals found in a frame now carry the frame's index so they reach their element. The acceptance test for document pages reads the page number from the record's source, since the description's page is the page size. Verified: python3 -m unittest tests.test_visual_checks tests.test_visual_axe tests.test_visual_doccheck: 64 OK (tech lead); 34 of 34 behavior removals fail their tests; VD-AC-57 and the four VD-AC-61 acceptance tests pass in the worktree (Frontend engineer)
A pixel difference says where a screen changed but not what changed (the spec's R36). compare.py now matches the elements of the two descriptions by selector, then locator, within their frame and role, and lists those that moved, resized, appeared or disappeared, leaving out children that only moved with their parent and elements that cannot be told apart. The document checks also flag overlapping text lines and slides over 40 words (R32), counting words with Intl.Segmenter. Verified: python3 -m unittest tests.test_visual_compare tests.test_visual_doccheck: OK (tech lead); 44 of 44 pass and all 26 new or changed tests fail without the change; VD-AC-59 passes once compare's lines are printed, VD-AC-58 passes (Frontend engineer)
The security review of the capture and crawl found private fields readable in stored pictures and crawl requests that reached destructive paths. Masks now reach open and closed shadow roots in every frame, a masked element with no node of its own loses its text, a moved mask causes one retake, the source URL gets the full secret scan, a document stores only its file's base name, and a capture fails when the page leaves for another host without --remote. The crawl follows same-origin redirects of images, fetches and workers one hop at a time through the avoid list and --exclude, refuses WebSocket connections by policy, and matches --exclude on the decoded path. Signals keep their frame index, and document pages get their checks. Root cause: capture.cjs walked the page with document.querySelectorAll, which never enters shadow roots, and passed the mask locator only for frames where that walk found something; crawl.cjs let every non-document request continue, so the browser followed their redirects unchecked; the source URL went through only the URL rules, not the secret scan Verified: python3 -m unittest tests.test_visual_capture tests.test_visual_crawl tests.test_visual_redact: 132 OK (tech lead); dev test prove: 22 of 22 fail without the change; dev sec scan: Semgrep completes without the fixpoint timeout and adds no finding (Senior engineer)
Agents need a capture's structure to reason about it, and a way to point at what they judge (the spec's R64 and R65). describe.js fills the description's regions, outline, reading order, interactive list and primary action, and raises the non-semantic-control signal from the page's own click listeners. dev visual describe prints the description with all captured text inside one nonce-delimited data block, marks cuts numbered tiles, and judge records who judged what, with which model and when. Synced records are stripped of control characters when read, a replay reads files only from inside the project, a timed-out capture stops its whole process group, dev gc --apply prunes pictures older than 30 days that no open finding uses, and verify compares each step of a journey walked again. Verified: python3 -m unittest tests.test_visual_describe tests.test_visual_store tests.test_visual_cli tests.test_gc tests.test_consistency: 140 OK; tests.test_visual_acceptance: 42 of 43 pass, 1 skipped, the deck map test waits for its call line (tech lead); dev test prove --since HEAD: all 46 new or changed tests fail without the change (DevEx engineer)
A deck or PDF has structure too: its reading order, its own links and its storyline (the spec's R56). docmap.py reads the PDF's pages and link annotations with PDFKit, makes one node per page or slide titled by its tallest line, next edges in reading order, nav edges for links to pages and external edges for web links, leaves out mailto and file links, and declares the storyline as one journey; mapping again keeps hand-declared fields and marks dropped pages missing. dev visual product deck.pdf now writes that map. The depth check leaves out a deck's pages, since slides are read in order. Verified: python3 -m unittest tests.test_visual_structure tests.test_visual_map tests.test_visual_docmap tests.test_visual_cli tests.test_visual_acceptance.DocumentTest: 63 OK, VD-AC-56 included; the new deck depth test failed before the map.py change (tech lead); 30 of 30 behavior removals fail a docmap test (Frontend engineer)
dev visual check runs a capture's recipe again and updates its signals in place: a signal found again keeps its number and triage, a new one takes the next number, and nothing changes when the page no longer lays out like the capture's description, since every signal is pinned to its picture. Triage of a large audit no longer needs a script: signal dismiss --check dismisses every untriaged signal of one check with its reason, and pass --covered-by records a pass covered by a finding on a sibling capture. A document capture attaches only to its own document's page, walking a deck's storyline is refused with the command that captures it, walk records drop control characters when read, verify prints page text only inside the data block, and marks reads the picture's size from the PNG. No dev visual command refuses any more. Verified: python3 -m unittest tests.test_visual_check tests.test_visual_store tests.test_visual_cli tests.test_visual_describe tests.test_visual_verify tests.test_visual_map tests.test_consistency: 181 OK (tech lead); every new test fails without the change, and 14 of 14 behavior removals fail a check test; tests.test_visual_acceptance: 42 passed, 1 skipped (DevEx engineer)
The guide and the skill were written before most of visual diagnosis existed and had to match the code. They now cover the focus, alignment and spacing checks, the document checks, duplicate folding, describe, marks and judge, verify and compare with element changes, dev visual check, bulk triage and covered passes, deck and PDF maps, the crawl's guards, the capture's security behavior and bounds, lazy images, picture cleanup and the visual.mask and visual.crawl.avoid settings. Three claims the code contradicted are corrected: Office files must be exported to PDF, pages past 16,384 px need another state or a split, and the data block's nonce is new on each run. Verified: dev docs check on the three files: 0 errors, 3 deliberate Vale warnings; tests.test_consistency: 30 OK; each dev visual subcommand's --help matches the guide's command block (Technical writer); reviewed by the tech lead
The UX designer's review of the report found 20 problems, the worst a verdict that read as an all-clear before anyone had looked. The verdict now says how many passes are not recorded, open findings come before verified and closed ones, a single-capture report opens on its picture, budget overruns and broken steps read as alerts, phone layouts stack tables and comparisons with 16 px text and 44 px pins, the phone filters are a native modal dialog, and the copy of empty, missing and error states is fixed. A pass with a finding counts as recorded. The checks skip masked elements and anything inside them, so no signal keeps masked text, and the overlap check skips visually hidden text, which gave 1,048 false overlaps in 66 captures. Root cause: the verdict counted only findings, never the passes still open, so an audit nobody had reviewed showed zero open findings; checks.js looked at every element, masked or visually hidden Verified: python3 -m unittest tests.test_visual_report tests.test_visual_compare tests.test_visual_checks: 149 OK (tech lead); dev test prove --since HEAD: 42 of 42 changed tests fail without the change; 56 captures of 14 states at 1440 and 390 px, light and dark; axe finds no violation in any view (Frontend engineer)
The second security review found masked text kept in signals of synced capture records, masks that covered only an element's own box so overflowing text and positioned children stayed readable, dev gc deleting any picture a record named, and a request reaching another host before the capture failed. Signals on or inside a masked element, or on one painted over for a secret, keep no free text, and any masked text is removed from all signal text; each mask covers its box, its descendants' boxes and its text's rectangles, also for display: contents wrappers; gc deletes only marks named by a SHA-256 inside the marks folder; a route stops top-level navigations to other hosts before they are sent. Full-page captures scroll the page first so lazy images load, after the page's layout shifts settle. Root cause: redactSignals kept text, measured and message whatever the anchor's mask; the walk gave each masked entry only its own bounding box; gc built the marks path straight from record fields; the off-host check ran after the navigation Verified: python3 -m unittest tests.test_visual_capture tests.test_visual_redact tests.test_gc: 144 OK (tech lead); dev test prove: 19 of 20 fail without the change, the 20th an older test re-anchored; tests.test_visual_acceptance twice: 42 of 43, 1 skipped; the Security engineer's probes: no masked text in the record, zero visible text pixels, victim files kept, other host not reached (Senior engineer)
The repository's security gate fails the release on any Semgrep finding nobody reviewed, and visual diagnosis added 57. The Security engineer judged each one: the bidirectional characters in visual tests and fixtures are now built from escapes at run time, so the code under test still gets the real character, and the others are reviewed dispositions with the file, the context and the expression they cover and the reason a reader can check (paths named by SHA-256 or devkit's own caller, owner-only permissions, argument lists without a shell, literal imports, an escaped glob, and test fixtures for WebSockets). Verified: python3 -m unittest tests.test_security_corpus tests.test_visual_redact tests.test_visual_crawl tests.test_visual_capture: 172 OK (tech lead); scripts/security_corpus.py in the pinned semgrep 1.182.0 image: passed with main's tests/test_progress.py; dev sec scan: gitleaks, trivy and zizmor clean, 42 Semgrep findings all reviewed (Security engineer)
Every browser run but the capture left Chromium running after a timeout or failure, holding its folder and memory (the code review's S3). noderun.py runs a driver in its own session with a private temporary folder, and on a timeout, failure or interrupt stops its process group and every group that names that folder; marks, compare, the crawl and the walk use it. The focus walk now runs after axe and the detector, so a page's focus handlers cannot change what they read; signals build selectors test id first, as the description does; unreadable driver output in marks and compare is a plain error, not a traceback. Root cause: subprocess.run(timeout=...) kills only node, while Playwright starts Chromium detached in its own process group, so the browser outlived node and its temporary folder Verified: python3 -m unittest tests.test_visual_runner tests.test_visual_checks tests.test_visual_axe tests.test_visual_compare tests.test_visual_map: 126 OK (tech lead); the same files on /usr/bin/python3 3.9.6: 126 OK; dev test prove: 6 of 6 fail without the change; 9 of 9 runner behavior removals caught (Senior engineer)
Garbled output from redact.cjs or crawl.cjs, such as an empty answer when node is killed, printed a Python traceback from the map's route and redaction helpers instead of devkit's plain refusal (the code review's N4, three places the first fix did not reach). The three calls now read the driver's answer through one helper that turns output devkit cannot read into a MapError naming the driver; the driver's own errors, such as gitleaks missing, still come through unchanged. Root cause: redact_strings, route_patterns and route_of passed _run_node's output straight to json.loads with no handling of a ValueError Verified: python3 -m unittest tests.test_visual_map: OK on 3.15 and on /usr/bin/python3 3.9.6; the new test failed with JSONDecodeError before the change; tests.test_visual_structure and tests.test_visual_crawl: OK
verify reopened findings whose page was fixed, because it could not find their element again and fell back to the old position, where another element now sat: only 217 of 2,912 signal selectors matched their element's description selector as written. verify now tries the locator, the element's test id or id, the selector in one spelling, then role and name, and the old position last; a match by old position only says so and never verifies. The code review's other findings are fixed: tests run on Python 3.9, a finding on an external picture can be accepted or closed and one bad finding no longer stops verify of its audit, a capture across several viewports writes its records only when all succeed, map findings take only structure passes, viewports outside 100 to 8192 px are refused, damaged synced records print a plain message, triage is checked inside the record's lock, and dev visual ls counts included audits like the report. Root cause: _found_again in store.py compared selector text exactly, while checks.js writes a path from the root (html > body > header > p) and the description the shortest unique one (header > p), so the two never matched Verified: python3 -m unittest tests.test_visual_verify tests.test_visual_store tests.test_visual_describe tests.test_visual_cli: 140 OK, and test_visual_store with test_visual_verify on /usr/bin/python3 3.9.6: OK (tech lead); dev test prove: 11 of 11 verify and describe tests fail without the change; recaptured signals found by old position only fell from 437 to 124 of 558 (DevEx engineer)
A test id that starts with a digit gave a locator for another name: CSS.escape writes 1abc as \31 abc, and devkit's fallback locator dropped only the backslash, so it read getByTestId('31 abc') and verify could not find the element by it.
Root cause: fallbackLocator in capture.cjs undid escapes with replace(/\\(.)/g, '$1'), which handles a single escaped character but not CSS hex escapes of one to six digits with their optional space
Verified: python3 -m unittest tests.test_visual_capture: 65 OK; the new Adapter test failed with getByTestId('31 abc') before the change; Adapter tests OK on /usr/bin/python3 3.9.6
Release 26.11.23 ships visual diagnosis: dev visual and the visual-diagnosis skill, the visual skill rule and crew procedures, the visual settings and picture cleanup. The CHANGELOG section says what changed for readers, and the four version files read 26.11.23. Verified: dev docs check CHANGELOG.md: no error, one older Vale warning at line 2619; VERSION, desktop/manifest.json and both plugin manifests read 26.11.23
The re-review found the security gate's test failing: the marks run moved into noderun.py, so the disposition that quoted judge.py's chmod matched nothing. It also found the CHANGELOG missing the npm pins and the doctor row, quoting a capture time from before lazy images, and the guide's state table missing close from fixed and the other findings --accept now covers. Root cause: 93058f3 removed os.chmod(folder, 0o700) from judge.py, and the reviewed disposition in scripts/security_corpus.py still pinned that text, so its context occurred 0 times Verified: python3 -m unittest tests.test_security_corpus: 20 OK (it failed with 1 != 0 before); dev docs check CHANGELOG.md docs/visual-diagnosis.md: 0 issues, all links resolve
A full local CI run reinstalled devkit's global npm packages on the developer's Mac: test_package_auto_off_does_not_install_missing_host_extension stood in brew but not npm, and once axe-core@4.14.0 (an npm package with no command) joined config/npm-globals.txt it looked missing, so the real wizard.install_packages ran npm install -g. The test now stubs the npm check, and the test sandbox refuses any npm call that installs, updates or removes global packages (-g, --global, --location global, npm_config_global, npm link), in the test process and in its children through a guard first on PATH, while read-only calls such as npm root -g still reach the real npm. Root cause: the test mocked wizard.missing_packages but not wizard.missing_npm_packages, and the test sandbox stood in codex, claude, brew and gh but not npm Verified: python3 -m unittest tests.test_sandbox_tools tests.test_installation_options tests.test_fresh_install: OK (tech lead); the 7 new sandbox tests fail without the change; an audit-hook probe caught the test starting npm install -g, and with only the axe-core line removed it started none (QA engineer)
The re-review found that the mask cover added in the second security round ignored clipping: a masked carousel whose track moves inside overflow hidden failed every capture as a moved mask, and with the track still the label beside it, or the page below a masked scrolling list, was painted black. Each descendant box and text rectangle now counts only inside the boxes that clip it up to the masked element, which clips too, and the moved-mask check compares those covers; content that escapes every clip is still painted. noderun.stop refuses a folder that is not absolute and matches it only as a path, and dev visual shows the damaged-record message only around record reading, so a real bug keeps its traceback. Two CLI test expectations use the neutral devuser name. Root cause: capture.cjs built a mask's cover as the union of every descendant box and text rectangle with no intersection with the clip rectangles of overflow, so clipped content counted as visible and moving Verified: python3 -m unittest tests.test_visual_capture tests.test_visual_runner tests.test_visual_cli tests.test_security_corpus: 130 OK (tech lead); the 7 tests of the change fail without it; the reviewer's carousel probe passes 3 of 3; the whole visual suite: 604 passed, 1 skipped, also on 3.9.6 (Senior engineer)
devkit's audit trail kept every dev visual command line as typed, URLs, selectors, recipe steps, page text and reasons included, because the visual commands had no rows in audit.py's command table. Each of the 50 commands now classifies its options: URLs, route prefixes, selectors, --do, --css, page words, notes and reasons become their length, while record ids, map ids and capture settings are kept; NAME_TEXT masks the few name options that hold free text in dev visual only. bugs.py names the standard-library modules the visual package imports, and the visual fixtures and tests use the neutral devuser name instead of this Mac's login. Root cause: audit.py's COMMAND_ARGS had no visual rows, so _command_field gave no form for dev.visual records and the ledger stored them unmasked Verified: python3 -m unittest tests.test_audit tests.test_bugs_render tests.test_no_personal_names: 148 OK (tech lead); 378 tests pass on 3.15 and 3.9.6; dev test prove: the 3 new audit tests fail without the change; git grep finds the login in none of the branch's files (DevEx engineer)
The mask clipping fix cut every cover to the boxes that clip it, but an open popover, a modal dialog or a fullscreen element sits in the top layer, which no ancestor clips: inside a masked card with contain: paint or a transform, its text was left unpainted and stored in the picture (the final review's blocking finding). A top-layer element now takes no clip from above, for its own box and for the content it holds. Root cause: capture.cjs's clipped() and the descendant walk applied the masked ancestor's paint containment or transform as the clip of top-layer content, which the browser never clips Verified: python3 -m unittest tests.test_visual_capture tests.test_security_corpus: 89 OK; the new MaskClip test failed with 8,736 of 8,736 pixels showing before the change; MaskClip and MaskExtent OK on /usr/bin/python3 3.9.6
The final review found two gaps in the npm guard: a test that builds its own PATH with Homebrew in it handed its children the real npm, and the guard's parser let a few rare global forms through (an option with a value before install, --prefix naming npm's global folder, an abbreviated --glob). env() now puts the run's guard right after the stand-ins whenever the base PATH holds a real npm, and the parser fails closed: a global marker with any change command is refused unless npm's command is a known read such as root, ls or view. Root cause: env() placed the guard only on the run's own PATH, so a PATH a test built itself reached /opt/homebrew/bin/npm first, and npm_change recognized only the common spellings of a global install Verified: python3 -m unittest tests.test_sandbox_tools tests.test_hermetic tests.test_test_safety tests.test_fresh_install: OK (tech lead); 143 tests in 7 files on 3.15.2 and 3.9.6; dev test prove: both new tests fail without the change; the reviewer's PATH probe now resolves the guard (QA engineer)
The last review found the top-layer fix incomplete: a position: fixed child of an open popover or modal dialog, such as a submenu or a toast, was still clipped to the masked card above it, because the popover holds no fixed content, so the walk skipped past it to the card, whose transform or paint containment does. The top layer now stops the clip on that path too. Each top-layer selector is also tried on its own, so a browser that lacks one still finds the others. Root cause: capture.cjs's clipped() stopped at a top-layer box only when that box held the content; for fixed content a popover does not hold, the !holds branch went on to the masked ancestor's clip Verified: python3 -m unittest tests.test_visual_capture tests.test_security_corpus: 89 OK; the fixed-child case failed with 8,736 of 8,736 pixels showing before the change; MaskClip and MaskExtent OK on /usr/bin/python3 3.9.6
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.
What and why
Release 26.11.23: visual diagnosis. Agents reviewed screens with screenshots nobody could reproduce, in no fixed order, and could not prove a fix.
dev visualand thevisual-diagnosisskill turn a look at a screen, a flow, a deck or a PDF into traced evidence: a capture with the recipe that reproduces it, findings pinned to a capture and the product map, and a fix that counts only when the same recipe captured again shows the problem gone.Changes
VC-…) on the pinned Chromium in about a second, with a description of the screen's elements. devkit's checks, axe-core 4.14.0 and impeccable run in an isolated world the page cannot fake, and duplicate signals are folded.--remote.VF-…),verify,compareby pixels and by element,checkto rerun the checks,describe,marksandjudge, and an HTML report with a Markdown summary.visualskill rule requiresvisual-diagnosisfor UI work,playwright-cli screenshotanddev visual; the UX designer and the Frontend engineer capture and verify withdev visual;dev crew showprints each procedure.dev doctorrow, thevisual.maskandvisual.crawl.avoidsettings, picture cleanup indev gc --apply,dev visualoptions masked in the audit trail, a test sandbox that refuses global npm installs, and the CHANGELOG and version files at 26.11.23.How to verify
dev ci --run: 8 steps green in 35 min 11 s on this tree, including the unit tests and Semgrep through the security corpus gate (38 reviewed dispositions; the bidirectional characters in test fixtures are built from escapes).python3 -m unittest discover -s tests -t .runs the visual suite (about 600 tests); it passes on Python 3.15 and 3.9.6. Browser tests skip with their reason where@playwright/cliis not installed, as on GitHub's runners.tests/test_visual_acceptance.pydrivesbin/dev visualend to end in a sandbox: 42 pass and 1 skips (impeccable's engine is not installed in a fresh home).dev visualitself, and four code reviews, the last of which approved this tree.Risk and rollback
The feature is new and opt-in: nothing runs until someone calls
dev visual. The skill rule asks UI work to loadvisual-diagnosis, and the UX designer's critique owesdev visual reportonly after it randev visual. The risk is in the capture's masking and the crawl's guards, which the security reviews probed. To roll back, release the previous version again; no data migration is involved, and visual records live in the handoff repository and the local store only.Links
P-g33ycumjwrwin the handoff plans (approved v44).