AntFleet

Disagreement · 54ec06bb-anthropic-1

Worker reports kind:'done' with agreedCount=0/degraded=false regardless of actual outcome

mismatch
repo e24ef98c·PR #11·reviewed 1 week ago

Primary finding

Worker reports kind:'done' with agreedCount=0/degraded=false regardless of actual outcome

mediumbughigh
  • apps/web/lib/review-worker.ts:156-162
  • apps/web/lib/review-worker.ts:30-33
The WorkerOutcome 'done' variant promises agreedCount and degraded, but runReviewWorker always returns hardcoded 0/false because processClaimedRow does not return the bundle. This makes the outcome misleading both for the webhook log ('webhook.worker_outcome') and any downstream consumer that might rely on the counters (the retry-cron currently counts kind only, so it does not catch this). Tests only assert outcome.kind === 'done' and never inspect the counters, so the lie passes CI. This is a maintainability/correctness hazard: a future caller that uses these fields will silently get wrong data.

Recommendation

Have processClaimedRow return a small summary { agreedCount, degraded } and wire it into the 'done' return. Or remove the counter fields from the WorkerOutcome shape if they are not actually used.

Counterpart finding

WorkerOutcome returns constant agreedCount/degraded values, losing useful telemetry

lowmaintainabilityhigh
  • apps/web/lib/review-worker.ts:148-154
The worker computes actual agreed findings and degraded status earlier, but the returned outcome always sets agreedCount=0 and degraded=false. This can mislead downstream metrics or logging if these fields are ever consumed beyond the current tests.

Recommendation

Return the real agreedCount (bundle.agreed.length) and degraded flag (bundle.degraded) from runReviewWorker’s success path.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →