Skip to content

test(skills): pin both sides of the nested-skill prune boundary - #11462

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/pin-nested-skill-depth
Jul 30, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/pin-nested-skill-depth

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

No user-visible change. MAXIMUM_NESTED_SKILL_DEPTH = 2 in the plugin-cache scan had only its miss side covered by tests, so the bound could be raised or lowered by a refactor with nothing failing. This pins both directions and records the tradeoff on the constant.

Measured boundary, now asserted: a skill is found through 2 intermediate directories below a verified skill package, and missed at 3.

Why the direction matters, in the comment so the next person doesn't have to rediscover it:

  • Raising it spends the entry budget on vendor payload — the exact cost that made ordinary Codex caches collapse to a poison sentinel and pin every skill amber (fix(skills): complete plugin-cache scans without false attention #10865).
  • Missing a deeper copy costs only a Details row, because a plugin-cache placement is not convergeable by any update command. So a copy Orca doesn't see is one it couldn't have helped with.

The failure direction is silence, which is the safe one. That asymmetry is the whole reason the bound is low, and it was undocumented.

Screenshots

No visual change

Testing

  • pnpm typecheck — 0 errors (note: required rm -f config/*.tsbuildinfo first; a stale buildinfo reported 4 phantom errors from a discarded branch)
  • pnpm test — src/main/skills: 16 files / 166 tests pass
  • npx oxlint src/main/skills clean, npx oxfmt --check src/main/skills clean
  • pnpm lint / pnpm build not run — this is a test-and-comment change with no runtime or dependency surface
  • Added tests that would catch a regression, mutation-verified in both directions:
mutation result
baseline (bound = 2) 41 pass
raise to 3 2 fail (miss side)
lower to 1 1 fail (found side)
restored 41 pass

The pin is non-vacuous in both directions — moving the constant either way fails the suite, which is the point.

AI Review Report

I established the boundary empirically before writing the test rather than reading it off the constant: probed 0–4 intermediate directories against the real scanner and observed found/found/found/missed/missed. That is what the it.each table encodes.

Risks checked: that the new test is not tautological (mutation table above); that pruned payload still records no scan issue in either the found or missed case, since surfacing Orca's own traversal rules as a user-facing coverage problem is the #10865 regression class; and that no production behavior changed — the only non-test edit is a comment.

Cross-platform: no platform-specific behavior. The test builds paths with path.join and creates only plain directories and files — no symlinks, so no Windows elevation/Developer-Mode dependency (unlike the symlink tests in this file, which are it.skipIf(process.platform === 'win32')). No shell invocation, no shortcuts, no labels, no Electron surface.

Security Audit

No new input handling, command execution, auth, secrets, IPC, or dependency surface. The change is one comment plus a test that writes only into mkdtemp directories, all registered in the existing temporaryDirectories cleanup. No path is derived from untrusted input. Nothing to follow up.

Notes

Closes #11454.

The under-detection this pins is real and deliberate: a genuine Orca skill nested 3+ levels inside another skill package is silently invisible. That is accepted, for the reason in the comment. If someone later needs those copies visible, the right change is a separate traversal for declared skill roots — not raising this bound, which would reintroduce the budget exhaustion.

The payload prune had only its miss side covered, so the bound could be raised
or lowered by a refactor without anything failing. Both directions are now
pinned: a skill is found through 2 intermediate directories below a package and
missed at 3.

Raising the bound spends the entry budget on vendor payload — the cost that made
ordinary caches collapse and pin every skill amber (#10865). Missing a deeper
copy costs only a Details row, since a plugin-cache placement is not convergeable
by any update command. Recording the tradeoff on the constant so the next person
to touch it knows which direction is the safe one.

No behavior change.

Closes #11454
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@brennanb2025, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2794f672-6eb3-4b93-9ee8-faf4f2fad467

📥 Commits

Reviewing files that changed from the base of the PR and between d0f341a and d1bd941.

📒 Files selected for processing (2)
  • src/main/skills/skill-plugin-cache-scan.test.ts
  • src/main/skills/skill-plugin-cache-scan.ts

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.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR pins both sides of the MAXIMUM_NESTED_SKILL_DEPTH = 2 prune boundary in the plugin-cache scanner — previously only the miss side was covered — and adds a comment explaining why the bound is deliberately low. No runtime behavior changes.

  • New it.each test probes 0–4 intermediate directories between a verified skill package and the target skill, asserting found for depths 0/1/2 and missed (silently, with no issues) for depths 3/4. The mutation table in the PR description confirms the test is non-vacuous: raising the constant fails 2 tests, lowering it fails 1.
  • Comment on MAXIMUM_NESTED_SKILL_DEPTH records the cost asymmetry (raising spends the entry budget on vendor payload; missing a deeper copy costs only a silent Details row) so the tradeoff is self-documenting for future maintainers.

Confidence Score: 5/5

Safe to merge — the only production edit is an explanatory comment; all logic is unchanged.

The change is a comment plus a new test. The test fixture, assertions, and cleanup are all correct. Tracing the payloadDepth propagation through the visit() recursion confirms the expected found/missed boundary exactly matches MAXIMUM_NESTED_SKILL_DEPTH=2, and the issues=[] assertion in every case is consistent with the silent-prune design. The mutation table in the PR description is accurate. No code path that handles real data was modified.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/main/skills/skill-plugin-cache-scan.ts Production-code-only change: an explanatory comment added above MAXIMUM_NESTED_SKILL_DEPTH=2 documenting the tradeoff, referencing both bug #10865 and the new pinning test. No logic changed.
src/main/skills/skill-plugin-cache-scan.test.ts New it.each block covering intermediateDepth 0–4 against the MAXIMUM_NESTED_SKILL_DEPTH=2 boundary. Test fixture, assertions, and cleanup are all correct. Both the found side (0,1,2) and the miss side (3,4) are pinned, and issues is asserted empty for every case.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[visit hostSkill
payloadDepth=null] -->|has SKILL.md| B[isSkillPackage=true
nextPayloadDepth=0]
    B --> C{0 > 2?}
    C -->|No| D[visit children
payloadDepth=0]
    D --> E[nested-1
payloadDepth=0
nextPayloadDepth=1]
    E --> F{1 > 2?}
    F -->|No| G[nested-2
payloadDepth=1
nextPayloadDepth=2]
    G --> H{2 > 2?}
    H -->|No| I[nested-3
payloadDepth=2
nextPayloadDepth=3]
    I --> J{3 > 2?}
    J -->|Yes| K[PRUNE - silent
return, no issue recorded]
    J -->|No if limit raised| L[orca-cli found]
    H -->|No - visit orca-cli| M[orca-cli
payloadDepth=2
isSkillPackage=true]
    M --> N[recordCandidate
Depth 2 = boundary]
    style K fill:#fbb,stroke:#c00
    style N fill:#bfb,stroke:#080
    style L fill:#fdb,stroke:#a80
Loading

Reviews (1): Last reviewed commit: "test(skills): pin both sides of the nest..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit 3eddc46 into main Jul 30, 2026
42 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…lyai#11462)

The payload prune had only its miss side covered, so the bound could be raised
or lowered by a refactor without anything failing. Both directions are now
pinned: a skill is found through 2 intermediate directories below a package and
missed at 3.

Raising the bound spends the entry budget on vendor payload — the cost that made
ordinary caches collapse and pin every skill amber (stablyai#10865). Missing a deeper
copy costs only a Details row, since a plugin-cache placement is not convergeable
by any update command. Recording the tradeoff on the constant so the next person
to touch it knows which direction is the safe one.

No behavior change.

Closes stablyai#11454
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.

Plugin-cache scan silently skips a skill nested 3+ levels inside another skill package

1 participant