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

@@ -3833,80 +3833,6 @@ class LocalAdapter {
return res.json();
}
// --- Compliance ---
async getComplianceStatus(workspaceId?: string): Promise<any> {
const url = workspaceId ? `/api/compliance/status?workspaceId=${workspaceId}` : '/api/compliance/status';
const res = await this.fetch(url);
return res.json();
}
/**
* M-02: download an AI-Act-compliance PDF. Accepts the same request
* shape as exportComplianceReport. Returns a Blob so the caller can
* trigger a browser download via URL.createObjectURL.
*/
async exportComplianceReportPdf(request: any): Promise<Blob> {
const res = await this.fetch('/api/compliance/export-pdf', {
method: 'POST', body: JSON.stringify(request),
});
if (!res.ok) {
const body = await res.json().catch(() => ({ error: res.statusText }));
throw new Error(body.error ?? `PDF export failed (${res.status})`);
}
return res.blob();
}
async exportComplianceReport(request: any): Promise<any> {
const res = await this.fetch('/api/compliance/export', { method: 'POST', body: JSON.stringify(request) });
return res.json();
}
async getComplianceInteractions(limit?: number): Promise<any> {
const res = await this.fetch(`/api/compliance/interactions?limit=${limit ?? 20}`);
return res.json();
}
async getComplianceModels(): Promise<any> {
const res = await this.fetch('/api/compliance/models');
return res.json();
}
// --- Compliance templates (M-03) ---
async listComplianceTemplates(): Promise<{ templates: any[] }> {
const res = await this.fetch('/api/compliance/templates');
return res.json();
}
async createComplianceTemplate(input: any): Promise<{ template: any }> {
const res = await this.fetch('/api/compliance/templates', {
method: 'POST', body: JSON.stringify(input),
});
if (!res.ok) {
const body = await res.json().catch(() => ({ error: res.statusText }));
throw new Error(body.error ?? `Create template failed (${res.status})`);
}
return res.json();
}
async updateComplianceTemplate(id: number, patch: any): Promise<{ template: any }> {
const res = await this.fetch(`/api/compliance/templates/${id}`, {
method: 'PATCH', body: JSON.stringify(patch),
});
if (!res.ok) {
const body = await res.json().catch(() => ({ error: res.statusText }));
throw new Error(body.error ?? `Update template failed (${res.status})`);
}
return res.json();
}
async deleteComplianceTemplate(id: number): Promise<void> {
const res = await this.fetch(`/api/compliance/templates/${id}`, { method: 'DELETE' });
if (!res.ok) {
const body = await res.json().catch(() => ({ error: res.statusText }));
throw new Error(body.error ?? `Delete template failed (${res.status})`);
}
}
// --- WebSocket ---
connectWebSocket(onMessage: (data: unknown) => void): () => void {
if (this.managedDesktop && (!this.desktopEndpoint || !this.desktopEndpointReady)) {

View File

@@ -31,7 +31,7 @@
// no-external build: never lazy-loads remote chunks (config.js, recorder,
// surveys) from us-assets.i.posthog.com. Combined with advanced_disable_decide
// this keeps script-src 'self' intact — no third-party script executes in the
// desktop webview, preserving Waggle/KVARK's data-sovereignty posture. Only
// desktop webview, preserving Waggle's data-sovereignty posture. Only
// the capture endpoint (us.i.posthog.com) is ever contacted.
import posthog from 'posthog-js/dist/module.no-external';