Skip to content

Harden sync lifecycle and platform discovery - #1

Merged
ensevengg merged 1 commit into
mainfrom
stabilize-sync-lifecycle
Sep 15, 2026
Merged

ensevengg merged 1 commit into
mainfrom
stabilize-sync-lifecycle

Conversation

@ensevengg

Copy link
Copy Markdown
Owner

Summary

First PR of a three-PR stack. Hardens the sync lifecycle and platform discovery ahead of the stacked feature work:

  • Scan error propagation — new OllamaScanReport carries per-manifest scan errors, so one unreadable manifest can no longer abort (or silently vanish from) sdl scan; sdl prune now refuses to run on incomplete scans instead of risking destructive cleanup on a partial view.
  • Config discovery — resolves ollama/lms via PATH first on Windows, reads LM Studio's own settings.json (downloadsFolder) for the models directory with a safe fallback, and defaults Ollama's library to /usr/share/ollama/.ollama/models on Linux (systemd-service layout).
  • Digest validation — manifest digests are validated against a strict SHA-256 pattern before use in blob paths (also closes a path-traversal hole from crafted manifests).
  • Honest sync state — SyncRecord now stores where LM Studio placed the import and is_synced verifies the target still exists, so models deleted from LM Studio are no longer reported "synced" forever.
  • Copy mode across volumes — the temporary naming alias is staged on Ollama's filesystem (.studiolink-imports), so --copy works when ~/.studiolink lives on another drive; temp aliases are cleaned up after import.
  • Safer prune — aliases required by symbolic-link imports and by not-yet-ready models are preserved; stale-record removal only happens after a complete scan.
  • CLI robustness — a missing lms executable surfaces as a clean LMStudioError instead of a raw OSError traceback.
  • Tooling — CI quality gate (ruff lint + format, pyright, build), Python 3.14 in the test matrix, dynamic version from studiolink.__version__, PEP 639 license metadata.

Verification

  • Full suite: 135 passed (main: 117) on Ubuntu and Windows-compatible fixtures.
  • ruff + pyright clean at the top of the stack.

Stack / merge order

  1. This PR → main
  2. support-artifact-bundles → stabilize-sync-lifecycle (vision/model-projector bundles)
  3. reliability-fixes → support-artifact-bundles (audit fixes + release 0.3.1)

Merge in order; each PR contains the previous one.

@ensevengg
ensevengg merged commit f9df9a3 into main Sep 15, 2026
7 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