Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: classify every data/ directory so Data Manager's biggest rows are actionable (#3285)
[._.]/ Adam Eivy786ca28ed1e9
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex ad74bb1d2e..e69e548c70 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -108,3 +108,7 @@## Review Hub- **[issue-3282] Queue cards now preview their body in three lines instead of printing it whole** — Every card rendered its full untruncated body, so a queue of 59 pending items ran roughly 56 screenfuls on desktop and 197 on a phone, and one error card alone printed a URL, a full browser user-agent string and a stack trace inline. Card bodies are now a fixed three-line plain-text preview with a per-card "Show more" that expands the full formatted text in place, titles clamp to two lines so the queue scans as a uniform list, and Accept/Reject/Complete/Dismiss/Delete stay on the collapsed card so a decision never requires expanding. Long agent-authored bodies also no longer inject their own headings into the page's outline.++## Data Manager++- **[issue-3285] Every directory on the Data Manager now says what it holds and whether it is safe to remove.** Seven of the thirteen biggest rows — including the single largest one — were labelled "Unknown category", and because an unrecognised directory also fell back to "not archivable, not deletable", the cleanup page silently refused to act on the very things filling the disk. All ~65 directories PortOS creates under `data/` are now classified with a real description and honest archive/purge flags: LoRA training checkpoints and the managed Python virtualenv are purgeable and say what survives, while generated sprite art, training datasets and 3D meshes are explicitly protected as the only copy. A directory that genuinely has no classification now reads "Not classified — PortOS does not know if this is safe to remove" and explains that Archive and Purge are being withheld on purpose, and a new test fails the build if a future data directory ships without an entry.diff --git a/client/src/pages/DataManager.jsx b/client/src/pages/DataManager.jsxindex a6b5d6ffbf..5e8bef6256 100644--- a/client/src/pages/DataManager.jsx+++ b/client/src/pages/DataManager.jsx@@ -128,6 +128,11 @@ function SizeBar({ size, maxSize }) {}function CategoryRow({ cat, maxSize, onExpand, expanded, detail, onArchive, onPurge, onConfirmPurge, onCancelPurge, confirmingPurge, archiving, purging }) {+ // Directories with no CATEGORIES entry come back with `classified: false` and+ // no Archive/Purge flags. Say why the buttons are missing in outcome terms so+ // the row reads as a deliberate safety stance, not a broken row (#3285).+ // Older servers omit `classified`; treat only an explicit false as unknown.+ const unclassified = cat.classified === false;return (<div className="border border-port-border rounded-lg overflow-hidden"><button@@ -138,7 +143,7 @@ function CategoryRow({ cat, maxSize, onExpand, expanded, detail, onArchive, onPu<div className="flex-1 min-w-0"><div className="flex items-center gap-2"><span className="text-sm font-medium text-white">{cat.label}</span>- <span className="text-xs text-gray-500">{cat.description}</span>+ <span className={`text-xs ${unclassified ? 'text-port-warning' : 'text-gray-500'}`}>{cat.description}</span></div><div className="mt-1"><SizeBar size={cat.size} maxSize={maxSize} />@@ -186,7 +191,11 @@ function CategoryRow({ cat, maxSize, onExpand, expanded, detail, onArchive, onPu</button>)}{!cat.archivable && !cat.deletable && (- <span className="text-xs text-gray-500">This category is protected and cannot be archived or deleted</span>+ <span className="text-xs text-gray-500">+ {unclassified+ ? 'PortOS has no classification for this directory, so it withholds Archive and Purge rather than risk deleting something irreplaceable. Inspect the contents below and remove it from a terminal if you know it is safe.'+ : 'This category is protected and cannot be archived or deleted'}+ </span>)}</div>)}diff --git a/client/src/pages/DataManager.test.jsx b/client/src/pages/DataManager.test.jsxnew file mode 100644index 0000000000..22aa79c0d2--- /dev/null+++ b/client/src/pages/DataManager.test.jsx@@ -0,0 +1,64 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';+import { render, screen, waitFor, fireEvent } from '@testing-library/react';+import DataManager from './DataManager';++// A directory with no server-side CATEGORIES entry comes back `classified: false`+// with both permission flags off. The row must explain *why* Archive/Purge are+// missing instead of leaving a dead end on the cleanup page (#3285).+const getDataOverview = vi.fn();+const getDataCategory = vi.fn();++vi.mock('../services/api', () => ({+ getDataOverview: (...a) => getDataOverview(...a),+ getDataBackups: vi.fn(() => Promise.resolve([])),+ getDataCategory: (...a) => getDataCategory(...a),+ archiveDataCategory: vi.fn(),+ purgeDataCategory: vi.fn(),+ deleteDataBackup: vi.fn(),+ getTombstoneSweepStatus: vi.fn(() => Promise.resolve({ refused: [] })),+ sweepTombstonesNow: vi.fn(),+}));++vi.mock('../services/socket', () => ({ default: { on: vi.fn(), off: vi.fn() } }));++const UNKNOWN_DESCRIPTION = "Not classified — PortOS doesn't know if this is safe to remove";++const expandRow = (label) => {+ const toggle = screen.getAllByText(label).map((el) => el.closest('button')).find(Boolean);+ fireEvent.click(toggle);+};++const overview = {+ totalSize: 3000,+ dataDir: 'data',+ categories: [+ { key: 'mystery-dir', path: 'data/mystery-dir', label: 'mystery-dir', description: UNKNOWN_DESCRIPTION, archivable: false, deletable: false, classified: false, size: 2000, fileCount: 12 },+ { key: 'prompts', path: 'data/prompts', label: 'Prompts', description: 'AI prompt templates', archivable: false, deletable: false, classified: true, size: 1000, fileCount: 4 },+ ],+};++describe('DataManager unclassified rows (#3285)', () => {+ beforeEach(() => {+ getDataOverview.mockReset().mockResolvedValue(overview);+ getDataCategory.mockReset().mockResolvedValue({ key: 'mystery-dir', items: [] });+ });++ it('renders the outcome-phrased description for an unclassified directory', async () => {+ render(<DataManager />);+ await waitFor(() => expect(screen.getByText(UNKNOWN_DESCRIPTION)).toBeInTheDocument());+ });++ it('explains the withheld actions on expand, and keeps the protected wording for known categories', async () => {+ render(<DataManager />);+ await waitFor(() => expect(screen.getByText(UNKNOWN_DESCRIPTION)).toBeInTheDocument());++ // The label also appears in the "Largest" stat tile — expand via the row's+ // own toggle button, not the first text match.+ expandRow('mystery-dir');+ await waitFor(() => expect(screen.getByText(/withholds Archive and Purge/)).toBeInTheDocument());+ expect(screen.queryByRole('button', { name: /Archive|Purge/ })).not.toBeInTheDocument();++ expandRow('Prompts');+ await waitFor(() => expect(screen.getByText(/This category is protected/)).toBeInTheDocument());+ });+});diff --git a/server/services/dataManager.categories.test.js b/server/services/dataManager.categories.test.jsnew file mode 100644index 0000000000..81381cc5ba--- /dev/null+++ b/server/services/dataManager.categories.test.js@@ -0,0 +1,105 @@+/**+ * Coverage guard for the Data Manager's CATEGORIES map (issue #3285).+ *+ * An unclassified `data/` directory doesn't merely render as "Unknown category"+ * — `categoryMeta()` also falls back to `archivable: false, deletable: false`,+ * so the row loses its Archive/Purge affordances entirely. That is how the+ * single largest directory on disk ended up being the one thing the cleanup+ * page refused to act on.+ *+ * This test enumerates the top-level `data/` directories the codebase can+ * create and fails when one of them has no CATEGORIES entry. Discovery is+ * derived, never hand-maintained, so a new data dir can't regress silently:+ *+ * 1. `PATHS` in lib/fileUtils.js — every value under `PATHS.data`.+ * 2. `DEFAULT_EXCLUDES` in services/backup.js — anchored rsync filter paths.+ * 3. Source scan of server/ + scripts/ for the two ways a data dir is spelled+ * outside PATHS: `join(PATHS.data, 'name')` and `join(root, 'data', 'name')`.+ * 4. `data.reference/` — dirs seeded into `data/` on first install.+ */++import { describe, it, expect } from 'vitest';+import { readdirSync, readFileSync } from 'fs';+import { join, relative, sep } from 'path';+import { PATHS } from '../lib/fileUtils.js';+import { DEFAULT_EXCLUDES } from './backup.js';+import { CATEGORIES, UNKNOWN_CATEGORY_DESCRIPTION } from './dataManager.js';++// A path segment that is a file, not a directory (`settings.json`, `TASKS.md`).+const isFileSegment = (segment) => segment.includes('.');++// `join(PATHS.data, 'name')` / `` `${PATHS.data}/name` `` / `join(x, 'data', 'name')`+const DATA_DIR_PATTERNS = [+ /PATHS\.data,\s*'([a-z0-9._-]+)'/g,+ /\$\{PATHS\.data\}\/([a-z0-9._-]+)/g,+ /,\s*'data',\s*'([a-z0-9._-]+)'/g+];++function walkJsFiles(dir, out = []) {+ for (const entry of readdirSync(dir, { withFileTypes: true })) {+ if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue;+ const full = join(dir, entry.name);+ if (entry.isDirectory()) walkJsFiles(full, out);+ else if (entry.name.endsWith('.js') && !entry.name.includes('.test.')) out.push(full);+ }+ return out;+}++/** @returns {Map<string, string>} data dir name → where it was discovered */+function discoverDataDirs() {+ const found = new Map();+ const add = (name, source) => {+ if (!name || isFileSegment(name) || found.has(name)) return;+ found.set(name, source);+ };++ const dataRoot = PATHS.data + sep;+ for (const [key, value] of Object.entries(PATHS)) {+ if (typeof value !== 'string' || !value.startsWith(dataRoot)) continue;+ add(value.slice(dataRoot.length).split(sep)[0], `PATHS.${key}`);+ }++ for (const { path } of DEFAULT_EXCLUDES) {+ add(path.replace(/^\//, '').split('/')[0], 'backup.js DEFAULT_EXCLUDES');+ }++ for (const dir of ['server', 'scripts']) {+ for (const file of walkJsFiles(join(PATHS.root, dir))) {+ const source = readFileSync(file, 'utf8');+ for (const pattern of DATA_DIR_PATTERNS) {+ for (const match of source.matchAll(pattern)) {+ add(match[1], relative(PATHS.root, file));+ }+ }+ }+ }++ for (const entry of readdirSync(join(PATHS.root, 'data.reference'), { withFileTypes: true })) {+ if (entry.isDirectory()) add(entry.name, 'data.reference/');+ }++ return found;+}++describe('dataManager CATEGORIES coverage (#3285)', () => {+ it('classifies every top-level data/ directory the codebase can create', () => {+ const discovered = discoverDataDirs();+ expect(discovered.size).toBeGreaterThan(20); // discovery itself must not silently break++ const unclassified = [...discovered]+ .filter(([name]) => !CATEGORIES[name])+ .map(([name, source]) => `${name} (from ${source})`);++ expect(unclassified, 'Add a CATEGORIES entry in server/services/dataManager.js for each of these').toEqual([]);+ });++ it('gives every category a label, a description, and explicit permission flags', () => {+ for (const [key, meta] of Object.entries(CATEGORIES)) {+ expect(meta.label, `${key} label`).toBeTruthy();+ expect(meta.description, `${key} description`).toBeTruthy();+ expect(meta.description, `${key} description`).not.toBe(UNKNOWN_CATEGORY_DESCRIPTION);+ expect(typeof meta.archivable, `${key} archivable`).toBe('boolean');+ expect(typeof meta.deletable, `${key} deletable`).toBe('boolean');+ }+ });+});diff --git a/server/services/dataManager.js b/server/services/dataManager.jsindex a4c958d218..e34e9ac68a 100644--- a/server/services/dataManager.js+++ b/server/services/dataManager.js@@ -8,32 +8,106 @@ import { PATHS, ensureDir } from '../lib/fileUtils.js';const execFileAsync = promisify(execFile);const DATA_DIR = PATHS.data;-const CATEGORIES = {- 'browser-profile': { label: 'Browser Profile', description: 'Chrome/Chromium browser data', archivable: false, deletable: true },- 'repos': { label: 'Cloned Repos', description: 'Git repositories cloned by agents', archivable: false, deletable: true },- 'health': { label: 'Apple Health', description: 'Daily health JSON snapshots', archivable: true, deletable: false },- 'meatspace': { label: 'MeatSpace', description: 'Body metrics, blood tests, eyes', archivable: true, deletable: false },+// Every top-level directory PortOS can create under `data/` needs an entry here.+// A missing entry doesn't just show "Unknown category" on the Data Manager — it+// also strips the Archive/Purge affordances, so the biggest thing on a cleanup+// page becomes the one thing the cleanup page refuses to act on (issue #3285).+// `dataManager.categories.test.js` enumerates the directories the codebase can+// emit and fails when one of them is unclassified.+//+// Flag semantics — be conservative, the user cannot undo a purge:+// archivable — worth tarring into `data/backup/`. False for large binary trees+// (the tarball lands *inside* data/, so archiving them grows the very number+// the user came here to shrink) and for anything holding secrets.+// deletable — the bytes are genuinely reproducible (caches, ephemeral working+// dirs, re-downloadable assets) or are already duplicated elsewhere. False+// whenever purging would destroy the only copy of generated or uploaded work.+export const CATEGORIES = {+ 'agents': { label: 'Agents', description: 'Agent personality data', archivable: false, deletable: false },+ 'ask-conversations': { label: 'Ask Conversations', description: 'Saved Ask chat transcripts', archivable: true, deletable: false },+ 'audio': { label: 'Audio', description: 'Rendered voice-over lines referenced by pipeline issues', archivable: true, deletable: false },'autofixer': { label: 'Autofixer', description: 'Autofixer run data', archivable: true, deletable: true },- 'db-dumps': { label: 'DB Dumps', description: 'PostgreSQL database backups', archivable: true, deletable: true },- 'screenshots': { label: 'Screenshots', description: 'Task-related screenshots', archivable: true, deletable: true },+ 'avatar': { label: 'Avatar', description: 'Uploaded avatar images', archivable: true, deletable: false },+ 'backup': { label: 'Backups', description: 'Data backup archives', archivable: false, deletable: true },+ 'brain': { label: 'Brain', description: 'Brain items and sync log', archivable: true, deletable: false },+ 'browser-downloads': { label: 'Browser Downloads', description: 'Files the agent browser downloaded — re-downloadable, safe to purge', archivable: false, deletable: true },+ 'browser-profile': { label: 'Browser Profile', description: 'Chrome/Chromium browser data', archivable: false, deletable: true },+ 'calendar': { label: 'Calendar', description: 'Calendar sync data', archivable: true, deletable: false },+ 'certs': { label: 'TLS Certificates', description: 'HTTPS certificate and private key — purging drops the install back to HTTP', archivable: false, deletable: false },+ 'conflict-journal': { label: 'Conflict Journal', description: 'Peer-sync conflict history — diagnostics only, safe to purge', archivable: true, deletable: true },'cos': { label: 'Chief of Staff', description: 'Agent data, reports, memories', archivable: true, deletable: false },- 'runs': { label: 'AI Runs', description: 'Agent run logs and outputs', archivable: true, deletable: true },+ 'creative': { label: 'Creative Ledger', description: 'Append-only ledger of creative generation runs', archivable: true, deletable: false },+ 'creative-commissions': { label: 'Creative Commissions', description: 'Commission records (file mirror of the Postgres store)', archivable: true, deletable: false },+ 'db-dumps': { label: 'DB Dumps', description: 'PostgreSQL database backups', archivable: true, deletable: true },+ 'digital-twin': { label: 'Digital Twin', description: 'Identity, goals, character data', archivable: true, deletable: false },+ 'games': { label: 'Games', description: 'Game project records and assets', archivable: true, deletable: false },+ 'health': { label: 'Apple Health', description: 'Daily health JSON snapshots', archivable: true, deletable: false },+ 'image-clean-tmp': { label: 'Image Cleaner Scratch', description: 'Ephemeral working files for Image Cleaner renders — swept automatically, safe to purge', archivable: false, deletable: true },+ 'image-refs': { label: 'Image References', description: 'Reference images uploaded for multi-reference edits — still served to existing renders', archivable: true, deletable: false },+ 'image-to-3d': { label: 'Image to 3D', description: 'Generated GLB meshes — the only copy; records live in Postgres', archivable: false, deletable: false },'images': { label: 'Images', description: 'Uploaded and generated images', archivable: true, deletable: true },- 'videos': { label: 'Videos', description: 'Locally generated videos', archivable: true, deletable: true },- 'video-thumbnails': { label: 'Video Thumbnails', description: 'JPEG thumbnails for generated videos', archivable: false, deletable: true },+ 'insights': { label: 'Insights', description: 'Derived goal scorecards and insights — rebuilt on the next insights run', archivable: true, deletable: true },+ 'jira-reports': { label: 'Jira Reports', description: 'Generated Jira reports — regenerable from Jira', archivable: true, deletable: true },+ 'loops': { label: 'Loops', description: 'Output history from scheduled loop runs', archivable: true, deletable: false },+ 'lora-datasets': { label: 'LoRA Datasets', description: 'Training images and captions for LoRA runs — uploaded source material, not regenerable', archivable: false, deletable: false },'loras': { label: 'LoRAs', description: 'LoRA adapter files for image generation', archivable: false, deletable: true },- 'calendar': { label: 'Calendar', description: 'Calendar sync data', archivable: true, deletable: false },- 'digital-twin': { label: 'Digital Twin', description: 'Identity, goals, character data', archivable: true, deletable: false },+ 'meatspace': { label: 'MeatSpace', description: 'Body metrics, blood tests, eyes', archivable: true, deletable: false },+ 'media-collections': { label: 'Media Collections', description: 'Media collection records', archivable: true, deletable: false },+ 'media-sketches': { label: 'Media Sketches', description: 'Saved sketch canvases used as render inputs', archivable: true, deletable: false },'messages': { label: 'Messages', description: 'Email and messaging data', archivable: true, deletable: true },+ 'model-personality': { label: 'Model Personality', description: 'Model personality probe results and settings', archivable: true, deletable: false },+ 'music': { label: 'Music', description: 'Uploaded and generated background tracks', archivable: true, deletable: false },+ 'openclaw': { label: 'OpenClaw', description: 'OpenClaw integration config', archivable: true, deletable: false },+ 'pipeline-comparative-rank': { label: 'Comparative Rank', description: 'Cached comparative issue rankings — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-editorial': { label: 'Editorial Analysis', description: 'Cached editorial analyses — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-editorial-health': { label: 'Editorial Health', description: 'Cached editorial health scores — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-foundation-judge': { label: 'Foundation Judge', description: 'Cached foundation-judge verdicts — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-issues': { label: 'Pipeline Issues (legacy)', description: 'Pre-Postgres issue files kept as the recovery source until the migration is confirmed', archivable: true, deletable: false },+ 'pipeline-judge': { label: 'Pipeline Judge', description: 'Cached pipeline-judge verdicts — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-pov-rewrites': { label: 'POV Rewrites', description: 'Cached perspective rewrites — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-reader-panel': { label: 'Reader Panel', description: 'Cached reader-panel reactions — re-running them costs LLM calls', archivable: true, deletable: false },+ 'pipeline-series': { label: 'Pipeline Series (legacy)', description: 'Pre-Postgres series files kept as the recovery source until the migration is confirmed', archivable: true, deletable: false },+ 'pipeline-series-review': { label: 'Series Review', description: 'Cached series reviews — re-running them costs LLM calls', archivable: true, deletable: false },+ 'privacy': { label: 'Privacy', description: 'Data-broker opt-out records and request history', archivable: true, deletable: false },'prompts': { label: 'Prompts', description: 'AI prompt templates', archivable: false, deletable: false },- 'brain': { label: 'Brain', description: 'Brain items and sync log', archivable: true, deletable: false },- 'agents': { label: 'Agents', description: 'Agent personality data', archivable: false, deletable: false },+ 'python': { label: 'Python Runtime', description: 'Managed virtualenv for local ML tooling — rebuilt on the next Python-backed run (re-downloads several GB of wheels)', archivable: false, deletable: true },+ 'repos': { label: 'Cloned Repos', description: 'Git repositories cloned by agents', archivable: false, deletable: true },'review': { label: 'Review', description: 'Review hub items', archivable: true, deletable: true },+ 'runs': { label: 'AI Runs', description: 'Agent run logs and outputs', archivable: true, deletable: true },+ 'screenshots': { label: 'Screenshots', description: 'Task-related screenshots', archivable: true, deletable: true },+ 'settings': { label: 'Settings', description: 'Per-feature settings files', archivable: true, deletable: false },+ 'sharing': { label: 'Peer Sync State', description: 'Peer-sync bookkeeping — purging forces a full resync and can resurrect deleted records', archivable: true, deletable: false },+ 'sprites': { label: 'Sprites', description: 'Sprite reference art, walk frames, and runtime atlases — the only copy of the generated art; records live in Postgres', archivable: false, deletable: false },+ 'story-builder': { label: 'Story Builder', description: 'Story Builder project records', archivable: true, deletable: false },+ 'telegram': { label: 'Telegram', description: 'Telegram bot data', archivable: true, deletable: true },+ 'templates': { label: 'Visual Templates', description: 'Shipped layout assets used as render anchors', archivable: false, deletable: false },'tools': { label: 'Tools', description: 'Tool execution data', archivable: true, deletable: true },- 'backup': { label: 'Backups', description: 'Data backup archives', archivable: false, deletable: true },- 'telegram': { label: 'Telegram', description: 'Telegram bot data', archivable: true, deletable: true }+ 'training-runs': { label: 'LoRA Training Runs', description: 'Training checkpoints, caches, and sample previews — the finished adapters live in LoRAs and survive a purge; run history in Postgres will point at missing artifacts', archivable: false, deletable: true },+ 'universes': { label: 'Universes', description: 'Universe Builder records — bibles, canon, and style references', archivable: true, deletable: false },+ 'update-detached': { label: 'Update Control', description: 'Control files for a detached self-update run — safe to purge when no update is running', archivable: false, deletable: true },+ 'uploads': { label: 'Uploads', description: 'Files uploaded through the UI and referenced by records', archivable: true, deletable: false },+ 'video-thumbnails': { label: 'Video Thumbnails', description: 'JPEG thumbnails for generated videos', archivable: false, deletable: true },+ 'videos': { label: 'Videos', description: 'Locally generated videos', archivable: true, deletable: true },+ 'writers-room': { label: 'Writers Room', description: 'Writers Room works and story bibles', archivable: true, deletable: false }};+// Shown for a directory with no CATEGORIES entry. Phrased as an outcome ("we+// don't know whether removing this is safe") rather than a mechanism ("unknown+// category") so the absent Archive/Purge buttons read as a deliberate safety+// stance instead of a broken row.+export const UNKNOWN_CATEGORY_DESCRIPTION = "Not classified — PortOS doesn't know if this is safe to remove";++/**+ * Resolve the display/permission metadata for a `data/` directory name.+ * Adds `classified: false` for the unknown fallback so the client can style+ * the row as "deliberately unactionable" instead of guessing from the copy.+ */+function categoryMeta(name) {+ const known = CATEGORIES[name];+ if (known) return { ...known, classified: true };+ return { label: name, description: UNKNOWN_CATEGORY_DESCRIPTION, archivable: false, deletable: false, classified: false };+}+// Validate category key contains only safe charactersconst SAFE_NAME = /^[a-z0-9_-]+$/;@@ -63,7 +137,7 @@ export async function getDataOverview() {]);const categories = dirs.map((d, i) => {- const meta = CATEGORIES[d.name] || { label: d.name, description: 'Unknown category', archivable: false, deletable: false };+ const meta = categoryMeta(d.name);return {key: d.name,path: `data/${d.name}`,@@ -108,7 +182,7 @@ export async function getCategoryDetail(categoryKey) {items.sort((a, b) => b.size - a.size);const totalSize = items.reduce((sum, item) => sum + item.size, 0);- const meta = CATEGORIES[categoryKey] || { label: categoryKey, archivable: false, deletable: false };+ const meta = categoryMeta(categoryKey);return { key: categoryKey, ...meta, totalSize, items };}