oliver-zehentleitner / maity
hub: auth/caller: runner calls compute is_latest only when refusing, and stop writing runner_session.last_seen_at (no reader) on every call
tsk-0vvym4bwrj2d Open
Audit round 3b (tsk-hgnbapyw7hnh), read at 80fef076. Kind: slow path on a hot route / dead write.
What is wrong
_runner_credential(hub/src/maity_hub/auth/caller.py:725-731) runs a second SELECT (newer) on every runner call to computeis_latest; only_refuse_revokedreads it (:534-535), and only inside its two error answers (:537-551)._runner(caller.py:749-759) selects the liverunner_sessionand updates itslast_seen_aton every call, with noSEEN_EVERYlimit (the agent path has one,:657-665).runner_session.last_seen_at(tables.py:1401) is read nowhere in hub/src; onlyroutes/runner.py:325-340and this update write it. (Runner presence readsrunner.last_seen_at,runners.py:99-104, a deliberate per-call write that stays.)
Proposal
- Compute
is_latestonly whenrevoked_atorrunner_removed_atis set. - Drop the
runner_session.last_seen_atupdate (or limit it perSEEN_EVERYlike_agent); keep the session-id SELECT,runner_actorneeds it.
Effort / risk: S. Low; the refusal's stop list must stay; the runner stream and revoke tests cover it.