fix(lading): surface tooling/FUSE-mount panics as errors#1904
Draft
goxberry wants to merge 1 commit into
Draft
Conversation
captool's JSONL paths panicked on a failed line read or malformed JSON via `.expect()` inside a stream-map closure. Convert each closure to return `Result<Line, Error>` and fail-fast on the first error; captool is an offline analyzer where silently skipping corrupt lines would mask the corruption being investigated. The fn-level `#[expect(clippy::expect_used)]` on `main` and `validate_capture` stays — the remaining `.expect()` sites are on `JoinHandle`s where a `JoinError` is the intentional propagation of an inner blocking-task panic. The reason text is updated accordingly so it no longer reads as tracked debt. logrotate_fs::Server::new panicked when `fuser::spawn_mount2` failed (e.g. missing /dev/fuse permissions). The function already has `#[from] std::io::Error -> Error::Io`, so the fix is just `?` on the `io::Result`; no new variant needed. The fn-level FIXME `#[expect]` is removed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 23, 2026
Contributor
Author
This was referenced May 23, 2026
|
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
Third and final PR in the FIXME-conversion stack. Addresses the three
remaining sites: two in the offline
captoolanalyzer, one in theFUSE-mount setup of the logrotate-fs generator.
bin/captool/main.rs—mainandvalidate_captureBoth functions consume a
LinesStreamvia.map(|l| { ... })andpanic via
.expect()on either a failed line read or a malformedJSON record. Convert the closures to return
Result<Line, Error>and fail-fast on the first error.
captoolis an offline analyzer —silently skipping corrupt lines would mask the corruption being
investigated.
The fn-level
#[expect(clippy::expect_used)]stays on bothfunctions: a few
.expect()calls remain ontokio::task::JoinHandleresults, where a
JoinErroris the intentional propagation of aninner blocking-task panic. The
reasontext is rewritten so theattribute no longer reads as tracked debt — it now describes
deliberate panic propagation.
generator/file_gen/logrotate_fs.rs::Server::newfuser::spawn_mount2returns anio::Resultand the existingError::Iovariant is already#[from] std::io::Error. The fix istrivial: replace
.expect("Failed to mount FUSE filesystem")with?. No new variant needed. The fn-level FIXME#[expect]isremoved.
End state
After this PR,
grep -rn 'FIXME' lading/src/returns no results. Allremaining
#[expect(clippy::expect_used)]attributes in theladingcrate are correctly-documented intentional panics (channel-iterator
construction,
OnceCellset-once,JoinHandletask-panicpropagation,
tokio::select!branch invariants, etc.) rather thantracked debt.
Test plan
./ci/validatepassesgrep -rn 'FIXME' lading/src/is emptycargo build --workspace --all-targets --all-features🤖 Generated with Claude Code