Feat v0.6.3 dead code sweep (#38)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-sqlite (push) Successful in 2m46s
CI/CD / test-go-pg (push) Successful in 2m47s
CI/CD / build-and-deploy (push) Successful in 26s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #38.
This commit is contained in:
2026-03-31 12:37:47 +00:00
committed by xcaliber
parent a887b4c78b
commit 3d4228f868
130 changed files with 522 additions and 1215 deletions

View File

@@ -243,7 +243,6 @@ describe('init() profile gate', () => {
});
// ── Boot-time 401 redirect suppression ──────
// v0.37.14: Stale cookie blank-login-page fix.
// When the login page boots the SDK with stale localStorage tokens,
// the REST client's 401 handler must NOT redirect to /login (we're
// already there). boot() handles 401 gracefully on its own.

View File

@@ -5,7 +5,6 @@ const path = require('path');
const { createBrowserContext, loadSource, SRC } = require('./helpers');
const vm = require('vm');
// v0.37.10: extensions.js deleted — extension system moves to Preact in v0.37.12.
// Skip all tests if the source file doesn't exist.
const EXTENSIONS_EXISTS = fs.existsSync(path.join(SRC, 'extensions.js'));
const maybeDescribe = EXTENSIONS_EXISTS ? describe : describe.skip;

View File

@@ -5,7 +5,6 @@ const path = require('path');
const { createBrowserContext, loadSource, SRC } = require('./helpers');
const vm = require('vm');
// v0.37.10: extensions.js deleted — extension system moves to Preact in v0.37.12.
// Skip all tests if the source file doesn't exist.
const EXTENSIONS_EXISTS = fs.existsSync(path.join(SRC, 'extensions.js'));
const maybeDescribe = EXTENSIONS_EXISTS ? describe : describe.skip;

View File

@@ -5,7 +5,6 @@
// simulated browser environment so tests run
// against the ACTUAL frontend code.
//
// v0.37.10: Removed loadAppModules (api.js + app.js deleted).
// ==========================================
const fs = require('fs');
@@ -108,7 +107,7 @@ function createBrowserContext(overrides = {}) {
function loadSource(sandbox, filename) {
const filepath = path.join(SRC, filename);
if (!fs.existsSync(filepath)) {
throw new Error(`Source file not found: ${filename} (deleted in v0.37.10?)`);
throw new Error(`Source file not found: ${filename} (deleted?)`);
}
const code = fs.readFileSync(filepath, 'utf-8');
const ctx = vm.createContext(sandbox);
@@ -129,7 +128,6 @@ function readSourceSafe(filename) {
/**
* Extract the model-processing transform from fetchModels (app-state.js).
* This is the core mapping logic that converts API response → App.models.
* v0.22.8: unified persona naming — no more preset aliases.
*/
function processModelsResponse(data, hiddenModels = new Set()) {
return (data.data || data.models || []).map(m => {

View File

@@ -7,13 +7,9 @@
// policy exists but the frontend doesn't
// check it.
//
// v0.22.5: Updated for server-rendered Go templates.
// v0.37.5: Settings surface moved to Preact — legacy SPA tests
// replaced with component source audits.
// v0.37.10: Legacy SPA source audit removed (ui-core.js, app.js,
// pages.js, settings-handlers.js, ui-admin.js all deleted).
// Policy gating now verified via Preact surfaces + admin templates.
// v0.37.12: Admin Go templates deleted (Preact since v0.37.6). Template
// element ID assertions removed — Preact component source audits
// at the bottom of this file cover the same policy keys.
//
@@ -130,10 +126,9 @@ describe('Team member dropdown population', () => {
});
// ── Kernel surface template ──────────────────
// v0.1.0: Chat surface removed. Verify admin mount exists and
// old SPA scaffold is gone.
describe('Kernel surface templates (v0.1.0)', () => {
describe('Kernel surface templates', () => {
const templateSrc = readAllTemplates();
it('admin-mount div exists', () => {
@@ -153,7 +148,6 @@ describe('Kernel surface templates (v0.1.0)', () => {
});
// ── Admin Preact surface ─────────────────────
// v0.37.6: Admin surface handles settings save via Preact.
// Verify the admin surface has policy key handling.
describe('Admin Preact surface handles settings', () => {

View File

@@ -1,11 +1,11 @@
// ==========================================
// Debug Bootstrap (v0.37.18)
// Debug Bootstrap
// ==========================================
// Thin entry point: initializes the debug engine (synchronous,
// captures early errors) then mounts the Preact debug modal
// after Preact globals are available.
//
// Replaces the 673-line imperative debug.js from v0.37.14.
// Replaces the 673-line imperative debug.js.
// Engine: src/js/sw/components/debug/engine.js
// Modal: src/js/sw/components/debug/index.js

View File

@@ -4,7 +4,6 @@
// Bug badge that shows error count. Subscribes to engine
// for reactive updates.
//
// v0.37.18: Preact rebuild from debug.js _updateBadge().
const html = window.html;
const { useEffect } = window.hooks;

View File

@@ -4,7 +4,6 @@
// Filterable console log display with type coloring,
// elapsed timestamps, and auto-scroll.
//
// v0.37.18: Preact rebuild from debug.js _renderConsoleTab().
const html = window.html;
const { useState, useMemo, useRef, useEffect } = window.hooks;

View File

@@ -5,7 +5,6 @@
// Singleton — init() must run before SDK boot to capture early errors.
// UI-agnostic: Preact components subscribe via .subscribe().
//
// v0.37.18: Extracted from debug.js (v0.37.14).
//
// Exports: debugEngine (singleton)

View File

@@ -5,7 +5,6 @@
// Global overlay — not a routed surface.
// Mounts via mountDebugModal(el, engine).
//
// v0.37.18: Preact rebuild of debug modal (CR P2-5).
import { debugEngine } from './engine.js';
import { ConsoleTab } from './console-tab.js';

View File

@@ -4,7 +4,6 @@
// Fetch log with expandable request/response details.
// Newest entries first.
//
// v0.37.18: Preact rebuild from debug.js _renderNetworkTab().
const html = window.html;
const { useState } = window.hooks;

View File

@@ -5,7 +5,6 @@
// command history, and collapsible JSON output.
// Admin-gated OR ?debug=1 URL param.
//
// v0.37.18: Preact rebuild from repl.js (v0.37.14).
const html = window.html;
const { useState, useRef, useEffect, useCallback } = window.hooks;

View File

@@ -3,7 +3,6 @@
// ==========================================
// Displays current application state snapshot as formatted JSON.
//
// v0.37.18: Preact rebuild from debug.js _renderStateTab().
const html = window.html;
const { useMemo } = window.hooks;

View File

@@ -131,13 +131,13 @@ export function createDomains(restClient) {
updateWorkflow: (id, wfId, data) => rc.put(`/api/v1/teams/${id}/workflows/${wfId}`, data),
deleteWorkflow: (id, wfId) => rc.del(`/api/v1/teams/${id}/workflows/${wfId}`),
publishWorkflow: (id, wfId) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/publish`, {}),
// Team workflow stages (v0.37.15 — FE wiring for existing BE routes)
// Team workflow stages
workflowStages: (id, wfId) => rc.get(`/api/v1/teams/${id}/workflows/${wfId}/stages`),
createWorkflowStage: (id, wfId, data) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/stages`, data),
updateWorkflowStage: (id, wfId, sid, data) => rc.put(`/api/v1/teams/${id}/workflows/${wfId}/stages/${sid}`, data),
deleteWorkflowStage: (id, wfId, sid) => rc.del(`/api/v1/teams/${id}/workflows/${wfId}/stages/${sid}`),
reorderWorkflowStages: (id, wfId, ids) => rc.patch(`/api/v1/teams/${id}/workflows/${wfId}/stages/reorder`, { ordered_ids: ids }),
// Adopt global workflows (v0.3.6)
// Adopt global workflows
availableWorkflows: (id) => rc.get(`/api/v1/teams/${id}/workflows/available`),
adoptWorkflow: (id, wfId) => rc.post(`/api/v1/teams/${id}/workflows/${wfId}/adopt`, {}),
},
@@ -239,7 +239,6 @@ export function createDomains(restClient) {
del: (id) => rc.del(`/api/v1/admin/extensions/${id}`),
},
// v0.38.1: Global connections
connections: crud(rc, '/api/v1/admin/connections'),
packages: {
@@ -251,20 +250,18 @@ export function createDomains(restClient) {
del: (id) => rc.del(`/api/v1/admin/packages/${id}`),
settings: (id) => rc.get(`/api/v1/admin/packages/${id}/settings`),
updateSettings: (id, data) => rc.put(`/api/v1/admin/packages/${id}/settings`, data),
dependencies: (id) => rc.get(`/api/v1/admin/packages/${id}/dependencies`), // v0.38.2
consumers: (id) => rc.get(`/api/v1/admin/packages/${id}/consumers`), // v0.38.2
update: (id, file) => rc.upload(`/api/v1/admin/packages/${id}/update`, file), // v0.5.4
exportPkg: (id) => `/api/v1/admin/packages/${id}/export`, // v0.5.4 (URL for window.open)
dependencies: (id) => rc.get(`/api/v1/admin/packages/${id}/dependencies`),
consumers: (id) => rc.get(`/api/v1/admin/packages/${id}/consumers`),
update: (id, file) => rc.upload(`/api/v1/admin/packages/${id}/update`, file),
exportPkg: (id) => `/api/v1/admin/packages/${id}/export`,
registry: () => rc.get('/api/v1/admin/packages/registry'),
registryInstall: (url) => rc.post('/api/v1/admin/packages/registry/install', { url }),
// v0.5.0: Extension permissions
registryInstall: (url) => rc.post('/api/v1/admin/packages/registry/install', { download_url: url }),
permissions: (id) => rc.get(`/api/v1/admin/extensions/${id}/permissions`),
grantPerm: (id, perm) => rc.post(`/api/v1/admin/extensions/${id}/permissions/${perm}/grant`, {}),
revokePerm: (id, perm) => rc.post(`/api/v1/admin/extensions/${id}/permissions/${perm}/revoke`, {}),
grantAllPerms: (id) => rc.post(`/api/v1/admin/extensions/${id}/permissions/grant-all`, {}),
},
// v0.38.2: Full dependency graph
dependencies: {
list: () => rc.get('/api/v1/admin/dependencies'),
},
@@ -278,7 +275,6 @@ export function createDomains(restClient) {
del: (id) => rc.del(`/api/v1/admin/surfaces/${id}`),
},
// v0.6.1: Backup/Restore
backup: {
create: (opts) => rc.post('/api/v1/admin/backup' + _qs(opts)),
list: () => rc.get('/api/v1/admin/backups'),

View File

@@ -27,7 +27,6 @@ export function createCan(authRef) {
/**
* Is the current user a platform admin?
* v0.2.0: Uses RBAC grant instead of legacy role field.
* @returns {boolean}
*/
function isAdmin() {

View File

@@ -104,7 +104,7 @@ export async function boot() {
sw.slots = slots;
sw.actions = actions;
// Realtime — room-scoped pub/sub over WebSocket (v0.5.0)
// Realtime — room-scoped pub/sub over WebSocket
sw.realtime = realtime;
// Shell helpers — imperative confirm/prompt backed by primitives

View File

@@ -1,7 +1,7 @@
/**
* SurfaceViewport — container where the active surface renders
*
* Deliberately thin for v0.37.4. Error boundaries and
* Deliberately thin. Error boundaries and
* surface transitions will be added in later versions.
*/
const { html } = window;

View File

@@ -1,6 +1,5 @@
/**
* Admin > Connections — global extension connection CRUD
* v0.38.1: Scoped credential management for extensions
*/
const { html } = window;
const { useState, useEffect, useCallback } = hooks;

View File

@@ -4,7 +4,7 @@
* Reads globals:
* __SECTION__ — active section name (string)
* __BASE__ — base path
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
* __CONFIG_SECTIONS__
*
* Layout: topbar (back + category tabs) + body (sidebar nav + content area).
* All 24+ sections are native Preact components loaded lazily.
@@ -34,7 +34,7 @@ const ADMIN_LABELS = {
audit: 'Audit',
};
// ── v0.38.3: Extension config sections ──────
// ── Extension config sections ──────
// Packages declare config_section in their manifest targeting "admin".
// We merge them into the appropriate category and section module map.
const _configSections = window.__CONFIG_SECTIONS__ || [];
@@ -72,7 +72,6 @@ const sectionModules = {
audit: () => import(`./audit.js${_v}`),
};
// v0.38.3: Register dynamic section loaders for extension config sections
for (const cs of _configSections) {
const pkgId = cs.package_id;
const component = cs.component || 'js/config.js';

View File

@@ -46,7 +46,7 @@ export default function PackagesSection() {
const [registryPkgs, setRegistryPkgs] = useState([]);
const [registryLoading, setRegistryLoading] = useState(false);
const [installing, setInstalling] = useState(false);
const [permsId, setPermsId] = useState(null); // v0.5.0: permissions drawer
const [permsId, setPermsId] = useState(null);
const [perms, setPerms] = useState([]);
const BASE = window.__BASE__ || '';
@@ -162,7 +162,7 @@ export default function PackagesSection() {
} catch (e) { sw.toast(e.message, 'error'); }
}
// ── Permissions drawer (v0.5.0) ────────────
// ── Permissions drawer ────────────
async function togglePerms(pkgId) {
if (permsId === pkgId) { setPermsId(null); setPerms([]); return; }
try {
@@ -323,7 +323,7 @@ export default function PackagesSection() {
</div>
`}
${/* ── Inline permissions drawer (v0.5.0) ── */``}
${/* ── Inline permissions drawer ── */``}
${permsId === pkg.id && html`
<div style="padding:8px 12px 12px 24px;background:var(--bg-2);border-bottom:1px solid var(--border);">
${perms.length === 0

View File

@@ -36,6 +36,7 @@ export default function SettingsSection() {
message_variant: cfg_.message?.variant || 'info',
footer_enabled: !!cfg_.footer?.enabled,
footer_text: cfg_.footer?.text || '',
package_registry_url: cfg_.package_registry?.url || '',
});
setVault(v);
} catch (e) { sw.toast(e.message, 'error'); }
@@ -78,6 +79,9 @@ export default function SettingsSection() {
text: cfg.footer_text,
}});
// Package Registry
await sw.api.admin.settings.update('package_registry', { value: { url: cfg.package_registry_url } });
sw.toast('Settings saved', 'success');
} catch (e) { sw.toast(e.message, 'error'); }
finally { setSaving(false); }
@@ -166,6 +170,13 @@ export default function SettingsSection() {
}
</div>
<div class="settings-section"><h3>Package Registry</h3>
<div class="form-group"><label>Registry URL</label>
<input value=${cfg.package_registry_url} onInput=${e => set('package_registry_url', e.target.value)} placeholder="https://registry.example.com/registry.json" />
</div>
<span class="text-muted" style="font-size:12px;">URL to a JSON registry index. Enables browsing and one-click install under Packages > Registry.</span>
</div>
<div class="settings-section"><h3>Email</h3>
<button class="btn-small" onClick=${testEmail}>Send Test Email</button>
</div>

View File

@@ -1,5 +1,5 @@
/**
* DocsSurface — builtin documentation viewer (v0.6.2)
* DocsSurface — builtin documentation viewer
*
* Reads globals:
* __SECTION__ — active doc slug (e.g. "GETTING-STARTED")
@@ -8,7 +8,6 @@
* Fetches markdown from GET /api/v1/docs/:name, renders with
* a simple markdown-to-HTML converter. Sidebar lists all docs.
*
* v0.6.2: dark mode fix, topbar navigation, error handling.
*/
const { html } = window;
const { useState, useEffect, useCallback, useMemo } = hooks;

View File

@@ -1,6 +1,5 @@
/**
* ConnectionsSection — personal extension connection CRUD
* v0.38.1: Scoped credential management for extensions
*/
const { html } = window;
const { useState, useEffect, useCallback } = hooks;

View File

@@ -4,7 +4,7 @@
* Reads globals:
* __SECTION__ — active section name (string)
* __BASE__ — base path
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
* __CONFIG_SECTIONS__
*
* Layout: topbar + left nav + content area (same CSS classes as before).
* All sections are native Preact components loaded lazily.
@@ -44,7 +44,7 @@ const SECTION_TITLES = {
connections: 'Connections', notifications: 'Notifications',
};
// ── v0.38.3: Extension config sections ──────
// ── Extension config sections ──────
// Packages declare config_section in their manifest. The backend passes
// matching entries via __CONFIG_SECTIONS__. We merge them into the nav
// and section module map for lazy loading.

View File

@@ -1,6 +1,5 @@
/**
* Team Admin > Connections — team-scoped extension connection CRUD
* v0.38.1: Scoped credential management for extensions
*/
const { html } = window;
const { useState, useEffect, useCallback } = hooks;

View File

@@ -4,7 +4,7 @@
* Reads globals:
* __SECTION__ — active section name (string)
* __BASE__ — base path
* __CONFIG_SECTIONS__ — v0.38.3: extension config sections (array|null)
* __CONFIG_SECTIONS__
*
* Layout: topbar (back + team name) + sidebar nav + content area.
* All 10+ sections are native Preact components loaded lazily.
@@ -36,7 +36,7 @@ const sectionModules = {
activity: () => import('./activity.js'),
};
// ── v0.38.3: Extension config sections ──────
// ── Extension config sections ──────
const _configSections = window.__CONFIG_SECTIONS__ || [];
const _base = window.__BASE__ || '';
for (const cs of _configSections) {

View File

@@ -1,6 +1,5 @@
/**
* Team Admin > Members
* v0.3.4: custom team roles support
*/
const { html } = window;
const { useState, useEffect, useCallback } = hooks;

View File

@@ -1,5 +1,5 @@
/**
* Team Admin > Workflows — v0.37.15 rewrite
* Team Admin > Workflows
*
* Tab layout: Workflows | Assignments | Monitor
* - Workflows: CRUD + inline stage editor (E2)
@@ -365,7 +365,6 @@ function StageForm({ stage, teams, onSave, onCancel }) {
stage?.branch_rules ? (typeof stage.branch_rules === 'string' ? stage.branch_rules : JSON.stringify(stage.branch_rules, null, 2)) : ''
);
// v0.3.4: stage_config fields
const sc = stage?.stage_config ? (typeof stage.stage_config === 'string' ? JSON.parse(stage.stage_config || '{}') : stage.stage_config) : {};
const [requiredRole, setRequiredRole] = useState(sc.required_role || '');
const [valApprovals, setValApprovals] = useState(sc.validation?.required_approvals || '');
@@ -664,7 +663,7 @@ function MonitorTab({ teamId }) {
`;
}
// ── Signoff Panel (v0.3.4) ──────────────────
// ── Signoff Panel ──────────────────
function SignoffPanel({ instanceId, teamId }) {
const [signoffs, setSignoffs] = useState([]);