Refactor Sessions to AuthSessions for Clarity · Entire
take a look at https://github.com/entireio/cli/pull/1341, that should be this branch. we are introducing a sessions.go file, with Sessions structs and so on. That's confusing. Refactor things to call them auth_sessions.go, and AuthSessions struct. whenever it's about auth, i want to see the name disambiguated. create a plan and show me what you'll do.
1mo ago·2h 42m·43 calls
Done — auth "session" names are now disambiguated from the real strategy.Session domain.
What changed (5 files + 2 renames, no commit — yours to make):
- Files:
api/sessions.go→api/auth_sessions.go,api/sessions_test.go→api/auth_sessions_test.go(viagit mv, history preserved). apipackage:Session→AuthSession,SessionsResponse→AuthSessionsResponse,ListSessions→ListAuthSessions,RevokeSession→RevokeAuthSession,RevokeCurrentSession→RevokeCurrentAuthSession,WithSessionsPath→WithAuthSessionsPath, plus unexportedauthSessionsPath/authSessionsBasePath/errAuthSessionsPathUnset. Test funcs renamed to match.clihelpers (auth.go/logout.go):coreAuthSessionsPath,newAuthSessionsClient,authSessionLister,defaultListAuthSessions,renderAuthSessionsTable,sortAuthSessionsByRecency,revokeCurrentAuthSession,revokeAllAuthSessions.
Decisions honored: AuthSession singular (one row), full scope (api + cli helpers).
Notes / tradeoffs:
- Used gopls semantic rename, not text substitution — so the bare
Session→AuthSessiondidn't mangle prose comments. Fixed the few comment/string cross-references gopls leaves alone (they're prose, not symbol refs). - JSON wire key stays "tokens" (server contract) — only Go identifiers and the two filenames changed.
- Left local test vars (
noSessions, thelistSessionsparam) and test-function names as-is: scoped, unambiguous, and not the names you flagged. - Verified:
go vetclean,golangci-lint0 issues on both packages,go test ./api/... ./cli/pass. The onemise run lintfailure is a pre-existing shellcheck nit inmise-tasks/release, which this refactor never touched.
fix mise-tasks/release with - Capture first, then test: status="$(git status --porcelain)"
1mo ago·2m·8 calls
Done. Both fixes committed separately (not pushed).
mise-tasks/releasenow capturesstatus="$(git status --porcelain)"then tests[ -n "$status" ]— fullmise run lintpasses clean.Three new commits on
auth-context-consolidation:144be12e31— file renames (sessions.go→auth_sessions.go)b912bcbd95— identifier renames toAuthSessionformsa8bf68d564— the release shellcheck fix
Heads-up: the refactor landed as two commits (moves, then content) because my first git add hit a stale pathspec and only the moves were staged — and your rule is new commits, never amend. If you'd prefer them as one before pushing, say so and I'll squash explicitly.
[144be12auth: disambiguate api session names as AuthSession
The api package is generic, so its Session/ListSessions/etc. collided
conceptually with the repo's agent/checkpoint session domain
(strategy.Session). Prefix the auth surface with Auth: api.Session ->
AuthSession, file sessions.go -> auth_sessions.go, and the cli-package
helpers (newAuthSessionsClient, defaultListAuthSessions,
revokeAllAuthSessions, etc.). JSON wire key stays "tokens".
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: cae0e9836123](/content/gh/entireio/cli/commit/144be12e3135df0e215c2b07f47c4017e3c3bfc7/index.html)
[b912bcbauth: rename session identifiers to AuthSession forms
Apply the Auth-prefix renames across the moved files and call sites:
api.Session -> AuthSession, ListSessions -> ListAuthSessions, etc., plus
cli helpers (newAuthSessionsClient, defaultListAuthSessions,
revokeAllAuthSessions, ...). JSON wire key stays "tokens".
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: c6c44b763a39+97/-97](/content/gh/entireio/cli/commit/b912bcbd959db10ceaa7bdfd765e8c43c0e8709d/index.html)
[a8bf68drelease: capture git status before testing (shellcheck SC2312)
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: 5b271c9e8439+2/-1](/content/gh/entireio/cli/commit/a8bf68d564e8dd30ffe0cae1ad276d57f915f70b/index.html)
[5da9c13auth: disambiguate api session names as AuthSession
The api package is generic, so its Session/ListSessions/etc. collided
conceptually with the repo's agent/checkpoint session domain
(strategy.Session). Prefix the auth surface with Auth: api.Session ->
AuthSession, file sessions.go -> auth_sessions.go, and the cli-package
helpers (newAuthSessionsClient, defaultListAuthSessions,
revokeAllAuthSessions, etc.). JSON wire key stays "tokens".
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: cae0e9836123](/content/gh/entireio/cli/commit/5da9c131bc63223531c080103949b0a2ba936c3b/index.html)
[5b21199auth: rename session identifiers to AuthSession forms
Apply the Auth-prefix renames across the moved files and call sites:
api.Session -> AuthSession, ListSessions -> ListAuthSessions, etc., plus
cli helpers (newAuthSessionsClient, defaultListAuthSessions,
revokeAllAuthSessions, ...). JSON wire key stays "tokens".
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: c6c44b763a39+97/-97](/content/gh/entireio/cli/commit/5b21199d8eb20e1b0e830551927b59d268f07099/index.html)
[73470ferelease: capture git status before testing (shellcheck SC2312)
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Entire-Checkpoint: 5b271c9e8439+2/-1](/content/gh/entireio/cli/commit/73470fefba7b099dc6f122fe45a577ef03e1378f/index.html)