Skip to main content
← 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() and collectiveLines() out of src/presentation/renderers/auth_whoami.ts into a new src/presentation/renderers/collective_standing.ts, unchanged, and import them back into the auth whoami renderer.
  • Move rollUpPlanName() into libswamp beside entitlementsOf() in src/libswamp/auth/whoami.ts. The upcoming subscriptionStatus generator needs it to build the JSON planName, and libswamp must not import from presentation. Export it through src/libswamp/mod.ts so the renderers may import it.
  • Add auth whoami renderer test cases for the two standings swamp-club now sends:
    • plan: "personal", planName: "Personal License", subscriptionStatus: null, trial: null
    • plan: "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's highestWhoamiPlan; the CLI shows identity.plan as sent, so what is pinned here is the CLI's rendering of each plan swamp-club may send, not the ranking.

Acceptance

  • swamp auth whoami output is byte-identical in log and --json modes
  • Existing src/presentation/renderers/auth_whoami_test.ts cases 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
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 10 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

10/26/2026, 12:14:47 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/25/2026, 11:44:49 PM

Sign in to post a ripple.