Skip to content

fix(config): resolve vault_path/runtime_dir to absolute paths#11

Merged
smixs merged 1 commit into
mainfrom
fix/config-resolve-abspath
Jun 17, 2026
Merged

fix(config): resolve vault_path/runtime_dir to absolute paths#11
smixs merged 1 commit into
mainfrom
fix/config-resolve-abspath

Conversation

@smixs

@smixs smixs commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Problem (reported by a downstream fork)

On a fresh install with the default relative VAULT_PATH=./vault, the brain silently boots without its persona and reply contract.

The session starts with:

cd vault && claude … --append-system-prompt "$(cat deploy/brain-system.md)" --mcp-config mcp-config.json

project_root = settings.vault_path.parent stays relative, so deploy/brain-system.md and mcp-config.json resolve against vault/ after the cdcat reads nothing → empty system prompt. The boot assertion in runtime.py misses it because it reads the file from the bot's cwd (repo root), not the brain's cwd (vault).

Hidden in production only because there VAULT_PATH is absolute.

Fix

One root of absoluteness — resolve() in the _expand_user field validator. vault_path, project_root, the persona file, mcp-config and the cd target all become absolute regardless of cwd. The cron CLI's _default_cron_dir() mirrors the same expanduser().resolve() so the brain's cron add and the in-bot ticker can't split jobs.json under a symlinked runtime path (found in blind review).

Tests

  • test_runtime: relative ./vault yields an absolute persona path end-to-end (RED before, GREEN after).
  • test_config: relative paths resolve to absolute.
  • test_cron_cli: CLI and bot agree on the cron dir under a symlinked RUNTIME_DIR.
  • Full suite 233 passed; ruff clean; no-claude-p guard clean.

Closes feedback item #3 (system prompt not loaded locally).

The brain starts with `cd vault && claude … "$(cat deploy/brain-system.md)"`.
With the default relative VAULT_PATH=./vault, project_root and the derived
persona/mcp paths stayed relative, so that cat resolved against vault/ AFTER
the cd and loaded NOTHING — the brain booted with no persona and no reply
contract. The boot assertion missed it because it reads the file from the
bot's cwd, not the brain's.

resolve() in the field validator gives one root of absoluteness: vault_path,
project_root, persona file, mcp-config and the cd target all become absolute
regardless of cwd. The cron CLI's _default_cron_dir() now mirrors the same
expanduser+resolve, so the brain's `cron add` and the in-bot ticker never
split jobs.json under a symlinked runtime path. Reported by a downstream fork.

Tests: relative ./vault yields an absolute persona path end-to-end
(test_runtime); config resolves relative paths; CLI and bot agree on the cron
dir under a symlinked RUNTIME_DIR. Fixed a cron_dir test that hardcoded /tmp
(symlink-canonicalised by resolve on macOS).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@smixs smixs merged commit f0abe30 into main Jun 17, 2026
1 check passed
@smixs smixs deleted the fix/config-resolve-abspath branch June 17, 2026 02:14
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