Skip to content

fix(project-skills): ignore a git root above home as the skill boundary - #1354

Open
pcbeingused333 wants to merge 1 commit into
EverMind-AI:mainfrom
pcbeingused333:fix/project-skills-git-root-above-home
Open

pcbeingused333 wants to merge 1 commit into
EverMind-AI:mainfrom
pcbeingused333:fix/project-skills-git-root-above-home

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #1338

Summary

project_skill_roots excluded home, agent home and the ancestors of agent home when picking the git root, but not the ancestors of home. With RAVEN_HOME outside home, a .git above home was accepted as the project boundary, so a gitless workdir under home could read skills (including symlinked ones) up to that outer root.

Cause: excluded lacks home_r.parents for the git-root check.

Fix: reject a git root that is home, an ancestor of home, agent home or an ancestor of agent home. The skill-dir walk still uses the original excluded set, so nothing else changes.

Test: new test_a_git_root_above_home_does_not_bound_a_gitless_workdir (git root above home, agent home outside it) fails before the change (boundary was the outer root) and passes after.

This change was prepared with an AI coding agent (Claude); the commit carries the Co-authored-by trailer per AGENTS.md.

A .git above home (RAVEN_HOME outside home) was accepted as the project
boundary, so a gitless workdir under home could read skills through it.
Treat ancestors of home like home itself for the git-root check.

Co-authored-by: Claude <noreply@anthropic.com>
@LivXue

LivXue commented Nov 18, 2026

Copy link
Copy Markdown
Member

Windows compatibility review — 0228a82459

Reviewed at head 0228a824595727e5fd64b14b105213af45174861 (base 90714e7789). Scope: the whole diff (2 files): raven/memory_engine/skill_forge/project_skills.py now rejects a git root that is home or any ancestor of home (git_root in {*excluded, *home_r.parents}), and the new test in tests/test_skill_forge_project_skills.py.

No Windows compatibility issue found.

  • The change is pure pathlib containment logic. On Windows the comparison is the favourable kind: PureWindowsPath equality is case-insensitive, so a .git found through differently-cased components still compares equal to the home_r.parents entries, and ancestors of a drive-rooted home terminate at C:\ as expected. A workdir on another drive has no ancestor overlap with home, so it is unaffected.
  • The rejected root only changes boundary/walk; the skill-dir walk keeps the original excluded set, and when the git root is rejected the walk is [start], so nothing above the workdir is scanned — the fix reads correctly.

Verification, native Windows host (GitHub tarball of 0228a82459, extracted under D:\tmp\rv1354):

  • python -S runner.py tests/test_skill_forge_project_skills.py -q → 24 passed, 9 skipped — the skips are the symlink-requiring fixtures (_symlink_to skips on WinError 1314), which includes the new test on this unelevated host.
  • A symlink-free probe of the same shape (.git above home, workdir under home, a regular local skill file) reproduced the fixed behaviour: roots.boundary == workdir.resolve() (not the outer git root), and the local skill is still read (['local']).

Gaps: the new test itself did not execute here (no symlink privilege), so the symlink-read part of the leak is verified by code reading only; the boundary half is the probe above. The tree is the commit's export rather than a git worktree.

This branch has not been deployed

No deployments
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.

Project skills: a git root above the user's home can still bound a git-less workdir

2 participants