Skip to content

fix(skills): stop a project's own skill copy driving global freshness - #11474

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/skill-repo-scope-not-global-freshness
Jul 30, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/skill-repo-scope-not-global-freshness

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a user report: Settings → Computer Use showed amber "Needs attention" that no
action could clear, while the same page said "Computer Use is ready" and
npx skills update computer-use --global correctly printed "All global skills are up to
date."

Cause

The reporter's global install was pristine — one SKILL.md, mode 644, hash matching the
bundled manifest, lock hash equal to the current source tree. The amber came entirely from
a project-scoped copy in one of their work directories:

~/.agents/skills/computer-use                          Current
~/Documents/projects/<work>/.agents/skills/…      Unrecognized

Orca's updater only ever passes --global, so a copy a project owns has no remedy by
design
. Two defects let it drive the global verdict anyway:

  1. locationChip tested byte status before topology, so an unrecognized repo-scope
    placement returned early and never reached its 'in-a-repo' case. Since
    SKIPPED_REASON_PRIORITY ranks unrecognized above in-a-repo, the summary sentence
    was wrong too — it told the user to remove a copy their own repo owns.
  2. isSkillCopyNeedingAttention excepted plugin-cache but not repo-scope.

This also explains why only computer-use was affected: it was the only skill with a
drifted project copy. Nothing about the skill itself.

Change

Repo-scoped placements stay discoverable, but never determine global skill freshness or
global update eligibility.

Stated by scope, not by byte status — an outdated or unreadable project copy is as far
outside the global updater's reach as an unrecognized one, so pinning only the reported
status would leave the same bug reachable through another.

Chip precedence is now explicit, because one chip stands for two dimensions:

  1. a read failure always reports the read failure, whoever owns the copy
  2. an owner-managed scope outranks byte status
  3. byte status last

Keeping 1 above 2 stops the new rule hiding a genuine read failure.

Ownership suppresses the group, never a location's visibility — a project copy is still
listed whenever another placement earns the row.

What is deliberately preserved

The badge predicate omits the shared helper's outdated carve-out on purpose: with the
eligibleUpdateNames early return, a non-eligible outdated copy is amber, and the code
explains why ("no eligible update is not proof a copy is fine"). Collapsing the two
predicates into one would flip that to green while the dialog still shows its reinstall
row — manufacturing exactly the badge/dialog contradiction #11128 fixed. The distinction is
preserved and pinned by a regression guard.

plugin-cache keeps its existing narrower exception, unchanged. Eligibility needed no
change at all: it already filters to convergent placements, so a project copy could never
affect it.

Verification

Case Badge In dialog
current global + unrecognized repo (the report) up-to-date omitted
repo-only, any status installed omitted
outdated global + repo copy update-available group for the global, repo as an in-a-repo row
non-eligible outdated global needs-attention (unchanged) yes
  • 4,399 tests pass across src/main/skills/, src/renderer/src/lib/, and the skills and
    settings component suites. Typecheck and pnpm lint green.
  • New tests confirmed non-vacuous: with the fix disabled, 9 fail and 57 keep passing.
    The non-eligible-outdated guard passes both ways, which is what proves that behavior is
    untouched.
  • An existing dialog test whose fixture was repo-scope now uses read-only, since a
    project copy correctly raises no row — its assertion about reason placement is preserved.

Scope

This fixes the reported cause. A genuinely modified or foreign global copy still reads
unrecognized with a dead-end remedy; that needs the neutral-unknown state, tracked
separately along with a workspace-readiness surface for project copies that may shadow the
global skill.

Manual validation (Electron, real app)

Isolated HOME reproducing the reporter's exact configuration: a pristine global copy
(SKILL.md mode 644, git tree sha 2072384f… matching the bundled manifest exactly),
provider symlinks from .claude/.grok, a real v3 updater lock, plus a drifted
project-scoped copy inside a registered repo.

Both runs were confirmed to see the same two placements before the UI was read, so the
build is the only variable:

current      canonical-copy   ~/.agents/skills/computer-use
unrecognized repo-scope       ~/projects/jinjing-work/.agents/skills/computer-use
eligibleUpdateNames: []

Before (origin/main) — amber Review skill on both the nav item and the skill card,
plus a ⚠ Details link, over a global copy that is byte-perfect:

before

After (this branch) — green Up to date, no nav badge, no Details link:

after

The project copy is still discovered and still listed; it simply no longer decides the
global verdict. The nav label is Review skill rather than Needs attention because
#11413 renamed that state.

The permissions warning in both shots is the isolated dev HOME lacking the Computer Use
helper app — unrelated to the badge under test, and identical on both sides.

A pristine global install plus a drifted copy inside a work directory showed
Settings -> Computer Use as amber "Needs attention", with the copy labelled
"may be modified ... Remove it if you want Orca to update this skill", while the
same page said "Computer Use is ready" and the update command correctly printed
"All global skills are up to date". No user action could clear it.

Orca's updater only ever passes --global, so a copy a project owns has no remedy
by design. Two defects made it drive the global verdict anyway:

- locationChip tested byte status before topology, so an unrecognized repo-scope
  placement returned early and never reached its 'in-a-repo' case. Because
  SKIPPED_REASON_PRIORITY ranks unrecognized above in-a-repo, the summary
  sentence was wrong too.
- isSkillCopyNeedingAttention excepted plugin-cache but not repo-scope.

Stated by scope rather than by byte status: an outdated or unreadable project
copy is as far outside the global updater's reach as an unrecognized one, so
pinning only the reported status would leave the same bug reachable through
another. Chip precedence is now explicit -- a read failure outranks ownership so
that rule cannot hide a real fault, and ownership outranks byte status.

Ownership suppresses the group, never a location's visibility: a project copy is
still listed whenever another placement earns the row.

The badge predicate deliberately omits the shared helper's outdated carve-out, so
a non-eligible outdated copy stays amber. Collapsing the two into one predicate
would flip that to green while the dialog still shows its reinstall row, so the
distinction is preserved and pinned by a regression guard.

Eligibility needed no change: it already filters to convergent placements.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds shared predicates for identifying owner-managed skill scopes and global freshness participation. Grouping, display-status, and nudge logic now ignore project-owned placements for global freshness while preserving them in qualifying groups. Chip precedence and skipped-reason selection account for participating locations. Tests cover project-only and mixed placements, display badges, nudge dismissal keys, skipped-location explanations, and dialog row visibility.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main fix: project-owned skill copies no longer affect global freshness.
Description check ✅ Passed The description is detailed and covers the bug, cause, change, verification, and manual validation, though it doesn't follow the template headings exactly.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/shared/skill-freshness.ts (1)

89-112: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Condense the new rationale comments.

  • src/shared/skill-freshness.ts#L89-L112: reduce ownership and participation rationale to concise one-line invariants.
  • src/renderer/src/components/skills/skill-freshness-grouping.ts#L34-L41: summarize chip precedence without narrating each branch.
  • src/renderer/src/components/skills/skill-freshness-grouping.ts#L106-L110: state only that repo-scoped placements cannot qualify a group.
  • src/renderer/src/lib/skill-freshness-display-status.ts#L27-L30: state only that repo-scoped placements do not affect global status.
Suggested wording
-// Why: Orca's updater only ever passes --global, so a copy a project owns is not
-// something Orca can act on — it has no remedy by design. Reporting it as global drift
-// produced an amber badge no user action could clear, over a copy their own repo
-// legitimately owns.
+// Repo-scoped placements do not participate in global freshness.

-// Precedence is explicit because one chip stands for two dimensions — who owns the copy,
-// and what its bytes look like:
-//   1. a read failure always reports the read failure, whoever owns the copy
-//   2. an owner-managed scope outranks byte status, because the owner's content is not
-//      the user's drift and Orca's global update never reaches it
-//   3. byte status last
+// Prefer read failures, then owner-managed scope, then byte status.

As per coding guidelines, “Comments must be concise, limited to non-obvious information, and preferably one line.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7eae0f13-2d0c-4061-b555-c876c472f610

📥 Commits

Reviewing files that changed from the base of the PR and between bd9653c and b3043b4.

📒 Files selected for processing (6)
  • src/renderer/src/components/skills/SkillFreshnessUpdateDialog.test.tsx
  • src/renderer/src/components/skills/skill-freshness-grouping.test.ts
  • src/renderer/src/components/skills/skill-freshness-grouping.ts
  • src/renderer/src/lib/skill-freshness-display-status.test.ts
  • src/renderer/src/lib/skill-freshness-display-status.ts
  • src/shared/skill-freshness.ts

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR fixes an amber "Needs attention" badge that could not be cleared: a project-owned repo-scope copy was driving the global freshness verdict even though Orca's updater only ever runs --global and can never touch that copy. The fix introduces skillPlacementParticipatesInGlobalFreshness (excludes repo-scope) and threads it through every freshness decision — badge status, dialog grouping, skip-reason selection, and nudge dismissal keys — so a project copy is still discovered and displayed but never judged.

  • skillPlacementParticipatesInGlobalFreshness is the single source of truth for scope exclusion; plugin-cache deliberately stays on the participating side to preserve its existing narrower exception.
  • locationChip precedence is now explicit: read-failure → owner-managed scope → byte status, so a repo-scope copy shows in-a-repo instead of unrecognized.
  • blockingChip filters to judged locations first, preventing a listed-only project copy from displacing the real blocking explanation.

Confidence Score: 5/5

Safe to merge — narrowly scoped to read-path display logic with no new writes, schema mutations, or IPC surface.

Every decision point is threaded through the same predicate so the invariant cannot silently break in one place while holding elsewhere. The intentional plugin-cache asymmetry is documented and backed by a regression guard. The test suite includes non-vacuous cases that fail with the fix disabled.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/shared/skill-freshness.ts Adds isOwnerManagedSkillScope and skillPlacementParticipatesInGlobalFreshness; prepends participation guard to isSkillCopyNeedingAttention.
src/renderer/src/lib/skill-freshness-display-status.ts Threads participation filter through both status and attention helpers.
src/renderer/src/components/skills/skill-freshness-grouping.ts Refactors locationChip precedence; filters non-participating placements from group-inclusion; adds participatesInGlobalFreshness to location rows.
src/renderer/src/components/skills/skill-freshness-skipped-reason.ts blockingChip prefers judged locations; falls back to full list when all are project-owned.
src/renderer/src/components/skills/SkillFreshnessNudge.tsx Excludes project-owned copies from nudge dismissal fingerprint.

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Review follow-up. The chip and the group no longer treat a project-owned copy as
global drift, but three surfaces still read it as one:

- skippedReason derived its one sentence from the highest-priority chip among a
  group's locations, with 'in-a-repo' ranked above 'duplicate', 'external-link',
  'broken-link' and above the no-chip case that hands over the reinstall command.
  A repo-scope copy can no longer earn a group, so whenever it won it explained a
  skip it had no part in — and swallowed the one runnable remedy. SkillLocationRow
  now carries whether the update judged it, and only judged rows explain. That also
  covers the scan-limit sentinel, which is repo-scope and chips 'inaccessible'.
- hasSkillCopyNeedingAttention counted project copies as the presence that makes a
  plugin-cache read failure a skill's problem, while the status function skipped
  them — the disagreement the two exist to prevent.
- The nudge mixed project copies into its dismissal fingerprint, so re-checking out
  a repo re-raised a nudge the user had already dismissed.

plugin-cache is untouched: it stays on the judged side everywhere, because updating
the plugin is a remedy a project copy does not have.
@brennanb2025
brennanb2025 merged commit 8ea8fe1 into main Jul 30, 2026
54 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/skill-repo-scope-not-global-freshness branch July 30, 2026 20:21
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…stablyai#11474)

* fix(skills): stop a project's own skill copy driving global freshness

A pristine global install plus a drifted copy inside a work directory showed
Settings -> Computer Use as amber "Needs attention", with the copy labelled
"may be modified ... Remove it if you want Orca to update this skill", while the
same page said "Computer Use is ready" and the update command correctly printed
"All global skills are up to date". No user action could clear it.

Orca's updater only ever passes --global, so a copy a project owns has no remedy
by design. Two defects made it drive the global verdict anyway:

- locationChip tested byte status before topology, so an unrecognized repo-scope
  placement returned early and never reached its 'in-a-repo' case. Because
  SKIPPED_REASON_PRIORITY ranks unrecognized above in-a-repo, the summary
  sentence was wrong too.
- isSkillCopyNeedingAttention excepted plugin-cache but not repo-scope.

Stated by scope rather than by byte status: an outdated or unreadable project
copy is as far outside the global updater's reach as an unrecognized one, so
pinning only the reported status would leave the same bug reachable through
another. Chip precedence is now explicit -- a read failure outranks ownership so
that rule cannot hide a real fault, and ownership outranks byte status.

Ownership suppresses the group, never a location's visibility: a project copy is
still listed whenever another placement earns the row.

The badge predicate deliberately omits the shared helper's outdated carve-out, so
a non-eligible outdated copy stays amber. Collapsing the two into one predicate
would flip that to green while the dialog still shows its reinstall row, so the
distinction is preserved and pinned by a regression guard.

Eligibility needed no change: it already filters to convergent placements.

* fix(skills): keep a project copy from explaining a global skill's skip

Review follow-up. The chip and the group no longer treat a project-owned copy as
global drift, but three surfaces still read it as one:

- skippedReason derived its one sentence from the highest-priority chip among a
  group's locations, with 'in-a-repo' ranked above 'duplicate', 'external-link',
  'broken-link' and above the no-chip case that hands over the reinstall command.
  A repo-scope copy can no longer earn a group, so whenever it won it explained a
  skip it had no part in — and swallowed the one runnable remedy. SkillLocationRow
  now carries whether the update judged it, and only judged rows explain. That also
  covers the scan-limit sentinel, which is repo-scope and chips 'inaccessible'.
- hasSkillCopyNeedingAttention counted project copies as the presence that makes a
  plugin-cache read failure a skill's problem, while the status function skipped
  them — the disagreement the two exist to prevent.
- The nudge mixed project copies into its dismissal fingerprint, so re-checking out
  a repo re-raised a nudge the user had already dismissed.

plugin-cache is untouched: it stays on the judged side everywhere, because updating
the plugin is a remedy a project copy does not have.
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.

1 participant