issue-213: Validate screenshot reconstruction against the live instance and record fidelity honestly #246
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!246
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-213/validate-screenshot-reconstruction-against-the-liv"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
213: Validate screenshot reconstruction against the live instance and record fidelity honestly
Closes #213 — 213.
Generated in 18m 27s.
Review findings
Now let me implement the High finding fix — a text-channel refs mode in
penpot_get_file:Now the Medium findings in the harness:I've completed a single remediation pass. Here's what I changed:include_refstopenpot_get_file(fileShape.ts,tools/file.ts): the bounded object tree now renders a{key: value}summary of each shape'stype,fillColorRefId/fillColorRefFile,typographyRefId/typographyRefFile,componentId/componentRoot,shapeRef. Updated the skill's verification step and README, with 4 new tests.hand-built framesfromstagedIdsinstead of hardcoding, and asserts linked-vs-literal per category over the hand-staged shapes only, reporting the clone ratios separately.1200×1080), regenerated the PNG (byte-identical to a freshresvgrender), and documented the DejaVu↔Source Sans Pro substitution in the fixture README and findings.width: 48to matchlibrarySpec.tsand made the seed comment honest about omitted layout/radius/sizing metadata.DESIGN.mdexisting.PENPOT_URL/PENPOT_TOKEN/PENPOT_LIBRARY_FILE_IDare available and there is no browser, so the live validation cannot be performed. The blocker is already stated plainly infindings.md; it can't be placed in the PR body from this stage.Gate:
npm test→ 825 pass, 1 fail, 1 skip. The failure is the pre-existingscripts/local-install.test.mjsmongodb-manifest mismatch (reproduces onorigin/main, unrelated to this diff).Review Findings — 213
Summary
Fixed the two High-adjacent tool gaps and every Medium/Low finding:
penpot_get_filegained aninclude_refstext-channel mode so the skill's ref-level verification is actually followable; the harness computes the hand-built frame count and scopes its linked-vs-literal assertion to agent-authored shapes (reporting clone ratios separately); the screen fixture canvas is content-sized and its font substitution documented; the stub's Badge geometry now matcheslibrarySpec.ts; and the bootstrap bullet no longer assumes aDESIGN.md. The remaining High finding (live-instance validation) is environment-blocked — no token and no browser — and stays unchecked;findings.mdstates that blocker explicitly.npm test: 825 pass, 1 fail (pre-existing, unrelated), 1 skip.Critical
High
fillColorRefId/fillColorRefFile, do text spans carrytypographyRefId, do the repeated elements carrycomponentId/componentRoot" viapenpot_get_file(include_objects: true), but that tool never renders shape fields into the text channel:formatObjectTree(src/fileShape.ts:626) emits only[id] name — N children, and the raw object maps are carried in the tool result'sdetails(size-budgeted,src/tools/file.ts:44) which pi documents as "for logs or UI rendering", not model content.penpot_status's preview is also onlyadd-obj "name" type(src/changeset.ts:627). The instruction is therefore not followable — the agent cannot observe any of the four fields it is told to verify, so it will either skip the check or assert linkage it did not see, which undermines the honesty this issue exists to enforce. Suggested fix: add a text-channel output mode (e.g.penpot_get_fileinclude_refs: true, or a summary line per shape withtype+fillColorRefId/typographyRefId/componentId/componentRoot) so the check is possible, or reword the step to what a text read can prove (named layers, nesting, child counts,penpot_list_librarynames) and state plainly that ref-level verification needs the raw objects.node extensions/penpot/scripts/live-write-check.mjswithPENPOT_URL/PENPOT_TOKEN/PENPOT_LIBRARY_FILE_IDagainst a disposable scratch file and record the run plus the UI checklist (Layers panel, text edit, swatch link, instance properties, canvas-vs-shopfront.png); if credentials are still unavailable, state the blocker in the PR body rather than treating the stub run as the live validation.Medium
"hand-built frames: 5 (screen + 4 regions)"as a hardcoded string while the instance count beside it is computed, so the number thatfindings.mdcites as a measurement can silently drift from the actual reconstruction as the check changes. Suggested fix: compute the hand-built count fromstagedIds/after.objects(frames instagedIdsthat are not an instance root and not inside an instance subtree) and print that value.reconstruction, which isstagedIdsplus every instance clone; the clones carry library refs by construction (19 of the 20 fills and 10 of the 12 spans), so the assertion at line 2001 passes even if every agent-authored primitive (screen, regions,title,tagline,hero-accent) used literal hexes — exactly the drift the issue wants caught. Suggested fix: compute and assert the ratio over the hand-staged shapes only (or report the two ratios separately: instance clones vs agent-authored primitives) so a literal fill in a composed primitive fails the check.Low
font-family="DejaVu Sans"and a 1200×1600 canvas whose content ends at ~y=1048 (~35% blank), while the README/findings.mddescribe it as authored fromDESIGN.md§3 typography (Source Sans Pro). This makes the fixture slightly less representative than claimed. Suggested fix: use the substituted Source Sans Pro family the library ships (or note the DejaVu substitution in the README) and size the canvas to the content.Badgelabel iswidth: 88wherelibrarySpec.tsuses48(and the seeded components omit thelayout/radius/sizing props the artifact carries), so the CHANGELOG/findings claim that the stub library "mirrorslibrarySpec.ts" is approximate. Suggested fix: pin the seed geometry/text/props tolibrarySpec.ts(a shared fixture or a test asserting the two agree) so the offline reconstruction matches the committed artifact.DESIGN.md" for a written spec; an image → design run may have noDESIGN.md, leaving the bootstrap path undefined. Suggested fix: reword to "bootstrap the palette/typography from the image's roles (Step 2), or from the project'sDESIGN.md(Step 1) when one exists".