File-stability pre-sync guard + materials file-type icons - #22
Merged
Conversation
Design spec for two features on the materials-ico branch: - file_stability.py: stdlib size-polling guard wired into NASSyncClient ._drive_job as a last-instant pre-rclone completeness check (stable subset -> --files-from; all-unstable -> non-failing deferral). New sync.stability config block; module called via asyncio.to_thread. - Materials file-type icons: MDI vendored offline under assets/fonts/mdi, a pure file_type_icon component, category colors via the Okabe-Ito palette, wired into the file list + metadata pane, with node-type icons for the equipment/project/run tree. Includes decisions table, config schema, test matrix, risks, open decisions, and appendices (reference impl, README usage note, file inventory). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Part A -- pre-rclone file-stability guard: - sync/file_stability.py: stdlib is_stable/wait_until_stable (size polling) - NASSyncClient._drive_job: pre-transfer gate via asyncio.to_thread -- settled files transfer, still-growing files defer without consuming the retry budget; whole-run jobs narrow to an explicit --files-from subset - config: SyncConfig.stability (FileStabilityConfig) Part B -- materials file-type icons (MDI, Okabe-Ito category colours): - ui/components/file_type_icon.py: pure ext->glyph/colour map + render - tree.py: equipment/project/run node-type icons via a Quasar slot q-icon - theme.py: vendored MDI webfont (assets/fonts/mdi) injected offline - file_list + metadata_pane: file-type icon in Name cell / selected card - DESIGN.md: sanction --oi-* for categorical file/node-type icon encoding Tests: file_stability, nas_client gate (defer/narrow), config, file_type icon map, tree node-type icons. Full unit suite green; ruff clean. Spec: docs/superpowers/specs/2026-05-30-file-stability-guard-and-material-file-icons-design.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent features (one combined spec). Design:
docs/superpowers/specs/2026-05-30-file-stability-guard-and-material-file-icons-design.md.Part A — file-stability pre-sync guard
Ensures
rcloneonly transfers files that have stopped being written.sync/file_stability.py(new): stdlib-onlyis_stable(path, interval, checks, timeout)andwait_until_stable(paths, ...)— pollsst_sizeand reports files whose size is stable across N consecutive observations.NASSyncClient._drive_job: a last-instant gate beforerclone copy(run viaasyncio.to_thread). Settled files transfer; still-growing files defer without consuming the retry budget (no new job state). Whole-run jobs narrow to an explicit--files-fromsubset.SyncConfig.stability(FileStabilityConfig) —enabled,interval_seconds,checks,timeout_seconds,max_workers.Why (vs the existing
QuiescenceSyncPoller): closes the enqueue→transfer gap (a job can sit queued while a writer resumes), gives one uniform guard over all paths into rclone, and skips wasted partial uploads. It is an efficiency/timeliness guard — verify remains the integrity authority.Part B — materials file-type icons (MDI, Okabe-Ito category colours)
ui/components/file_type_icon.py(new): pure extension→{MDI glyph,--oi-*colour, tooltip, category} map + render wrapper, mirroringsync_status_icon.py.<q-icon>.theme.py: vendored MDI webfont underassets/fonts/mdi/, injected offline (no CDN); already bundled byexlab_wizard.spec'sassets/tree.DESIGN.md: amended the Absolute-Constraints + §01 to sanction--oi-*for categorical file/node-type icon encoding (semantic status still uses--color-*).Tests / verification
test_file_stability.py,test_nas_client_stability.py(defer + narrow),test_file_type_icon.py,test_tree.py; extendedtest_models.py.tests/unitsuite green;ruffclean.rclonebinary). Manual GUI check still recommended.Packaging note
The MDI webfont (~750 KB) ships in the bundle (offline desktop app); no spec change required.
🤖 Generated with Claude Code