Repository navigation
test(skills): pin both sides of the nested-skill prune boundary - #11462
Conversation
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
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
Greptile SummaryThis PR pins both sides of the
Confidence Score: 5/5Safe 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.
|
| 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
Reviews (1): Last reviewed commit: "test(skills): pin both sides of the nest..." | Re-trigger Greptile
…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
Summary
No user-visible change.
MAXIMUM_NESTED_SKILL_DEPTH = 2in 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:
plugin-cacheplacement 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 changeTesting
pnpm typecheck— 0 errors (note: requiredrm -f config/*.tsbuildinfofirst; a stale buildinfo reported 4 phantom errors from a discarded branch)pnpm test—src/main/skills: 16 files / 166 tests passnpx oxlint src/main/skillsclean,npx oxfmt --check src/main/skillscleanpnpm lint/pnpm buildnot run — this is a test-and-comment change with no runtime or dependency surfaceThe 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.eachtable 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.joinand creates only plain directories and files — no symlinks, so no Windows elevation/Developer-Mode dependency (unlike the symlink tests in this file, which areit.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
mkdtempdirectories, all registered in the existingtemporaryDirectoriescleanup. 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.