refactor: remove KVARK, enterprise packs and the compliance subsystem (P1.4, P1.6)
KVARK is the commercial enterprise product and is not part of the community edition. The agent's KVARK tools were never wired into the server, so removing them changes no runtime behaviour beyond the routes listed here. - agent: delete kvark-tools; CombinedRetrieval and formatCombinedResult now merge workspace and personal memory only (no KVARK lane, no source conflict note); connector substrate is always 'waggle' - agent: promote_skill stops at workspace scope; team and enterprise scopes answer "not available in this edition" instead of an upgrade prompt - server: delete src/kvark and GET /api/marketplace/enterprise-packs - marketplace: delete ENTERPRISE_PACKS - compliance (EU AI Act dashboard, its templates and the KVARK template seeded on every boot): delete core/src/compliance, the /api/compliance/* routes, agent compliance-pdf and the Cockpit compliance panel. The ai_interactions table lives in the memory substrate and goes with P1.5.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Skills 2.0 gap E — promote_skill tool.
|
||||
*
|
||||
* Tests the one-step promotion chain personal → workspace → team → enterprise,
|
||||
* tier gating, frontmatter rewrite with promoted_from history, file move,
|
||||
* and skill_promotion improvement signal emission.
|
||||
* Tests the one-step promotion personal → workspace, the refusal of team and
|
||||
* enterprise scopes in this edition, frontmatter rewrite with promoted_from
|
||||
* history, file move, and skill_promotion improvement signal emission.
|
||||
*/
|
||||
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
||||
import * as fs from 'node:fs';
|
||||
@@ -32,8 +32,6 @@ describe('promote_skill — gap E', () => {
|
||||
onSkillsChanged: () => { reloadCount++; },
|
||||
getWorkspaceId: () => 'ws-alpha',
|
||||
getTeamId: () => 'team-bravo',
|
||||
hasTeamSkillLibrary: () => true,
|
||||
isEnterprise: () => true,
|
||||
improvementSignals: signals,
|
||||
...overrides,
|
||||
});
|
||||
@@ -87,22 +85,6 @@ describe('promote_skill — gap E', () => {
|
||||
// onSkillsChanged fired
|
||||
expect(reloadCount).toBe(1);
|
||||
});
|
||||
|
||||
it('appends to existing promoted_from across multiple hops', async () => {
|
||||
const wsDir = getSkillDirForScope(tmpDir, 'workspace', { workspaceId: 'ws-alpha' })!;
|
||||
// Skill already promoted once (personal → workspace), now promote to team
|
||||
fs.mkdirSync(wsDir, { recursive: true });
|
||||
const content = `---\nname: already-moved\nscope: workspace\npromoted_from: [personal]\n---\nbody`;
|
||||
fs.writeFileSync(path.join(wsDir, 'already-moved.md'), content, 'utf-8');
|
||||
const tools = createTools();
|
||||
|
||||
await run(tools, 'promote_skill', { skill_name: 'already-moved' });
|
||||
|
||||
const teamDir = getSkillDirForScope(tmpDir, 'team', { teamId: 'team-bravo' })!;
|
||||
const parsed = parseSkillFrontmatter(fs.readFileSync(path.join(teamDir, 'already-moved.md'), 'utf-8'));
|
||||
expect(parsed.frontmatter.scope).toBe('team');
|
||||
expect(parsed.frontmatter.promoted_from).toEqual(['personal', 'workspace']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validation', () => {
|
||||
@@ -136,30 +118,22 @@ describe('promote_skill — gap E', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('tier gating', () => {
|
||||
it('denies team promotion when hasTeamSkillLibrary is false', async () => {
|
||||
describe('edition limits', () => {
|
||||
it('refuses team promotion and leaves the skill in place', async () => {
|
||||
const wsDir = getSkillDirForScope(tmpDir, 'workspace', { workspaceId: 'ws-alpha' })!;
|
||||
seedSkill(wsDir, 'paid-feature', 'workspace');
|
||||
const tools = createTools({ hasTeamSkillLibrary: () => false });
|
||||
const out = await run(tools, 'promote_skill', { skill_name: 'paid-feature' });
|
||||
expect(out).toContain('your plan does not include');
|
||||
expect(out).toContain('TEAMS or ENTERPRISE');
|
||||
seedSkill(wsDir, 'shared-helper', 'workspace');
|
||||
const out = await run(createTools(), 'promote_skill', { skill_name: 'shared-helper' });
|
||||
expect(out).toContain('not available in this edition');
|
||||
expect(fs.existsSync(path.join(wsDir, 'shared-helper.md'))).toBe(true);
|
||||
expect(signals.getByCategory('skill_promotion')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('denies team promotion when no team is linked even if capability allows', async () => {
|
||||
const wsDir = getSkillDirForScope(tmpDir, 'workspace', { workspaceId: 'ws-alpha' })!;
|
||||
seedSkill(wsDir, 'solo-ws', 'workspace');
|
||||
const tools = createTools({ getTeamId: () => null });
|
||||
const out = await run(tools, 'promote_skill', { skill_name: 'solo-ws' });
|
||||
expect(out).toContain('not linked to a team');
|
||||
});
|
||||
|
||||
it('denies enterprise promotion without isEnterprise', async () => {
|
||||
it('refuses enterprise promotion', async () => {
|
||||
const teamDir = getSkillDirForScope(tmpDir, 'team', { teamId: 'team-bravo' })!;
|
||||
seedSkill(teamDir, 'hot-skill', 'team');
|
||||
const tools = createTools({ isEnterprise: () => false });
|
||||
const out = await run(tools, 'promote_skill', { skill_name: 'hot-skill' });
|
||||
expect(out).toContain('requires ENTERPRISE tier');
|
||||
const out = await run(createTools(), 'promote_skill', { skill_name: 'hot-skill' });
|
||||
expect(out).toContain('Cannot promote to enterprise scope');
|
||||
expect(out).toContain('not available in this edition');
|
||||
});
|
||||
|
||||
it('denies workspace promotion when no workspace is active', async () => {
|
||||
|
||||
Reference in New Issue
Block a user