Skip to content

File-stability pre-sync guard + materials file-type icons - #22

Merged
Xander-git merged 2 commits into
mainfrom
worktree-materials-ico
May 30, 2026
Merged

File-stability pre-sync guard + materials file-type icons#22
Xander-git merged 2 commits into
mainfrom
worktree-materials-ico

Conversation

@Xander-git

Copy link
Copy Markdown
Collaborator

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 rclone only transfers files that have stopped being written.

  • sync/file_stability.py (new): stdlib-only is_stable(path, interval, checks, timeout) and wait_until_stable(paths, ...) — polls st_size and reports files whose size is stable across N consecutive observations.
  • NASSyncClient._drive_job: a last-instant gate before rclone copy (run via asyncio.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-from subset.
  • Config: 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, mirroring sync_status_icon.py.
  • Tree: equipment/project/run node-type icons via a Quasar slot <q-icon>.
  • theme.py: vendored MDI webfont under assets/fonts/mdi/, injected offline (no CDN); already bundled by exlab_wizard.spec's assets/ tree.
  • File list + metadata pane: file-type icon in the Name cell / selected-file card.
  • DESIGN.md: amended the Absolute-Constraints + §01 to sanction --oi-* for categorical file/node-type icon encoding (semantic status still uses --color-*).

Tests / verification

  • New: test_file_stability.py, test_nas_client_stability.py (defer + narrow), test_file_type_icon.py, test_tree.py; extended test_models.py.
  • Full tests/unit suite green; ruff clean.
  • Not exercised in CI-less sandbox: e2e/Playwright + integration (no browser / rclone binary). 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

Xander-git and others added 2 commits May 30, 2026 02:08
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>
@Xander-git
Xander-git merged commit 97eea4e into main May 30, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant