Skip to content

feat(rust): detection-only build (default 'file' feature) + infer 0.19 - #90

Merged
brentrager merged 2 commits into
mainfrom
detection-only-feature
Oct 5, 2026
Merged

brentrager merged 2 commits into
mainfrom
detection-only-feature

Conversation

@brentrager

@brentrager brentrager commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In Rust, smooai-file always pulled in aws-sdk-s3, aws-config, reqwest and tokio/full, so a service that only needs to sniff bytes it already holds couldn't use it cheaply. As a result the Smoo AI monorepo's media pipeline hand-rolled two separate infer sniffers (api-prime and temporal-worker), and they drifted apart. One normalizes audio/x-m4a to audio/mp4 and the other doesn't, so an inbound .m4a text is rejected (SMOODEV-3648).

Solution

  • New file feature, on by default, gating the I/O File type and its modules (file, metadata, source), FileError::Http, and every I/O dependency. Existing users see no change.

  • default-features = false leaves only detection, content_disposition and the error types, and depends on just infer, mime_guess and thiserror.

  • infer 0.16 → 0.19.

  • rust:check now also runs cargo check --no-default-features --all-targets. Test files that need File are gated on the feature. The crate-level doc example is split: a detection example runs without features, and the File example is only included with file.

  • .NET: SourceLink 8.0.0 → 10.0.303. A new advisory (GHSA-23fw-v26w-5fgq) on Microsoft.Build.Tasks.Git 8.0.0, combined with TreatWarningsAsErrors, made every restore fail, so validate was red on every PR (reproduced locally). Build-time only (PrivateAssets="All"). Verified with dotnet format --verify-no-changes, and all 97 .NET tests pass.

Verification

  • cargo test (default): all suites pass.
  • cargo test --no-default-features: 32 unit tests, 3 error-taxonomy tests and the doctest pass.
  • cargo clippy -D warnings passes both ways; cargo fmt --check passes.
  • cargo tree --no-default-features: only infer, mime_guess, thiserror.

🤖 Generated with Claude Code

…er 0.19

The I/O File type (and its AWS SDK, reqwest and tokio deps) moves behind a
default-on 'file' feature, so default-features = false leaves only detection,
content_disposition and the validation errors. Lets a service's core library
sniff bytes it already holds without pulling the AWS SDK in: the Smoo AI media
pipeline had two hand-written infer sniffers that drifted apart (SMOODEV-3648).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a0c9cff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/file Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…3fw-v26w-5fgq

TreatWarningsAsErrors turns the NU1902 advisory into a restore failure, so
dotnet format/build failed on every PR. Build-time only (PrivateAssets=All).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brentrager
brentrager merged commit b49d0bb into main Oct 5, 2026
1 check passed
@brentrager
brentrager deleted the detection-only-feature branch October 5, 2026 18:06
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