Skip to content

test(remote): refresh render history fixtures to the recorded-outcome shape - #855

Merged
huichen merged 2 commits into
mainfrom
fix/render-fixture-post-d848
Sep 25, 2026
Merged

huichen merged 2 commits into
mainfrom
fix/render-fixture-post-d848

Conversation

@huichen

@huichen huichen commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Why

The render fixtures froze the pre-#848/#849 wire shape, and lean-render-history asserted it — a false green:

row old fixture (frozen) old scenario expected what the phone gets now
htc_1 shell, exit 127 isError: false reads 已运行 isError: true → reads 运行失败 (#848)
htc_2 read, ok isError: false — no isError key (#849)
htc_3 write, ok isError: false — no isError key (#849)
htc_4 grep, soft-fail exit 1 isError: true (hand-authored probe) reads 运行失败 no key → reads 已运行

mobile/shot/mock/leanRender.ts's own §7b warned the expectations had to flip once the outcome was recorded for real; #848 landed and the scenario kept passing against the old page.

What changed

  • scripts/screenshots/gen-lean-render-fixtures.mjs (authority for the fixture shape): the full page now carries the recorded failure (isError: true on the exit-127 call) and omits the uninformative flag elsewhere.
  • render-lean-history-entries.json regenerated through the shipping trim (no hand edit); render-full-history-entries.json rewritten by the generator.
  • desktop/src-tauri/src/remote_host/lean.rs self-check: assert_recorded_tool_outcomes runs on the full page and the trimmed page, so generation fails if the fixture regresses to isError: false or loses its failure row.
  • lean-render-history: the one failing row is the recorded failure (its command arrives through the on-open get_tool_call_args fetch perf(remote): fetch a lean shell row's command on tap (#851) #851 added); the soft-fail grep reads 已运行.
  • lean-render-full-history: the single failing row is the same recorded failure (its command is in the page there).
  • lean-render-full (failed === 2, the two live-lane failure shapes) is untouched and re-verified green.

Verification (real mobile render surface, worktree port 8137 / CDP 9223)

All five lean-render-* scenarios exit 0, 0 eval errors:

lean-render-live         exit=0  "no dropped payload reached the screen"
lean-render-live-mid     exit=0  "思考中 + 正在读取(frank-summary.md)"
lean-render-full         exit=0  ["future nosuch-subcommand --verbose","ls /nonexistent-workspace-path"]  ← still 2
lean-render-history      exit=0  "shell(127)=future nosuch-subcommand --verbose 运行失败; grep(1)=grep -c dopamine notes/compare-table.md 已运行"
lean-render-full-history exit=0  "frank-summary.md / compare-table.md; failed=future nosuch-subcommand --verbose"

Falsification of the two changed/new assertions:

  • dropped the failed row's tap (the trigger for the lazy fetch) → eval error: the failing row must fetch its dropped command on open, got "", 1 step(s) could not reach their target;
  • restored the old isError: false fixture → eval error: the recorded failure (exit 127) must be the one failing history row, got 0, step fails.
  • generator self-check falsified both ways: isError: false → panics "a history result must not send isError: false"; no failure row → panics "must keep a recorded failure".

Also checked the screenshot is not the DOM-green/covered trap: elementFromPoint on the expanded failed row lands inside it and the fetched command is on screen.

… shape

The render fixtures froze the pre-#848/#849 wire: every history
`tool_result` spelled out `isError` — `false` on the exit-127 failure and on
the successes (which never carry a flag now), and `true` only on a
hand-authored probe row. `lean-render-history` asserted that shape, so it
would have stayed green against a page the phone no longer receives.

- the full fixture records the real failure (`isError: true` on the exit-127
  call) and omits the uninformative flag everywhere else (#849);
- the lean page is regenerated through the shipping trim, and the generator's
  self-check asserts the shape on both the full page and its trimmed form;
- both history scenarios flip: the exit-127 row reads 运行失败 (its command
  still arrives through the on-open fetch #851 added) and the soft-fail grep
  reads 已运行. lean-render-full-history's single failing row is that same
  recorded failure.

Verified in the real mobile render surface: all five lean scenarios pass, the
two new assertions were falsified (dropping the fetch trigger and restoring
the old `isError: false` shape each fail the step), and the live full-feed
`failed === 2` check still holds.
@huichen
huichen enabled auto-merge (squash) September 25, 2026 19:48
@huichen
huichen merged commit d3fa34f into main Sep 25, 2026
12 checks passed
@huichen
huichen deleted the fix/render-fixture-post-d848 branch September 25, 2026 20:04
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