Floe Agent
Docs

Storage diagnostics and safe cleanup / 储存空间诊断与安全清理

Status: implemented in source, not yet device-accepted. This document describes the current behavior. The Data management page covers Floe's own data only; iOS Storage remains the authority for the app's system-accounted size, and no guessed cap is shown. Last updated: 2026-10-16 (measured physical extent union through public fcntl(F_LOG2PHYS_EXT) with a fail-closed fallback, one shared snapshot cache, a Floe-app-only numeric overview whose details reconcile with the total, and a separate Shared files section).

Why this exists / 背景

An upgraded device reported Floe's figures far above what iOS Storage showed. The previous inspector already read host-allocated size keys (totalFileAllocatedSize), so logical lengths alone do not explain the difference. Local probes then proved one concrete over-counting mechanism: APFS clone families report their full allocated size on every member, so adding the members up counts the same shared blocks several times. The census now measures this instead of guessing, and the page presents only what it can honestly support. The affected device is not reachable from the development host, so device-specific numbers remain unconfirmed; the measurement is privacy-preserving and never deletes user data to produce it.

The engine / 计量引擎

FloeAgent/Sources/FloeCore/StorageAccounting.swift, StorageCloneAccounting.swift and StorageReportBuilder.swift:

Snapshot cache / 快照缓存

One shared StorageSnapshotCenter (StorageDiagnosticService.shared) renders the last valid totals immediately:

App wiring / App 接线

Safe cleanup / 安全清理

FloeAgent/Sources/FloeCore/StorageCleanup.swift (engine) + FloeApp/Settings/StorageDiagnosticService.swift (registered plan):

Tests / 测试

The engine's behavior is covered by focused checks executed against the patched sources during development: ordinary files, sparse disks (logical vs allocated), hard links counted once, nested roots, parent/unattributed files, symlinks not followed, hidden and vanishing files, cancellation, report arithmetic; pure-clone family dedup, measured private bytes, unsupported-volume fallback; snapshot cache reentry, invalidation, failure cooldown, persistence and store privacy/corruption handling. The App-hosted storage suites, full-App build and device acceptance remain with the integration owner. FloeApp compilation is part of the full App build.

Honesty / 诚实边界

Search documentation

    Results open the matching section.