grimoire → eidos Package Rename

Summary

The multi-step process of migrating the external grimoire project into the Sokrates monorepo, renaming the workspace package to eidos, and propagating the rename across all NixOS modules, Docker configs, and tooling. Complicated by directory structure mistakes and parallel worktree reconciliation.

Details

Background

The monorepo originally contained a workspace package called grimoire at sokrates/grimoire/. An external standalone project (also named grimoire) had evolved its Python package to use the name sets, with source at sets_app/src/sets/. The goal: consolidate the current sets source into the monorepo as eidos — the final identity.

File-Level Migration (and Mistakes)

First attempt: Copied sets_app/src/sets/ alongside existing grimoire/, producing two copies. Reverted — the external sets is the evolved grimoire.

Second attempt: Leftover untracked eidos/ directory caused mv grimoire eidos to move into it instead of renaming, producing eidos/grimoire/src/sets/. Another reset.

Correct approach (clean slate):

  1. Remove stale grimoire/src/grimoire/ tree
  2. Copy sets_app/src/sets/ as replacement
  3. Rename workspace directory grimoire/eidos/
  4. Rename inner package eidos/src/sets/eidos/src/eidos/

Import and Config Updates

  • 44 source files: from sets.from eidos.
  • 8 scripts: from grimoire.from eidos.
  • pyproject.toml: Package name, hatch target, ruff isort, ty config, Python 3.11→3.13
  • Dependencies: Added redis[hiredis]>=5.0.0 (from external project’s OAuth state store)

Infrastructure Rename

  • docker-compose.yml: Container service definitions updated to eidos
  • NixOS modules: fleet.nix, hermes.nix, dev.nix, networking.nix — all service references and network aliases updated
  • Justfile: Build, deploy, and diagnostic commands updated
  • CLI: grimoire_urleidos_url, query-grimoire/query-eidos/, SOKRATES_GRIMOIRE_URLSOKRATES_EIDOS_URL

Worktree Reconciliation

Five parallel dev worktrees existed during the rename. Four had branched from an early commit with grimoire/ paths; only Team Gamma had current eidos/ paths. Cherry-picking failed due to path mismatches. Resolution: merge Gamma first, extract diffs from others, remap grimoire/eidos/ paths, apply manually due to content drift.

Final State

Package at eidos/src/eidos/, Python 3.13, ruff + ty tooling. Only remaining grimoire reference: docker-compose.yml image tag ghcr.io/sokrates-is/grimoire:latest (awaits CI pipeline update).