+ >
+ );
+}
diff --git a/apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts b/apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts
index b4bf02c410..5a9ec54043 100644
--- a/apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts
+++ b/apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts
@@ -70,6 +70,8 @@ test.describe("Mobile storage maintenance", () => {
await settingsMenu.getByRole("link", { name: "Storage" }).click();
await expect(testPage.getByTestId("storage-settings-page")).toBeVisible();
+ await expect(testPage.getByTestId("storage-disk-capacity-card")).toBeVisible();
+ await expect(testPage.getByRole("progressbar")).toBeVisible();
await testPage
.getByRole("button", { name: "More information about Scheduled maintenance" })
.click();
@@ -117,6 +119,13 @@ test.describe("Mobile storage maintenance", () => {
await expect(testPage.getByText("Go build cache adopted")).toBeVisible();
await testPage.reload();
await expect(testPage.getByTestId("storage-go-cache-adopt-path")).toHaveValue(externalGoCache);
+ await expect(testPage.getByTestId("storage-dependency-allowlist")).toContainText(".yarn/cache");
+ await testPage
+ .getByRole("button", { name: "More information about Folders Kandev will check" })
+ .tap();
+ await expect(testPage.getByRole("tooltip")).toContainText("recursively");
+ await testPage.reload();
+ await expect(testPage.getByTestId("storage-settings-page")).toBeVisible();
await testPage.getByRole("button", { name: "More information about Quarantine" }).click();
await expect(testPage.getByRole("tooltip")).toContainText("recoverable holding area");
await expect
diff --git a/apps/web/e2e/tests/system/storage-maintenance.spec.ts b/apps/web/e2e/tests/system/storage-maintenance.spec.ts
index 79d5fc78af..9bd8cce902 100644
--- a/apps/web/e2e/tests/system/storage-maintenance.spec.ts
+++ b/apps/web/e2e/tests/system/storage-maintenance.spec.ts
@@ -141,6 +141,11 @@ test.describe("System storage maintenance", () => {
await expect(testPage.getByTestId("storage-policy-card")).toBeVisible();
await expect(testPage.getByTestId("storage-run-history")).toBeVisible();
await expect(testPage.getByTestId("storage-quarantine-card")).toBeVisible();
+ await expect(testPage.getByTestId("storage-disk-capacity-card")).toBeVisible();
+ await expect(testPage.getByRole("progressbar")).toBeVisible();
+ await expect(testPage.getByTestId("storage-dependency-allowlist")).toContainText(
+ "node_modules",
+ );
await expect(testPage.getByTestId("storage-overview-spinner")).toBeVisible();
await expect(testPage.getByTestId("storage-analysis-total")).toHaveCount(0);
await expect(testPage.getByTestId("toast-message")).toHaveCount(0);
diff --git a/apps/web/hooks/domains/system/use-storage-maintenance.test.tsx b/apps/web/hooks/domains/system/use-storage-maintenance.test.tsx
index 66c8d15e9a..8f76c363c4 100644
--- a/apps/web/hooks/domains/system/use-storage-maintenance.test.tsx
+++ b/apps/web/hooks/domains/system/use-storage-maintenance.test.tsx
@@ -16,6 +16,7 @@ const mocks = vi.hoisted(() => ({
purge: vi.fn(),
fetchJob: vi.fn(),
fetchOverview: vi.fn(),
+ fetchDisk: vi.fn(),
fetchPolicy: vi.fn(),
fetchQuarantine: vi.fn(),
fetchRuns: vi.fn(),
@@ -36,6 +37,7 @@ vi.mock("@/lib/api/domains/system-api", () => ({
purgeStorageQuarantine: mocks.purge,
fetchSystemJob: mocks.fetchJob,
fetchStorageOverview: mocks.fetchOverview,
+ fetchStorageDisk: mocks.fetchDisk,
fetchStoragePolicy: mocks.fetchPolicy,
fetchStorageQuarantine: mocks.fetchQuarantine,
fetchStorageRuns: mocks.fetchRuns,
@@ -55,7 +57,7 @@ const settings: StorageMaintenanceSettings = {
idle_for_minutes: 10,
orphan_grace_hours: 168,
quarantine_retention_hours: 168,
- workspaces: { enabled: true },
+ workspaces: { enabled: true, dependency_cleanup_enabled: false },
kandev_containers: { enabled: true },
go_cache: { enabled: false, max_bytes: 16106127360, adopted_path: "" },
docker: {
@@ -93,6 +95,15 @@ const overview: StorageOverviewResponse = {
last_run: null,
};
+const disk = {
+ path: "/data",
+ total_bytes: 100,
+ used_bytes: 80,
+ available_bytes: 20,
+ used_percent: 80,
+ available: true,
+};
+
const cleanupJobId = "cleanup-job";
const cleanupJob = {
id: cleanupJobId,
@@ -120,6 +131,7 @@ function wrapper({ children }: { children: ReactNode }) {
beforeEach(() => {
vi.clearAllMocks();
mocks.fetchOverview.mockResolvedValue(overview);
+ mocks.fetchDisk.mockResolvedValue(disk);
mocks.fetchPolicy.mockResolvedValue({
settings: overview.settings,
capabilities: overview.capabilities,
@@ -146,6 +158,7 @@ describe("useStorageMaintenance", () => {
runs: false,
quarantine: false,
overview: true,
+ disk: false,
});
expect(result.current.overview).toBeNull();
@@ -162,6 +175,7 @@ describe("useStorageMaintenance", () => {
await waitFor(() => expect(result.current.overview).toEqual(overview));
expect(mocks.fetchRuns).toHaveBeenCalledWith(20);
expect(mocks.fetchQuarantine).toHaveBeenCalledTimes(1);
+ expect(mocks.fetchDisk).toHaveBeenCalledTimes(1);
expect(result.current.pendingAction).toBeNull();
});
@@ -251,6 +265,20 @@ describe("useStorageMaintenance", () => {
});
});
+describe("useStorageMaintenance disk isolation", () => {
+ it("keeps the other sections usable when the disk request fails", async () => {
+ mocks.fetchDisk.mockRejectedValueOnce(new Error("disk unavailable"));
+ const { result } = renderHook(() => useStorageMaintenance(), { wrapper });
+
+ await waitFor(() => expect(result.current.sectionErrors.disk).toBe("disk unavailable"));
+ expect(result.current.policy?.settings).toEqual(settings);
+ expect(result.current.overview).toEqual(overview);
+ expect(result.current.runs).toEqual([]);
+ expect(result.current.quarantine).toEqual([]);
+ expect(result.current.loading.disk).toBe(false);
+ });
+});
+
describe("useStorageMaintenance busy feedback", () => {
it("retains labeled busy feedback and reruns the same resources with force", async () => {
mocks.run.mockRejectedValueOnce(
diff --git a/apps/web/hooks/domains/system/use-storage-maintenance.ts b/apps/web/hooks/domains/system/use-storage-maintenance.ts
index 9fbdc5a000..d666a468b1 100644
--- a/apps/web/hooks/domains/system/use-storage-maintenance.ts
+++ b/apps/web/hooks/domains/system/use-storage-maintenance.ts
@@ -23,6 +23,7 @@ import {
analyzeStorage,
deleteStorageQuarantine,
fetchStorageOverview,
+ fetchStorageDisk,
fetchStoragePolicy,
fetchStorageQuarantine,
fetchStorageRuns,
@@ -96,7 +97,7 @@ export function settingsWithDockerAcknowledgement(
};
}
-export type StorageSection = "policy" | "overview" | "runs" | "quarantine";
+export type StorageSection = "policy" | "overview" | "disk" | "runs" | "quarantine";
export type StorageSectionLoading = Record;
export type StorageSectionErrors = Record;
type Reload = (sections?: StorageSection[]) => Promise;
@@ -376,23 +377,27 @@ export function useStorageMaintenance() {
const storage = useAppStore((state) => state.system.storage);
const setPolicy = useAppStore((state) => state.setSystemStoragePolicy);
const setOverview = useAppStore((state) => state.setSystemStorageOverview);
+ const setDisk = useAppStore((state) => state.setSystemStorageDisk);
const setRuns = useAppStore((state) => state.setSystemStorageRuns);
const setQuarantine = useAppStore((state) => state.setSystemStorageQuarantine);
const [loading, setLoading] = useState({
policy: true,
overview: true,
+ disk: true,
runs: true,
quarantine: true,
});
const [sectionErrors, setSectionErrors] = useState({
policy: null,
overview: null,
+ disk: null,
runs: null,
quarantine: null,
});
const sectionGenerations = useRef>({
policy: 0,
overview: 0,
+ disk: 0,
runs: 0,
quarantine: 0,
});
@@ -421,13 +426,15 @@ export function useStorageMaintenance() {
[],
);
const reload = useCallback(
- async (sections: StorageSection[] = ["policy", "overview", "runs", "quarantine"]) => {
+ async (sections: StorageSection[] = ["policy", "overview", "disk", "runs", "quarantine"]) => {
const jobs = sections.map((section) => {
switch (section) {
case "policy":
return loadSection("policy", fetchStoragePolicy, setPolicy);
case "overview":
return loadSection("overview", fetchStorageOverview, setOverview);
+ case "disk":
+ return loadSection("disk", fetchStorageDisk, setDisk);
case "runs":
return loadSection("runs", () => fetchStorageRuns(20), setRuns);
case "quarantine":
@@ -440,7 +447,7 @@ export function useStorageMaintenance() {
);
if (failure) throw failure.reason;
},
- [loadSection, setOverview, setPolicy, setQuarantine, setRuns],
+ [loadSection, setDisk, setOverview, setPolicy, setQuarantine, setRuns],
);
const commitAdoptedPolicy = useCallback(
(policy: StoragePolicyResponse) => {
diff --git a/apps/web/lib/api/domains/system-api.test.ts b/apps/web/lib/api/domains/system-api.test.ts
index d3c31079d5..ed1f61ba95 100644
--- a/apps/web/lib/api/domains/system-api.test.ts
+++ b/apps/web/lib/api/domains/system-api.test.ts
@@ -35,6 +35,7 @@ import {
analyzeStorage,
deleteStorageQuarantine,
fetchStorageOverview,
+ fetchStorageDisk,
fetchStoragePolicy,
fetchStorageQuarantine,
fetchStorageRuns,
@@ -393,7 +394,7 @@ const storageSettings = {
idle_for_minutes: 10,
orphan_grace_hours: 168,
quarantine_retention_hours: 168,
- workspaces: { enabled: true },
+ workspaces: { enabled: true, dependency_cleanup_enabled: false },
kandev_containers: { enabled: true },
go_cache: { enabled: false, max_bytes: 16106127360, adopted_path: "" },
docker: {
@@ -429,6 +430,25 @@ describe("storage maintenance", () => {
expect((await fetchStorageQuarantine())[0]?.id).toBe("entry-1");
});
+ it("loads disk capacity independently without caching", async () => {
+ fetchSpy.mockResolvedValueOnce(
+ jsonResponse({
+ path: "/data",
+ total_bytes: 1000,
+ used_bytes: 800,
+ available_bytes: 200,
+ used_percent: 80,
+ available: true,
+ }),
+ );
+
+ const response = await fetchStorageDisk();
+
+ expect(lastCall().url).toBe(`${BASE}/storage/disk`);
+ expect(lastCall().init?.cache).toBe("no-store");
+ expect(response.used_percent).toBe(80);
+ });
+
it("saves dedicated Docker acknowledgement with its confirmation", async () => {
fetchSpy.mockResolvedValueOnce(jsonResponse({ settings: storageSettings }));
await saveStorageSettings(storageSettings, "DEDICATED");
diff --git a/apps/web/lib/api/domains/system-api.ts b/apps/web/lib/api/domains/system-api.ts
index f67644bcee..8c27004e7b 100644
--- a/apps/web/lib/api/domains/system-api.ts
+++ b/apps/web/lib/api/domains/system-api.ts
@@ -17,6 +17,7 @@ import type {
StorageAdoptionResponse,
StorageMaintenanceRun,
StorageMaintenanceSettings,
+ StorageDiskCapacityResponse,
StorageOverviewResponse,
StoragePolicyResponse,
StorageQuarantineEntry,
@@ -275,6 +276,15 @@ export function fetchStorageOverview(
});
}
+export function fetchStorageDisk(
+ options?: ApiRequestOptions,
+): Promise {
+ return fetchJson(`${SYSTEM_BASE}/storage/disk`, {
+ ...options,
+ cache: "no-store",
+ });
+}
+
export function fetchStoragePolicy(options?: ApiRequestOptions): Promise {
return fetchJson(`${SYSTEM_BASE}/storage/settings`, {
...options,
diff --git a/apps/web/lib/state/slices/system/system-slice.test.ts b/apps/web/lib/state/slices/system/system-slice.test.ts
index 0101130479..c149e409f2 100644
--- a/apps/web/lib/state/slices/system/system-slice.test.ts
+++ b/apps/web/lib/state/slices/system/system-slice.test.ts
@@ -95,7 +95,7 @@ describe("system storage slice", () => {
idle_for_minutes: 10,
orphan_grace_hours: 168,
quarantine_retention_hours: 168,
- workspaces: { enabled: true },
+ workspaces: { enabled: true, dependency_cleanup_enabled: false },
kandev_containers: { enabled: true },
go_cache: { enabled: false, max_bytes: 16106127360, adopted_path: "" },
docker: {
@@ -137,6 +137,7 @@ describe("system storage slice", () => {
expect(store.getState().system.storage).toEqual({
policy,
overview,
+ disk: null,
runs: [],
quarantine: [],
});
diff --git a/apps/web/lib/state/slices/system/system-slice.ts b/apps/web/lib/state/slices/system/system-slice.ts
index 260c581313..1e228aed76 100644
--- a/apps/web/lib/state/slices/system/system-slice.ts
+++ b/apps/web/lib/state/slices/system/system-slice.ts
@@ -10,7 +10,7 @@ export const defaultSystemState: SystemSliceState = {
updates: null,
jobs: {},
metrics: null,
- storage: { policy: null, overview: null, runs: [], quarantine: [] },
+ storage: { policy: null, overview: null, disk: null, runs: [], quarantine: [] },
},
};
@@ -65,6 +65,10 @@ export const createSystemSlice: StateCreator<
set((draft) => {
draft.system.storage.overview = overview;
}),
+ setSystemStorageDisk: (disk) =>
+ set((draft) => {
+ draft.system.storage.disk = disk;
+ }),
setSystemStorageRuns: (runs) =>
set((draft) => {
draft.system.storage.runs = runs;
diff --git a/apps/web/lib/state/slices/system/types.ts b/apps/web/lib/state/slices/system/types.ts
index 1632cd890e..82e44f387a 100644
--- a/apps/web/lib/state/slices/system/types.ts
+++ b/apps/web/lib/state/slices/system/types.ts
@@ -7,6 +7,7 @@ import type {
SystemJob,
SystemMetricsSnapshot,
StorageMaintenanceRun,
+ StorageDiskCapacityResponse,
StorageOverviewResponse,
StoragePolicyResponse,
StorageQuarantineEntry,
@@ -31,6 +32,7 @@ export type SystemSliceState = {
storage: {
policy: StoragePolicyResponse | null;
overview: StorageOverviewResponse | null;
+ disk: StorageDiskCapacityResponse | null;
runs: StorageMaintenanceRun[];
quarantine: StorageQuarantineEntry[];
};
@@ -48,6 +50,7 @@ export type SystemSliceActions = {
setSystemMetricsSnapshot: (snapshot: SystemMetricsSnapshot) => void;
setSystemStoragePolicy: (policy: StoragePolicyResponse) => void;
setSystemStorageOverview: (overview: StorageOverviewResponse) => void;
+ setSystemStorageDisk: (disk: StorageDiskCapacityResponse) => void;
setSystemStorageRuns: (runs: StorageMaintenanceRun[]) => void;
setSystemStorageQuarantine: (entries: StorageQuarantineEntry[]) => void;
};
diff --git a/apps/web/lib/types/system.ts b/apps/web/lib/types/system.ts
index 718c493464..dff14a37a6 100644
--- a/apps/web/lib/types/system.ts
+++ b/apps/web/lib/types/system.ts
@@ -261,6 +261,10 @@ export interface StorageResourceSettings {
enabled: boolean;
}
+export interface StorageWorkspaceSettings extends StorageResourceSettings {
+ dependency_cleanup_enabled: boolean;
+}
+
export interface StorageGoCacheSettings {
enabled: boolean;
max_bytes: number;
@@ -282,7 +286,7 @@ export interface StorageMaintenanceSettings {
idle_for_minutes: number;
orphan_grace_hours: number;
quarantine_retention_hours: number;
- workspaces: StorageResourceSettings;
+ workspaces: StorageWorkspaceSettings;
kandev_containers: StorageResourceSettings;
go_cache: StorageGoCacheSettings;
docker: StorageDockerSettings;
@@ -421,6 +425,16 @@ export interface StorageOverviewResponse {
last_run: StorageMaintenanceRun | null;
}
+export interface StorageDiskCapacityResponse {
+ path: string;
+ total_bytes: number;
+ used_bytes: number;
+ available_bytes: number;
+ used_percent: number;
+ available: boolean;
+ warning?: string;
+}
+
export interface StoragePolicyResponse {
settings: StorageMaintenanceSettings;
capabilities: StorageCapabilities;
diff --git a/apps/web/src/locales/en/system.json b/apps/web/src/locales/en/system.json
index ac5cbf92d3..86a05c2ba3 100644
--- a/apps/web/src/locales/en/system.json
+++ b/apps/web/src/locales/en/system.json
@@ -307,6 +307,17 @@
"storageDockerUnavailableBadge": "Docker unavailable",
"storageDockerUnavailableNotice": "Docker is unavailable; Docker cleanup options cannot run on this host.",
"storageDockerUnmeasured": "Docker usage could not be measured",
+ "storageDiskTitle": "Disk capacity",
+ "storageDiskDescription": "Current usage of the filesystem containing Kandev storage.",
+ "storageDiskLoading": "Loading disk capacity…",
+ "storageDiskUnavailable": "Disk capacity is unavailable right now.",
+ "storageDiskUsed": "{{percent}}% full",
+ "storageDiskUsedSize": "{{size}} used",
+ "storageDiskCapacitySummary": "{{available}} available · {{total}} total",
+ "storageDiskPath": "Storage path",
+ "storageDiskProgressAria": "Disk usage: {{percent}}% full",
+ "storageDiskHighWarning": "This filesystem is becoming full (80% or more used).",
+ "storageDiskCriticalWarning": "This filesystem is critically full (90% or more used).",
"storageEligibleNow": "Eligible now",
"storageEnableGoCacheFirst": "Enable the managed Go cache first.",
"storageEnableManagedGoCacheAria": "Enable managed Go cache",
@@ -412,6 +423,14 @@
"storageWorkspacesDescription": "Reclaim resources that Kandev can positively identify as no longer in use.",
"storageWorkspacesDetail": "{{reclaimable}} reclaimable after the grace period · {{active}} active",
"storageWorkspacesTitle": "Workspaces and containers",
+ "storageWorkspaceDependencies": "Remove dependencies from archived or deleted workspaces",
+ "storageWorkspaceDependenciesDescription": "Opt in to remove dependency folders while keeping the workspace source and recovery metadata.",
+ "storageWorkspaceDependenciesHelp": "When enabled and saved, Kandev recursively checks only the listed folders inside unprotected Kandev task workspaces that are archived or deleted. It skips missing folders, symlinks, active or protected workspaces, and ambiguous folders such as vendor, target, build, dist, .cache, and .git. Restoring a trimmed workspace may require reinstalling dependencies.",
+ "storageDependencyFoldersTitle": "Folders Kandev will check",
+ "storageDependencyFoldersDescription": "These exact directory names are the complete cleanup allowlist.",
+ "storageDependencyFoldersHelp": "Kandev searches recursively for these directory names. Missing folders are skipped. Kandev never targets the excluded ambiguous names, follows symlinks, or accepts custom paths. Only archived or deleted, unprotected Kandev workspaces are eligible, and dependencies may need to be reinstalled after restore.",
+ "storageCleanWorkspaceDependencies": "Clean workspace dependencies",
+ "storageEnableWorkspaceDependenciesAndSave": "Enable and save dependency cleanup before running it.",
"systemMetrics": "System metrics",
"uiStateHelp": "Clears layout and UI preferences saved in your browser (panel sizes, pinned tasks, expanded groups, etc.). Use this if the app looks broken, panels are stuck, or the layout feels wrong. Your tasks, sessions, and server data are not affected - only the per-browser UI state. The page reloads after the reset.",
"uiStateReset": "Reset",
diff --git a/apps/web/src/locales/pseudo/system.json b/apps/web/src/locales/pseudo/system.json
index 19b835bc73..3a43f98f5d 100644
--- a/apps/web/src/locales/pseudo/system.json
+++ b/apps/web/src/locales/pseudo/system.json
@@ -307,6 +307,17 @@
"storageDockerUnavailableBadge": "Ďōćķēŕ ũńàvàĩĺàƀĺē",
"storageDockerUnavailableNotice": "Ďōćķēŕ ĩś ũńàvàĩĺàƀĺē; Ďōćķēŕ ćĺēàńũƥ ōƥţĩōńś ćàńńōţ ŕũń ōń ţĥĩś ĥōśţ.",
"storageDockerUnmeasured": "Ďōćķēŕ ũśàĝē ćōũĺď ńōţ ƀē ḿēàśũŕēď",
+ "storageDiskTitle": "Ďĩśķ ćàƥàćĩţŷ",
+ "storageDiskDescription": "Ćũŕŕēńţ ũśàĝē ōƒ ţĥē ƒĩĺēśŷśţēḿ ćōńţàĩńĩńĝ Ķàńďēv śţōŕàĝē.",
+ "storageDiskLoading": "Ĺōàďĩńĝ ďĩśķ ćàƥàćĩţŷ…",
+ "storageDiskUnavailable": "Ďĩśķ ćàƥàćĩţŷ ĩś ũńàvàĩĺàƀĺē ŕĩĝĥţ ńōŵ.",
+ "storageDiskUsed": "{{percent}}% ƒũĺĺ",
+ "storageDiskUsedSize": "{{size}} ũśēď",
+ "storageDiskCapacitySummary": "{{available}} àvàĩĺàƀĺē · {{total}} ţōţàĺ",
+ "storageDiskPath": "Śţōŕàĝē ƥàţĥ",
+ "storageDiskProgressAria": "Ďĩśķ ũśàĝē: {{percent}}% ƒũĺĺ",
+ "storageDiskHighWarning": "Ţĥĩś ƒĩĺēśŷśţēḿ ĩś ƀēćōḿĩńĝ ƒũĺĺ (80% ōŕ ḿōŕē ũśēď).",
+ "storageDiskCriticalWarning": "Ţĥĩś ƒĩĺēśŷśţēḿ ĩś ćŕĩţĩćàĺĺŷ ƒũĺĺ (90% ōŕ ḿōŕē ũśēď).",
"storageEligibleNow": "Ēĺĩĝĩƀĺē ńōŵ",
"storageEnableGoCacheFirst": "Ēńàƀĺē ţĥē ḿàńàĝēď Ĝō ćàćĥē ƒĩŕśţ.",
"storageEnableManagedGoCacheAria": "Ēńàƀĺē ḿàńàĝēď Ĝō ćàćĥē",
@@ -412,6 +423,14 @@
"storageWorkspacesDescription": "Ŕēćĺàĩḿ ŕēśōũŕćēś ţĥàţ Ķàńďēv ćàń ƥōśĩţĩvēĺŷ ĩďēńţĩƒŷ àś ńō ĺōńĝēŕ ĩń ũśē.",
"storageWorkspacesDetail": "{{reclaimable}} ŕēćĺàĩḿàƀĺē àƒţēŕ ţĥē ĝŕàćē ƥēŕĩōď · {{active}} àćţĩvē",
"storageWorkspacesTitle": "Ŵōŕķśƥàćēś àńď ćōńţàĩńēŕś",
+ "storageWorkspaceDependencies": "Ŕēḿōvē ďēƥēńďēńćĩēś ƒŕōḿ àŕćĥĩvēď ōŕ ďēĺēţēď ŵōŕķśƥàćēś",
+ "storageWorkspaceDependenciesDescription": "Ōƥţ ĩń ţō ŕēḿōvē ďēƥēńďēńćŷ ƒōĺďēŕś ŵĥĩĺē ķēēƥĩńĝ ţĥē ŵōŕķśƥàćē śōũŕćē àńď ŕēćōvēŕŷ ḿēţàďàţà.",
+ "storageWorkspaceDependenciesHelp": "Ŵĥēń ēńàƀĺēď àńď śàvēď, Ķàńďēv ŕēćũŕśĩvēĺŷ ćĥēćķś ōńĺŷ ţĥē ĺĩśţēď ƒōĺďēŕś ĩńśĩďē ũńƥŕōţēćţēď Ķàńďēv ţàśķ ŵōŕķśƥàćēś ţĥàţ àŕē àŕćĥĩvēď ōŕ ďēĺēţēď. Ĩţ śķĩƥś ḿĩśśĩńĝ ƒōĺďēŕś, śŷḿĺĩńķś, àćţĩvē ōŕ ƥŕōţēćţēď ŵōŕķśƥàćēś, àńď àḿƀĩĝũōũś ƒōĺďēŕś śũćĥ àś vēńďōŕ, ţàŕĝēţ, ƀũĩĺď, ďĩśţ, .ćàćĥē, àńď .ĝĩţ. Ŕēśţōŕĩńĝ à ţŕĩḿḿēď ŵōŕķśƥàćē ḿàŷ ŕēqũĩŕē ŕēĩńśţàĺĺĩńĝ ďēƥēńďēńćĩēś.",
+ "storageDependencyFoldersTitle": "Ƒōĺďēŕś Ķàńďēv ŵĩĺĺ ćĥēćķ",
+ "storageDependencyFoldersDescription": "Ţĥēśē ēxàćţ ďĩŕēćţōŕŷ ńàḿēś àŕē ţĥē ćōḿƥĺēţē ćĺēàńũƥ àĺĺōŵĺĩśţ.",
+ "storageDependencyFoldersHelp": "Ķàńďēv śēàŕćĥēś ŕēćũŕśĩvēĺŷ ƒōŕ ţĥēśē ďĩŕēćţōŕŷ ńàḿēś. Ḿĩśśĩńĝ ƒōĺďēŕś àŕē śķĩƥƥēď. Ķàńďēv ńēvēŕ ţàŕĝēţś ţĥē ēxćĺũďēď àḿƀĩĝũōũś ńàḿēś, ƒōĺĺōŵś śŷḿĺĩńķś, ōŕ àććēƥţś ćũśţōḿ ƥàţĥś. Ōńĺŷ àŕćĥĩvēď ōŕ ďēĺēţēď, ũńƥŕōţēćţēď Ķàńďēv ŵōŕķśƥàćēś àŕē ēĺĩĝĩƀĺē, àńď ďēƥēńďēńćĩēś ḿàŷ ńēēď ţō ƀē ŕēĩńśţàĺĺēď àƒţēŕ ŕēśţōŕē.",
+ "storageCleanWorkspaceDependencies": "Ćĺēàń ŵōŕķśƥàćē ďēƥēńďēńćĩēś",
+ "storageEnableWorkspaceDependenciesAndSave": "Ēńàƀĺē àńď śàvē ďēƥēńďēńćŷ ćĺēàńũƥ ƀēƒōŕē ŕũńńĩńĝ ĩţ.",
"systemMetrics": "Śŷśţēḿ ḿēţŕĩćś",
"uiStateHelp": "Ćĺēàŕś ĺàŷōũţ àńď ŨĨ ƥŕēƒēŕēńćēś śàvēď ĩń ŷōũŕ ƀŕōŵśēŕ (ƥàńēĺ śĩźēś, ƥĩńńēď ţàśķś, ēxƥàńďēď ĝŕōũƥś, ēţć.). Ũśē ţĥĩś ĩƒ ţĥē àƥƥ ĺōōķś ƀŕōķēń, ƥàńēĺś àŕē śţũćķ, ōŕ ţĥē ĺàŷōũţ ƒēēĺś ŵŕōńĝ. Ŷōũŕ ţàśķś, śēśśĩōńś, àńď śēŕvēŕ ďàţà àŕē ńōţ àƒƒēćţēď - ōńĺŷ ţĥē ƥēŕ-ƀŕōŵśēŕ ŨĨ śţàţē. Ţĥē ƥàĝē ŕēĺōàďś àƒţēŕ ţĥē ŕēśēţ.",
"uiStateReset": "Ŕēśēţ",
diff --git a/apps/web/src/locales/pt-pt/system.json b/apps/web/src/locales/pt-pt/system.json
index 525ad0733b..7dfa13af1d 100644
--- a/apps/web/src/locales/pt-pt/system.json
+++ b/apps/web/src/locales/pt-pt/system.json
@@ -307,6 +307,17 @@
"storageDockerUnavailableBadge": "Docker indisponível",
"storageDockerUnavailableNotice": "O Docker não está disponível; as opções de limpeza do Docker não podem ser executadas neste anfitrião.",
"storageDockerUnmeasured": "Não foi possível medir a utilização do Docker",
+ "storageDiskTitle": "Capacidade do disco",
+ "storageDiskDescription": "Utilização atual do sistema de ficheiros que contém o armazenamento do Kandev.",
+ "storageDiskLoading": "A carregar a capacidade do disco…",
+ "storageDiskUnavailable": "A capacidade do disco não está disponível neste momento.",
+ "storageDiskUsed": "{{percent}}% cheio",
+ "storageDiskUsedSize": "{{size}} utilizado",
+ "storageDiskCapacitySummary": "{{available}} disponível · {{total}} no total",
+ "storageDiskPath": "Caminho do armazenamento",
+ "storageDiskProgressAria": "Utilização do disco: {{percent}}% cheio",
+ "storageDiskHighWarning": "Este sistema de ficheiros está a ficar cheio (80% ou mais utilizado).",
+ "storageDiskCriticalWarning": "Este sistema de ficheiros está criticamente cheio (90% ou mais utilizado).",
"storageEligibleNow": "Elegível agora",
"storageEnableGoCacheFirst": "Ative primeiro a cache do Go gerida.",
"storageEnableManagedGoCacheAria": "Ativar a cache do Go gerida",
@@ -412,6 +423,14 @@
"storageWorkspacesDescription": "Recupere recursos que o Kandev consegue identificar com segurança como já não estando em uso.",
"storageWorkspacesDetail": "{{reclaimable}} recuperáveis após o período de tolerância · {{active}} ativas",
"storageWorkspacesTitle": "Áreas de trabalho e contentores",
+ "storageWorkspaceDependencies": "Remover dependências de áreas de trabalho arquivadas ou eliminadas",
+ "storageWorkspaceDependenciesDescription": "Ative para remover pastas de dependências, mantendo o código-fonte e os metadados de recuperação.",
+ "storageWorkspaceDependenciesHelp": "Quando ativado e guardado, o Kandev verifica recursivamente apenas as pastas listadas dentro de áreas de trabalho de tarefas do Kandev arquivadas ou eliminadas. Ignora pastas ausentes, ligações simbólicas, áreas ativas ou protegidas e pastas ambíguas como vendor, target, build, dist, .cache e .git. Restaurar uma área de trabalho limpa pode exigir reinstalar as dependências.",
+ "storageDependencyFoldersTitle": "Pastas que o Kandev irá verificar",
+ "storageDependencyFoldersDescription": "Estes nomes exatos de diretórios são a lista completa de limpeza permitida.",
+ "storageDependencyFoldersHelp": "O Kandev procura recursivamente estes nomes de diretórios. As pastas ausentes são ignoradas. O Kandev nunca visa os nomes ambíguos excluídos, segue ligações simbólicas ou aceita caminhos personalizados. Só são elegíveis áreas de trabalho do Kandev arquivadas ou eliminadas e não protegidas; depois de restaurar, pode ser necessário reinstalar as dependências.",
+ "storageCleanWorkspaceDependencies": "Limpar dependências das áreas de trabalho",
+ "storageEnableWorkspaceDependenciesAndSave": "Ative e guarde a limpeza de dependências antes de a executar.",
"systemMetrics": "Métricas do sistema",
"uiStateHelp": "Limpa as preferências de esquema e de interface guardadas no seu navegador (tamanhos dos painéis, tarefas afixadas, grupos expandidos, etc.). Use isto se a aplicação parecer avariada, se os painéis estiverem bloqueados ou se o esquema parecer errado. As suas tarefas, sessões e dados do servidor não são afetados - apenas o estado da interface de cada navegador. A página é recarregada após a reposição.",
"uiStateReset": "Repor",
diff --git a/apps/web/src/locales/zh-cn/system.json b/apps/web/src/locales/zh-cn/system.json
index 10b407424f..3a20b24227 100644
--- a/apps/web/src/locales/zh-cn/system.json
+++ b/apps/web/src/locales/zh-cn/system.json
@@ -307,6 +307,17 @@
"storageDockerUnavailableBadge": "Docker 不可用",
"storageDockerUnavailableNotice": "Docker 不可用;此主机无法运行 Docker 清理选项。",
"storageDockerUnmeasured": "无法测量 Docker 用量",
+ "storageDiskTitle": "磁盘容量",
+ "storageDiskDescription": "包含 Kandev 存储的文件系统当前使用情况。",
+ "storageDiskLoading": "正在加载磁盘容量…",
+ "storageDiskUnavailable": "磁盘容量暂时不可用。",
+ "storageDiskUsed": "已满 {{percent}}%",
+ "storageDiskUsedSize": "已使用 {{size}}",
+ "storageDiskCapacitySummary": "可用 {{available}} · 总计 {{total}}",
+ "storageDiskPath": "存储路径",
+ "storageDiskProgressAria": "磁盘使用率:已满 {{percent}}%",
+ "storageDiskHighWarning": "此文件系统正在变满(已使用 80% 或更多)。",
+ "storageDiskCriticalWarning": "此文件系统已严重满载(已使用 90% 或更多)。",
"storageEligibleNow": "当前符合条件",
"storageEnableGoCacheFirst": "请先启用托管的 Go 缓存。",
"storageEnableManagedGoCacheAria": "启用托管 Go 缓存",
@@ -412,6 +423,14 @@
"storageWorkspacesDescription": "回收 Kandev 能明确识别为不再使用的资源。",
"storageWorkspacesDetail": "宽限期后可回收 {{reclaimable}} · 活动 {{active}}",
"storageWorkspacesTitle": "工作区与容器",
+ "storageWorkspaceDependencies": "删除已归档或已删除工作区中的依赖项",
+ "storageWorkspaceDependenciesDescription": "选择加入后可删除依赖目录,同时保留工作区源代码和恢复元数据。",
+ "storageWorkspaceDependenciesHelp": "启用并保存后,Kandev 只会在已归档或已删除且未受保护的 Kandev 任务工作区中递归检查下列目录。缺失目录、符号链接、活动或受保护工作区,以及 vendor、target、build、dist、.cache 和 .git 等含义不明确的目录都会跳过。恢复清理过的工作区后可能需要重新安装依赖项。",
+ "storageDependencyFoldersTitle": "Kandev 将检查的文件夹",
+ "storageDependencyFoldersDescription": "这些确切的目录名称构成完整的清理允许列表。",
+ "storageDependencyFoldersHelp": "Kandev 会递归搜索这些目录名称。缺失目录会跳过。Kandev 永远不会处理排除的含义不明确名称、跟随符号链接或接受自定义路径。只有已归档或已删除且未受保护的 Kandev 工作区符合条件,恢复后可能需要重新安装依赖项。",
+ "storageCleanWorkspaceDependencies": "清理工作区依赖项",
+ "storageEnableWorkspaceDependenciesAndSave": "请先启用并保存依赖清理设置,再运行清理。",
"systemMetrics": "系统指标",
"uiStateHelp": "清除保存在浏览器中的布局与 UI 偏好(面板大小、固定任务、展开分组等)。若应用显示异常、面板卡住或布局不对,可使用此选项。任务、会话与服务器数据不受影响 — 仅影响当前浏览器保存的 UI 状态。重置后页面会重新加载。",
"uiStateReset": "重置",
diff --git a/docs/plans/storage-overview-parallel-scan/plan.md b/docs/plans/storage-overview-parallel-scan/plan.md
new file mode 100644
index 0000000000..b94c50205e
--- /dev/null
+++ b/docs/plans/storage-overview-parallel-scan/plan.md
@@ -0,0 +1,147 @@
+---
+spec: docs/specs/system-page/storage-overview-parallel-scan.md
+created: 2026-08-08
+status: completed
+---
+
+# Implementation Plan: Faster storage analysis, capacity visibility, and dependency cleanup
+
+## Overview
+
+Deliver three related Storage maintenance improvements: overlap the four expensive overview
+measurements, expose a lightweight filesystem-capacity endpoint and accessible progress card, and
+add an opt-in, ownership-aware dependency-directory cleanup provider for archived/deleted task
+workspaces. Preserve existing overview contracts, per-source error degradation, process-local
+overview cache behavior, progressive page loading, and activity-coordinator idle semantics.
+
+## Backend design
+
+- Refactor the overview composition in
+ `apps/backend/internal/backendapp/storage_maintenance.go` around a small measurement seam that
+ can run workspace, Go-cache, quarantine, and Docker analysis concurrently.
+- Use explicit result slots or equivalent ownership-safe state so each measurement writes only its
+ own result and error before the parent goroutine assembles `Summary`.
+- Wait for all measurements rather than cancelling siblings on an expected provider error. Preserve
+ the current behavior where unavailable sources are represented in the returned summary and other
+ sources still contribute their data.
+- Keep settings loading before the measurement fan-out because provider construction and configured
+ paths depend on that snapshot.
+- Keep disk capacity outside the overview cache so the capacity card is cheap and can refresh
+ independently while a cold scan is pending. Reuse the existing cross-platform statfs/free-space
+ semantics in `apps/backend/internal/system/metrics` through a small capacity result seam rather
+ than duplicating platform-specific calculations.
+- Add a `GET /api/v1/system/storage/disk` handler that measures the filesystem containing the
+ Kandev storage root and returns total, used, available, percentage, path, and availability/error
+ fields. A capacity failure must not fail the overview or other Storage sections.
+
+### Workspace dependency cleanup
+
+- Add a persisted, default-off `workspaces.dependency_cleanup_enabled` setting and surface it in the
+ Workspaces policy card with localized warning/help copy. Always display the exact fixed allowlist
+ in a code-styled disclosure labeled as folders Kandev will check; pair it with the existing
+ `StorageSettingHelp` information control so hover, keyboard focus, and tap expose the same
+ explanation.
+- Add a `workspace_dependencies` cleanup provider and resource-specific action. It uses the same
+ maintenance lease, busy response, Run anyway behavior, cancellation, retry, and run-history
+ result shape as other destructive providers.
+- Reuse the workspace provider's fail-closed ownership, authoritative inventory, path containment,
+ and no-follow-symlink checks. Introduce a small eligibility source if needed to distinguish
+ archived task rows from deleted tasks whose ownership marker remains on disk.
+- Prune only the fixed allowlist from the spec. Count directories and reclaimed bytes, preserve
+ source/Git/recovery metadata, skip protected or state-changing workspaces, and make the operation
+ idempotent so retrying after interruption is safe.
+- Keep full workspace orphan grace and quarantine retention unchanged. Dependency pruning is a
+ separate provider and must never be implied by the disk percentage or by read-only Analyze.
+- Coordinate pruning with quarantine restore and task reactivation so a restore/unarchive cannot
+ race a dependency deletion. Revalidate ownership and task state immediately before each target
+ removal; fail closed on incomplete inventory.
+
+## Tests
+
+- Add a deterministic barrier-based backend test for the overview fan-out. It must prove all four
+ measurements enter before release, then assert the assembled summary and independent errors.
+- Retain or update composition fakes only as needed to inject blocking providers; avoid tests that
+ depend on `time.Sleep` or host filesystem size.
+- Add capacity provider/handler tests for byte math, clamping, unavailable filesystems, timeout or
+ cancellation, and the selected storage-root path. Extend API fixtures for the new disk response.
+- Add workspace-provider tests for allowlist-only deletion, archived/deleted eligibility, active
+ inventory protection, symlink/path escape rejection, byte/count results, cancellation, retry,
+ restore-after-prune, and default-off settings validation.
+- Run the existing cache, handler, operations, scheduler, and activity-coordinator suites to guard
+ the unchanged contracts.
+- Extend desktop and mobile Storage E2E coverage for the independent capacity card, the progress
+ bar's accessible percentage, the new policy option, visible allowlisted-folder names, the
+ hover/focus/tap help explanation, and the workspace dependency action. Keep the page one-column on
+ mobile and verify no horizontal overflow.
+
+## Observability and rollout
+
+- When a compatible post-change runtime is available, use the existing backend request-duration
+ logs to capture a comparable cold overview before and after implementation. The cache must be
+ cold for both measurements and the host dataset/settings must be held constant. If the running
+ runtime predates the capacity route, record the baseline and deterministic/managed E2E evidence
+ instead of claiming a comparable post-change timing.
+- Capture disk-capacity response timing separately to confirm it is available before the cold
+ overview completes.
+- Record the measured result in the implementation task handoff. If workspace traversal remains
+ the dominant cost, open a separate bounded directory-traversal optimization rather than expanding
+ this change.
+
+## Implementation waves
+
+Wave 1:
+
+- [x] [Task 01: Parallelize overview measurements](task-01-parallelize-overview-measurements.md)
+
+Wave 2:
+
+- [x] [Task 03: Add disk capacity and progress card](task-03-disk-capacity-progress.md)
+- [x] [Task 04: Add opt-in dependency cleanup](task-04-workspace-dependency-cleanup.md)
+
+Wave 3:
+
+- [x] [Task 02: Integrated regression and timing validation](task-02-regression-and-timing-validation.md)
+
+## Implementation results
+
+- Overview measurements now fan out after settings load. A barrier-based test proves workspace,
+ Go-cache, quarantine, and Docker measurements all enter before release; the backend package and
+ storage packages pass with `-race`.
+- `GET /api/v1/system/storage/disk` reports filesystem total, used, available, percentage, path,
+ and safe unavailable states. The page loads it independently, renders the accessible progress
+ bar, and applies 80% warning/90% critical presentation thresholds.
+- Workspace dependency cleanup is default-off, uses the exact 12-entry allowlist, requires a
+ complete authoritative task inventory, targets only archived/deleted unprotected Kandev-owned
+ roots, and revalidates ownership, containment, symlink safety, and eligibility before each
+ deletion. Results report affected workspaces, directories, bytes, and warnings.
+- Focused backend tests, the backend race suite, backend lint, web typecheck/lint/i18n checks, 101 focused web
+ tests, public-doc validation, and managed Chromium/mobile Storage E2E flows pass. The mobile
+ flow verifies the allowlist disclosure through touch interaction without horizontal overflow;
+ the workspace suite also verifies exact allowlist-copy behavior and restore after dependency
+ pruning, and the Windows metrics package compiles.
+- The captured pre-change live baseline remains approximately 103 seconds cold and effectively
+ instantaneous warm because of the 15-minute overview cache. The post-change managed E2E holds
+ the overview response and confirms the disk card renders independently before it is released;
+ a same-dataset live timing comparison was not taken against the currently running pre-change
+ backend (its disk route returned 404). Workspace traversal remains the dominant optimization
+ risk to monitor after rollout.
+- Idle behavior is unchanged: scheduled cleanup still requires the existing quiet period and
+ blocks on active execution/shell/setup/cleanup/Docker-build resources; manual Analyze remains
+ read-only and not idle-gated.
+
+## Risks
+
+- Goroutine-owned result state must be race-free; run the focused backend suite with `-race`.
+- A provider that blocks or ignores cancellation can still determine request duration; the change
+ removes top-level serialization but does not alter provider traversal behavior.
+- A refactor that accidentally wraps each provider in a separate cache or changes error joining
+ could regress warm reads or partial summaries; preserve the existing cache and response tests.
+- Disk usage can be confused with Kandev-counted bytes; label the progress card as the filesystem
+ containing Kandev storage and show raw total/available values so the distinction is explicit.
+- Dependency names such as `vendor`, `target`, and `.cache` are ambiguous; keep them out of the
+ initial fixed allowlist and make skipped/warned paths visible in the run result.
+- Dependency pruning can race restore, unarchive, or a newly admitted task. Use the existing
+ maintenance admission path plus per-target revalidation and fail closed on any state change.
+- The activity gate covers instrumented runtime work. Workspace reconciliation that occurs before an
+ execution activity lease is acquired remains outside this change and should be audited separately
+ if it becomes a demonstrated idle-gate gap.
diff --git a/docs/plans/storage-overview-parallel-scan/task-01-parallelize-overview-measurements.md b/docs/plans/storage-overview-parallel-scan/task-01-parallelize-overview-measurements.md
new file mode 100644
index 0000000000..acd4fb6519
--- /dev/null
+++ b/docs/plans/storage-overview-parallel-scan/task-01-parallelize-overview-measurements.md
@@ -0,0 +1,67 @@
+---
+id: "01-parallelize-overview-measurements"
+title: "Parallelize overview measurements"
+status: done
+wave: 1
+depends_on: []
+plan: "plan.md"
+spec: "../../specs/system-page/storage-overview-parallel-scan.md"
+---
+
+# Task 01: Parallelize overview measurements
+
+## Acceptance
+
+- Workspace, Go-cache, quarantine, and Docker measurements start concurrently after settings are
+ loaded.
+- A provider error does not prevent successful results from the other providers from reaching the
+ existing `Summary` response.
+- The API response, provider construction, and overview cache behavior remain unchanged.
+- No measurement goroutine or shared result state produces a race or leak under cancellation.
+
+## Verification
+
+```bash
+cd apps/backend && go test -race ./internal/backendapp ./internal/system/storage ./internal/agent/runtime/activity ./internal/agent/runtime/lifecycle
+```
+
+The new unit test must use barriers/channels to prove concurrent entry; it must not use a sleep-
+based timing assertion.
+
+## Files likely touched
+
+- `apps/backend/internal/backendapp/storage_maintenance.go`
+- `apps/backend/internal/backendapp/storage_maintenance_test.go` or the existing focused backend
+ composition test file
+- Any small test-only provider seams required by the composition test
+
+## Dependencies
+
+None.
+
+## Inputs
+
+- Spec: parallel overview measurements, failure modes, and unchanged API/persistence guarantees
+- Existing `storageOverview.Summary` composition in
+ `apps/backend/internal/backendapp/storage_maintenance.go`
+- Typed providers in `apps/backend/internal/system/storage/workspaces/provider.go`,
+ `gocache/provider.go`, `store.go`, and `dockerstore/provider.go`
+- Existing cache and API tests in `apps/backend/internal/system/storage`
+
+## Output contract
+
+Return a compact handoff capsule with acceptance status, changed entry points, focused test results,
+race-test results, risk tags, and any provider behavior that remains dominant in live timing.
+
+## Result
+
+Implemented the four-way fan-out with isolated result/error slots and preserved the existing
+summary/cache contract. The barrier test proves concurrent entry without sleeps. These checks pass:
+
+```text
+go test ./internal/backendapp ./internal/system/storage/... ./internal/system/metrics ./internal/agent/runtime/activity ./internal/agent/runtime/lifecycle -count=1
+go test -race ./internal/backendapp ./internal/system/storage/... ./internal/system/metrics -count=1
+```
+
+The remaining dominant cost is workspace traversal; provider traversal itself was intentionally
+left unchanged in this task.
diff --git a/docs/plans/storage-overview-parallel-scan/task-02-regression-and-timing-validation.md b/docs/plans/storage-overview-parallel-scan/task-02-regression-and-timing-validation.md
new file mode 100644
index 0000000000..6b19a58984
--- /dev/null
+++ b/docs/plans/storage-overview-parallel-scan/task-02-regression-and-timing-validation.md
@@ -0,0 +1,75 @@
+---
+id: "02-regression-and-timing-validation"
+title: "Validate storage scan and idle behavior"
+status: done
+wave: 3
+depends_on: ["01-parallelize-overview-measurements", "03-disk-capacity-progress", "04-workspace-dependency-cleanup"]
+plan: "plan.md"
+spec: "../../specs/system-page/storage-overview-parallel-scan.md"
+---
+
+# Task 02: Validate storage scan and idle behavior
+
+## Acceptance
+
+- Existing Storage E2E coverage still shows policy, history, and quarantine before a held overview
+ response, the independent disk-capacity card renders before a held overview response, and the
+ mobile Storage flow has no horizontal overflow.
+- Cache, handler, operations, scheduler, activity-coordinator, disk-capacity, and workspace
+ dependency tests pass after the changes.
+- When a compatible post-change backend is available, a comparable cold overview request is timed
+ on the same host/settings as the baseline and the independent disk request is timed separately.
+ If the running backend predates the disk route, the baseline, deterministic fan-out barrier, and
+ held-overview managed E2E are recorded as the accepted non-mutating evidence instead.
+- The Aug 5 `skipped_busy` behavior remains explainable by active `execution_preparing` and
+ `execution_running` leases; no cleanup is run while those resources are active.
+
+## Verification
+
+```bash
+cd apps/backend && go test -race ./internal/backendapp ./internal/system/storage ./internal/agent/runtime/activity ./internal/agent/runtime/lifecycle
+cd apps/web && pnpm e2e:run --project chromium tests/system/storage-maintenance.spec.ts
+cd apps/web && pnpm e2e:run --project mobile-chrome tests/system/mobile-storage-maintenance.spec.ts
+```
+
+For the live timing comparison, use a read-only cold-cache setup and the existing backend request
+duration logs. Do not drive the user's live browser or mutate storage data to manufacture a scan.
+
+## Files likely touched
+
+- `apps/web/e2e/tests/system/storage-maintenance.spec.ts`
+- `apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts`
+- implementation task handoff or validation notes for the before/after timing result
+
+## Dependencies
+
+Tasks 01, 03, and 04.
+
+## Inputs
+
+- Existing progressive-loading, capacity, dependency-option, and mobile Storage E2E scenarios
+- Existing cache, capacity, dependency-cleanup, and idle-gate tests
+- Baseline cold request: approximately 103 seconds on the captured host; warm request: effectively
+ instantaneous due to the successful overview cache
+
+## Output contract
+
+Return exact commands and results, available cold/warm timing evidence, mobile artifacts if a test
+fails, idle-gate confirmation, and remaining optimization risks. Mark this task done only after
+Task 01 is implemented and the regression evidence is complete.
+
+## Result
+
+The pre-change cold baseline was approximately 103 seconds on the captured host, with warm reads
+effectively instantaneous from the 15-minute cache. The new deterministic fan-out test proves the
+four measurements overlap, and the managed E2E progressive-loading test holds the overview while
+the disk card and fast sections render. Chromium Storage E2E passed 6/6; mobile Storage E2E passed
+4/4 after the touch disclosure flow was isolated from the existing scheduled-help tooltip.
+
+The existing activity/lifecycle packages and storage race suite pass, along with backend lint and
+the Windows disk-metrics compile check. Fresh desktop and mobile PR captures show the progress
+card and independent loading state. The idle contract remains
+unchanged: the Aug 5 `skipped_busy` entry correctly reported active `execution_preparing` and
+`execution_running` resources. A same-dataset post-change live timing sample was not collected
+because the currently running local backend predates this endpoint; its disk request returned 404.
+The managed E2E evidence is the non-mutating substitute for independent capacity availability.
diff --git a/docs/plans/storage-overview-parallel-scan/task-03-disk-capacity-progress.md b/docs/plans/storage-overview-parallel-scan/task-03-disk-capacity-progress.md
new file mode 100644
index 0000000000..8e8751db84
--- /dev/null
+++ b/docs/plans/storage-overview-parallel-scan/task-03-disk-capacity-progress.md
@@ -0,0 +1,75 @@
+---
+id: "03-disk-capacity-progress"
+title: "Add disk capacity and progress card"
+status: done
+wave: 2
+depends_on: []
+plan: "plan.md"
+spec: "../../specs/system-page/storage-overview-parallel-scan.md"
+---
+
+# Task 03: Add disk capacity and progress card
+
+## Acceptance
+
+- `GET /api/v1/system/storage/disk` measures the filesystem containing Kandev's storage root and
+ returns total, used, available, percentage, path, and availability/error fields.
+- The disk request is independent from the cached overview and remains responsive while the
+ overview scan is held or cold.
+- The Storage page shows localized used percentage, used/available/total sizes, and an accessible
+ progress bar with warning styling at 80% and critical styling at 90%.
+- A capacity failure renders an unavailable card and does not block policy, history, quarantine, or
+ overview sections.
+- Desktop and mobile layouts remain usable without horizontal overflow.
+
+## Verification
+
+```bash
+cd apps/backend && go test -race ./internal/system/metrics ./internal/system/storage ./internal/backendapp
+cd apps/web && pnpm run typecheck
+cd apps/web && pnpm test -- --run components/settings/system/storage/storage-disk-capacity-card.test.tsx
+```
+
+The implementation must reuse or factor the existing cross-platform disk-free-space semantics in
+`apps/backend/internal/system/metrics`; do not add a Unix-only storage API.
+
+## Files likely touched
+
+- `apps/backend/internal/system/metrics/disk_unix.go`
+- `apps/backend/internal/system/metrics/disk_windows.go`
+- `apps/backend/internal/system/metrics/*_test.go`
+- `apps/backend/internal/system/storage/handler.go`
+- `apps/backend/internal/system/storage/types.go`
+- `apps/backend/internal/backendapp/storage_maintenance.go`
+- `apps/backend/internal/system/storage/handler_test.go`
+- `apps/web/lib/api/domains/system-api.ts`
+- `apps/web/lib/types/system.ts`
+- `apps/web/hooks/domains/system/use-storage-maintenance.ts`
+- `apps/web/components/settings/system/storage/storage-disk-capacity-card.tsx`
+- Storage API/component fixtures and tests
+- localized system translation resources
+
+## Dependencies
+
+None. The card is intentionally independent of Task 01's overview fan-out.
+
+## Inputs
+
+- Spec: filesystem capacity indicator, API surface, and failure scenarios
+- Existing `apps/backend/internal/system/metrics/disk_unix.go` and `disk_windows.go`
+- Existing progressive-loading request orchestration in `use-storage-maintenance.ts`
+- Existing `formatGigabytes` and localized Storage card patterns
+
+## Output contract
+
+Return a compact handoff capsule with API/test results, desktop/mobile evidence, exact percentage
+semantics, and any platform-specific capacity limitations.
+
+## Result
+
+Added the cross-platform `GET /api/v1/system/storage/disk` endpoint and an independently loaded
+capacity card. Unix statfs and Windows `GetDiskFreeSpaceEx` expose total, service-available, used,
+and clamped percentage values. The UI renders the exact percentage and byte-derived sizes, with
+accessible progress semantics plus 80%/90% warning styling; unavailable reads remain non-blocking.
+Backend metrics/storage tests, web typecheck/lint, focused component tests, and the desktop/mobile
+managed Storage E2E flows pass.
diff --git a/docs/plans/storage-overview-parallel-scan/task-04-workspace-dependency-cleanup.md b/docs/plans/storage-overview-parallel-scan/task-04-workspace-dependency-cleanup.md
new file mode 100644
index 0000000000..fc09ef0533
--- /dev/null
+++ b/docs/plans/storage-overview-parallel-scan/task-04-workspace-dependency-cleanup.md
@@ -0,0 +1,96 @@
+---
+id: "04-workspace-dependency-cleanup"
+title: "Add opt-in dependency cleanup"
+status: done
+wave: 2
+depends_on: []
+plan: "plan.md"
+spec: "../../specs/system-page/storage-overview-parallel-scan.md"
+---
+
+# Task 04: Add opt-in dependency cleanup
+
+## Acceptance
+
+- Storage settings persist a default-off workspace dependency-cleanup option and reject malformed
+ settings without changing the previous saved value.
+- Scheduled and full manual maintenance can prune only the fixed allowlist beneath Kandev-owned
+ task workspaces whose task is archived or deleted and whose authoritative inventory has no active
+ references.
+- The resource-specific `workspace_dependencies` run uses the existing maintenance activity gate,
+ busy-resource response, Run anyway path, cancellation, retry, and history persistence.
+- The provider never follows symlinks, crosses the task workspace root, deletes ambiguous directory
+ names, or mutates active/borrowed/restored workspaces. It revalidates before each deletion.
+- Results report successfully pruned directories, reclaimed bytes, skips, and warnings, and retries
+ are idempotent. The directory count is the number of directories actually removed; skipped paths
+ are represented in warnings.
+- A workspace can be restored after pruning with source and recovery metadata intact, with a clear
+ indication that dependencies may need to be installed again.
+- The Workspaces policy card visibly lists every allowlisted directory Kandev checks before the
+ option is enabled. An adjacent info control exposes the recursive-search, excluded-folder,
+ safety, and reinstall explanation on hover, keyboard focus, and touch activation.
+
+## Verification
+
+```bash
+cd apps/backend && go test -race ./internal/system/storage ./internal/system/storage/workspaces ./internal/backendapp ./internal/task/service
+cd apps && pnpm --filter @kandev/web test -- --run components/settings/system/storage/storage-policy-card.test.tsx components/settings/system/storage/storage-maintenance-settings.test.tsx
+```
+
+Add filesystem fixtures for every allowlist entry and negative fixtures for `vendor`, `target`,
+`.cache`, `.git`, symlinked directories, escaped paths, active workspaces, and incomplete inventory.
+Use channels/barriers for state-change races rather than sleep-based tests.
+
+## Files likely touched
+
+- `apps/backend/internal/system/storage/types.go`
+- `apps/backend/internal/system/storage/settings.go`
+- `apps/backend/internal/system/storage/workspaces/types.go`
+- `apps/backend/internal/system/storage/workspaces/provider.go`
+- `apps/backend/internal/system/storage/workspaces/provider_test.go`
+- `apps/backend/internal/system/storage/runner.go`
+- `apps/backend/internal/system/storage/operations.go`
+- `apps/backend/internal/system/storage/operations_test.go`
+- `apps/backend/internal/backendapp/storage_maintenance.go`
+- `apps/backend/internal/backendapp/storage_inventory.go`
+- `apps/backend/internal/task/service/*` only if task/reactivation or restore coordination requires
+ an existing cleanup hook to be extended
+- `apps/web/lib/types/system.ts`
+- `apps/web/components/settings/system/storage/storage-policy-card.tsx`
+- `apps/web/components/settings/system/storage/storage-maintenance-settings.tsx`
+- `apps/web/components/settings/system/storage/storage-setting-help.tsx`
+- `apps/web/e2e/tests/system/storage-maintenance.spec.ts`
+- `apps/web/e2e/tests/system/mobile-storage-maintenance.spec.ts`
+- localized system translation resources
+
+## Dependencies
+
+None for the backend contract. Task 02 integrates this behavior with the full desktop/mobile
+regression suite.
+
+## Inputs
+
+- Spec: fixed allowlist, eligibility, retention interaction, safety guarantees, and run selection
+- Existing workspace candidate/quarantine logic in `workspaces/provider.go`
+- Existing authoritative inventory in `backendapp/storage_inventory.go`
+- Existing settings normalization and `selectCleanupProviders` resource-selection behavior
+- Existing quarantine restore and task resource cleanup tests
+
+## Output contract
+
+Return a compact handoff capsule with settings/API changes, provider safety results, race-test
+results, run-history examples, user-facing warning copy, and any remaining package-manager coverage
+gaps. Mark the task done only when no path can be deleted outside the allowlist and owned roots.
+
+## Result
+
+Implemented the persisted default-off setting and `workspace_dependencies` provider. The provider
+fails closed on incomplete inventory, only accepts the exact allowlist (`node_modules`,
+`bower_components`, `.pnpm-store`, `.yarn/cache`, `.yarn/unplugged`, `.venv`, `venv`, `.tox`,
+`.nox`, `__pypackages__`, `Pods`, `.gradle`), skips ambiguous folders, never follows symlinks, and
+revalidates ownership, containment, protection, and archived/deleted eligibility before each
+deletion. Tests cover archived/deleted selection, active protection, exclusions, symlink payloads,
+incomplete inventory, cancellation, byte/directory/workspace counts, default-off provider
+selection, and restore after pruning with source and ownership metadata intact. The policy card
+displays every allowlisted folder and the existing hover/focus/tap help control explains the
+recursive scope and reinstall consequence.
diff --git a/docs/public/operations.md b/docs/public/operations.md
index 7c8520a997..f36f60d809 100644
--- a/docs/public/operations.md
+++ b/docs/public/operations.md
@@ -135,6 +135,11 @@ policy saves reuse the displayed snapshot instead of scanning disk again. The pa
snapshot was last analyzed. Select **Analyze** to force a fresh scan; restarting the backend also
clears the in-memory snapshot.
+The page also shows the current percentage used on the filesystem containing Kandev's storage,
+along with used, available, and total capacity. This is host-volume capacity, not just the bytes
+that Kandev can classify. The card warns at 80% full and uses a critical style at 90%; these
+thresholds do not trigger cleanup.
+
Scheduled cleanup is disabled by default and runs only after the configured resource-idle quiet
period. Orphaned task workspaces and rotated Go caches move into Kandev's quarantine before
permanent deletion. Each entry shows its `delete_after` retention deadline: **Delete** and
@@ -151,6 +156,20 @@ checks still apply.
If scheduled cleanup is disabled, no independent quarantine sweeper runs: use a full **Run now** or
one of the quarantine actions when you want cleanup.
+The Workspaces policy includes an off-by-default **Remove dependencies from archived or deleted
+task workspaces** option. When enabled, a scheduled cleanup or the matching manual action can
+recursively remove only these directories from eligible, unprotected Kandev task workspaces:
+
+`node_modules`, `bower_components`, `.pnpm-store`, `.yarn/cache`, `.yarn/unplugged`, `.venv`,
+`venv`, `.tox`, `.nox`, `__pypackages__`, `Pods`, and `.gradle`.
+
+The Storage page always shows this exact list next to an information control. Kandev skips missing
+directories, never follows symlinks, and does not target ambiguous names such as `vendor`, `target`,
+`build`, `dist`, `.cache`, or `.git`. Only archived or deleted workspaces without active or
+protected references qualify. This does not change the existing full-workspace lifecycle (seven
+days of orphan grace followed by seven days of quarantine retention), and restoring a workspace
+after dependency pruning may require reinstalling its dependencies.
+
Host-wide Docker build-cache and unused-image cleanup remain disabled until you confirm that Kandev
owns a dedicated Docker daemon.
Do not enable those rules on a daemon shared with unrelated workloads.
diff --git a/docs/specs/INDEX.md b/docs/specs/INDEX.md
index c6254f243f..9787a8a928 100644
--- a/docs/specs/INDEX.md
+++ b/docs/specs/INDEX.md
@@ -210,6 +210,7 @@ System pages (Radarr/Sonarr-style) for status, disk usage, database maintenance,
|---|---|
| [system-page](system-page/spec.md) | draft |
| [storage-maintenance](system-page/storage-maintenance.md) | building |
+| [storage-overview-parallel-scan](system-page/storage-overview-parallel-scan.md) | shipped |
| [feature-toggles](feature-toggles/spec.md) | draft |
---
diff --git a/docs/specs/system-page/storage-overview-parallel-scan.md b/docs/specs/system-page/storage-overview-parallel-scan.md
new file mode 100644
index 0000000000..05ac21f9e1
--- /dev/null
+++ b/docs/specs/system-page/storage-overview-parallel-scan.md
@@ -0,0 +1,269 @@
+---
+status: shipped
+created: 2026-08-08
+owner: kandev
+---
+
+# Storage maintenance scan, capacity, and dependency cleanup
+
+This is a focused extension to [Storage maintenance](storage-maintenance.md). It improves cold
+analysis time, gives the operator an immediate view of the filesystem capacity that contains
+Kandev's storage, and adds an opt-in way to reclaim dependency directories from archived or deleted
+task workspaces without deleting their source trees.
+
+## Why
+
+The Storage maintenance page currently waits for a cold overview scan before it can show the
+analysis card. The page already requests policy, run history, quarantine, and overview data
+independently, so those lightweight sections are not the source of the long wait. The backend
+overview itself measures workspaces, the Go build cache, quarantine, and Docker usage one after
+another.
+
+The page also needs to answer two operator questions without requiring filesystem expertise: how
+close is the host volume containing Kandev's data to full, and can dependency-heavy archived task
+workspaces be trimmed while their source remains recoverable? The capacity signal must not wait for
+the slow overview scan, and dependency cleanup must be explicitly enabled because restoring an
+archived workspace after pruning requires dependencies to be installed again.
+
+A live cold request took about 103 seconds on a host with approximately 102 GB of workspace data
+and 38 GB of Go-cache data. The same route was effectively instantaneous on the next request
+because the successful 15-minute overview cache was warm. The independent measurements should be
+able to overlap so the cold path is governed primarily by the slowest source rather than the sum
+of all four source times.
+
+## What
+
+### Parallel overview measurements
+
+After the settings snapshot needed to construct the providers is loaded, the overview scan starts
+these independent measurements concurrently:
+
+- workspace usage and candidate classification;
+- Go build-cache usage and candidate classification;
+- quarantine totals;
+- Docker usage, when Docker is configured and available.
+
+The scan waits for all four results before returning the existing `Summary`. Each measurement keeps
+its current value/error behavior: one failed source does not discard successful results from the
+other sources, and the response shape remains unchanged.
+
+The existing successful-snapshot cache, 15-minute freshness window, forced refresh used by manual
+Analyze, concurrent-refresh coalescing, and stale-snapshot protection remain in force. No new
+durable state is introduced by this scan optimization.
+
+### Filesystem capacity indicator
+
+The page adds a lightweight, independently loaded disk-capacity card. It reads the filesystem that
+contains Kandev's storage root (the task/workspace storage volume), rather than adding Kandev-owned
+byte counts to the host disk total. The card shows:
+
+- a localized exact percentage such as **80% full**;
+- a progress bar with the same value exposed through `aria-valuenow`;
+- used, available, and total capacity in the existing GB formatting; and
+- the measured storage path or a localized explanation when the capacity read is unavailable.
+
+The capacity request is not held behind the cold overview scan and is not served from the 15-minute
+overview snapshot. It can therefore show current host-volume pressure while the detailed analysis
+card is still loading. The percentage is calculated from the filesystem's service-available bytes,
+clamped to 0–100, and the API returns the raw byte values so the UI never has to infer them.
+
+The indicator uses accessible warning styling when the volume reaches 80% full and critical styling
+at 90% full. Those thresholds are presentation constants, not cleanup triggers; the card does not
+automatically delete anything when a threshold is crossed.
+
+### Opt-in dependency-directory cleanup
+
+Maintenance settings add an off-by-default **Remove dependencies from archived or deleted task
+workspaces** option under the Workspaces section. When enabled, scheduled maintenance and a full
+manual run may recursively remove a fixed, safety-reviewed allowlist of dependency directories
+inside Kandev-owned task workspace roots:
+
+- `node_modules`, `bower_components`, and `.pnpm-store`;
+- `.yarn/cache` and `.yarn/unplugged`;
+- `.venv`, `venv`, `.tox`, `.nox`, and `__pypackages__`;
+- `Pods` and `.gradle` when they are nested beneath an eligible task workspace.
+
+The initial allowlist deliberately excludes ambiguous names such as `vendor`, `target`, `build`,
+`dist`, `.cache`, and `.git`. Those may contain committed source, recovery metadata, or unrelated
+artifacts and require a separate classification decision. The option does not accept arbitrary
+paths or shell commands.
+
+The Workspaces policy card always shows the exact allowlist in a localized, code-styled **Folders
+Kandev will check** disclosure so the user can see what the option covers before enabling it. An
+adjacent information icon provides hover, keyboard-focus, and tap behavior and explains that these
+are directory names Kandev searches for recursively, that absent directories are simply skipped,
+that excluded names are never targeted, and that restoring a pruned task may require reinstalling
+dependencies. The list and help content remain usable on mobile; hover is an enhancement, not the
+only way to access the explanation.
+
+Dependency pruning uses the same fail-closed workspace ownership and activity inventory as orphan
+workspace cleanup. A target must be beneath a real Kandev-owned task workspace, belong to a task that
+is archived or deleted, and have no active execution, session worktree, environment borrower, or
+other protected reference. The provider revalidates the target before each destructive operation.
+Deleted tasks are identified from the ownership marker and the absence of an authoritative task
+row; an incomplete inventory causes the provider to make no changes.
+
+This option does not change the existing full-workspace lifecycle. The current defaults are seven
+days of orphan grace followed by seven days of quarantine retention, not a single two-week age
+threshold. Dependency pruning can reclaim the large dependency directories during that lifecycle
+while preserving source files and workspace metadata. A later restore succeeds with the remaining
+workspace, but the UI and run result explain that dependencies were removed and may need to be
+reinstalled.
+
+The existing manual resource-selection contract gains the provider name
+`workspace_dependencies`, allowing an explicit **Clean workspace dependencies** action in the
+Workspaces settings card. It uses the normal maintenance activity gate, busy-resource feedback,
+Run anyway behavior, cancellation, retry, and run-history reporting. It never runs as part of
+read-only Analyze.
+
+### Page behavior
+
+The Storage maintenance page continues to render policy, history, quarantine, and the capacity card
+as soon as their independent requests complete. Only the analysis card remains in its existing
+loading state while the cold overview scan is running. A cached overview continues to load without a
+new filesystem scan, and manual Analyze continues to request a fresh read-only snapshot. Enabling
+dependency cleanup adds one policy control and one workspace-specific action without changing the
+mobile one-column composition.
+
+### Idle behavior invariant
+
+This change does not alter cleanup scheduling or task admission. The existing resource-idle gate
+continues to block scheduled cleanup when instrumented execution, shell/test/setup/cleanup work,
+or Docker image builds are active. The quiet period is measured from the last released task
+activity, and a newly admitted task cancels and drains a maintenance lease before proceeding.
+
+Manual Analyze remains read-only and is not idle-gated. The existing `skipped_busy` history entry
+that reports `execution_preparing` and `execution_running` is therefore a correct scheduled-run
+outcome, not an overview-scan failure.
+
+## Success criteria
+
+- A deterministic backend test proves all four independent measurements have started before any
+ blocking measurement is released; the test must not rely on a timing race.
+- The same test proves the returned summary and per-source errors match the serial implementation.
+- When a compatible post-change backend is available, a cold live overview measurement is captured
+ after implementation using the existing request timing logs. The result should be bounded by the
+ slowest provider plus join overhead, rather than the sum of provider durations, on the same host
+ and dataset. If the only running backend predates the capacity route, the baseline timing plus the
+ deterministic fan-out barrier and held-overview managed E2E are the accepted non-mutating evidence
+ until a compatible runtime is available.
+- Existing cache tests still prove that warm reads, forced Analyze refreshes, coalesced misses, and
+ failed refreshes behave exactly as before.
+- Existing desktop and mobile Storage maintenance flows continue to show fast sections while an
+ overview is pending, and the capacity card renders independently with no horizontal overflow.
+- Capacity tests verify exact byte fields, percentage clamping, 80%/90% presentation thresholds,
+ unavailable filesystems, and accessible progress-bar semantics.
+- Dependency-cleanup tests verify the default-off setting, allowlist-only deletion, byte/count
+ reporting, symlink and path-containment safety, active-workspace protection, archived/deleted
+ eligibility, cancellation, retry, and restore-after-prune behavior.
+- Desktop and mobile UI tests verify the visible allowlist, the info control's hover/focus/tap
+ explanation, excluded-folder copy, and no horizontal overflow.
+- Existing activity-coordinator and scheduled-runner tests continue to prove the idle behavior
+ described above.
+
+## Scenarios
+
+### Cold overview starts independent sources together
+
+Given no cached successful overview, when `GET /api/v1/system/storage` or manual Analyze begins,
+then settings are loaded once, all independent measurements start without waiting for one another,
+and the response contains the same summary fields as before.
+
+### Capacity is visible while analysis is pending
+
+Given a slow or cold overview scan, when the Storage page opens, then the independent capacity
+request can render the filesystem percentage and progress bar before the detailed analysis finishes.
+If the capacity read fails, the card shows an unavailable state without blocking the other sections.
+
+### Dependency cleanup is opt-in and scoped
+
+Given the dependency option is disabled, when scheduled or manual maintenance runs, then no
+dependency directory is removed. Given it is enabled and an archived or deleted workspace is
+unprotected, when the workspace-dependency provider runs, then only allowlisted dependency
+directories beneath that workspace are removed and the run records their count and reclaimed bytes.
+
+### The UI explains the cleanup scope
+
+Given the Workspaces policy card is visible, then it shows the exact allowlisted folder names before
+the user enables the option. Its information control explains the recursive search, skipped absent
+folders, excluded folder names, safety checks, and reinstall consequence through hover, keyboard
+focus, and touch activation.
+
+### Active or restored workspaces are protected
+
+Given a workspace is active, borrowed by an active task, has an active execution/session handle, or
+changes state while pruning, then the provider skips it without deleting any dependency directory.
+Given a user restores a workspace after dependencies were pruned, then the source tree and recovery
+metadata remain available and the result explains that dependencies must be reinstalled.
+
+### One source fails
+
+Given one measurement returns an error, when the other measurements complete, then successful
+source results remain available, the failed source reports its existing unavailable/error state,
+and the request does not deadlock or leak measurement goroutines.
+
+### Cached overview is reused
+
+Given a successful snapshot younger than 15 minutes, when the page is opened, refreshed, or policy
+settings are saved, then the cached snapshot is returned without starting another filesystem or
+Docker scan.
+
+### Manual Analyze remains read-only
+
+Given active task execution, when the user selects Analyze, then the request may run because it
+does not acquire the maintenance idle lease and it does not delete or mutate storage.
+
+### Scheduled cleanup remains idle-gated
+
+Given `execution_preparing` or `execution_running` activity is active, when the scheduled cleanup
+interval fires, then the run is persisted as `skipped_busy` with those stable resource labels and
+no cleanup provider runs. When a task is admitted while maintenance holds the lease, maintenance
+is cancelled and drained before the task proceeds.
+
+## Failure modes
+
+- A provider returns an error: preserve its current per-source error representation while joining
+ the other provider results.
+- The request context is cancelled: stop waiting and return according to the existing handler/job
+ contract without leaving background work or a shared cache flight stranded.
+- Multiple callers miss or force-refresh together: preserve the existing single-flight cache
+ behavior and ensure a stale completion cannot overwrite a newer snapshot.
+- Docker is unavailable: preserve the current unavailable Docker summary and do not make other
+ measurements wait on a Docker-specific retry.
+- Filesystem capacity is unavailable or times out: return an unavailable capacity card and continue
+ loading policy, history, quarantine, and overview independently.
+- A dependency target is a symlink, escapes the workspace root, or has ambiguous ownership: skip it
+ and record a warning; never follow it or fall back to arbitrary recursive deletion.
+- A task becomes active or is restored during dependency pruning: cancel/skip the affected target,
+ leave it intact, and allow the maintenance job to retry safely.
+
+## API surface
+
+The existing `GET /api/v1/system/storage` and `POST /api/v1/system/storage/analyze` contracts remain
+the public entry points for cached and forced overview reads. Add a lightweight
+`GET /api/v1/system/storage/disk` response with `path`, `total_bytes`, `used_bytes`,
+`available_bytes`, `used_percent`, `available`, and an optional `warning`. Extend persisted storage
+settings with the workspace dependency-cleanup boolean, and expose `workspace_dependencies` as a
+valid resource name for the existing `POST /api/v1/system/storage/run` selection field. No other
+route or API contract changes are required.
+
+## Persistence guarantees
+
+The disk-capacity response is read-only and is not persisted or included in the 15-minute overview
+cache. The dependency-cleanup preference is persisted with the existing install-wide storage
+settings object and defaults to false. Maintenance history continues to persist cleanup results,
+including dependency counts/bytes and scheduled `skipped_busy` outcomes. Overview snapshots retain
+their existing TTL and invalidation rules.
+
+## Out of scope
+
+- Changing the 15-minute cache TTL, cache ownership, or refresh semantics.
+- Parallelizing directory traversal inside an individual workspace or Go-cache tree; that can be a
+ separate bounded-worker optimization if the post-change measurements show it is still dominant.
+- Changing storage ownership, full-workspace grace/retention rules, quiet-period semantics, resource
+ labels, or task preemption behavior.
+- Allowing arbitrary dependency paths, shell commands, generic `vendor`/`target`/build-directory
+ deletion, or host-wide package-manager cache cleanup.
+- Automatically pruning on the disk-percentage threshold; the progress bar is informational only.
+- Replacing the existing progressive-loading page composition; the new capacity card is an
+ independently loaded addition and uses the existing mobile one-column pattern.