Skip to content

fix(page-fidelity): no number it never measured; say it is not a LOOK - #191

Open
MendixMau wants to merge 1 commit into
masterfrom
fix/page-fidelity-honest
Open

MendixMau wants to merge 1 commit into
masterfrom
fix/page-fidelity-honest

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Direct lane

What changed and why (one paragraph):
A wireframe template whose opening HTML comment says "inside <main>" made page-fidelity.js treat the comment as the page. Headings, actions, content and classes all compared 0 of 0, so the score came from bindings alone. Two builds read "fidelity 100%" and "50%" as "the page looks right" and never opened a screenshot (#188). Changes in this PR:

  • The scorer strips HTML comments before it reads the wireframe.
  • When there is nothing to compare, it prints UNMEASURED with the reason, exits 3 and logs nothing.
  • A page whose model still has a Stub: caption, scored without --stub, prints STUB IN MODEL, logs 0% and exits 4.
  • snippetcalls are followed into snippet bodies found in the input. Snippets that are missing are named, the result is marked (partial), and the output gives the describe snippet command to fetch them.
  • The printed label is text-match. The file and TSV names stay the same. Every run ends with "text-match compares identifiers, not pixels — it is not a LOOK".
  • check-design-reaches-app.sh also reads the Docker build's .docker/build/app/web/theme.compiled.css when it is the newest built theme.
  • ui-loop.md step 4 and iterative-build-loop.md (stub marker) are updated to match.

This is PR 1 of 3 for the look enforcement. PR 2 (pages owed a look, then seen, then gated) and PR 3 (grader subagent) follow.

Field evidence: I ran the scorer on the real wireframe of one of the two field builds:

  • Before: headings 0/0 actions 0/0 content 0/0 classes 0/0 bindings 3/6, printed as fidelity 50%.
  • After: real denominators (for example headings 1/2, content 0/4, classes 0/35, bindings 0/6 against an unbuilt page).

The new fixture commented-template.html is a genericized reduction of that template, captured not hand-written. CAPTURE.md records master's output against the new output (master fidelity 100% … bindings 2/2, new text-match 85% … headings 2/2 … classes 6/22).

  • No client data anywhere in the diff (leak guard clean; diff grepped for project names)
  • Size cap: 6 non-fixture files, about 210 changed lines excluding fixtures, CAPTURE.md and CHANGELOG
  • Test tier:
    • T0: every new assertion (OUT6–OUT11) was reproduced by a probe run, along with the existing fixture cases (Demo_Overview 100%, Demo_List 100%, Catalog).
    • T2: the field wireframe above.
    • T1: bash tests/wave2/test-page-fidelity-mocks.sh project-bin/page-fidelity.js has not been run locally yet and waits on the maintainer's ok. CI covers it at T3.
  • Instrument: golden input captured. Path resolution is unchanged; the docker path is probed under $MODEL_DIR from find_model_dir, so both layouts are covered. No new platform-specific tools.
  • CHANGELOG.md line appended

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

A wireframe template whose header comment names <main> made the scorer
take the comment as the page: every text dimension compared 0/0 and the
"fidelity" number came from bindings alone (100% and 50% on two pages).

- strip HTML comments before parsing the wireframe
- UNMEASURED (exit 3, not logged) when there is nothing to compare
- STUB IN MODEL (logged 0%, exit 4) for a Stub: caption scored without --stub
- follow snippetcalls into snippets found in the input; mark missing ones (partial)
- print the score as text-match and always note it is not a LOOK
- check-design-reaches-app.sh: read the docker build's compiled theme when newest

Field run: two builds on one wireframe template (#188); fixture is a
genericized reduction of that template, before/after in CAPTURE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants