Skip to content

Route studio create --from URLs through Data Liberation - #3952

Draft
chubes4 wants to merge 56 commits into
trunkfrom
feat/site-artifact-import-cli
Draft

Route studio create --from URLs through Data Liberation#3952
chubes4 wants to merge 56 commits into
trunkfrom
feat/site-artifact-import-cli

Conversation

@chubes4

@chubes4 chubes4 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

studio create --from <url> routes through Data Liberation and materializes its portable artifact through Static Site Importer. The vendored engine is synchronized with Automattic/data-liberation-agent trunk at 02d8d6403060a859a9846a5c41086cf00b03a8f9, including the URL-scheme allowlist merged in Automattic/data-liberation-agent#198.

The branch also keeps tagged real CLI E2E tests out of the parallel unit-test suite, matching the documented Vitest contract. Those tests continue to run serially in the dedicated CLI E2E job, avoiding collisions on their shared test port.

This PR remains draft while the refreshed CI run completes. The synchronized vendor is not by itself a claim of complete site parity or publication to Studio trunk.

Contributor Attribution

Aagam Shah (@aagam-shah) authored the transform-URL safety fix and regression in #4784 (2b9000c9a9687b551fc9dd95fc7caaad72a0bec7) and the comma-safe srcset fix and regression in #4785 (cdd4723ad00ad275d4abc4e9358ac0e7b4763320). Their original commits and Claude co-author trailers are preserved in this branch history. The fixes were also ported into Automattic/data-liberation-agent#170 and Automattic/data-liberation-agent#171. The upstream port descriptions explicitly credit Aagam; the port commits themselves did not preserve his authorship, which was an attribution mistake.

Verification

  • The synchronized DLA tree is byte-identical to upstream 02d8d640 for all changed files.
  • DLA: 93 test files and 980 tests passed; build and installed-package verification passed.
  • Studio targeted CLI tests: 88 tests passed.
  • Studio unit suite with its intended !e2e filter: 388 files and 3,572 tests passed.
  • A fresh four-page URL import completed with zero fallbacks, zero core/html, and zero invalid blocks.
  • Gutenberg: 736/736 blocks valid, saves completed, and zero empty-Group prompts were visible. The 66 matching DOM nodes are hidden structural carriers with no rendered boxes.
  • Rendered comparison found exact desktop geometry on all four routes and 156/160 geometry matches overall; the four remaining matches differ only in the semantic mobile menu element (button in the source versus summary in core Navigation) at identical geometry.
  • Pixel differences were 0.06-0.10% on desktop and 0-0.01% on mobile.
  • A real visible Jetpack contact-form submission completed successfully.

AI Assistance

GPT-5.6 Sol via OpenCode synchronized and verified the vendored package, diagnosed and corrected the CI suite boundary, exercised the packaged import and WordPress editor/runtime workflows, and prepared this description. Earlier work on the branch also used GPT-5.6 Terra and GPT-6 Astra via OpenCode for vendor synchronization, verification, and contributor-attribution review. Aagam Shah authored the two original fixes credited above; the porting and vendoring work does not replace that credit.

@chubes4

chubes4 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

CI follow-up pushed in 7d7f45d8c:

  • Unit lane now runs npm run test -- --tagsFilter='!e2e', keeping tagged CLI integration suites in the dedicated serialized CLI E2E lane.
  • Filtered Unit verification passed: 211 files, 2747 passed, 60 skipped.
  • Focused start-stop.e2e.test.ts passed: 2/2.
  • The full local CLI E2E lane remains machine-sensitive under concurrent Playground/PHP load; isolated lifecycle coverage passes and the existing dedicated lane remains serialized.

AI assistance: openai/gpt-5.6-sol via OpenCode diagnosed the CI lane overlap, drafted the one-line test-selection change, and ran verification. Chris Huber remains responsible for the change.

@chubes4

chubes4 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

1,145-route scale validation

The latest branch head (ca6191a59) is pushed and the end-to-end Richlynn run completed successfully through this Studio CLI path.

  • Source: https://www.richlynngroup.com/
  • Routes: 1,145/1,145 completed
  • Batches: 124/124 completed
  • Final state: zero failed or pending batches
  • WordPress routes: 1,148 unique page URIs, no duplicate paths
  • Cache: 5,364 network requests avoided
  • Recovery: resumed across compiler interruption, encoded Unicode paths, transient HTML classification, and canonical route collisions

This proves the Studio orchestration and dependent SSI batching path can handle the target scale. It does not mark the generated site as fidelity-complete: Richlynn still has 13,055 core/html blocks, 1,235 reported fallbacks, 396 retained external assets, and no exact visual/editor parity proof. The generated site remains evidence under the zero-fallback gate.

Dependency PRs:

Validation on the pushed Studio head: npx vitest run apps/cli/commands/site/tests/create.test.ts apps/cli/lib/tests/run-wp-cli-command.test.ts (66/66 passed).

AI assistance: openai/gpt-5.6-sol via OpenCode was used for scale-run diagnosis, implementation support, verification, and drafting this evidence update. Chris Huber remains responsible for the submitted changes.

@chubes4 chubes4 changed the title Experiment: create Studio sites from static artifacts Add studio create --from static source imports Aug 3, 2026
@borkweb

borkweb commented Aug 3, 2026

Copy link
Copy Markdown
Member

The /liberate command already imports static sites into Studio via the blocks-engine 🕺

You can do so via: /liberate ~/path/to/static/site

That being said, switching out liberate's tooling to a different set of direct calls would make sense if the php-transformer has caught up to the JS approach! I also like the direct CLI command that you have for it.

@chubes4

chubes4 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@borkweb I have not compared the outputs side by side, but I was hoping the approaches could coexist initially. This PR intentionally avoids disrupting existing behavior.

Longer term, I think Data Liberation could own the browser-dependent stages: client-side rendering, runtime behavior, and the visual feedback loop, and use the Studio CLI to materialize the site.

The shared contract would be a clean HTML-based website artifact, regardless of the original source.

I think that refactoring can be explored separately from this PR. Redirecting /liberate is not necessary for this primitive to exist.

Comment thread packages/data-liberation-agent/src/lib/screenshot/screenshotter.ts Fixed
Comment thread packages/data-liberation-agent/src/lib/screenshot/screenshotter.ts Fixed
Comment thread packages/data-liberation-agent/src/lib/screenshot/screenshotter.ts Fixed
@chubes4

chubes4 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Synced the DLA iPhone mobile capture identity repair into the existing draft, resolving the generated-bundle-only rebase conflict by rebuilding from the rebased vendor source. Verification: vendor targeted test and full vendor suite passed (87 files, 907 tests); Studio CLI build, lint, and typecheck passed. Full Studio test has 14 environment failures after the fresh dependency setup because the bundled SQLite integration was initially absent; postinstall then completed the runtime asset setup. AI assistance: OpenAI gpt-5.6-terra via OpenCode performed source-level vendoring, regeneration, rebase, and verification.

Comment thread packages/data-liberation-agent/src/lib/html-extract/html-extract.ts Fixed
…260911

# Conflicts:
#	packages/data-liberation-agent/dist/mcp-server.bundle.mjs
#	packages/data-liberation-agent/scripts/block-fixer/package-lock.json
@chubes4
chubes4 marked this pull request as ready for review September 13, 2026 04:02
@chubes4
chubes4 requested a review from a team as a code owner September 13, 2026 04:02
@chubes4
chubes4 marked this pull request as draft September 13, 2026 12:44
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.

4 participants