Problem
The Fleet badge on the rail counts the wrong thing. The Fleet page definition says it counts agents with a measured problem. The code counts agents that owe someone a reply.
An agent owing a reply is the normal state of a busy fleet, so the badge is lit most of the time and does not tell the person that something is broken.
What the definition says
Fleet page AC23: the badge counts agents that have at least one measured problem; an agent counts once however many problems it has, unknowns never count, and the badge never counts open asks to the person or silence notices.
AC21 lists the measured problems: a failed latest run, a delivery alarm, and a run that has waited past the dispatch threshold.
What the code does
countFleetAlerts in apps/web/src/j5/fleet/fleet.logic.ts counts agents with openAsks > 0.
openAsks comes from apps/server/src/j5/a2a/FleetReadsHttp.ts: open Exchanges whose receiver is that agent.
apps/web/src/j5/fleet/FleetRailEntry.tsx renders that count as the badge.
- The test in
fleet.logic.test.ts is named "counts alerts from owed asks only".
A failed run or a delivery alarm does not change the badge. It has been this way since the page shipped in #149.
Decision
The definition is right and the code is wrong (Jackson, 2026-10-08).
Done when
- The badge counts agents with at least one of the measured problems in AC21, once each.
- An agent that only owes a reply does not count.
- Unknown facts do not count.
- The test asserts those three things.
Mobile: check whether the mobile app shows a Fleet badge and, if it does, that it uses the same count.
Problem
The Fleet badge on the rail counts the wrong thing. The Fleet page definition says it counts agents with a measured problem. The code counts agents that owe someone a reply.
An agent owing a reply is the normal state of a busy fleet, so the badge is lit most of the time and does not tell the person that something is broken.
What the definition says
Fleet page AC23: the badge counts agents that have at least one measured problem; an agent counts once however many problems it has, unknowns never count, and the badge never counts open asks to the person or silence notices.
AC21 lists the measured problems: a failed latest run, a delivery alarm, and a run that has waited past the dispatch threshold.
What the code does
countFleetAlertsinapps/web/src/j5/fleet/fleet.logic.tscounts agents withopenAsks > 0.openAskscomes fromapps/server/src/j5/a2a/FleetReadsHttp.ts: open Exchanges whose receiver is that agent.apps/web/src/j5/fleet/FleetRailEntry.tsxrenders that count as the badge.fleet.logic.test.tsis named "counts alerts from owed asks only".A failed run or a delivery alarm does not change the badge. It has been this way since the page shipped in #149.
Decision
The definition is right and the code is wrong (Jackson, 2026-10-08).
Done when
Mobile: check whether the mobile app shows a Fleet badge and, if it does, that it uses the same count.