Skip to Content
JobWzrd Docs

Audit response — explicit PASS / REVISE per issue

Audit: PRODUCTION-ARCHITECTURE-REVIEW.md (REVISE) + FAILURE-MODE-REGISTER.md + METRICS-AND-ALERTS.md + LOGGING-COVERAGE.md. Response design: ../architecture/B6-EXECUTION-DESIGN.md.

Legend: PASS = the revised design removes or controls the issue with a stated mechanism and a test. PASS-by-removal = the defective code path is deleted rather than mitigated. REVISE = still open, because it needs the owner decision, a staging measurement, or a later slice. Nothing is marked PASS because tests currently pass.


1. Failure-mode register (FM-01 … FM-25) — 25 rows

IDVerdictResolution
FM-01 stranded runningPASSSource lease (running_at, lease_expires_at, 120 s), reclaim in cron; every settle fenced on lease_owner. Design §2, §6. Tests AT-04, AT-08.
FM-02 duplicate replays all sourcesPASSOne message per (search, source); a redelivery re-runs one source. AT-01/AT-02.
FM-03 ingest bound racePASS-by-removalremaining read/decrement deleted; replaced by reservation guard (§5). AT-09.
FM-04 partial reported completePASS-by-removalanyOk ⇒ complete deleted; aggregate CASE with partial. AT-15/AT-16.
FM-05 unbounded concurrencyPASSExplicit ceilings (6 MiniWzrd / 4 jobindie; sum 10), never unset. §4.
FM-06 replica multiplies quotaREVISEOwner decision D2. Interim: single replica enforced by deployment + documented; backend ceilings chosen for one replica. Brief §D2.
FM-07 ambiguous retry re-scrapesPASSops_dispatch_attempts + uncertain; retry table forbids retry after send. §6.3/§6.4, AT-12.
FM-08 DLQ unreadPASSDLQ consumer + ops_dead_letters + alert AL-02 + manual replay script that refuses ambiguity. §7, AT-13/AT-14.
FM-09 publish fails after chargePASSRule: that source → failed/queue_publish_failed, uncharged; zero publishes ⇒ search failed + search cap released. AT-18.
FM-10 D1 write contentionREVISECeilings chosen conservatively; ramp gates require measured batch p95 < 500 ms. §4.3. Cannot be closed before staging.
FM-11 partial D1 batchPASSAccounting rides the final chunk's transaction; ingest idempotent; resume path. §5.3, AT-07.
FM-12 unparsable 200PASSPer-source err_code + detail endpoint; no longer folded into complete. AT-15.
FM-13 WAF blocks exitsREVISEGateway health alert AL-07 + per-source SOURCE_BLOCKED; per-source egress routing still not built (out of scope, unchanged).
FM-14 no usable exitPASSFails closed; source failed with the gateway reason; AL-07.
FM-15 charge then refusalPASSRefusals remain pre-charge; AT-24/AT-25.
FM-16 silent cron failurePASSretention.run + search.reclaimed counters; AL-10 absence alert.
FM-17 session without owner rowREVISELogging catches it (auth.session.resolved without owner), detection only; the identity repair path is unchanged and untested. Add to B2 follow-ups.
FM-18 R2 orphanREVISEDetection via r2_orphans_total + RB-13; no automated scan in B6.
FM-19 partial erasureREVISEExisting list-until-empty design; outside B6 execution scope, unchanged.
FM-20 Logpush gapREVISEO10 plans partition-completeness detection; unprovable until staging.
FM-21 cron driftREVISEcron.started/completed events planned; a heartbeat row + alert is not yet in the migration list. Add in B6 observability phase.
FM-22 AI 429PASSai_* codes + keyword fallback semantics; AI queue deferred (separate workload).
FM-23 Gmail uncertain auto-retryPASSNo send queue exists; the send stays synchronous with the explicit outcome field.
FM-24 backlog beyond retentionPASSoldest_message_age_s alert AL-03 at 15 min (retention 4 days).
FM-25 clock skewREVISELease/expiry use server Date.now(); no monotonic guard. Documented limitation; revisit if multi-region.

Summary: 16 PASS (2 of them PASS-by-removal), 9 REVISE (D2, staging measurements, adjacent slices, fairness). None of the 9 is an execution-model defect; each is a decision, a measurement or a neighbouring slice.


2. Alerts (AL-01 … AL-15) — now implementable?

IDVerdictDepends on
AL-01 search stuck runningPASSaggregate query + search.reclaimed event
AL-02 DLQ non-emptyPASSDLQ consumer
AL-03 backlog agePASSQueues analytics (platform)
AL-04 5xx ratioPASShttp.request.completed
AL-05 scrape uncertainPASSdispatch state machine
AL-06 all sources failingPASSscrape_outcome counter
AL-07 gateway degradedPASSgateway /health probe
AL-08 D1 batch failuresPASSdb.batch.failed
AL-09 scraper quota refusalsPASS402 dispatch events
AL-10 retention absentPASSretention.run
AL-11 Logpush gapREVISEstaging only
AL-12 config 503PASSCONFIG_* codes
AL-13 auth rejection spikePASSauth.rejected
AL-14 empty-ratio anomalyREVISEneeds per-source history (only last_run_at/last_error_code exist)
AL-15 R2 orphansREVISEscan tool not built

12 PASS, 3 REVISE (all detection-only, none blocking go-live).


3. Queue requirements Q1 … Q10

#RequirementVerdictMechanism
Q1slow source doesn't block unrelatedPASSone source per invoc + 10 permits
Q2sources independently executablePASSper-source message + lease + retry
Q3users concurrentPASSqueue concurrency
Q4persist as each completesPASSper-source ingest + detail endpoint
Q5failure doesn't discard successesPASSper-source commit; partial
Q6status running/complete/partial/failedPASSaggregate CASE
Q7see finished sources while others runPASSGET /searches/{id} + polling
Q8failed message doesn't block othersPASSbatch size 1; DLQ
Q9one user can't starve othersREVISEcaps bound volume, but no per-tenant fairness scheduler; accepted for now (owner decision D1 keep)
Q10slow source no global lockPASSno lock; reservation guard

9 PASS, 1 REVISE (fairness, deliberately deferred).


4. Review-§3 REVISE list (the ten ranked items)

  1. Fan-out granularity → PASS (design §1–2) · 2. Unbounded concurrency → PASS (§4) ·
  2. Process-local scraper quota → REVISE (D2) · 4. Stranded running → PASS (§2, §6) ·
  3. Partial-as-complete → PASS (§3) · 6. Ingest bound race → PASS-by-removal (§5) ·
  4. DLQ unobserved → PASS (§7) · 8. Observability → PASS (plan) (§10, O1–O10; unproven until implemented) · 9. Dispatch attempt ledger → PASS (§6) · 10. Per-source budget → REVISE (D2, second line of defence).

5. Logging-coverage gaps

ModuleVerdictWhere
router / auth / respondPASS (plan)O2
platform/dbPASS (plan)O3
platform/scraperClientPASS (plan)O4
platform/queuePASS (plan)O5
ingest / validationPASS (plan)O6
scrapers (Go/Rust)PASS (plan)§9 contract + O8
frontendREVISEclient error channel deferred to the app slice
redactionPASS (plan)O7 + AT-22

6. What is still not closed (honest list)

ItemBlocked by
FM-06 / FM-09 fairness and replica quotasowner decision D2
FM-10 D1 latency under loadstaging measurement (no production resources touched)
FM-13 per-source egress routingseparate slice, explicitly out of B6
FM-17/FM-18/FM-19 detection gapsadjacent slices (B2, B3, account erasure)
FM-20/FM-21 archival + cron heartbeatstaging + one small migration in the observability phase
Q9 per-tenant fairnessaccepted risk while one-active-search remains
Observability plan itselfunimplemented by instruction: no source changed

No item above is marked PASS on the strength of local tests alone.

On this page