fix(frontend): serve real robots and sitemap files #1372

Merged
PlasticDigits merged 1 commit from fix/issue-1212-crawl-files into main 2026-10-04 01:32:38 +00:00
Owner

/robots.txt and /sitemap.xml currently return the SPA HTML shell on dex.cl8y.com. This change ships real crawl files, serves the required media types, and returns 404 when those files are missing. Crawl-file backups/trailing slashes and /sitemap_index.xml also return 404.

The sitemap stays empty and the shared HTML shell gets X-Robots-Tag: noindex, nofollow. Robots allows crawlers to fetch that header with an empty Disallow: directive and pins its sitemap to the DEX origin. Existing OG metadata, PNG serving, browser routes, and hashed-asset caching remain intact.

Adds a modular source/HTTP verifier, CRAWL-1–CRAWL-6 invariants, agent instructions, and a crosslinked QA checklist. Also corrects the adjacent #578 cache assertion and lets #706 preserve a dedicated Playwright port so parallel worktrees do not accidentally test Grafana on port 3000.

Refs #1212. Production acceptance remains pending the frontend deployment; this PR does not claim a deployed fix.

Validation

  • Source-fixture nginx verification passed, including present bodies/types and disposable missing-file tests.
  • Production Vite build passed with a synthetic WalletConnect project ID for the test artifact. Built-dist nginx verification passed twice, including after final checker edits.
  • make verify-issue-578: passed, 9 unit tests.
  • PLAYWRIGHT_WEB_PORT=5189 PLAYWRIGHT_HTML_OPEN=never make verify-issue-706: passed, 53 unit tests, nginx smoke, live cache checks, and 3 browser tests. Initial browser timeouts from the port-3000 service collision were resolved and retested.
  • Independent agent review, malformed/poisoned-body rejection checks, Bash syntax, diff checks, and commit hooks passed (Rust fmt/clippy, TypeScript, secret scan).
  • Production baseline, 2026-10-04 01:22 UTC: robots still returned 200 text/html; the strict live checker correctly rejected it. This branch has not been deployed.

Acceptance and agent verification checklist

  • AC1/AC2 local behavior: VERIFY1212_REQUIRE_NGINX=1 make verify-issue-1212 checks robots/plain text and sitemap/XML with body validation.
  • AC3: same command removes disposable files and checks both 404s plus sibling 404s.
  • AC4: inspect empty sitemap; verifier checks SPA shell/noindex for wallet, trader, manage, mint, and browser routes.
  • AC5: rerun #578 and #706 commands above; #1212 also checks real PNG, immutable successful assets, and no-store missing JS/CSS.
  • AC6: source checker pins the robots origin/directives and rejects nonempty/invalid sitemap contents, comments/claims, and HTML.
  • AC7 local verifier, production build, and retest: VERIFY1212_DIST_DIR=/absolute/path/to/frontend-dapp/dist VERIFY1212_REQUIRE_NGINX=1 make verify-issue-1212 verifies actual copied build artifacts.
  • AC1/AC2 production and AC7 post-deploy: after deploying this revision, run VERIFY1212_LIVE_URL=https://dex.cl8y.com make verify-issue-1212; record status, media type, body, and timestamp. The currently deployed old shell fails this check.

For review, use QA checklist and agent playbook. Choose an unused Playwright port. Agents may skip checklist items they cannot complete, record the concrete reason, leave those criteria unchecked, and mark the completed verification scope PASS with skips. Skips do not establish live acceptance; observed failures remain FAIL until corrected and retested. The relevant follow-up is the normal frontend deployment and live HTTP recheck.

`/robots.txt` and `/sitemap.xml` currently return the SPA HTML shell on dex.cl8y.com. This change ships real crawl files, serves the required media types, and returns 404 when those files are missing. Crawl-file backups/trailing slashes and `/sitemap_index.xml` also return 404. The sitemap stays empty and the shared HTML shell gets `X-Robots-Tag: noindex, nofollow`. Robots allows crawlers to fetch that header with an empty `Disallow:` directive and pins its sitemap to the DEX origin. Existing OG metadata, PNG serving, browser routes, and hashed-asset caching remain intact. Adds a modular source/HTTP verifier, CRAWL-1–CRAWL-6 invariants, agent instructions, and a crosslinked QA checklist. Also corrects the adjacent #578 cache assertion and lets #706 preserve a dedicated Playwright port so parallel worktrees do not accidentally test Grafana on port 3000. Refs #1212. Production acceptance remains pending the frontend deployment; this PR does not claim a deployed fix. ### Validation - Source-fixture nginx verification passed, including present bodies/types and disposable missing-file tests. - Production Vite build passed with a synthetic WalletConnect project ID for the test artifact. Built-dist nginx verification passed twice, including after final checker edits. - `make verify-issue-578`: passed, 9 unit tests. - `PLAYWRIGHT_WEB_PORT=5189 PLAYWRIGHT_HTML_OPEN=never make verify-issue-706`: passed, 53 unit tests, nginx smoke, live cache checks, and 3 browser tests. Initial browser timeouts from the port-3000 service collision were resolved and retested. - Independent agent review, malformed/poisoned-body rejection checks, Bash syntax, diff checks, and commit hooks passed (Rust fmt/clippy, TypeScript, secret scan). - Production baseline, 2026-10-04 01:22 UTC: robots still returned `200 text/html`; the strict live checker correctly rejected it. This branch has not been deployed. ### Acceptance and agent verification checklist - [x] AC1/AC2 local behavior: `VERIFY1212_REQUIRE_NGINX=1 make verify-issue-1212` checks robots/plain text and sitemap/XML with body validation. - [x] AC3: same command removes disposable files and checks both 404s plus sibling 404s. - [x] AC4: inspect empty sitemap; verifier checks SPA shell/noindex for wallet, trader, manage, mint, and browser routes. - [x] AC5: rerun #578 and #706 commands above; #1212 also checks real PNG, immutable successful assets, and no-store missing JS/CSS. - [x] AC6: source checker pins the robots origin/directives and rejects nonempty/invalid sitemap contents, comments/claims, and HTML. - [x] AC7 local verifier, production build, and retest: `VERIFY1212_DIST_DIR=/absolute/path/to/frontend-dapp/dist VERIFY1212_REQUIRE_NGINX=1 make verify-issue-1212` verifies actual copied build artifacts. - [ ] AC1/AC2 production and AC7 post-deploy: after deploying this revision, run `VERIFY1212_LIVE_URL=https://dex.cl8y.com make verify-issue-1212`; record status, media type, body, and timestamp. The currently deployed old shell fails this check. For review, use [QA checklist](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/416dad055abd6be608353bd71975f1c20fae5e88/docs/qa/issue-1212/README.md) and [agent playbook](https://git.cl8y.com/code/cl8y-dex-terraclassic/src/commit/416dad055abd6be608353bd71975f1c20fae5e88/skills/AGENTS_FRONTEND_CRAWL_FILES.md). Choose an unused Playwright port. Agents may skip checklist items they cannot complete, record the concrete reason, leave those criteria unchecked, and mark the completed verification scope PASS with skips. Skips do not establish live acceptance; observed failures remain FAIL until corrected and retested. The relevant follow-up is the normal frontend deployment and live HTTP recheck.
fix(frontend): serve honest crawler endpoints for issue 1212
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
416dad055a
PlasticDigits deleted branch fix/issue-1212-crawl-files 2026-10-04 01:32:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic!1372
No description provided.