Skip to content

FOYER-V3 R1: assert-gated walkthroughs for node-foyer - #10

Merged
HomenShum merged 2 commits into
mainfrom
foyer-walkthrough
Sep 13, 2026
Merged

HomenShum merged 2 commits into
mainfrom
foyer-walkthrough

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

Summary

Three single-pane walkthrough specs for Node Foyer's own surfaces (walkthrough.foyer.specs.mjs, captured by walkthrough.foyer.mjs, rendered via src/foyer-index.js reusing Walkthrough.jsx's new captureViewport geometry). New mechanism in this capturer, not present in any existing walkthrough.*.mjs: every cap op carries an assert checked against the live DOM immediately before the screenshot — fail-closed on a mismatch (aborts the spec, keeps zz-fail.png), so a capture that would show a wrong or stale state never ships. Each capture also reads the wall's own foyer-build-sha via a same-origin fetch at the first and last frame and discards the run if the served build moved mid-capture.

Step 0 (separate commit, 4cffdba): hand-applied the captureViewport geometry change from wip/slidelang-capture-viewport-20260912 (5088aaa) onto the current Walkthrough.jsx (which had since gained the chromeless/FILL refactor upstream) — geometryFor(wt) replaces the hardcoded 1280x800 CAP_VW/IMG_H/SX/SY constants so a 1440x900 wall and a 390x844 phone capture each get their own aspect ratio.

Storyboard

Capture Viewport Source Beats
FYwall 1440x900 production (https://node-foyer.vercel.app/) header provenance → all 22 cards → a verified card (NodeVoice) beside a reachable-only one (NodeProof) → a stable-sweeps line → NodeRoom's hover apparatus (probe URL, HTTP status, sha256) → __fixture_dead UNKNOWN with its tried URL → the Foyer's own card verified on both layers
FYphone 390x844 production soft-hyphenated long name → Details opens a real dialog with the wall now inert behind it → a 44px Open target → Close returns focus to Details
FYagent 1440x900 built preview, VITE_CONVEX_URL unset the wall root's own data-foyer-snapshot-source="file" fallback attribute → the same build's /.well-known/agent-ui.json and /api/apps.json served raw

Each capture carries the seven STORYBOARD.md beats (premise/question/axis/conflict/evidence/verdict/exit) as one storyboard object, matching node-foyer's WalkthroughCapture type exactly.

Judge results (gemini-3.6-flash, key resolved from env, never printed)

  • FYwallfix-then-publish, 20/22.
  • FYphonefix-then-publish, 22/22.
  • FYagent — sampled 3 times (this repo's own documented judge variance): 13/22 fix-then-publish, then 8/22 and 6/22 rework. Recorded as rework (2 of 3, most recent run) rather than resampled until a good score appeared. The defect repeats every run for a structural reason: the goto beats navigate to a raw JSON response with no in-app element to animate a cursor onto, and STORYBOARD.md forbids faking an interaction the frame doesn't show. The judge's own fix — a terminal/curl panel showing the actual fetch — is real but out of scope for this round.

Media budget

Three GIFs (979KB + 399KB + 998KB) + three posters (126KB + 87KB + 120KB) = ~2.58MB, under node-foyer's WALKTHROUGH_MEDIA_BUDGET_BYTES (4MB). Posters and GIFs are copied into node-foyer/public/media/walkthroughs/<id>/; the manifest draft is at node-foyer/data/walkthroughs.manifest.json for the planner to re-hash and promote to public/media/walkthroughs.json.

Test plan

  • npm run check — 60/60 JS files parse, 36/36 tour steps and 34/34 prose citations match (fixed the line-number drift the geometry commit caused in docs/START_HERE.md and .tours/01-primary-user-flow.tour)
  • All 15 capture-time asserts held across the three specs (7 + 5 + 3 frames)
  • npx playwright test e2e/foyer.spec.ts against the FYagent preview: 12 passed, 1 skipped, 1 failed (pre-existing registry/adapters.json vs public/data/snapshot.json drift from a concurrent planner commit — both protected/runner-owned files outside this PR's scope)
  • Rendered MP4s spot-checked frame-by-frame; GIFs and posters visually verified after re-encoding for size

🤖 Generated with Claude Code

HomenShum and others added 2 commits September 12, 2026 18:09
Hand-applied from wip/slidelang-capture-viewport-20260912 (5088aaa): geometryFor(wt)
replaces the hardcoded CAP_VW/IMG_H/SX/SY module constants, deriving displayed image
height and per-axis cursor scale from wt.captureViewport (default 1280x800 unchanged).
Upstream had since added the chromeless FILL/framed refactor, burst frames and
scalesOf, none of which this commit touches -- only the geometry math is ported.

Load-bearing for FOYER-V3 R1: FYwall (1440x900) and FYphone (390x844) captures need
their own aspect ratio instead of inheriting the Streamlit-era 1280x800 default.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…e-foyer

Three single-pane specs for Node Foyer's own surfaces (walkthrough.foyer.specs.mjs,
captured by walkthrough.foyer.mjs, rendered via src/foyer-index.js reusing
Walkthrough.jsx's new captureViewport geometry):

- FYwall (1440x900, production): header provenance, all 22 cards, a verified card
  beside a reachable-only one, a stable-sweeps line, the NodeRoom hover apparatus,
  the dead fixture's UNKNOWN state with its tried URL, and the Foyer's own card
  verified on both layers.
- FYphone (390x844, production): a soft-hyphenated long name, Details opening a real
  dialog with the wall inert behind it, a 44px Open target, Close returning focus.
- FYagent (1440x900, built preview with VITE_CONVEX_URL unset): the wall's own
  data-foyer-snapshot-source="file" fallback attribute, then the same build's
  /.well-known/agent-ui.json and /api/apps.json served raw.

New in this capturer, not present in any existing walkthrough.*.mjs: every `cap` op
carries an `assert` (visible / count / attr equals|matches / focused) checked against
the live DOM immediately before the screenshot, fail-closed on a mismatch (aborts,
keeps zz-fail.png) rather than only on a thrown exception. Each capture also reads
the wall's own foyer-build-sha via a same-origin fetch (works even when the last
frame has navigated off the wall's HTML, e.g. FYagent's raw JSON pages) at the first
and last frame and discards the run if the served build moved mid-capture.

Selector resolver (testid:/btn:/link:/aria:/placeholder:/text:/css:) merges
walkthrough.collab.mjs's testid: prefix with walkthrough.visual.mjs's broader set.

Judge (gemini-3.6-flash, GEMINI key resolved from env, never printed): FYwall
fix-then-publish 20/22, FYphone fix-then-publish 22/22. FYagent scored 13/8/6 across
3 sampled runs (2 of 3 rework) — this repo's own documented judge variance, but the
underlying defect repeats every run: goto-based JSON navigation has no in-app element
to animate a cursor onto, and STORYBOARD.md forbids faking one. Recorded honestly
rather than resampled until a good score appeared; a terminal/curl panel is the real
fix, left for a follow-up round.

README gains a "Node Foyer" real-world example section; docs/START_HERE.md and
.tours/01-primary-user-flow.tour line citations updated for the line numbers the
prior geometry commit (4cffdba) shifted in src/Walkthrough.jsx.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@HomenShum
HomenShum merged commit a0750d1 into main Sep 13, 2026
2 checks passed
@HomenShum
HomenShum deleted the foyer-walkthrough branch September 13, 2026 01:52
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.

1 participant