Skip to content

refactor(paths): consolidate ~/.socket dir constants, add _state, drop dead helpers#197

Merged
John-David Dalton (jdalton) merged 1 commit into
mainfrom
refactor/socket-dirs
Jun 10, 2026
Merged

refactor(paths): consolidate ~/.socket dir constants, add _state, drop dead helpers#197
John-David Dalton (jdalton) merged 1 commit into
mainfrom
refactor/socket-dirs

Conversation

@jdalton

Copy link
Copy Markdown
Collaborator

What

Reshape the ~/.socket/ directory constants + helpers in paths/socket.ts and constants/socket.ts.

  • Add _state (~/.socket/_state) — version-less persistent app state: the home for daemon sockets, locks, OAuth refresh, durable caches that survive version bumps (mirrors pnpm state-dir / XDG_STATE_HOME). New getSocketStateDir / getSocketAppStateDir / getSocketAppRuntimeDir (the _state/<app>/run/ dir for a daemon's socket + concurrency.lock + pid) + RUN_DIR + getSocketStateDirEnv.
  • Consolidate the infra-dir names into one SOCKET_DIR map holding full _-prefixed names (cacache/dlx/state/wheelhouse).
  • Rename SOCKET_APP_PREFIX -> SOCKET_DIR_PREFIX — it prefixes dirs (including infra dirs like _cacache), not apps.
  • Remove dead helpers with zero consumers: getSocketCliDir, getSocketRegistryDir, getSocketRegistryGithubCacheDir, plus orphaned SOCKET_CLI_APP_NAME / SOCKET_FIREWALL_APP_NAME / SOCKET_REGISTRY_APP_NAME.
  • Collapse duplicated JSDoc blocks + refresh the stale @file layout comment.

Why

Foundation for the proteus credential-broker daemon (needs a stable, version-less _state/<app>/run/ home for its Unix socket + lock). Also removes accumulated dead code + a self-contradicting *_APP_NAME naming (the constants describe dirs, not apps).

Verification

  • typecheck — 0 errors
  • lint --all — 0 / 0
  • 1761 tests pass (env + constants + paths + external-tools), 0 failures

getSocketAppCacheDir/getSocketAppCacheTtlDir kept (bundled into socket-cli dist); getSocketWheelhouseDir kept (used by janus).

@jdalton John-David Dalton (jdalton) merged commit 27b8829 into main Jun 10, 2026
10 checks passed
@jdalton John-David Dalton (jdalton) deleted the refactor/socket-dirs branch June 10, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant