Skip to content

fix(visual2): Layer 1 build-output skip + Stage 2 crash-guard#86

Merged
dadachi merged 2 commits into
mainfrom
fix/visual2-robustness
May 23, 2026
Merged

fix(visual2): Layer 1 build-output skip + Stage 2 crash-guard#86
dadachi merged 2 commits into
mainfrom
fix/visual2-robustness

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented May 23, 2026

Two robustness fixes surfaced by a real VISUAL=2 run (sentova, paid substrate). Independent — one commit each.

1. fix(layer1): skip compiled build output to match rename.rb (#84)

#84 made rename.rb skip app/assets/builds + public/assets (build output regenerated from un-renamed source — e.g. Turbo's visitCompleted in application.js). But Layer 1's scan didn't skip those paths, so it scanned the bundle rename deliberately left alone and flagged the intentionally-un-renamed tokens — the two skip lists had drifted.

The run hit exactly this: rails Layer 1 FAIL (9 leftover Completed) = visitCompleted×7 + visitRequestCompleted×2 in the skipped application.js.

Fix: add SKIP_SUBPATHS (app/assets/builds, public/assets) to layer1.ts's walk. Real-source leftovers are still flagged (covered by a new test).

2. fix(judge): a Stage 2 mobile-mcp failure must not crash the run

mobile-mcp runs in a child process; if it exits mid-walk the SDK rejects with McpError: Connection closed. That was unhandled → it aborted dispatch before buildRunReport, so the run wrote no report at all (and, in a paid→free session, the free run never started).

Fix: wrap the Stage 2 walk so any throw degrades to a recorded Stage 2 failure (pass:false + error) on the walked platforms — the run still produces a report with Stage 2 marked failed.

Testing

  • New Layer 1 test: build-output bundles ignored, real-source leftover still flagged.
  • npm run ci73/73.
  • (Stage 2 crash-guard isn't unit-tested — the throw originates deep in the MCP SDK child process and runStage2Visual isn't injectable without a refactor; verified by the next real run.)

Not included (separate, environment)

The run also exposed a :3000 collision — the developer's substrate dev server (nativeapptemplateapi) occupies the same host:port the agent bridges into the generated app and tries to bind. That's an environment issue (stop the substrate server before a VISUAL=2 run); a longer-term "run the generated server on a free port" improvement is worth a separate issue.

🤖 Generated with Claude Code

dadachi and others added 2 commits May 23, 2026 12:30
PR #84 made rename.rb skip app/assets/builds + public/assets (build output
regenerated from un-renamed source, e.g. Turbo's visitCompleted in
application.js). But Layer 1's scan skip-set didn't include those paths, so
it scanned the bundle rename deliberately left alone and flagged the
intentionally-un-renamed tokens.

A real VISUAL=2 sentova run hit this: rails Layer 1 FAIL (9 leftover
"Completed") — all from visitCompleted×7 + visitRequestCompleted×2 in the
skipped application.js. The two skip lists had drifted.

Add SKIP_SUBPATHS (app/assets/builds, public/assets) to layer1.ts walk so
Layer 1 ignores exactly what rename.rb ignores. Real-source leftovers are
still flagged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mobile-mcp runs in a child process; if it exits mid-walk the SDK rejects
with "McpError: Connection closed". That was unhandled, so it aborted
dispatch before buildRunReport — losing the entire report (and, in a
multi-run session, everything after it).

Wrap the Stage 2 walk in runStage2Phase: any throw degrades to a recorded
Stage 2 failure on the walked platforms (pass:false + error), so the run
still produces a report with Stage 2 marked failed instead of crashing.

Surfaced by a real VISUAL=2 sentova run that crashed at Stage 2 and wrote
no report.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit fe9809e into main May 23, 2026
1 check passed
@dadachi dadachi deleted the fix/visual2-robustness branch May 23, 2026 06:12
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