Automattic / Automattic/studio
Homepage selection still fails after successful capture, with no diagnostics and no retained artifact
- Dominant language
- TypeScript
- Stars
- 517
- Forks
- 95
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 162
Description
## Problem
`studio site create --from ` still terminates with `Capture does not identify one rendered homepage for the source URL` after a fully successful capture, on a site where the `og:url` fallback added for #4649 does not resolve the ambiguity.
Observed on `https://promptpilates.com` (redirects to `https://www.promptpilates.com/`). All 84 routes captured successfully over ~9 minutes, then export failed at the entrypoint-selection step. No site was created.
Two things make this expensive beyond the failure itself:
1. **The error does not say what was found.** `capture-export.ts` throws the same message when `entrypointCandidates.length` is `0` and when it is `> 1`. These are opposite problems with opposite fixes, and the operator cannot tell which occurred. #4649 explicitly asked that "capture diagnostics should preserve enough evidence to explain which route was selected or why selection was ambiguous" — that part does not appear to have landed.
2. **The whole capture is discarded on failure.** Nothing was written to `~/Studio/_liberations/`, so there is no artifact to diagnose from. Nine minutes of fetching a live third-party site has to be repeated to investigate, and repeated again for each attempt.
## Expected
- The error names the candidate count and lists the candidate URLs (and their canonical URLs) so the failure mode is identifiable without re-running.
- A capture that completed is retained on export failure, so the run can be diagnosed and re-exported without re-fetching the source.
## Reproduction
1. Build Studio PR #3952 at `05c1935f` (`feat/site-artifact-import-cli`).
2. Run:
```
studio site create --path ~/Studio/wix-run-promptpilates \
--name wix-run-promptpilates \
--from https://promptpilates.com \
--static-site-importer-url https://github.com/Automattic/static-site-importer/releases/download/v1.8.0/static-site-importer.zip \
--store-import-result --skip-browser
```
3. Capture completes (84/84 routes). Export then fails with the message above.
4. `~/Studio/_liberations/` contains no directory for the source.
## Source
`packages/data-liberation-agent/src/lib/capture-export.ts` ~L1121-1137: `exactEntrypointCandidates` falls back to `canonicalUrl` matching, then `if (entrypointCandidates.length !== 1) throw`.
Follow-up to #4649.
Contributor guide
Research direction
Start in packages/data-liberation-agent/src/lib/capture-export.ts around L1121-1137, then run the provided reproduction against the 84-route capture. Trace the completed capture's export-failure path and existing artifact storage; done means the error identifies the candidate URLs and canonical URLs, and the completed capture remains available for diagnosis and re-export.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100