You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complete Bundle 49 by making a long desktop library import observable and safely cancellable without exposing host paths, sidecar credentials, ports, process handles or generic host authority to the renderer.
implementation must not be merged ahead of its predecessor
canonical merge/release authorization remains separate
Current architecture finding
renderer
-> library_import_root (awaits whole operation)
-> Rust spawn_blocking
-> one-shot authenticated Python sidecar
-> POST /v1/library/import (blocking)
-> scan -> import metadata/identity -> persist
-> final result
The scanner already supports a cancel_requested callback, but the desktop service currently constructs it without a cancellation source. The current renderer cannot cancel an in-flight import because the only import command returns after the whole sidecar request finishes.
Counters are non-negative and monotonic. Unknown totals must remain unknown rather than fabricated.
Security invariants
opaque random job IDs only;
capability ID is resolved by trusted Rust before job creation;
renderer never receives canonical root path;
renderer never receives sidecar secret, nonce, loopback port or PID;
no generic filesystem/shell/network command is introduced;
status/cancel reject unknown or stale job IDs fail-closed;
cancellation is idempotent;
at most one active library import per desktop app instance for this slice;
progress payloads contain no absolute paths or raw exception details;
hard process termination is fallback, not the primary cancellation mechanism;
SQLite writes remain transactionally safe and partial completion is explicit.
Deliverables
Rust ImportJobRegistry and bounded lifecycle DTOs;
narrow Tauri start/status/cancel commands;
cooperative cancellation wiring into the Python import pipeline;
phase/counter progress reporting;
renderer Cancel action and accessible progress state;
deterministic job lifecycle tests;
sidecar auth tests for status/cancel controls;
renderer authority regression tests;
rollback document and schema tree.
Acceptance
import start returns promptly with an opaque job ID;
renderer can observe phase changes without direct sidecar/network access;
counters never decrease;
cancellation during scanning terminates cooperatively and returns cancelled;
cancellation during later phases reaches a defined checkpoint and never reports fake success;
repeated cancel is safe;
unknown/stale job IDs fail closed;
app exit terminates active sidecar within bounded shutdown time;
full Python CI and Rust desktop proof gates pass;
no new absolute-path leak is introduced.
Out of scope
multiple concurrent imports;
resumable imports after process restart;
background daemon mode;
analysis jobs (Bundle 50);
cloud synchronization;
release/signing/notarization;
merge authorization.
Governance
This issue authorizes no merge, release, deploy or production effect. The safest implementation base is chosen only after predecessor #102 reaches its governed merge boundary.
Value
Complete Bundle 49 by making a long desktop library import observable and safely cancellable without exposing host paths, sidecar credentials, ports, process handles or generic host authority to the renderer.
Dependency
1884a874a2c467919959dee17f0257faeb79c944Current architecture finding
The scanner already supports a
cancel_requestedcallback, but the desktop service currently constructs it without a cancellation source. The current renderer cannot cancel an in-flight import because the only import command returns after the whole sidecar request finishes.Target schema tree
Lifecycle contract
Job states:
pendingrunningcancellingsucceededcancelledfailedPhases:
startingscanningimportingpersistingfinalizingSafe counters:
discovered_entriesacceptedimportedpersistedCounters are non-negative and monotonic. Unknown totals must remain unknown rather than fabricated.
Security invariants
Deliverables
ImportJobRegistryand bounded lifecycle DTOs;Acceptance
cancelled;Out of scope
Governance
This issue authorizes no merge, release, deploy or production effect. The safest implementation base is chosen only after predecessor #102 reaches its governed merge boundary.