steps 5-8: deep gut — purge chat/notes/projects/providers from code
main.go: remove ~300 lines of stale routes referencing deleted handlers (channels, messages, folders, personas, notes, projects, memories, models, providers, tasks, roles, usage, routing, capabilities, etc.) Fix branding: "Chat Switchboard" → "Switchboard Core" pages: remove chat/notes/projects surface manifests and templates Keep: admin, settings, team-admin, workflow, workflow-landing frontend: delete chat/, notes/, projects/ surface directories (19 files) Delete 5 CSS files (4,144 lines): sw-chat-*, sw-notes-*, sw-projects-* SDK: strip gutted API domains (594→287 lines), remove chatPane/notesPane tests: remove integration_test.go (5,194 lines, broken imports to deleted packages) and perm_enforcement_test.go (551 lines, depended on deleted test helpers). Fix testmain_test.go (remove providers import). openapi.yaml: replace 12,491-line stale spec with kernel auth stub. Full ICD rebuild is Step 8 proper. Auth (builtin, mTLS, OIDC) untouched throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
{{/*
|
||||
Chat surface (v0.37.10 — Preact).
|
||||
Replaced the ~387-line SPA scaffold with a single mount point.
|
||||
Preact ChatSurface component handles all rendering.
|
||||
*/}}
|
||||
|
||||
{{define "surface-chat"}}
|
||||
|
||||
{{/* ── Crash Catcher (visible without devtools) ── */}}
|
||||
<div id="crashBanner" style="display:none;position:fixed;top:0;left:0;right:0;z-index:99999;background:#b00020;color:#fff;padding:12px 20px;font-family:monospace;font-size:13px;max-height:40vh;overflow-y:auto;">
|
||||
<strong>Init Error</strong> <button onclick="this.parentElement.style.display='none'" style="float:right;background:none;border:1px solid #fff;color:#fff;cursor:pointer;padding:2px 8px;border-radius:3px">X</button>
|
||||
<pre id="crashDetail" style="margin:8px 0 0;white-space:pre-wrap;font-size:12px;"></pre>
|
||||
</div>
|
||||
<script nonce="{{$.CSPNonce}}">
|
||||
window.addEventListener('error', function(e) {
|
||||
var b = document.getElementById('crashBanner');
|
||||
var d = document.getElementById('crashDetail');
|
||||
if (b && d) {
|
||||
b.style.display = '';
|
||||
d.textContent += (e.filename || '') + ':' + (e.lineno || '') + ' ' + (e.message || e) + '\n';
|
||||
}
|
||||
});
|
||||
window.addEventListener('unhandledrejection', function(e) {
|
||||
var b = document.getElementById('crashBanner');
|
||||
var d = document.getElementById('crashDetail');
|
||||
if (b && d) {
|
||||
b.style.display = '';
|
||||
d.textContent += 'Promise: ' + (e.reason?.message || e.reason || 'unknown') + '\n' + (e.reason?.stack || '') + '\n';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{/* ── Mount Point ────────────────────────── */}}
|
||||
<div id="chat-mount" style="height:100%;display:flex;">
|
||||
<div style="display:flex;align-items:center;justify-content:center;width:100%;color:var(--text-2,#999);font-size:14px;">
|
||||
Loading...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "css-chat"}}
|
||||
<link rel="stylesheet" href="{{.BasePath}}/css/sw-chat-surface.css?v={{.Version}}">
|
||||
<link rel="stylesheet" href="{{.BasePath}}/branding/custom.css" onerror="this.remove()">
|
||||
{{end}}
|
||||
|
||||
{{define "scripts-chat"}}
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/marked.min.js"></script>
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/purify.min.js"></script>
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/codemirror/codemirror.bundle.js?v={{$.Version}}"></script>
|
||||
<script type="module" nonce="{{$.CSPNonce}}">
|
||||
// v0.37.10: Preact boot — same pattern as settings/admin/team-admin surfaces.
|
||||
// Vendor modules: no ?v= query — hooks.module.js does a bare
|
||||
// import from "./preact.module.js" internally, so the URL must match.
|
||||
const { h, render } = await import('{{$.BasePath}}/js/sw/vendor/preact.module.js');
|
||||
const hooksModule = await import('{{$.BasePath}}/js/sw/vendor/hooks.module.js');
|
||||
const { default: htm } = await import('{{$.BasePath}}/js/sw/vendor/htm.module.js');
|
||||
const html = htm.bind(h);
|
||||
window.preact = window.preact || { h, render };
|
||||
window.hooks = window.hooks || hooksModule;
|
||||
window.html = window.html || html;
|
||||
|
||||
const { boot } = await import('{{$.BasePath}}/js/sw/sdk/index.js?v={{$.Version}}');
|
||||
await boot();
|
||||
|
||||
await import('{{$.BasePath}}/js/sw/surfaces/chat/index.js?v={{$.Version}}');
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -1,66 +0,0 @@
|
||||
{{/*
|
||||
Notes surface (v0.37.11 — Preact).
|
||||
Replaced the v0.37.9 template mount with a single mount point.
|
||||
Preact NotesSurface component handles all rendering.
|
||||
*/}}
|
||||
|
||||
{{define "surface-notes"}}
|
||||
|
||||
{{/* ── Crash Catcher (visible without devtools) ── */}}
|
||||
<div id="crashBanner" style="display:none;position:fixed;top:0;left:0;right:0;z-index:99999;background:#b00020;color:#fff;padding:12px 20px;font-family:monospace;font-size:13px;max-height:40vh;overflow-y:auto;">
|
||||
<strong>Init Error</strong> <button onclick="this.parentElement.style.display='none'" style="float:right;background:none;border:1px solid #fff;color:#fff;cursor:pointer;padding:2px 8px;border-radius:3px">X</button>
|
||||
<pre id="crashDetail" style="margin:8px 0 0;white-space:pre-wrap;font-size:12px;"></pre>
|
||||
</div>
|
||||
<script nonce="{{$.CSPNonce}}">
|
||||
window.addEventListener('error', function(e) {
|
||||
var b = document.getElementById('crashBanner');
|
||||
var d = document.getElementById('crashDetail');
|
||||
if (b && d) {
|
||||
b.style.display = '';
|
||||
d.textContent += (e.filename || '') + ':' + (e.lineno || '') + ' ' + (e.message || e) + '\n';
|
||||
}
|
||||
});
|
||||
window.addEventListener('unhandledrejection', function(e) {
|
||||
var b = document.getElementById('crashBanner');
|
||||
var d = document.getElementById('crashDetail');
|
||||
if (b && d) {
|
||||
b.style.display = '';
|
||||
d.textContent += 'Promise: ' + (e.reason?.message || e.reason || 'unknown') + '\n' + (e.reason?.stack || '') + '\n';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{{/* ── Mount Point ────────────────────────── */}}
|
||||
<div id="notes-mount" style="height:100%;display:flex;">
|
||||
<div style="display:flex;align-items:center;justify-content:center;width:100%;color:var(--text-2,#999);font-size:14px;">
|
||||
Loading...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "css-notes"}}
|
||||
<link rel="stylesheet" href="{{.BasePath}}/css/sw-notes-surface.css?v={{.Version}}">
|
||||
<link rel="stylesheet" href="{{.BasePath}}/branding/custom.css" onerror="this.remove()">
|
||||
{{end}}
|
||||
|
||||
{{define "scripts-notes"}}
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/marked.min.js"></script>
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/purify.min.js"></script>
|
||||
<script nonce="{{$.CSPNonce}}" src="{{$.BasePath}}/vendor/codemirror/codemirror.bundle.js?v={{$.Version}}"></script>
|
||||
<script type="module" nonce="{{$.CSPNonce}}">
|
||||
// v0.37.11: Preact boot — same pattern as chat surface.
|
||||
const { h, render } = await import('{{$.BasePath}}/js/sw/vendor/preact.module.js');
|
||||
const hooksModule = await import('{{$.BasePath}}/js/sw/vendor/hooks.module.js');
|
||||
const { default: htm } = await import('{{$.BasePath}}/js/sw/vendor/htm.module.js');
|
||||
const html = htm.bind(h);
|
||||
window.preact = window.preact || { h, render };
|
||||
window.hooks = window.hooks || hooksModule;
|
||||
window.html = window.html || html;
|
||||
|
||||
const { boot } = await import('{{$.BasePath}}/js/sw/sdk/index.js?v={{$.Version}}');
|
||||
await boot();
|
||||
|
||||
await import('{{$.BasePath}}/js/sw/surfaces/notes/index.js?v={{$.Version}}');
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -1,32 +0,0 @@
|
||||
{{/*
|
||||
Projects surface — v0.37.16: Card grid + detail with inline chat.
|
||||
*/}}
|
||||
|
||||
{{define "surface-projects"}}
|
||||
<div id="projects-mount" style="height:100%;overflow:hidden;"></div>
|
||||
{{end}}
|
||||
|
||||
{{define "css-projects"}}
|
||||
<link rel="stylesheet" href="{{.BasePath}}/css/sw-projects-surface.css?v={{.Version}}">
|
||||
{{end}}
|
||||
|
||||
{{define "scripts-projects"}}
|
||||
<script nonce="{{.CSPNonce}}">
|
||||
window.__PROJECT_ID__ = '{{.Data.ProjectID}}';
|
||||
</script>
|
||||
|
||||
<script type="module" nonce="{{.CSPNonce}}">
|
||||
const { h, render } = await import('{{.BasePath}}/js/sw/vendor/preact.module.js');
|
||||
const hooksModule = await import('{{.BasePath}}/js/sw/vendor/hooks.module.js');
|
||||
const { default: htm } = await import('{{.BasePath}}/js/sw/vendor/htm.module.js');
|
||||
const html = htm.bind(h);
|
||||
window.preact = window.preact || { h, render };
|
||||
window.hooks = window.hooks || hooksModule;
|
||||
window.html = window.html || html;
|
||||
|
||||
const { boot } = await import('{{.BasePath}}/js/sw/sdk/index.js?v={{.Version}}');
|
||||
await boot();
|
||||
|
||||
await import('{{.BasePath}}/js/sw/surfaces/projects/index.js?v={{.Version}}');
|
||||
</script>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user