Skip to content

CLI: Bound the stored static import receipt - #4676

Merged
chubes4 merged 1 commit into
feat/site-artifact-import-clifrom
fix/cli-bounded-static-import-receipt
Aug 26, 2026
Merged

CLI: Bound the stored static import receipt#4676
chubes4 merged 1 commit into
feat/site-artifact-import-clifrom
fix/cli-bounded-static-import-receipt

Conversation

@aagam-shah

Copy link
Copy Markdown
Contributor

What

The generated .studio-import/import.php now stores the bounded result projection as import_receipt in result.json, on both the success and the failure path. It used to store Static Site Importer's full response.

Why

On a 28-page Wix artifact, SSI's import response was 3.04 GB (import_report 2.72 GB, materialization_receipt 325 MB). macOS write(2) rejects a single write of 2 GB or more, so file_put_contents returned false and the import failed with "Static Site Importer result receipt could not be saved" after every page and the theme had already been materialized. Node could not have parsed a receipt that size either.

The CLI reads only continuation, canonicalization_pending, completed_routes, and total_routes from the receipt, and the database option already stores the same bounded projection.

With this change the same import completes, canonicalizes 32 pages, and writes a 124 KB receipt. The oversized SSI response itself is reported separately in the static-site-importer repo.

How to test

  • npx vitest run apps/cli/commands/site/tests/create.test.ts
  • studio create --from <artifact dir or url> on a large site and confirm .studio-import/result.json stays small and the import finishes.

Part of the studio create --from work in #3952.

AI assistance: Claude Code (Claude Fable 5) traced the failed write to the 2 GB limit and drafted the change. Aagam Shah directed the work and is responsible for it.

🤖 Generated with Claude Code

@aagam-shah

Copy link
Copy Markdown
Contributor Author

Note on CI: the red "Unit Tests" job is inherited from the base branch. PR #3952's own build (buildkite 21303) fails the same job, and the failing suites are all in apps/studio and packages/ui (15 files, 104 tests locally on the untouched base). "Data Liberation" and "Lint" pass here.

The generated import script wrote Static Site Importer's full response
into `.studio-import/result.json` as `import_receipt`. On a 28-page Wix
artifact that response was 3.04 GB (`import_report` 2.72 GB,
`materialization_receipt` 325 MB). macOS `write(2)` rejects a single
write of 2 GB or more, so `file_put_contents` returned false and the
import failed with "result receipt could not be saved" after every page
and the theme had already been materialized.

Store the existing bounded projection (`static_site_importer_studio_result_projection`)
as the receipt on both the success and failure paths. The CLI only reads
`continuation`, `canonicalization_pending`, `completed_routes`, and
`total_routes` from the receipt, and the database option already stores
the same projection.

With this change the same import completes, canonicalizes 32 pages, and
writes a 124 KB receipt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aagam-shah
aagam-shah force-pushed the fix/cli-bounded-static-import-receipt branch from 77f6abc to abd13b2 Compare August 25, 2026 07:04
@aagam-shah

Copy link
Copy Markdown
Contributor Author

CI update: after a no-change re-push, "CLI E2E Tests" passed again (22 min) and "Unit Tests" flipped from pass to fail with the same inherited apps/studio / packages/ui suites. The desktop "E2E Tests" job failed on both runs (35 min, 32 min) while it passed on #4674 and #4675, which branch from the same base. This PR only changes the PHP string the CLI generates for studio create --from; nothing outside apps/cli/commands/site/create.ts reads import_receipt, and the desktop E2E suite does not exercise --from. I cannot open the Buildkite log from here — if someone with access can check which spec failed, I will follow up; otherwise a re-run may be enough.

@chubes4
chubes4 merged commit 67ca1ad into feat/site-artifact-import-cli Aug 26, 2026
6 of 8 checks passed
@chubes4
chubes4 deleted the fix/cli-bounded-static-import-receipt branch August 26, 2026 02: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.

2 participants