Skip to content

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

Closed

Description

@ajianaz

Summary

Found while reviewing #343 (config trust store). The 'CodeCora home' is resolved by three different pieces of code:

  • crates/tole-core/src/skills.rs (~91-100): $CODECORA_HOME/tole/skills/..., else $HOME|$USERPROFILE/.codecora/tole/skills/..., and if neither HOME nor USERPROFILE exists it falls back to . (the current directory).
  • crates/tole-core/src/update_check.rs (~52-64): codecora_home() appends .codecora/tole even when CODECORA_HOME IS set ($CODECORA_HOME/.codecora/tole), so with CODECORA_HOME=/x skills live in /x/tole/ but the update cache lands in /x/.codecora/tole/.
  • crates/tole-cli/src/config_trust.rs (feat(cli): config trust store and tole config trust/untrust (#208, part 2 of 3) #343): a third local re-implementation, deliberately WITHOUT a cwd fallback and refusing empty/relative roots.

Impact

  1. Inconsistent data location when CODECORA_HOME is set (update-check cache vs skills).
  2. Security-relevant: when HOME/USERPROFILE are unset, skills resolve to ./.codecora/tole/skills/<name> — i.e. inside the (possibly cloned, untrusted) project directory, which is exactly what the config trust store was careful to avoid (an empty or relative root would put the store inside the hostile repo).

Expected

One shared resolver (home root = $CODECORA_HOME or $HOME|$USERPROFILE/.codecora; an empty or relative value is treated as unset/refused; NO cwd fallback), used by skills, update-check and the config trust store, with tests for set/unset/empty/relative. Keep tole-core's published API unchanged or add one small public fn deliberately. Note CODECORA_HOME semantics must be decided once (is the tole data dir $CODECORA_HOME/tole as skills.rs and the issue text assume?).

Found by

Review of PR #343 (agent report) + reading both helpers.

Activity

  1. added
    bug
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions