Skip to content

fix(skills): external_dirs distinct provenance and read-only guard (#108032) - #108767

Closed
okyssta wants to merge 1 commit into
NousResearch:mainfrom
okyssta:auto-fix/issue-108032
Closed

okyssta wants to merge 1 commit into
NousResearch:mainfrom
okyssta:auto-fix/issue-108032

Conversation

@okyssta

@okyssta okyssta commented Sep 12, 2026

Copy link
Copy Markdown

Fixes #108032.

Provenance — skills under skills.external_dirs (e.g. ~/.agents/skills) were collapsed to provenance='agent', so Desktop badged them learned (习得) and the starmap/journey counted shared team mounts as self-improved sediment. Now they report external in skill_usage.provenance() and /api/skills, render as an external badge, are non-editable in Desktop, and are excluded from the learning-graph starmap.

Write guard (security) — background curator was already blocked, but foreground skill_manage (patch/edit/write_file/remove_file/delete) mutated external checkouts in place with no permission check. Now skill_manage refuses in-place external mutations by default, with a local-copy hint. Opt in with skills.external_dirs_allow_mutations: true (also honours allow_external_edits / allow_external_mutations aliases).

Tests: tests/tools/test_skill_usage.py, tests/agent/test_skill_utils.py, tests/tools/test_skill_manager_tool.py, tests/agent/test_learning_graph.py — all green; manual verification of external provenance and read-only refusal with/without the opt-in.

…ousResearch#108032)

Skills mounted via skills.external_dirs were collapsed to provenance
'agent', causing the Desktop UI to badge them as 'learned' and counting
them toward the starmap/journey growth. They were also mutable in place
via foreground skill_manage, risking corruption of shared/team checkouts.

- Add skills.external_dirs_allow_mutations (default false) and helpers
  is_external_dir_skill_path / is_external_dirs_writes_allowed.
- Report external provenance ('external') in skill_usage.provenance and
  the /api/skills endpoint, render an 'external' badge in Desktop and
  make those skills non-editable there.
- Enforce a foreground + background read-only guard in skill_manage that
  refuses patch/edit/delete/write_file/remove_file on external mounts
  unless the opt-in is set, with a local-copy hint.
- Exclude external mounts from the learning-graph starmap.

Co-authored-by: kyssta-exe
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) comp/desktop Electron desktop app (apps/desktop/*) comp/dashboard Web dashboard / control panel UI (dashboard/, landing) area/config Config system, migrations, profiles needs-decision Awaiting maintainer decision before any implementation duplicate This issue or pull request already exists labels Sep 12, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #108040 (KoNit-K, opened ~19h earlier), which fixes the same #108032 with the same mechanism: a first-class external provenance (skill_usage / web_routers/skills / Desktop badge + i18n) plus a default-deny skill_manage write guard on skills.external_dirs behind the identically named skills.external_dirs_allow_mutations opt-in. Same 15-file footprint. Reviewers should pick one; note both reverse the intentional in-place external edits from merged #17512, which is why #108040 carries needs-decision.

@okyssta

okyssta commented Sep 12, 2026

Copy link
Copy Markdown
Author

Closing as duplicate — this PR has the duplicate label and triage AI (alt-glitch) flagged it as a duplicate of #108040, which fixes the same issue #108032 with the same mechanism (external provenance + read-only guard on skills.external_dirs). Same 15-file footprint; reviewers should keep one. See also #108040 which carries needs-decision as both reverse the intentional in-place external edits from merged #17512.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/dashboard Web dashboard / control panel UI (dashboard/, landing) comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug/Security]: external_dirs skills misclassified as "learned" (agent-owned) with absent write/patch permission guard

2 participants