DEV Community

Cover image for Your Vibe-Coded Site Goes Dark When the Builder Does. I Wrote an Export Checker.
Vincent for Polydraft

Posted on

Your Vibe-Coded Site Goes Dark When the Builder Does. I Wrote an Export Checker.

This week on X, a post made the rounds with a blunt subject line: your vibe-coded app has 31 days to live. The news behind it is real. TechCrunch reported that Rocket, an Indian AI app builder that competed with Lovable and Replit, emailed users on November 28 to say the platform will close on December 31, 2026. You can keep building with remaining credits through December 5. From December 6, credit-consuming features stop, but project downloads, GitHub sync, website publishing, custom domains, and APK downloads stay available. After December 31, accounts, projects, and data become inaccessible. Sites hosted on Rocket, including ones on custom domains, go offline.

That last sentence is the part that matters if you pointed a real domain at a marketing site. Downloading a zip is not the same as the URL still resolving in January.

It does not matter whether the zip came from Rocket, Lovable, Cursor, or an AI website builder. If the HTML, the sitemap, the hero image, or the events feed still names a host you do not control, the export is a copy of a site that lives somewhere else. A second post this week put it plainly: exporting the code still leaves hosting, data, and logins behind.

So I wrote the kind of site a coding agent produces for "an independent bookstore in Asheville with hours, an events page, and a used-book shelf." The HTML is prerendered on purpose. There is a real title, a real H1, hours, an address, and JSON-LD — this is not an empty #root. Then I packed it the way a hosted-builder export often arrives: preview-host canonicals, a vendor CDN image, an events fetch against a vendor API, a CNAME that still names the preview, and a package.json whose only deploy script is the builder's CLI. The preview hostname in the fixture, appbuilder-preview.example, does not exist. It stands in for the class of *.lovable.app and *.rocket.new URLs the checker also flags on a real tree.

Then I wrote a short checker, export_check.py, that reads the local zip and reports leftover vendor hosts. I ran it on the export as the builder handed it over, on the same tree after I only rewrote the homepage canonical and og:url, and on a version that actually points at a first-party domain with relative images and a portable build. All the numbers below come from those three runs.

The fixture

The business is fictional. It is called Quarry Bell Books, and it sells used and new books at 14 Lexington Avenue in Asheville, North Carolina. The "before" tree is a finished-looking marketing site: a title, an H1, hours, a hero image, and BookStore JSON-LD. The leftovers are every absolute URL still pointing at the preview host.

Here is the head of the exported homepage, trimmed to the part that matters. The host is fake and will not resolve.

<title>Quarry Bell Books | Used and new books in Asheville</title>
<link rel="canonical" href="https://quarry-bell.appbuilder-preview.example/">
<meta property="og:url" content="https://quarry-bell.appbuilder-preview.example/">
<meta property="og:image" content="https://cdn.appbuilder-preview.example/projects/qb/hero.jpg">
Enter fullscreen mode Exit fullscreen mode

If you open the site in the builder's preview, it looks ordinary. If you open sitemap.xml, robots.txt, CNAME, src/events.js, or package.json, the sitemap locs, the robots sitemap, the DNS file, the events fetch, and the only deploy script still name that same vendor. The custom domain you care about is not in the zip. It is an attachment on a dashboard that goes away with the account.

The checker

export_check.py reads a local directory: HTML, XML, robots, JS/TS, JSON, CSS, and a CNAME if one is present. It does not fetch URLs, does not log in to a builder, and does not publish anything. You pass --production-host for the domain you intend to keep.

It reports:

  • a canonical, og:url, sitemap loc, robots sitemap, JSON-LD URL, image src, or fetch target whose host is a known builder preview suffix (lovable.app, rocket.new, bolt.new, replit.app, replit.dev, v0.dev) or a host you passed with --vendor-host
  • the same kinds of URL when they still point at localhost
  • any other absolute URL that is not your production host, and is not on a small allowlist (schema.org, w3.org, Google Fonts, and hosts you pass with --allow-host)
  • a CNAME file that still names the vendor
  • a package.json whose scripts only deploy through a builder CLI, with no portable build script

It treats www and the apex as the same site, so quarrybellbooks.example and www.quarrybellbooks.example both count as production. It does not flag generic destination hosts such as vercel.app or netlify.app by default — those are often where you are moving to. It also does not prove that DNS already points at the new host. A clean run means the files you are about to ship no longer mention a vendor you are leaving.

export_check.py (about 750 lines, 15 tests)
#!/usr/bin/env python3
"""export_check.py — local export-readiness checker for a marketing-site zip.

Reads files already on disk. It does not fetch URLs, does not log in to a
builder, and does not publish anything. Run it on a tree you own.

Pass --production-host for the domain you intend to keep. The checker flags
absolute URLs that still point at a builder preview host, a vendor CDN or
API, or localhost, plus a vendor-only deploy script and a CNAME that still
names the vendor.
"""

from __future__ import annotations

import argparse
import json
import os
import re
import sys
import unittest
from dataclasses import dataclass, field
from pathlib import Path
from urllib.parse import urlparse

SKIP_DIRS = {
    ".git",
    "node_modules",
    "dist",
    "build",
    "out",
    "coverage",
    "target",
    ".next",
    ".cache",
    ".venv",
    "venv",
    "__pycache__",
    "vendor",
}

SCAN_SUFFIXES = {
    ".html",
    ".htm",
    ".xml",
    ".txt",
    ".js",
    ".jsx",
    ".ts",
    ".tsx",
    ".mjs",
    ".cjs",
    ".css",
    ".json",
    ".toml",
    ".md",
    ".svg",
}

SCAN_NAMES = {
    "CNAME",
    "robots.txt",
    "sitemap.xml",
    "_redirects",
    "package.json",
    "netlify.toml",
    "vercel.json",
    "wrangler.toml",
}

# Hosts that are references, not a place the site is hosted.
DEFAULT_ALLOW = {
    "schema.org",
    "www.schema.org",
    "www.w3.org",
    "w3.org",
    "fonts.googleapis.com",
    "fonts.gstatic.com",
    "cdnjs.cloudflare.com",
    "unpkg.com",
    "esm.sh",
}

# Common preview / builder hosting suffixes. A match means the URL still
# lives on a vendor preview, not on a domain you control. Intentionally
# omits generic destination hosts such as vercel.app or netlify.app.
VENDOR_SUFFIXES = (
    "lovable.app",
    "lovableproject.com",
    "rocket.new",
    "bolt.new",
    "replit.app",
    "replit.dev",
    "v0.dev",
    "appbuilder-preview.example",
)

VENDOR_CLI_RE = re.compile(
    r"\b(appbuilder|lovable|rocket|bolt|replit)\b",
    re.IGNORECASE,
)

URL_RE = re.compile(r"https?://[^\s\"'<>\\)]+", re.IGNORECASE)
LOCALHOST_RE = re.compile(
    r"https?://(?:localhost|127\.0\.0\.1)(?::\d+)?(?:/[^\s\"'<>\\)]*)?",
    re.IGNORECASE,
)
TITLE_RE = re.compile(r"<title[^>]*>(.*?)</title>", re.I | re.S)
CANONICAL_RE = re.compile(
    r'<link[^>]+rel=["\']canonical["\'][^>]*>',
    re.I,
)
HREF_RE = re.compile(r'\bhref=["\']([^"\']+)["\']', re.I)
OGURL_RE = re.compile(
    r'<meta[^>]+property=["\']og:url["\'][^>]*>',
    re.I,
)
CONTENT_RE = re.compile(r'\bcontent=["\']([^"\']+)["\']', re.I)
ROBOTS_SITEMAP_RE = re.compile(r"(?im)^sitemap:\s*(\S+)")
SITEMAP_LOC_RE = re.compile(r"<loc>\s*([^<\s]+)\s*</loc>", re.I)


def iter_files(root: Path):
    for dirpath, dirnames, filenames in os.walk(root):
        dirnames[:] = [d for d in dirnames if d not in SKIP_DIRS and not d.startswith(".git")]
        for name in filenames:
            yield Path(dirpath) / name


def rel(root: Path, path: Path) -> str:
    try:
        return path.relative_to(root).as_posix()
    except ValueError:
        return str(path)


def host_of(url: str) -> str | None:
    try:
        p = urlparse(url)
    except ValueError:
        return None
    if p.scheme not in {"http", "https"}:
        return None
    host = (p.hostname or "").lower().rstrip(".")
    return host or None


def strip_www(host: str) -> str:
    return host[4:] if host.startswith("www.") else host


def same_site(host: str, production: str) -> bool:
    return strip_www(host) == strip_www(production)


def is_vendor_host(host: str, extra: list[str]) -> bool:
    suffixes = list(VENDOR_SUFFIXES) + [h.lower().lstrip(".") for h in extra]
    for suf in suffixes:
        if host == suf or host.endswith("." + suf):
            return True
    return False


def is_localhost(host: str) -> bool:
    return host in {"localhost", "127.0.0.1", "::1"}


@dataclass
class Finding:
    code: str
    severity: str
    path: str
    detail: str


@dataclass
class Report:
    root: Path
    production_host: str | None = None
    vendor_hosts: list[str] = field(default_factory=list)
    allow_hosts: set[str] = field(default_factory=set)
    title: str = ""
    files: list[str] = field(default_factory=list)
    findings: list[Finding] = field(default_factory=list)
    production_urls: int = 0
    foreign_urls: int = 0
    vendor_urls: int = 0
    seen_urls: set = field(default_factory=set)

    def add(self, code: str, severity: str, path: str, detail: str) -> None:
        key = (code, path, detail)
        if any((f.code, f.path, f.detail) == key for f in self.findings):
            return
        self.findings.append(Finding(code, severity, path, detail))

    @property
    def fails(self) -> list[Finding]:
        return [f for f in self.findings if f.severity == "fail"]

    @property
    def warns(self) -> list[Finding]:
        return [f for f in self.findings if f.severity == "warn"]


def should_scan(path: Path) -> bool:
    if path.name in SCAN_NAMES:
        return True
    if path.suffix.lower() in SCAN_SUFFIXES:
        return True
    return False


def classify_host(report: Report, host: str) -> str:
    if is_localhost(host):
        return "localhost"
    if is_vendor_host(host, report.vendor_hosts):
        return "vendor"
    if report.production_host and same_site(host, report.production_host):
        return "production"
    if host in report.allow_hosts or any(
        host == a or host.endswith("." + a) for a in report.allow_hosts
    ):
        return "allow"
    return "foreign"


def record_url(report: Report, path: Path, url: str, *, context: str) -> None:
    url = url.rstrip(chr(46) + chr(44) + chr(59) + chr(41) + chr(93) + chr(62) + chr(125) + chr(34) + chr(39))
    host = host_of(url)
    if not host:
        return
    relpath = rel(report.root, path)
    seen = (relpath, url)
    generic = context == "URL"
    if seen in report.seen_urls and generic:
        return

    kind = classify_host(report, host)

    if seen not in report.seen_urls:
        report.seen_urls.add(seen)
        if kind == "production":
            report.production_urls += 1
        elif kind in {"localhost", "vendor", "foreign"}:
            report.foreign_urls += 1
            if kind == "vendor":
                report.vendor_urls += 1

    if kind == "production" or kind == "allow":
        return
    if kind == "localhost":
        report.add(
            "localhost-url",
            "fail",
            relpath,
            f"{context} is {url} in {relpath}",
        )
        return
    if kind == "vendor":
        report.add(
            "vendor-url",
            "fail",
            relpath,
            f"{context} is {url} in {relpath}",
        )
        return
    sev = "fail" if report.production_host else "warn"
    report.add(
        "foreign-url",
        sev,
        relpath,
        f"{context} is {url} in {relpath}",
    )



def scan_text(report: Report, path: Path, text: str) -> None:
    relpath = rel(report.root, path)
    name = path.name.lower()

    if path.suffix.lower() in {".html", ".htm"} and not report.title:
        m = TITLE_RE.search(text)
        if m:
            report.title = re.sub(r"\s+", " ", m.group(1)).strip()

    if name == "cname":
        host = text.strip().split()[0].strip().lower() if text.strip() else ""
        if host:
            url = host if host.startswith("http") else "https://" + host
            record_url(report, path, url, context="CNAME")
        return

    if name == "robots.txt":
        for m in ROBOTS_SITEMAP_RE.finditer(text):
            record_url(report, path, m.group(1).strip(), context="robots sitemap")

    if name == "sitemap.xml" or path.suffix.lower() == ".xml":
        for m in SITEMAP_LOC_RE.finditer(text):
            record_url(report, path, m.group(1).strip(), context="sitemap loc")

    if path.suffix.lower() in {".html", ".htm"}:
        for tag in CANONICAL_RE.findall(text):
            hm = HREF_RE.search(tag)
            if hm:
                record_url(report, path, hm.group(1), context="canonical")
        for tag in OGURL_RE.findall(text):
            cm = CONTENT_RE.search(tag)
            if cm:
                record_url(report, path, cm.group(1), context="og:url")

    # Catch remaining absolute URLs (JSON-LD, src, href, fetch, env, CSS).
    for m in URL_RE.finditer(text):
        record_url(report, path, m.group(0), context="URL")

    if name == "package.json":
        scan_package_json(report, path, text)


def scan_package_json(report: Report, path: Path, text: str) -> None:
    relpath = rel(report.root, path)
    try:
        data = json.loads(text)
    except json.JSONDecodeError:
        return
    scripts = data.get("scripts") or {}
    if not isinstance(scripts, dict) or not scripts:
        return
    vendor_scripts = []
    portable_build = False
    for name, cmd in scripts.items():
        if not isinstance(cmd, str):
            continue
        if VENDOR_CLI_RE.search(cmd):
            vendor_scripts.append(f"{name}={cmd}")
        elif name in {"build", "export", "static"} and cmd.strip():
            portable_build = True
    if vendor_scripts and not portable_build:
        report.add(
            "vendor-only-deploy",
            "fail",
            relpath,
            "package.json scripts only deploy via a builder CLI ("
            + ", ".join(vendor_scripts)
            + ") and there is no portable build script in "
            + relpath,
        )
    elif vendor_scripts and portable_build:
        report.add(
            "vendor-cli-script",
            "warn",
            relpath,
            "builder CLI still referenced in package.json ("
            + ", ".join(vendor_scripts)
            + ") in "
            + relpath,
        )


def scan(root: Path, *, production_host: str | None, vendor_hosts: list[str], allow_hosts: set[str]) -> Report:
    root = root.resolve()
    report = Report(
        root=root,
        production_host=production_host.lower() if production_host else None,
        vendor_hosts=vendor_hosts,
        allow_hosts=set(DEFAULT_ALLOW) | {h.lower() for h in allow_hosts},
    )
    for path in iter_files(root):
        report.files.append(rel(root, path))
        if not should_scan(path):
            continue
        try:
            text = path.read_text(errors="replace")
        except OSError:
            continue
        scan_text(report, path, text)
    return report


def format_report(report: Report) -> str:
    lines = [
        "export_check.py  (local files only)",
        f"root: {report.root}",
    ]
    if report.production_host:
        lines.append(f"production host: {report.production_host}")
    lines += [
        "",
        "TREE",
        f"  title              {report.title or '(none)'}",
        f"  files              {len(report.files)}",
        f"  production URLs    {report.production_urls}",
        f"  leftover URLs      {report.foreign_urls}",
        f"  vendor URLs        {report.vendor_urls}",
        "",
        "FINDINGS",
    ]
    if not report.findings:
        lines.append("  (none)")
    else:
        width = max(len(f.code) for f in report.findings)
        for f in report.findings:
            flag = "fail" if f.severity == "fail" else "warn"
            lines.append(f"  - {f.code.ljust(width)}  [{flag}]  {f.detail}")
    fails = len(report.fails)
    warns = len(report.warns)
    lines += [
        "",
        "VERDICT",
        f"  {fails} fail, {warns} warning",
    ]
    if fails:
        lines.append("  The export still depends on a host you do not control.")
    elif warns:
        lines.append("  No hard fails. Read the warnings before you point a domain at it.")
    else:
        lines.append("  No leftover vendor, foreign, or localhost URLs in the scanned files.")
        lines.append("  This is not a promise the live DNS already points here.")
    return "\n".join(lines) + "\n"


def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
    p = argparse.ArgumentParser(description="Check a site export for leftover vendor hosts.")
    p.add_argument("root", nargs="?", default=".", help="directory to scan")
    p.add_argument("--production-host", help="the domain you intend to keep, e.g. www.example.com")
    p.add_argument(
        "--vendor-host",
        action="append",
        default=[],
        help="extra builder/preview hostname to treat as vendor (repeatable)",
    )
    p.add_argument(
        "--allow-host",
        action="append",
        default=[],
        help="hostname that is allowed to appear as an absolute URL (repeatable)",
    )
    p.add_argument("--self-test", action="store_true", help="run unit tests and exit")
    return p.parse_args(argv)


# ------------------------- tests -------------------------


class ExportCheckTests(unittest.TestCase):
    def scan_tree(self, tmp: Path, files: dict[str, str], **kwargs) -> Report:
        for relpath, content in files.items():
            path = tmp / relpath
            path.parent.mkdir(parents=True, exist_ok=True)
            path.write_text(content)
        return scan(
            tmp,
            production_host=kwargs.get("production_host", "www.quarrybellbooks.example"),
            vendor_hosts=kwargs.get("vendor_hosts", []),
            allow_hosts=set(kwargs.get("allow_hosts", [])),
        )

    def test_vendor_canonical_and_og(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://shop.appbuilder-preview.example/">'
                        '<meta property="og:url" content="https://shop.appbuilder-preview.example/">'
                        "</head><body><h1>Shop</h1></body></html>"
                    )
                },
            )
            codes = [f.code for f in report.fails]
            self.assertIn("vendor-url", codes)
            details = " ".join(f.detail for f in report.fails)
            self.assertIn("canonical", details)
            self.assertIn("og:url", details)

    def test_clean_production_urls_pass(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://www.quarrybellbooks.example/">'
                        '<meta property="og:url" content="https://www.quarrybellbooks.example/">'
                        '<script type="application/ld+json">{"@context":"https://schema.org",'
                        '"@type":"Bookstore","url":"https://www.quarrybellbooks.example/"}</script>'
                        "</head><body><h1>Shop</h1>"
                        '<img src="/images/hero.jpg" alt="Storefront">'
                        "</body></html>"
                    ),
                    "sitemap.xml": (
                        '<?xml version="1.0"?><urlset xmlns="http://www.w3.org/2000/svg">'
                        "<url><loc>https://www.quarrybellbooks.example/</loc></url></urlset>"
                    ),
                    "robots.txt": "User-agent: *\nAllow: /\nSitemap: https://www.quarrybellbooks.example/sitemap.xml\n",
                    "package.json": '{"scripts":{"build":"vite build","dev":"vite"}}',
                },
            )
            self.assertEqual(report.fails, [])
            self.assertEqual(report.warns, [])
            self.assertGreaterEqual(report.production_urls, 3)

    def test_apex_and_www_are_same_site(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://quarrybellbooks.example/">'
                        "</head></html>"
                    )
                },
                production_host="www.quarrybellbooks.example",
            )
            self.assertEqual(report.fails, [])

    def test_sitemap_and_robots_still_vendor_after_html_rewrite(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://www.quarrybellbooks.example/">'
                        "</head></html>"
                    ),
                    "sitemap.xml": (
                        "<?xml version='1.0'?><urlset>"
                        "<url><loc>https://shop.appbuilder-preview.example/</loc></url>"
                        "<url><loc>https://shop.appbuilder-preview.example/events</loc></url>"
                        "</urlset>"
                    ),
                    "robots.txt": "Sitemap: https://shop.appbuilder-preview.example/sitemap.xml\n",
                },
            )
            locs = [f for f in report.fails if f.code == "vendor-url"]
            self.assertGreaterEqual(len(locs), 3)
            joined = " ".join(f.detail for f in locs)
            self.assertIn("sitemap loc", joined)
            self.assertIn("robots sitemap", joined)
            self.assertNotIn("canonical is https://shop.appbuilder-preview.example", joined)

    def test_vendor_cdn_and_api(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title></head><body>"
                        '<img src="https://cdn.appbuilder-preview.example/projects/qb/hero.jpg" alt="x">'
                        "</body></html>"
                    ),
                    "src/events.js": (
                        'export async function loadEvents() {\n'
                        '  return fetch("https://api.appbuilder-preview.example/v1/projects/qb/events");\n'
                        "}\n"
                    ),
                },
            )
            details = " ".join(f.detail for f in report.fails)
            self.assertIn("cdn.appbuilder-preview.example", details)
            self.assertIn("api.appbuilder-preview.example", details)

    def test_localhost_flagged(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="http://localhost:5173/">'
                        "</head></html>"
                    )
                },
            )
            self.assertTrue(any(f.code == "localhost-url" for f in report.fails))

    def test_cname_vendor(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {"CNAME": "quarry-bell.appbuilder-preview.example\n"},
            )
            self.assertTrue(any(f.code == "vendor-url" and "CNAME" in f.detail for f in report.fails))

    def test_vendor_only_deploy_script(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {"package.json": '{"scripts":{"dev":"appbuilder dev","deploy":"appbuilder publish"}}'},
            )
            self.assertTrue(any(f.code == "vendor-only-deploy" for f in report.fails))

    def test_portable_build_downgrades_cli_to_warning(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "package.json": '{"scripts":{"build":"vite build","deploy":"appbuilder publish"}}',
                    "index.html": "<html><head><title>Shop</title></head></html>",
                },
            )
            self.assertFalse(any(f.code == "vendor-only-deploy" for f in report.fails))
            self.assertTrue(any(f.code == "vendor-cli-script" for f in report.warns))

    def test_schema_and_font_hosts_allowed(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter">'
                        '<script type="application/ld+json">{"@context":"https://schema.org"}</script>'
                        "</head></html>"
                    )
                },
            )
            self.assertEqual(report.findings, [])

    def test_allow_host_and_extra_vendor(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<script src="https://maps.example-maps.test/maps.js"></script>'
                        '<img src="https://files.other-builder.test/a.jpg" alt="x">'
                        "</head></html>"
                    )
                },
                allow_hosts=["maps.example-maps.test"],
                vendor_hosts=["other-builder.test"],
            )
            details = " ".join(f.detail for f in report.fails)
            self.assertIn("other-builder.test", details)
            self.assertNotIn("maps.example-maps.test", details)

    def test_foreign_url_without_production_host_is_warning(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        '<html><head><title>Shop</title>'
                        '<a href="https://random-cdn.example.net/x.jpg">x</a></head></html>'
                    )
                },
                production_host=None,
            )
            self.assertEqual(report.fails, [])
            self.assertTrue(any(f.code == "foreign-url" for f in report.warns))

    def test_lovable_suffix_detected_without_flag(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://quarry-bell.lovable.app/">'
                        "</head></html>"
                    )
                },
            )
            self.assertTrue(any("lovable.app" in f.detail for f in report.fails))

    def test_dedupes_identical_findings(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://shop.appbuilder-preview.example/">'
                        "</head></html>"
                    )
                },
            )
            canon = [f for f in report.findings if "canonical" in f.detail]
            # canonical match plus the general URL sweep may see the same href;
            # identical (code, path, detail) pairs must collapse.
            details = [f.detail for f in canon]
            self.assertEqual(len(details), len(set(details)))

    def test_format_report_contains_verdict(self):
        import tempfile

        with tempfile.TemporaryDirectory() as d:
            report = self.scan_tree(
                Path(d),
                {
                    "index.html": (
                        "<html><head><title>Shop</title>"
                        '<link rel="canonical" href="https://shop.appbuilder-preview.example/">'
                        "</head></html>"
                    )
                },
            )
            text = format_report(report)
            self.assertIn("VERDICT", text)
            self.assertIn("fail", text)
            self.assertIn("host you do not control", text)


def main(argv: list[str] | None = None) -> int:
    args = parse_args(argv)
    if args.self_test:
        suite = unittest.defaultTestLoader.loadTestsFromTestCase(ExportCheckTests)
        result = unittest.TextTestRunner(verbosity=2).run(suite)
        return 0 if result.wasSuccessful() else 1
    root = Path(args.root)
    if not root.exists():
        print(f"export_check.py: no such directory: {root}", file=sys.stderr)
        return 2
    report = scan(
        root,
        production_host=args.production_host,
        vendor_hosts=args.vendor_host or [],
        allow_hosts=set(args.allow_host or []),
    )
    sys.stdout.write(format_report(report))
    return 1 if report.fails else 0


if __name__ == "__main__":
    sys.exit(main())
Enter fullscreen mode Exit fullscreen mode

Run 1: the zip as the builder handed it over

$ python3 export_check.py --production-host www.quarrybellbooks.example fixtures/before

export_check.py  (local files only)
root: fixtures/before
production host: www.quarrybellbooks.example

TREE
  title              Quarry Bell Books | Used and new books in Asheville
  files              7
  production URLs    0
  leftover URLs      8
  vendor URLs        8

FINDINGS
  - vendor-url          [fail]  robots sitemap is https://quarry-bell.appbuilder-preview.example/sitemap.xml in robots.txt
  - vendor-only-deploy  [fail]  package.json scripts only deploy via a builder CLI (dev=appbuilder dev, deploy=appbuilder publish) and there is no portable build script in package.json
  - vendor-url          [fail]  CNAME is https://quarry-bell.appbuilder-preview.example in CNAME
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/ in sitemap.xml
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/events in sitemap.xml
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/used-books in sitemap.xml
  - vendor-url          [fail]  canonical is https://quarry-bell.appbuilder-preview.example/ in index.html
  - vendor-url          [fail]  og:url is https://quarry-bell.appbuilder-preview.example/ in index.html
  - vendor-url          [fail]  URL is https://cdn.appbuilder-preview.example/projects/qb/hero.jpg in index.html
  - vendor-url          [fail]  URL is https://api.appbuilder-preview.example/v1/projects/quarry-bell/events in src/events.js

VERDICT
  10 fail, 0 warning
  The export still depends on a host you do not control.
Enter fullscreen mode Exit fullscreen mode

Zero production URLs. Eight leftover vendor URLs, plus a deploy script that only works while the builder's CLI still exists. The homepage, the sitemap, the robots file, the hero image, the events feed, and the DNS file all name a host that will go away with the account.

Terminal output of export_check.py on the before, mid, and after fixtures

Run 2: rewriting the homepage is not a migration

The mid tree is the fix I see most often: someone searches index.html for the preview host, replaces the canonical and og:url (and, in this fixture, the JSON-LD url) with https://www.quarrybellbooks.example/, and calls it done.

$ python3 export_check.py --production-host www.quarrybellbooks.example fixtures/mid

export_check.py  (local files only)
root: fixtures/mid
production host: www.quarrybellbooks.example

TREE
  title              Quarry Bell Books | Used and new books in Asheville
  files              7
  production URLs    1
  leftover URLs      7
  vendor URLs        7

FINDINGS
  - vendor-url          [fail]  robots sitemap is https://quarry-bell.appbuilder-preview.example/sitemap.xml in robots.txt
  - vendor-only-deploy  [fail]  package.json scripts only deploy via a builder CLI (dev=appbuilder dev, deploy=appbuilder publish) and there is no portable build script in package.json
  - vendor-url          [fail]  CNAME is https://quarry-bell.appbuilder-preview.example in CNAME
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/ in sitemap.xml
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/events in sitemap.xml
  - vendor-url          [fail]  sitemap loc is https://quarry-bell.appbuilder-preview.example/used-books in sitemap.xml
  - vendor-url          [fail]  URL is https://cdn.appbuilder-preview.example/projects/qb/hero.jpg in index.html
  - vendor-url          [fail]  URL is https://api.appbuilder-preview.example/v1/projects/quarry-bell/events in src/events.js

VERDICT
  8 fail, 0 warning
  The export still depends on a host you do not control.
Enter fullscreen mode Exit fullscreen mode

The homepage now claims a first-party domain. The sitemap, the robots file, the hero image, the events fetch, the CNAME, and the deploy script do not. If you pointed DNS at a new host tomorrow, crawlers would still be handed a sitemap of preview URLs, the hero would 404 with the vendor CDN, and the events list would stall on an API that disappears on December 31.

This is why "just export the code" is not a complete answer when you evaluate an AI website builder. The first question in that piece is the one that changes everything downstream: if you cancel, what URL keeps working? An export is useful. It is also a zip of whatever the agent wrote, including every preview host it baked into the files.

Three runs of export_check.py on the Quarry Bell Books fixture

Run 3: first-party URLs, relative assets, a portable build

The after tree keeps the same pages and the same copy. The canonical, og:url, JSON-LD, sitemap, and robots sitemap all use https://www.quarrybellbooks.example/. The hero is /images/hero.jpg. Events are prerendered into a local module instead of fetched from a vendor API. There is no vendor CNAME. package.json has a vite build script, not appbuilder publish.

$ python3 export_check.py --production-host www.quarrybellbooks.example fixtures/after

export_check.py  (local files only)
root: fixtures/after
production host: www.quarrybellbooks.example

TREE
  title              Quarry Bell Books | Used and new books in Asheville
  files              7
  production URLs    5
  leftover URLs      0
  vendor URLs        0

FINDINGS
  (none)

VERDICT
  0 fail, 0 warning
  No leftover vendor, foreign, or localhost URLs in the scanned files.
  This is not a promise the live DNS already points here.
Enter fullscreen mode Exit fullscreen mode

Ten findings down to zero. The checker is careful about that last line, and so am I. A clean tree is the prerequisite for a migration, not the migration. You still have to build the static output, host it, and point the domain at that host before the old preview disappears.

What the findings actually mean

A leftover canonical or og:url is the share-preview problem: Slack, iMessage, and search results keep describing a URL that will 404. A leftover sitemap or robots sitemap is the crawler problem: Google and AI engines keep discovering the vendor host. A leftover CDN image is the one that looks fine until the vendor's file host goes dark. A leftover events fetch is content that was never in the zip — it lived in the builder's database. A vendor CNAME is DNS still aimed at a company that has set a shutdown date. A vendor-only deploy script is the tell that you have not yet practiced shipping the site with a tool that will still exist in January.

The mid run is the one to stare at. Rewriting index.html dropped two findings and left eight. The files people forget are the files that keep the site tied to the old host.

The Lovable vs Claude Code comparison is mostly about price, hosting, and GitHub sync, but the repo you sync is only a migrated site if the production host is in the files and the vendor host is not. GitHub sync is a copy of the tree. It is not a new place for the site to live.

Three decisions after an export check: rewrite every absolute URL, move assets and data off the vendor, then host and point DNS before the preview disappears

What I would do with a real export

If I were handed a vibe-coded marketing site tomorrow, because the builder sent a shutdown email or because I simply wanted off a hosted preview, I would do this before I pointed a domain at it:

  1. Pick the domain you intend to keep. Run python3 export_check.py --production-host www.yourdomain.com . on the unzipped export, on a machine you own.
  2. Rewrite every finding, not only the canonical in index.html. Sitemap locs, robots.txt, JSON-LD, image hosts, and client-side API fetches all count. Copy assets you still need into the tree so they are not on a vendor CDN.
  3. Replace a vendor-only deploy script with a build that emits static files you can host anywhere, and actually run that build once on a host that is not the builder.
  4. Point the domain at the new host and confirm the live document, the sitemap, and a share preview all name the first-party URL. Then run the checker again. A scan you run once is a scan that is out of date after the next prompt "adds an events page."

A site built with an AI website builder still has to pass this test. The builder is doing the right kind of work if the published document already lives on infrastructure you control, and if an export — when you want one — does not still mention a preview host. Generating the first version of the site is the cheap part. Knowing whether the site survives the vendor is the part that decides whether the domain you printed on the bookmark still opens in January.

What we do in PolyDraft, and what we do not claim

PolyDraft is the AI website builder we work on. It publishes server-rendered HTML to your own Cloudflare account, so the live URL is not on PolyDraft's host. That is the "own-cloud deploy" model in the evaluation guide: the site was never on the vendor's infrastructure, so a shutdown or a cancelled subscription is not a migration scramble. It does not make a check like this unnecessary. An agent can still bake a preview URL into a sitemap, or fetch events from a host you will not have next month. We still run checks like these on what we ship, and you should run them on anything with your name on the domain, whoever or whatever built it.

Before you point the domain at the zip

  1. Search the tree for the builder's hostname, not just for canonical. Look in sitemap.xml, robots.txt, CNAME, image URLs, and fetch calls.
  2. Run python3 export_check.py --production-host www.yourdomain.com . against the files you are shipping.
  3. Host the build somewhere that is not the vendor, point DNS there, and confirm the live sitemap and a share preview before the old preview disappears.
  4. Save the files and run the checker again after the next change.

If you are a Rocket user, the official window is short: building stops on December 6, and hosted sites go offline on December 31. Ten minutes against the zip, on a tree you already have, is cheaper than finding out in January that the domain still pointed at a company that has closed.

Top comments (0)