Skip to content

fix(core): resolve the CodeCora home in one place - #348

Merged
ajianaz merged 1 commit into
developfrom
fix/codecora-home-resolver
Oct 9, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/codecora-home-resolver

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

One shared CodeCora-home resolver in tole-core (tole_core::paths::{codecora_root, tole_data_dir}), used by skills, the update-check cache and the config trust store.

Why

The home was resolved three ways. Skills fell back to the current directory when HOME/USERPROFILE were unset (security-relevant: a cloned, untrusted project could supply user-global skills), and the update-check cache appended .codecora/tole even when CODECORA_HOME was set, disagreeing with skills. Closes #344.

Changes

  • New crates/tole-core/src/paths.rs: root = $CODECORA_HOME, else $HOME|$USERPROFILE + .codecora; empty = unset; relative refused; no cwd fallback; Option<PathBuf>. tole_data_dir() = <root>/tole. Additive public API.
  • skills.rs: uses it; when unresolvable the user-global location is skipped entirely.
  • update_check.rs: cache is <root>/tole/update-cache.json (moves for CODECORA_HOME users; it is only a cache); unresolvable = check skipped as before.
  • tole-cli/config_trust.rs: local copy removed; same error message.
  • CHANGELOG ### Fixed; threat-model note.

Testing

  • Resolver matrix (set/empty/relative/HOME/USERPROFILE/precedence/nothing), skills no-cwd-fallback, update-check path tests; env tests serialized by one lock that restores previous values (also on panic).
  • New skills and update-check tests verified to fail against the old code.
  • fmt, clippy (-D warnings), workspace tests, bare/shell-tools profiles, tole-core --no-default-features --tests, cora review --staged (clean).

🤖 Generated with Claude Code

Add tole_core::paths (codecora_root / tole_data_dir) as the single
source of truth: $CODECORA_HOME, else $HOME|$USERPROFILE/.codecora;
empty = unset, relative refused, no cwd fallback (None when
unresolvable). Skills now skip the user-global location instead of
falling back to the cwd, the update-check cache uses <root>/tole
(was $CODECORA_HOME/.codecora/tole), and config_trust drops its local
copy.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit c39f77f into develop Oct 9, 2026
17 checks passed
@ajianaz ajianaz mentioned this pull request Oct 9, 2026
@ajianaz
ajianaz deleted the fix/codecora-home-resolver branch October 9, 2026 06:43
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.

codecora home resolution is duplicated three ways: update_check differs when CODECORA_HOME is set; skills falls back to the cwd

1 participant