Skip to content

Move browser programs out of Python - #664

Merged
max-sixty merged 3 commits into
mainfrom
codex/visual-review-foundation
Sep 13, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/visual-review-foundation

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Leaf maintained substantial browser and build programs inside Python string literals, which left the JavaScript outside native formatting and linting. This moves the Pierre vendor build, render probe driver, export preparation, MCP readiness, and demo selection logic into JavaScript sources; Python now owns orchestration and structured inputs.

The render driver preserves synchronous probe calls and bounded readiness waits. Export reads state from the document canonical capability root and disposes the Playwright response. Pierre regeneration remains byte-identical.

Validation:

  • uv run pytest tests — 1,043 passed
  • uv run pre-commit run --all-files
  • Real demo-recording browser journey
  • Byte-identical uv run scripts/vendor.py pierre output

This was written by Codex on behalf of @max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The move itself reads cleanly, and the paths it touches still behave: tests/test_render_gate.py (107 passed) exercises the new driver, wait_for_theme, and pre_upgrade_findings, and tests/test_mcp_app.py passes. The three tests/test_render_export.py failures I see locally reproduce identically at the merge base — this sandbox cannot launch the installed Chrome — so they are not the branch's. Two things to change.

_state_url's missing-root guard no longer fires on the case it was written for. Inline below.

The two references that own the directories this PR adds files to still describe them as they were. skills/leaf/assets/CLAUDE.md's Render gates section names each non-probe member of render-checks/ and its role ("render-checks/init.js installs the pre-navigation window-error channel"), and states that "The served graph imports the public widget API statically, so the JavaScript parser and module loader validate its syntax, dependencies, and named exports". driver.js is the first member deliberately outside that graph — render_checks.py filters it out of PROBE_SOURCES and installs it as a Playwright init script instead — so nothing but eslint parses it, and the next contributor to add a file there reads the opposite. Same shape in scripts/CLAUDE.md's Vendored bundles section, which still presents vendor.py as the whole of a bundle's source: scripts/vendor-src/pierre/ is now a second input, and the /* LEAF_PIERRE_LANGUAGES */ sentinel build_pierre substitutes into carries no explanation where it sits. Both edits are outside the diff — say the word and I'll push them.

Comment thread skills/leaf/scripts/leaf/exporting.py Resolved
@max-sixty
max-sixty merged commit 7097707 into main Sep 13, 2026
13 checks passed
@max-sixty
max-sixty deleted the codex/visual-review-foundation branch September 13, 2026 04:02
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