Skip to content

fix(daemon): emit version on uffsd --version - #71

Merged
githubrobbi merged 1 commit into
mainfrom
fix/uffsd-version-and-sync-recipes
Apr 26, 2026
Merged

fix(daemon): emit version on uffsd --version#71
githubrobbi merged 1 commit into
mainfrom
fix/uffsd-version-and-sync-recipes

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

Why

just use's install-time --version probe shows uffsd returning empty:

Installed versions:
  uffsmcp.exe  uffsmcp 0.5.74
  uffs.exe     uffs 0.5.74
  uffsd.exe                     ← empty
  uffs_mft.exe uffs_mft 0.5.74

Root cause: uffsd's clap #[command(...)] attribute was missing version, so clap doesn't wire a --version handler at all and the binary exits silently.

Peer binaries already pull CARGO_PKG_VERSION via clap's auto-version:

  • uffs-mcp/src/main.rs#[command(name = "uffsmcp", version, about)]
  • uffs-mft/src/cli.rs#[command(author, version, about, ...)]
  • uffs-cli/src/args.rs → custom print_version() handler

What

Daemon fix (crates/uffs-daemon/src/main.rs):

  • Add version to #[command(...)].
  • Align clap name from "uffs-daemon""uffsd", matching the actual [[bin]] name = "uffsd" in crates/uffs-daemon/Cargo.toml (and the binary path users invoke).

Verified locally:

$ ./target/debug/uffsd --version
uffsd 0.5.74
$ ./target/debug/uffsd --help | head -1
UFFS background search daemon

Bonus dev tooling (just/build.just) — fixes a recurring friction in the daily-driver oneliner:

git pull; just use
    ↓
error: Your local changes to the following files would be overwritten
       by merge: Cargo.lock

cargo build rewrites Cargo.lock whenever a transitive dep re-resolves (mtime drift, polars git pin movement, etc.); after a just ship upstream the lockfile has moved, so a plain git pull aborts.

  • just syncgit fetch origin main && git reset --hard FETCH_HEAD, guarded against running on any branch other than main so feature branches with real WIP cannot be wiped by accident. Prints what's being discarded. Both [unix] (bash) and [windows] (PowerShell) variants, matching the existing use / use-local split.
  • just refreshrefresh: sync use. Drop-in replacement for the git pull; just use leg of the daily-driver oneliner.

New oneliner:

clear; Remove-Item -Recurse -Force "$env:LOCALAPPDATA\uffs\cache" -ErrorAction SilentlyContinue; `
Remove-Item -Recurse -Force "$env:TEMP\uffs_index_cache" -ErrorAction SilentlyContinue; `
~\bin\uffs.exe mcp kill; ~\bin\uffs.exe daemon kill; `
just refresh; `
~\bin\uffs.exe daemon start; ~\bin\uffs.exe mcp start; ~\bin\uffs.exe status

Self-test on this branch (which is not main) confirms the safety guard:

$ just sync
❌ just sync only runs on main (current: fix/uffsd-version-and-sync-recipes)
   Use 'git pull --rebase' (or commit the WIP first) on feature branches.

Scope

Single PR, type fix because the version-flag is the user-visible behavioral defect driving the patch-bump release. The recipe additions are dev-tooling-only and have no effect on shipped binaries.

Tests / verification

  • cargo build -p uffs-daemon — clean
  • ./target/debug/uffsd --version / --help — both produce the expected output
  • just lint-fast — green (file-size, fmt-check, lint-prod, lint-tests, lint-ci, typos, reuse)
  • lint-pre-push — green across all 13 gates including tests, rustdoc, doc-tests, check-windows, smoke
  • just --summary | grep shows sync, refresh, use, use-local all parsed
  • just sync on this branch correctly refuses with the helpful error

Follow-up

After this lands I'll cut v0.5.75 via just ship so ~/bin/uffsd.exe --version actually shows uffsd 0.5.75 next time you just refresh.

The `uffsd` binary was missing a `version` attribute on its clap
`#[command(...)]`, so `uffsd --version` exited silently.  This is
visible in `just use`'s install-time `--version` probe:

    Installed versions:
      uffsmcp.exe  uffsmcp 0.5.74
      uffs.exe     uffs 0.5.74
      uffsd.exe                     ← empty
      uffs_mft.exe uffs_mft 0.5.74

Peer binaries already pull `CARGO_PKG_VERSION` via clap's auto-version:
- `uffs-mcp/src/main.rs` → `#[command(name = "uffsmcp", version, about)]`
- `uffs-mft/src/cli.rs`  → `#[command(author, version, about, ...)]`
- `uffs-cli/src/args.rs` → custom `print_version()` handler

This change brings `uffsd` into parity:
- Adds `version` to the `#[command(...)]` attribute.
- Aligns the clap `name` from `"uffs-daemon"` to `"uffsd"` to match
  the actual `[[bin]] name = "uffsd"` in
  `crates/uffs-daemon/Cargo.toml` (and the binary path users invoke).

Verified locally:

    $ ./target/debug/uffsd --version
    uffsd 0.5.74
    $ ./target/debug/uffsd --help | head -1
    UFFS background search daemon

Also adds two `just` recipes that fix a recurring friction in the
daily-driver oneliner:

    git pull; just use
        ↓
    error: Your local changes to the following files would be overwritten
    by merge: Cargo.lock

`cargo build` rewrites `Cargo.lock` whenever a transitive dep
re-resolves (mtime drift, polars git pin movement, etc.); after a
`just ship` upstream the lockfile has moved, so a plain `git pull`
aborts.

- `just sync`: `git fetch origin main && git reset --hard FETCH_HEAD`,
  guarded against running on any branch other than `main` so feature
  branches with real WIP cannot be wiped by accident.  Prints what's
  being discarded.  Both `[unix]` (bash) and `[windows]` (PowerShell)
  variants, matching the existing `use` / `use-local` split.
- `just refresh`: `refresh: sync use` — drop-in replacement for the
  `git pull; just use` leg of the daily-driver oneliner.

New oneliner becomes:

    clear; Remove-Item ...; uffs.exe mcp kill; uffs.exe daemon kill; \
        just refresh; uffs.exe daemon start; uffs.exe mcp start; \
        uffs.exe status

Self-test on this branch (which is not `main`):

    $ just sync
    ❌ just sync only runs on main (current: fix/uffsd-version-and-sync-recipes)
       Use 'git pull --rebase' (or commit the WIP first) on feature branches.

The version fix is the user-visible behavior change driving the
patch-bump release; the recipe additions are dev-tooling-only and have
no effect on shipped binaries.
@githubrobbi
githubrobbi enabled auto-merge (squash) April 26, 2026 14:53
@githubrobbi
githubrobbi merged commit 6c647cc into main Apr 26, 2026
16 checks passed
@githubrobbi
githubrobbi deleted the fix/uffsd-version-and-sync-recipes branch April 26, 2026 15:05
githubrobbi added a commit that referenced this pull request Apr 26, 2026
…sorts as empty (#73)

Bug:

  T62 `--sort extension asc` fails on Windows live MFT with

  "Not asc: bash_history > 2008" because `scripts/windows/api-validation.rs`

  computes the per-row Extension column with a naive

  `name.rsplit('.').next()`. For `.bash_history` (leading-dot hidden

  file) that yields `"bash_history"` instead of `""`, mis-ordering it

  ahead of the digit-prefixed names.

Why CLI + MCP already work, but API didn't:

  v0.5.74 fixed the MCP lane (`crates/uffs-mcp/src/tools/search.rs`)

  and v0.5.75 (PR #71) shipped alongside, but the same dot-gated fix

  for `extension_from_name` in `uffs-format`/`uffs-core` is what the

  CLI uses. The pure-RPC validation lane in `api-validation.rs` derives

  its own Extension column from the daemon's `name` JSON field via

  `rpc_field_computed("_ext")` and never picked up the fix.

Fix:

  Add `extract_ext_dot_gated` helper mirroring

  `extract_extension_after_dot` in

  `crates/uffs-core/src/search/filters/ext_match.rs`. Returns empty

  string for: dotless names, leading-dot hidden files, trailing-dot

  names. Use it in (a) `_ext` computed column (sort + display) and

  (b) the `type_*` allowlist validator (so dotless rows are not

  classified by their full name as a phantom extension).

Verification:

  - `rust-script -p` + `cargo check` on generated package: clean.

  - Existing dot-gated regression tests in `uffs-format` /

    `uffs-core` / `uffs-mcp` already pin equivalent semantics for

    the workspace lanes.

Affects: T62 (sort extension asc) + type_code/document/executable/picture/system.
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