P0 Discovery Deployment Runbook
Purpose
Deploy and validate the P0 discovery fix so discovered businesses are written into onboarding readiness flows.When to run this
- Rolling out commit
65c90d3 - Re-validating P0 discovery behavior after backend deployment changes
Prerequisites
- Cloud Run deploy access in
payroll-bi-gauntlet - Admin JWT for onboarding debug endpoint
- Intake UI access and December payroll sample file
Inputs
- Target commit SHA (
65c90d3) - Cloud Run service (
payroll-pipeline-cbs-api) batch_idcaptured from intake upload- Tenant (
creative_benefit_strategies)
Procedure
Commit
✅ Committed:65c90d3 - fix(p0): discover businesses from intake batch into onboarding registry
1) Deploy backend (Cloud Run)
Option A: Cloud Build (recommended)2) Runtime validation (post-deploy)
Step 2.1: Upload December payroll
- Upload December payroll file via intake UI
- Capture
batch_idfrom response or logs
Step 2.2: Call Debug Endpoint
- ✅
discovered_count> 0 (should include AIC, Motor Medics, Auto Intensive Care of Savannah) - ✅
invalid_period_countpresent (should be 0 ideally) - ✅
dry_run: truepresent - ✅
dim_upserted_count: 0(dry-run, no writes) - ✅
onboarding_upserted_count: 0(dry-run, no writes)
Step 2.3: Trigger Discovery (Non-Dry-Run)
Discovery should run automatically after intake processing completes (viaapi/routes/intake_processor.py line 707).
Alternatively, trigger manually via intake completion flow.
Step 2.4: Refresh Preflight/Readiness
- Navigate to Preflight UI
- Refresh readiness check
- Expected: Missing businesses (AIC, Motor Medics, Auto Intensive Care of Savannah) now appear in “Not ready for ingest” list
Step 2.5: Verify No Duplicates (Idempotency)
- Re-upload same Dec payroll file (or re-trigger discovery for same batch_id)
- Refresh Preflight again
- Expected: No duplicate entries, same business count
3) BigQuery verification (optional)
dim_business_mapping: Entries for discovered businesses withlast_seen_date = 2026-12-01config_business_onboarding: Registry entries withscope = 'PAYROLL_DISCOVERED'
Verification
✅ P0 Fully Closed if:- Debug endpoint returns discovered businesses (dry-run)
- Preflight/readiness shows missing businesses as “Not ready for ingest”
- No duplicates on re-run (idempotency verified)
Failure modes & fixes
- Debug endpoint returns 0 discovered businesses
- Verify mapped intake rows and period validity.
- Discovery not reflected in readiness UI
- Confirm intake completion trigger and readiness refresh path.
- Duplicates appear on re-run
- Validate idempotent keys and upsert logic for onboarding registry.
Artifacts produced
- Deployment record for commit
65c90d3 - Debug endpoint output for discovery dry-run
- Readiness UI evidence
- Duplicate-check SQL result
Related docs
docs/runbooks/P0_DISCOVERY_RUNTIME_VALIDATION_STEPS.mddocs/guides/P0_DISCOVERY_IMPLEMENTATION.mddocs/reference/READINESS_DATA_SOURCE_TRACE.md