← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneesstack72
Relationships
#3947 refactor(cli): share auth whoami's collective-standing helpers ahead of swamp subscription, and pin Personal License and Admin standings
Opened by stack72 · 10/25/2026· Shipped 10/26/2026
Summary
Preparatory refactor for swamp subscription (slice 1). swamp subscription status must word each collective's standing exactly as swamp auth whoami does, so the standing helpers move into one shared module instead of being copied. No user-visible behaviour changes in this PR.
Changes
- Move
standing(),runningTrial()andcollectiveLines()out ofsrc/presentation/renderers/auth_whoami.tsinto a newsrc/presentation/renderers/collective_standing.ts, unchanged, and import them back into theauth whoamirenderer. - Move
rollUpPlanName()into libswamp besideentitlementsOf()insrc/libswamp/auth/whoami.ts. The upcomingsubscriptionStatusgenerator needs it to build the JSONplanName, and libswamp must not import from presentation. Export it throughsrc/libswamp/mod.tsso the renderers may import it. - Add
auth whoamirenderer test cases for the two standings swamp-club now sends:plan: "personal",planName: "Personal License",subscriptionStatus: null,trial: nullplan: "admin",planName: "Admin"- Both as a collective's line and as the top-level
Plan:roll-up. The ranking that picks the top-level plan (admin > paid > personal > free) is swamp-club'shighestWhoamiPlan; the CLI showsidentity.planas sent, so what is pinned here is the CLI's rendering of each plan swamp-club may send, not the ranking.
Acceptance
-
swamp auth whoamioutput is byte-identical in log and--jsonmodes - Existing
src/presentation/renderers/auth_whoami_test.tscases pass without edits; only new cases are added - Personal License and Admin standings are pinned by tests
- New file carries the AGPLv3 header; libswamp names are imported from their defining files, not
mod.ts - Architecture fitness tests under
integration/pass
Out of scope
The swamp subscription command group, status and start — follow-up PRs.
02Bog Flow
Shipped
Click a lifecycle step above to view its details.
03Sludge Pulse
Sign in to post a ripple.