Background
Raised during review of PR #75 (refresh stale Cargo lockfiles before publish preflight).
Problem
discover_tracked_lockfiles in lading/commands/lockfile.py mixes direct filesystem I/O (workspace_root.rglob, Path.exists) with injected runner calls. Failures are hidden via LOGGER.warning and silent empty-tuple returns rather than being surfaced through explicit APIs. Tests compensate by mocking filesystem layout rather than testing integrations.
Resolution
- Route filesystem operations (lockfile enumeration, manifest existence checks) through the injected
runner or a dedicated filesystem port so the function has no direct Path I/O.
- Make discovery failures explicit in the public API (raise a typed exception or return a
Result-style type) rather than logging warnings and returning empty tuples silently.
- Replace mock-based unit tests with real integration tests that exercise discovery and refresh against temporary directory fixtures without stubbing the internals.
References
Background
Raised during review of PR #75 (refresh stale Cargo lockfiles before publish preflight).
Problem
discover_tracked_lockfilesinlading/commands/lockfile.pymixes direct filesystem I/O (workspace_root.rglob,Path.exists) with injectedrunnercalls. Failures are hidden viaLOGGER.warningand silent empty-tuple returns rather than being surfaced through explicit APIs. Tests compensate by mocking filesystem layout rather than testing integrations.Resolution
runneror a dedicated filesystem port so the function has no directPathI/O.Result-style type) rather than logging warnings and returning empty tuples silently.References