fix(context-bill): skill discovery refuses a tree past the entry cap too

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-26 02:26:26 +00:00
1 parent 1ec023b1ed
commit 77fe211776
2 files changed
+21 -8

No files matched your search

+9
View File
@@ -391,6 +391,15 @@ describe("upstream fix b: installed-tree layout (repo-checkout subdir skip)", ()
fs.rmSync(root, { recursive: true, force: true });
});
it("refuses skill discovery past its entry cap instead of walking on", () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), "context-bill-discovery-cap-"));
fs.mkdirSync(path.join(root, "vendor"));
for (let i = 0; i < 10; i++) fs.mkdirSync(path.join(root, "vendor", `d${i}`));
expect(() => findSkillDirs(root, 5)).toThrow(/more than 5 entries to walk/);
expect(findSkillDirs(root)).toEqual([]);
fs.rmSync(root, { recursive: true, force: true });
});
it("bills a subdirectory whose SKILL.md is a directory to its container, as discovery does not count it as a skill", () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), "context-bill-skilldir-"));
fs.writeFileSync(path.join(root, "SKILL.md"), "---\nname: c\ndescription: d\n---\n# c\n");