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:
shumeiko.it
2026-10-20 00:27:02 +02:00
parent 10ad678547
commit b734c1d3d2
53 changed files with 56 additions and 6936 deletions

View File

@@ -1,52 +0,0 @@
/**
* Enterprise Packs — KVARK-conditional capability packs.
*
* These packs only appear when KVARK is connected (vault has 'kvark:connection').
* They represent enterprise-grade capabilities that depend on KVARK's
* semantic search, governance, and entity resolution subsystems.
*
* The skills referenced may not all exist yet — packs are metadata
* that describe what will be available once KVARK features are fully wired.
*/
export interface EnterprisePack {
slug: string;
display_name: string;
description: string;
target_roles: string;
icon: string;
/** Skills included in this pack */
skills: string[];
/** Which KVARK features this pack requires */
kvarkRequirements: string[];
}
export const ENTERPRISE_PACKS: EnterprisePack[] = [
{
slug: 'enterprise-document-qa',
display_name: 'Enterprise Document Q&A',
description: 'Ask questions across your organization\'s document library using KVARK\'s semantic search and retrieval pipeline',
target_roles: 'knowledge-worker,analyst,researcher',
icon: '\u{1F4DA}',
skills: ['kvark_ask_document', 'kvark_search', 'document_summary'],
kvarkRequirements: ['search', 'ask_document'],
},
{
slug: 'compliance-workflow',
display_name: 'Compliance Workflow',
description: 'Governed document processing with audit trails — every action logged and traceable through KVARK\'s governance layer',
target_roles: 'compliance,legal,admin',
icon: '\u{1F6E1}\uFE0F',
skills: ['kvark_action', 'audit_trail_query', 'compliance_check'],
kvarkRequirements: ['governed_action'],
},
{
slug: 'knowledge-graph-enrichment',
display_name: 'Knowledge Graph Enrichment',
description: 'Automatically link entities, extract relationships, and build knowledge graphs using KVARK\'s entity resolution',
target_roles: 'researcher,analyst,knowledge-manager',
icon: '\u{1F578}\uFE0F',
skills: ['kvark_search', 'entity_extraction', 'relationship_mapping'],
kvarkRequirements: ['search', 'entity_resolution'],
},
];

View File

@@ -38,8 +38,6 @@ export { seedNewSources, NEW_SOURCES } from './sources-seed.js';
export { SecurityGate } from './security.js';
export { isCiscoScannerAvailable, ciscoScan, getCiscoScannerVersion, resetAvailabilityCache, setExecFile } from './cisco-scanner.js';
export type { CiscoScanResult, CiscoScanIssue } from './cisco-scanner.js';
export { ENTERPRISE_PACKS } from './enterprise-packs.js';
export type { EnterprisePack } from './enterprise-packs.js';
export { MCP_SERVERS, seedMcpServers } from './mcp-registry.js';
export type { McpServerEntry } from './mcp-registry.js';
export { createMarketplaceMcpProvenance } from './install-security.js';

View File

@@ -1,107 +0,0 @@
/**
* Enterprise Packs — unit tests for KVARK-conditional pack definitions
* and the enterprise-packs endpoint behavior.
*/
import { describe, it, expect } from 'vitest';
import { ENTERPRISE_PACKS, type EnterprisePack } from '../src/enterprise-packs';
describe('ENTERPRISE_PACKS definitions', () => {
it('has at least 3 enterprise packs', () => {
expect(ENTERPRISE_PACKS.length).toBeGreaterThanOrEqual(3);
});
it('every pack has required fields', () => {
for (const pack of ENTERPRISE_PACKS) {
expect(typeof pack.slug).toBe('string');
expect(pack.slug.length).toBeGreaterThan(0);
expect(typeof pack.display_name).toBe('string');
expect(pack.display_name.length).toBeGreaterThan(0);
expect(typeof pack.description).toBe('string');
expect(pack.description.length).toBeGreaterThan(0);
expect(typeof pack.target_roles).toBe('string');
expect(pack.target_roles.length).toBeGreaterThan(0);
expect(typeof pack.icon).toBe('string');
expect(pack.icon.length).toBeGreaterThan(0);
expect(Array.isArray(pack.skills)).toBe(true);
expect(pack.skills.length).toBeGreaterThan(0);
expect(Array.isArray(pack.kvarkRequirements)).toBe(true);
expect(pack.kvarkRequirements.length).toBeGreaterThan(0);
}
});
it('all slugs are unique', () => {
const slugs = ENTERPRISE_PACKS.map(p => p.slug);
expect(new Set(slugs).size).toBe(slugs.length);
});
it('slugs are kebab-case (no spaces or uppercase)', () => {
for (const pack of ENTERPRISE_PACKS) {
expect(pack.slug).toMatch(/^[a-z0-9]+(-[a-z0-9]+)*$/);
}
});
it('every pack references at least one kvark skill', () => {
for (const pack of ENTERPRISE_PACKS) {
const hasKvarkSkill = pack.skills.some(s => s.startsWith('kvark_'));
expect(hasKvarkSkill).toBe(true);
}
});
it('contains the expected pack slugs', () => {
const slugs = ENTERPRISE_PACKS.map(p => p.slug);
expect(slugs).toContain('enterprise-document-qa');
expect(slugs).toContain('compliance-workflow');
expect(slugs).toContain('knowledge-graph-enrichment');
});
});
describe('Enterprise packs endpoint behavior (simulated)', () => {
// Simulate the endpoint logic without starting a real Fastify server.
// The real endpoint uses getKvarkConfig(vault) to decide.
function simulateEndpoint(kvarkConfigured: boolean) {
if (!kvarkConfigured) {
return {
packs: [] as EnterprisePack[],
total: 0,
kvarkRequired: true,
hint: 'Enterprise packs require a KVARK connection. Configure KVARK credentials in the vault to unlock.',
};
}
return {
packs: ENTERPRISE_PACKS,
total: ENTERPRISE_PACKS.length,
kvarkRequired: false,
};
}
it('returns packs when KVARK is configured', () => {
const result = simulateEndpoint(true);
expect(result.packs.length).toBeGreaterThanOrEqual(3);
expect(result.total).toBe(ENTERPRISE_PACKS.length);
expect(result.kvarkRequired).toBe(false);
});
it('returns empty array when KVARK is not configured', () => {
const result = simulateEndpoint(false);
expect(result.packs).toEqual([]);
expect(result.total).toBe(0);
expect(result.kvarkRequired).toBe(true);
expect(result.hint).toBeDefined();
});
it('no packs leak when KVARK is absent', () => {
const result = simulateEndpoint(false);
expect(result.packs).toHaveLength(0);
// Ensure the response shape is consistent
expect(result).toHaveProperty('kvarkRequired', true);
expect(result).toHaveProperty('total', 0);
});
});