fix(ingestion): treat password-locked and maintenance stores as closed, not failed #550
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 573 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #550"
general
weight: 0.35
mattmck
Refs #529, #532 (not closing: shipped to
devonly).Why
On the 2026-11-25 65-source bulk run, 5 jobs failed only because the store had locked itself: Clionadh, Kathleen & Co, Penelope Luz and Bee's Knees answered
/products.jsonwith 401 (and/with a 302 to/password), and Colores de Carol's Big Cartel API answered 403{"reason":"Store is under maintenance"}. Each firedingestion.job_failedand so the prod alert. With the nightly refresh (#532 / #546) every routine lock would turn into a nightly failure email. Owner decision: a closed store is not an error. Leave the catalog alone and try again next run. Never try to get past the lock.What
lib/connectors/store-closed.ts): a typedStoreClosedError(source,reasonpassword_page | maintenance,httpStatus,url,detail).-
ShopifyGenericConnectorandHoloTacoShopifyConnector: a 401 on the catalog request, or a redirect ending on/password, throws it after that one request. No retry.-
BigCartelConnector: a 403 whose JSONreasonmentions maintenance throws it. The 403 body is now kept so it can be read.- Any other 401/403 is still an ordinary failure. That includes Cloudflare challenges (
cf-mitigated: challenge, or an HTML 403 on Big Cartel).functions/ingestion.ts): catches it and ends the jobsucceededatmetrics.pipeline.stage = "store_closed"(INGESTION_STORE_CLOSED_STAGEin shared). The reason goes inmetrics.storeClosedand a warn line in the job log. It ends the job through the newmarkIngestionJobStoreClosed(), which emitsingestion.store_closedand neveringestion.job_failed.- Nothing is written to the catalog: the pull never returned, so no listing is marked missing and nothing is pruned.
- Nothing is re-queued, and the poison handler already ignores finished jobs.
- The next run starts normally.
- No status was added (
ingestion_job.statushas no CHECK constraint), so there is no migration.GET /api/reference-admin/jobsreturns each job'sstage, and sources-adminlastJobreturnsstage. The admin Job Runs tab, the Admin Jobs table and the Sources tab's Last job column show these runs as "Store closed" (violet badge or lock icon, with hover text).docs/observability-plan.md,docs/agents/ingestion-sources.md,docs/agents/auth-telemetry-backups.md, a CLAUDE.md rule line, and the shared and web READMEs.Tests
tests/store-closed.unit.test.cjs(new) covers:- the detectors
- Shopify 401 and redirect to
/password(one request, project User-Agent)- Holo Taco 401
- Big Cartel maintenance 403
- a Cloudflare-style 403 on Shopify and on Big Cartel staying a normal failure
- a Big Cartel 403 with another reason staying a normal failure
ingestion-worker-continuation):- status
succeeded, stagestore_closed- no
failedwrite- nothing materialized, no freshness marking, nothing enqueued
- the next run completes normally
- a poisoned copy is ignored
markIngestionJobStoreClosedemits onlyingestion.store_closed. Sources-admin carrieslastJob.stage. Webingestion-job-status.test.tscovers the label.npm run typecheckis clean.npm run lintshows only pre-existing warnings. Functions 3975 pass (2 skipped, as before), web 893, shared 261.Not covered
ingestion.store_closed. QueryAppEventsto see which stores were closed on a run.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Recognized locked or closed Shopify and Big Cartel storefronts now finish ingestion successfully with a “Store closed” status instead of being reported as failures.
Admin job and source views show the “Store closed” status with a dedicated badge or icon. Job details include pipeline stage information.
Pending AI batches can finish processing before a closed-store job completes.
Other access errors, including Cloudflare challenges, continue to be treated as failures.
Documentation
* Updated guidance on closed-store handling, job statuses, and related telemetry.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->