refreshClubsCache (Dispatcher.scala:82) populates the completion cache from /api/clubs, which is Club.selectAll with no join and no LIMIT (ClubRoutes.scala:34).
Measured on a real dev machine: 9,762 slugs / 197 KB in ~/.cache/ccas/clubs.txt — mostly opponent and scouted clubs ingested by history/recruitment crawls, none of which any command can act on. Tab-completing --club offers thousands of clubs you don't manage.
Knock-on: UseClub.warnIfUnknown (UseClub.scala:30-35) can never fire for any club CCAS has ever seen, so its typo hint is dead weight.
Proposal: point refreshClubsCache at /api/managed-clubs — already tombstone-filtered (ManagedClub.scala:50-56) and carrying slug on ManagedClubResponse — with /api/clubs as a fallback when the managed set is empty. That cuts the file to single digits, makes the 6h TTL nearly irrelevant, and gives warnIfUnknown real signal.
Also invalidate the cache from the ClubsAdd / ClubsRemove handlers so the 6h TTL doesn't delay a set change the user just made.
Note: tombstoned _stale_<id> slugs already never reach completion — /api/clubs filters via Club.isTombstoned (ClubRoutes.scala:32-38), pinned by TestRoutes.scala:957-978. Verified empirically: grep -c '^_stale_' ~/.cache/ccas/clubs.txt -> 0.
refreshClubsCache(Dispatcher.scala:82) populates the completion cache from/api/clubs, which isClub.selectAllwith no join and no LIMIT (ClubRoutes.scala:34).Measured on a real dev machine: 9,762 slugs / 197 KB in
~/.cache/ccas/clubs.txt— mostly opponent and scouted clubs ingested by history/recruitment crawls, none of which any command can act on. Tab-completing--cluboffers thousands of clubs you don't manage.Knock-on:
UseClub.warnIfUnknown(UseClub.scala:30-35) can never fire for any club CCAS has ever seen, so its typo hint is dead weight.Proposal: point
refreshClubsCacheat/api/managed-clubs— already tombstone-filtered (ManagedClub.scala:50-56) and carryingslugonManagedClubResponse— with/api/clubsas a fallback when the managed set is empty. That cuts the file to single digits, makes the 6h TTL nearly irrelevant, and giveswarnIfUnknownreal signal.Also invalidate the cache from the
ClubsAdd/ClubsRemovehandlers so the 6h TTL doesn't delay a set change the user just made.Note: tombstoned
_stale_<id>slugs already never reach completion —/api/clubsfilters viaClub.isTombstoned(ClubRoutes.scala:32-38), pinned byTestRoutes.scala:957-978. Verified empirically:grep -c '^_stale_' ~/.cache/ccas/clubs.txt-> 0.