fix(decode): mark pcat skip/transient in timings — stop false catalog-gap reads
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

Cold-pool fast-fail (and transport blips) make pcat return null without
ever evaluating the VIN; EMEX then identifies the car and the row lands
as 'No catalog — identified as X' (pcat sub-timing 1-2ms). Downstream
catalog-gap detection can't tell these from true coverage gaps and
flags covered brands (Audi, 2026-06-11, 7 retries by one user).

- timings.pcat_skipped=1 on cold-pool fast-fail
- timings.pcat_transient=1 on transport failure (circuit-open skips
  already carry pcat_circuit_open)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 11:50:36 +03:00
parent ef4ab9bcd5
commit fd789574fd

View File

@@ -779,8 +779,21 @@ export class VehiclesService {
// Propagate pcat's transient signal to the shared outcome (neg-cache gate).
if (pcatOutcome.transient && outcome) outcome.transient = true;
pcatResolved = true;
if (ctx && ctx.timings.pcat === undefined) {
ctx.timings.pcat = Date.now() - pcatStart;
if (ctx) {
if (ctx.timings.pcat === undefined) {
ctx.timings.pcat = Date.now() - pcatStart;
}
// pcat never definitively evaluated this VIN. Without these markers a
// "No catalog — identified as X" produced while pcat was skipped/flaky
// is indistinguishable from a true coverage gap, and the panel's
// catalog-gap detector raises false brand-gap insights (seen
// 2026-06-11: Audi flagged from cold-pool 1-2ms skips).
if (pcatOutcome.coldSkip) {
ctx.timings.pcat_skipped = 1;
} else if (pcatOutcome.transient && !pcatCircuitOpen) {
// Circuit-open skips already carry pcat_circuit_open.
ctx.timings.pcat_transient = 1;
}
}
});