Skip to content

Rename the CLI from iglo.mem to iglo.memory - #5

Merged
Igloczek merged 2 commits into
mainfrom
rename-iglo-memory
Nov 30, 2026
Merged

Igloczek merged 2 commits into
mainfrom
rename-iglo-memory

Conversation

@Igloczek

Copy link
Copy Markdown
Contributor

Summary

Renames the executable to iglo.memory so it matches the repository and the sibling tools (iglo.code, iglo.email, iglo.monitor). Saved credentials move to ~/.config/iglo.memory/credentials.json. Existing users keep their saved key through a read-only fallback, so they do not have to enter it again.

  • Build, CI and package: dist/iglo.memory, iglo.memory-linux-x64.tar.gz, package.json name, and the bun.lock workspace name.
    • Only the workspace-name line of bun.lock changed. A full bun install regeneration also bumped transitive @types/node and undici-types, so I didn't keep it. [email protected] install --frozen-lockfile passes on a clean node_modules.
  • Text: scripts, error messages and hints, help text, README (rename, migration note and credentials path only), docs/**, PRD and tests.
  • .ai/skills.json: its validation command used a developer's absolute path, /home/cezar/…/iglo.mem/.agents/skills/setup/scripts/check.ts. That script is tracked in this repo, so the path is now repo-relative (.agents/skills/setup/scripts/check.ts) instead of being renamed to another machine-specific path.
  • Unchanged: repository-side paths (.agent/memory.json, .agent/knowledge, .agent/decisions, .agent/memory-index).

Credentials decision: read-only fallback, no migration

The full reasoning is in docs/decisions.md under "Shared credentials". Short version: copying or moving a secret would add a second write path, a moment with two copies or none, and cleanup decisions about a file an older binary may still need. Reading the old file in place has no race and writes nothing.

Situation Behaviour
OPENROUTER_API_KEY set Always used (unchanged)
New file exists New file is used; the legacy file is not even checked
New file missing, legacy present Legacy file is read with the same checks: 0700 directory, 0600 file, owner uid, no symlinks, nlink ≤ 1, ancestor checks, not inside a Git repo, valid JSON
Legacy file unsafe or malformed CREDENTIALS_INVALID, never skipped silently. Skipping would make a broken key look missing and lead to a new-key prompt
New location unsafe CREDENTIALS_INVALID; no fallback to the legacy file
An empty new directory exists Still falls back to the legacy file
First-time init and init --reset-credentials Write only the new location, atomically. Reset reads neither file, so it is also the recovery path when the legacy file is unsafe
What init prints (stderr) Using the saved key from <path>. When the key comes from the legacy file, it says so and points to the new path and --reset-credentials. After a save, if a legacy file is still there, it says that file is no longer read and can be deleted. The JSON on stdout is unchanged

Remaining iglo.mem hits (git grep -nP 'iglo\.mem(?!ory)')

  • src/credentials.ts:15: LEGACY_APP, the fallback code itself.
  • src/errors.ts:10: the CREDENTIALS_INVALID hint names the legacy file. When the legacy file fails a check, the user needs to know which file to repair.
  • README.md:38,40,42: the "Migrating from iglo.mem" note.
  • test/credentials.test.ts:18,21,206,219,220,223: fallback tests.
  • scripts/qa-terminal.py:62: legacy reuse and reset check in the PTY harness.

Tests

test/credentials.test.ts covers:

  • saving to the new path with 0700/0600 permissions;
  • reading the legacy file when the new one is absent, including when an empty new directory exists;
  • the new file winning, and the legacy file being ignored once the new one exists;
  • an invalid new location failing instead of falling back;
  • legacy cases that must give CREDENTIALS_INVALID: readable file, shared directory, malformed JSON, hardlink, symlinked file, symlinked directory, .git in the directory, Git repository as an ancestor. Each also confirms that nothing is created at the new location and that the env override still works;
  • through the CLI: init reuses a legacy key without prompting and prints the paths, the key never appears in output, and the env override takes precedence.

qa-terminal.py now also runs a PTY reset with a home that has only a legacy file: the key is saved to the new location and the legacy bytes are unchanged.

Verification (local, Linux x86_64)

  • sh scripts/check.sh: lint, format, tests (187 passed, 0 failed) and tsc all pass.
  • sh scripts/build.sh produces dist/iglo.memory.
  • scripts/qa-cli.ts: PASS.
  • python3 scripts/qa-terminal.py: PASS, including legacy_reuse_and_reset.
  • python3 scripts/qa-clean.py (Docker): PASS.
  • Manual smoke test with a disposable HOME containing only a legacy file: init returned credentialSource: saved without prompting and printed the legacy-location notice, and nothing was created at the new location. After chmod 644 on the legacy file, init returned CREDENTIALS_INVALID.

🤖 Generated with Claude Code

Igloczek and others added 2 commits November 30, 2026 17:01
…back

The executable, package, CI artifact, scripts, messages and docs now use
iglo.memory. Credentials are saved to ~/.config/iglo.memory/credentials.json.
When that file is absent, a key saved by iglo.mem is read in place with the
same security checks; an unsafe legacy file is CREDENTIALS_INVALID. Saves and
resets write only the new location.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
List the pre-rename credentials file as a resolution step in the PRD,
point the CREDENTIALS_INVALID message at init --reset-credentials and at
repairing or removing an unsafe legacy path, record that an unsafe legacy
directory without a credentials file still fails closed, and give an exact
command sequence for moving the key by hand into a 0700 directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Igloczek

Copy link
Copy Markdown
Contributor Author

Council verdict: APPROVE (unanimous, round 2, head 5ef6c56). Two independent reviewers from different providers (Claude Opus 5.5 and DeepSeek V4 Pro via OpenCode; Codex and Gemini were unavailable due to quota limits) checked the rename against the requirements: iglo.memory everywhere (build output dist/iglo.memory, CI artifact, package.json, scripts, errors, docs, tests, QA), credentials in ~/.config/iglo.memory/ with a read-only fallback to the legacy ~/.config/iglo.mem/credentials.json that is subject to the identical security checks (0700/0600, owner uid, no symlinks/hardlinks, ancestor and Git-containment checks, fail-closed on an unsafe location, env override first, saves only to the new path), repository paths unchanged, and remaining legacy-name strings limited to the fallback code, its tests and the README migration note. Round 1 raised one should-fix (PRD precedence list omitted the legacy step) and three nits (recovery hint via --reset-credentials, exact manual-migration commands, hint exception confirmation); all were fixed in 5ef6c56 and verified. Both reviewers independently ran scripts/check.sh (187 tests), the build, qa-cli, qa-terminal (incl. legacy reuse/reset), qa-clean, adversarial disposable-HOME cases, and confirmed CI green; both explicitly agree the solution is correctly and completely implemented.

@Igloczek
Igloczek merged commit a68a44d into main Nov 30, 2026
2 checks passed
@Igloczek
Igloczek deleted the rename-iglo-memory branch November 30, 2026 18:10
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