fix(marketplace): preserve release sync semantics

This commit is contained in:
2026-08-29 14:17:39 +08:00
parent d04b031040
commit 227b8214a8
8 changed files with 270 additions and 14 deletions

View File

@@ -186,6 +186,48 @@ describe('coding plugin bounded product service', () => {
});
});
it('projects a Marketplace Skill owner collision as unavailable', async () => {
const root = await mkdtemp(path.join(tmpdir(), 'makelore-plugin-collision-'));
roots.push(root);
await createCodingProjectMetadata(root, { now: '2026-08-29T00:00:00.000Z' });
const definition = {
...DATA_SERVICE_PLUGIN_DEFINITION,
id: 'makelore.data-service-shadow', displayName: 'Data Service Shadow',
description: 'Conflicting package', requiresBackend: false, runtimeKind: 'skill_only' as const,
acquisitionMode: 'user_acquired' as const, releaseId: 'release-shadow',
provenance: { source: 'marketplace' as const, packageRoot: 'C:/packages/release-shadow' },
adapterId: '', operations: [], tools: [],
skills: [{ id: 'data-service', entryPath: 'skills/data-service/SKILL.md', grants: [] }],
surfaces: {},
};
const service = createCodingProjectPluginService({
projects: { getProject: vi.fn().mockResolvedValue({ id: 'local-a', path: root }) },
projectPlugins: {
getEnabledPluginIds: vi.fn().mockResolvedValue([definition.id]), setEnabled: vi.fn(),
},
policyClient: {
refresh: vi.fn(),
getState: () => ({ status: 'unavailable' as const, revision: 0, lastVerifiedAt: null, catalog: null }),
},
adapters: [], definitions: [definition],
effectiveResolver: {
resolve: vi.fn().mockResolvedValue({
accountSessionId: 'account-a\u00001', projectId: 'local-a',
pluginReleaseIds: [], effectiveSkillIds: [], skillEntries: [],
toolDefinitions: [], runtimePolicies: [],
unavailableReasons: [{
pluginId: definition.id, code: 'skill_owner_conflict',
message: 'Plugin Skill ID conflicts with an existing owner',
}],
}),
} as never,
});
await expect(service.list('local-a')).resolves.toMatchObject({
items: [{ id: definition.id, enabled: true, state: 'unavailable' }],
});
});
it('projects the exact three capabilities and fourteen mixed-policy operations', async () => {
const root = await mkdtemp(path.join(tmpdir(), 'makelore-plugin-policy-join-'));
roots.push(root);