fix: close marketplace client review findings

This commit is contained in:
2026-08-28 21:01:51 +08:00
parent 8dfa542860
commit 1614f7efc1
25 changed files with 1224 additions and 143 deletions

View File

@@ -166,6 +166,33 @@ describe('Pi managed resource loader', () => {
expect(resources.catalogRevision).toBe(13);
});
it('keeps each effective Skill paired with its verified package root when relative paths collide', async () => {
const fixture = await fixtureRoot();
const firstRoot = path.join(fixture.root, 'packages', 'first');
const secondRoot = path.join(fixture.root, 'packages', 'second');
const relativeEntry = 'skills/shared/SKILL.md';
await Promise.all([
mkdir(path.join(firstRoot, 'skills', 'shared'), { recursive: true }),
mkdir(path.join(secondRoot, 'skills', 'shared'), { recursive: true }),
]);
await Promise.all([
writeFile(path.join(firstRoot, relativeEntry), 'first package', 'utf8'),
writeFile(path.join(secondRoot, relativeEntry), 'second package', 'utf8'),
]);
const resolved = await resolveExplicitCodingSkillPaths(fixture.skillsDir, [
{ id: 'first-skill', entryPath: relativeEntry, packageRoot: firstRoot },
{ id: 'second-skill', entryPath: relativeEntry, packageRoot: secondRoot },
]);
expect(resolved.skillPaths).toEqual([
path.join(firstRoot, relativeEntry),
path.join(secondRoot, relativeEntry),
]);
await expect(readFile(resolved.skillPaths[0]!, 'utf8')).resolves.toBe('first package');
await expect(readFile(resolved.skillPaths[1]!, 'utf8')).resolves.toBe('second package');
});
it('filters a known disabled plugin Skill for the next worker and restores it after re-enable', async () => {
const fixture = await fixtureRoot();
const assignedSkillIds = ['grilling', 'data-service'];