Skip to content

Ephemeris: use the shared Ephemeris key file when Gnomon has none of its own - #133

Merged
tensorlink-dev merged 1 commit into
mainfrom
feat/shared-ephemeris-credentials
Oct 10, 2026
Merged

tensorlink-dev merged 1 commit into
mainfrom
feat/shared-ephemeris-credentials

Conversation

@tensorlink-dev

Copy link
Copy Markdown
Contributor

Signing in once to Ephemeris now connects Gnomon too. ephemeris auth login (ephemeris-cli), ephemeris-mcp login and savetokens all save one key file, ~/.config/ephemeris/credentials, as a single EPHEMERIS_API_KEY=pc_live_... line. They get the key from the browser sign-in Ephemeris shipped (device flow), so nobody copies it. Gnomon now falls back to that file.

Behaviour

  • Gnomon's own key wins. ~/.config/gnomon/ephemeris.token is used whenever it exists, and gnomon connect ephemeris still writes only that file.
  • The shared file follows the same privacy rules: a regular file you own, mode 600, in a mode-700 directory, no symlinks.
    • A shared file that fails them is ignored, not fatal: startup carries on with local models only.
    • Reason: many existing ~/.config/ephemeris directories are 755, and refusing to start would be worse than skipping the file.
  • connect ephemeris --status and the MCP onboarding info report credential_source: gnomon, shared, shared_ignored_not_private, or null.
  • --disconnect removes Gnomon's own key only. If the shared file still connects Gnomon, the output says so and points to ephemeris auth logout.
  • read_token accepts both formats: a bare token, or the shared EPHEMERIS_API_KEY= line.
  • EPHEMERIS_CREDENTIALS_FILE overrides the shared path and must be absolute, like the existing XDG_CONFIG_HOME rule.

Tests

Six new tests in tests/test_onboarding.py:

  • the shared key connects Gnomon (check, provider registration) and Gnomon's own file isn't written;
  • Gnomon's own key wins;
  • a non-private directory or file is ignored, and the session still starts;
  • disconnect guidance;
  • a relative override is rejected.

Results:

  • tests/test_onboarding.py: 40 pass.
  • tests/ overall: 1158 pass. One failure, test_portable_schemas.py, is only because jsonschema isn't installed in my test environment; it's unrelated to this change.

🤖 Generated with Claude Code

…its own

ephemeris auth login, ephemeris-mcp login and savetokens all save one key file,
~/.config/ephemeris/credentials (EPHEMERIS_API_KEY=...; EPHEMERIS_CREDENTIALS_FILE
overrides). Gnomon now falls back to it, so signing in with any of them connects
Gnomon too.

- Gnomon's own ~/.config/gnomon/ephemeris.token still wins, and connect writes
  only that.
- The shared file must pass the same checks (regular file owned by you, mode 600,
  directory 700, no symlinks). One that doesn't is ignored, not fatal: startup
  keeps local models, and status says credential_source: shared_ignored_not_private.
- Status reports credential_source: gnomon | shared | shared_ignored_not_private.
- --disconnect removes Gnomon's own key only, and says when the shared one still
  connects it (remove that with ephemeris auth logout).
- The model catalog directory is created privately if only the shared key is used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tensorlink-dev
tensorlink-dev merged commit 8e82d63 into main Oct 10, 2026
10 checks passed
@tensorlink-dev
tensorlink-dev deleted the feat/shared-ephemeris-credentials branch October 10, 2026 11:13
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