fix(config): resolve vault_path/runtime_dir to absolute paths#11
Merged
Conversation
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).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
project_root = settings.vault_path.parentstays relative, sodeploy/brain-system.mdandmcp-config.jsonresolve againstvault/after thecd→catreads nothing → empty system prompt. The boot assertion inruntime.pymisses 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_PATHis absolute.Fix
One root of absoluteness —
resolve()in the_expand_userfield validator.vault_path,project_root, the persona file,mcp-configand thecdtarget all become absolute regardless of cwd. The cron CLI's_default_cron_dir()mirrors the sameexpanduser().resolve()so the brain'scron addand the in-bot ticker can't splitjobs.jsonunder a symlinked runtime path (found in blind review).Tests
test_runtime: relative./vaultyields 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 symlinkedRUNTIME_DIR.Closes feedback item #3 (system prompt not loaded locally).