Skip to content

Phase 19 soak check — manual run required (auth gap) - #7

Draft
mereditharmcgee wants to merge 2 commits into
mainfrom
chore/phase19-soak-check-2026-05-26
Draft

Phase 19 soak check — manual run required (auth gap)#7
mereditharmcgee wants to merge 2 commits into
mainfrom
chore/phase19-soak-check-2026-05-26

Conversation

@mereditharmcgee

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Why this PR exists

The 4-week soak check for Phase 19 (idx_reviews_building_status) was triggered on 2026-05-26 in a remote Claude Code environment. wrangler whoami returned "You are not authenticated" — no CLOUDFLARE_API_TOKEN is set and no cached OAuth token exists in the container. The live remote audit was skipped per the auth-gate rule.

This PR adds a manual runbook at .planning/audits/phase19-soak-check-2026-05-26.md so you can complete the check from a credentialed local terminal. Close or merge this PR once you've run the script and recorded the result.


What to verify

Phase 19 added idx_reviews_building_status ON reviews(building_id, status) to production D1 on 2026-04-29. The soak check confirms the query planner is still using the composite index after 4 weeks of real user traffic — not reverting to the old idx_reviews_status single-column scan.

Baseline: .planning/audits/d1-indexes-2026-04-28.md (sections "After (remote)" for Q1, Q2, Q3).


Copy-paste script

Run these commands from a local terminal where wrangler whoami succeeds.

0. Confirm index still exists

npx wrangler d1 execute ratemyplace-db --remote --command "SELECT name FROM sqlite_master WHERE type='index' AND name='idx_reviews_building_status'"

Expected: 1 row — name = idx_reviews_building_status

Q1 — buildings LEFT JOIN approved reviews

npx wrangler d1 execute ratemyplace-db --remote --command "EXPLAIN QUERY PLAN SELECT b.*, COUNT(r.id) as review_count, ROUND(AVG(r.overall_score), 1) as avg_overall, l.name as landlord_name FROM buildings b LEFT JOIN reviews r ON b.id = r.building_id AND r.status = 'approved' LEFT JOIN landlords l ON b.landlord_id = l.id GROUP BY b.id HAVING COUNT(r.id) > 0 ORDER BY COUNT(r.id) DESC, AVG(r.overall_score) DESC LIMIT 10 OFFSET 0"

Expected: SEARCH r USING INDEX idx_reviews_building_status (building_id=? AND status=?) LEFT-JOIN

Q2 — landlords LEFT JOIN buildings LEFT JOIN approved reviews

npx wrangler d1 execute ratemyplace-db --remote --command "EXPLAIN QUERY PLAN SELECT l.*, COUNT(DISTINCT b.id) as building_count, COUNT(r.id) as review_count, ROUND(AVG(r.overall_score), 1) as avg_overall FROM landlords l LEFT JOIN buildings b ON b.landlord_id = l.id LEFT JOIN reviews r ON r.building_id = b.id AND r.status = 'approved' GROUP BY l.id HAVING COUNT(r.id) > 0 ORDER BY COUNT(r.id) DESC, l.name ASC LIMIT 10 OFFSET 0"

Expected: SEARCH r USING INDEX idx_reviews_building_status (building_id=? AND status=?) LEFT-JOIN (may also show a preceding BLOOM FILTER ON r line — that's a bonus, not required for PASS)

Q3 — autocomplete: buildings LEFT JOIN approved reviews

npx wrangler d1 execute ratemyplace-db --remote --command "EXPLAIN QUERY PLAN SELECT b.id, b.address, b.neighborhood, b.city, b.state, b.slug, COUNT(r.id) as review_count, ROUND(AVG(r.overall_score), 1) as avg_overall FROM buildings b LEFT JOIN reviews r ON b.id = r.building_id AND r.status = 'approved' WHERE b.address LIKE '%boston%' ESCAPE '\' OR b.neighborhood LIKE '%boston%' ESCAPE '\' GROUP BY b.id ORDER BY review_count DESC, b.address ASC LIMIT 5"

Expected: SEARCH r USING INDEX idx_reviews_building_status (building_id=? AND status=?) LEFT-JOIN


Checklist

  • Step 0: index still exists in sqlite_master
  • Q1 PASS — SEARCH r USING INDEX idx_reviews_building_status
  • Q2 PASS — SEARCH r USING INDEX idx_reviews_building_status
  • Q3 PASS — SEARCH r USING INDEX idx_reviews_building_status

If any query FAILS

  1. Run npx wrangler d1 execute ratemyplace-db --remote --command "PRAGMA optimize" then re-EXPLAIN.
  2. If still failing: see the remediation guidance in .planning/audits/phase19-soak-check-2026-05-26.md.
  3. If the index is missing (Step 0 failed): this is a CRITICAL schema regression — escalate immediately.

Expected output reference

Full expected EXPLAIN output for each query (verbatim from the locked baseline) is in .planning/audits/d1-indexes-2026-04-28.md, sections "EXPLAIN QUERY PLAN (after, remote)" for Q1, Q2, and Q3.

https://claude.ai/code/session_01BZFGwHbDHPfuhMGuE1DxsE
EOF
)


Generated by Claude Code

4-week soak check for idx_reviews_building_status could not run remotely
because CLOUDFLARE_API_TOKEN is not set in this environment. Adds a manual
runbook so the owner can complete the check from a credentialed local terminal.

https://claude.ai/code/session_01BZFGwHbDHPfuhMGuE1DxsE
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 26, 2026

Copy link
Copy Markdown

Deploying ratemyplace with  Cloudflare Pages  Cloudflare Pages

Latest commit: f1bb6bf
Status: ✅  Deploy successful!
Preview URL: https://49364f61.ratemyplace-64y.pages.dev
Branch Preview URL: https://chore-phase19-soak-check-202.ratemyplace-64y.pages.dev

View logs

All 4 checks green against production D1: composite index present,
Q1/Q2/Q3 planner output exact match to the 2026-04-28 baseline,
bloom filter still active on Q2. No regression, no follow-up needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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