Skip to content

fix(fuse): kill cargo-mutants 27.1.0 struct-field survivors - #727

Closed
KooshaPari wants to merge 6 commits into
mainfrom
fix/cargo-mutants-struct-field
Closed

fix(fuse): kill cargo-mutants 27.1.0 struct-field survivors#727
KooshaPari wants to merge 6 commits into
mainfrom
fix/cargo-mutants-struct-field

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Aug 10, 2026

Copy link
Copy Markdown
Owner

User description

Summary

The Mutation Testing main-push lane (ec353cb) failed: cargo-mutants 27.1.0 examines 261 fuse mutants and missed 6 \delete field\ mutants on the \FuseMountOptions\ literals in the mount entry points.

Root cause (cargo-mutants 27.1.0): the new \delete field\ operator targets struct literals with a ..base\ and \�isit_expr_struct\ pushes those mutants directly into the examine set, bypassing \�llows_mutant\ — so \�xclude_re\ cannot exclude them (the existing \FuseSessionRegistry::\ pattern silently stops matching for this genre).

Fix:

  • Extract \session_mount_options\ — the four platform mount entry points (Linux/macOS + Windows variants) now share one literal, and the session-id wiring becomes unit-testable without a live mount.
  • Drop the redundant \serialize: true\ (already the \FuseMountOptions\ default) — eliminates the equivalent mutants.
  • New \session_mount_options_pins_session_id\ unit test catches the remaining \delete field session_id\ mutant.
  • Triage note added to \mutants.toml\ and \docs/ops/mutants-hard-gate.md.

Verification

  • Local parity run (cargo-mutants 27.1.0, --timeout 60 --jobs 8, same config): 257 mutants, 222 caught, 35 unviable, 0 missed, exit 0.
  • \cargo test -p sharecli-fuse\ full suite (lib 42 + integration 43): all green.
  • \cargo fmt --all -- --check\ clean.

FR reference: FR-003 (mutants hard gate), FR-009 (FUSE IO Intercept).


CodeAnt-AI Description

Align FUSE session behavior across platforms and validate registry handling without live mounts

What Changed

  • CoW mounts now use .sharecli-cow, while non-CoW mounts use .sharecli-cow-staging by default on every platform.
  • All session-backed mount entry points preserve the requested session ID and keep write serialization enabled.
  • FUSE registry resolution consistently reports missing, unknown, and ambiguous mounts, while still resolving a sole mount or a specified mountpoint.
  • Added tests for default CoW directories, session ID preservation, mount listing, resolution, singleton behavior, and unmount errors.
  • Updated mutation-testing rules and documentation to keep testable registry behavior covered while excluding only mount-dependent paths.

Impact

✅ Consistent CoW directories across platforms
✅ Session IDs preserved on every mount
✅ Clearer errors for missing or ambiguous mounts

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI lite review requested due to automatic review settings August 10, 2026 07:11
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 02ee431 Aug 10, 2026 · 22:40 22:41
✅ Reviewed your PR ce431fc Aug 10, 2026 · 07:11 07:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary

This PR centralizes FuseMountOptions construction for Linux, macOS, and Windows mount entry points. It preserves session IDs and removes redundant serialization configuration.

It adds no-mount tests for FuseSessionRegistry, shared mount-resolution logic, and CoW root selection. It documents the mutation-testing strategy and narrows mutation exclusions.

Verification reports 257 mutants, 222 caught, 35 unviable, and 0 missed. The sharecli-fuse test suite passes, and formatting checks are clean.

Must Fix

None identified.

Should Fix

None identified.

Consider

The documentation explains why live-kernel-dependent mount entry points remain excluded. It also records no-mount coverage for registry operations and delete field mutants.

Approve / Request Changes

Approve. The PR fixes the missed mutants, improves shared mount-option handling, adds targeted regression coverage, and preserves the public API.

Walkthrough

The Fuse session registry now centralizes mount option construction and entry resolution. It adds no-mount registry tests, platform-specific mutation triage, and separate default CoW roots for enabled and disabled modes.

Changes

Fuse session registry and CoW behavior

Layer / File(s) Summary
CoW root selection
crates/sharecli-fuse/src/cow_session.rs
from_options selects .sharecli-cow when CoW is enabled and .sharecli-cow-staging when disabled. Tests cover both defaults.
Shared session mount options
crates/sharecli-fuse/src/session_registry.rs
session_mount_options sets the requested session ID and enables write serialization. Linux/macOS and Windows foreground and background mounts use the helper. Tests verify the defaults.
Registry resolution and mutation triage
crates/sharecli-fuse/src/session_registry.rs, crates/sharecli-fuse/mutants.toml, docs/ops/mutants-hard-gate.md
Unix and Windows resolution use shared entry lookup and error handling. No-mount tests cover registry lookup, listing, canonicalization, ambiguity, and unmount failures. Mutation configuration and documentation identify mount-bound exclusions and retain testable Linux resolution mutants.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant resolve_fs
  participant FuseSessionRegistry
  participant resolve_entry
  resolve_fs->>resolve_entry: resolve mountpoint or sole registry entry
  resolve_entry->>FuseSessionRegistry: inspect registered sessions
  FuseSessionRegistry-->>resolve_entry: entry or empty/ambiguous error
  resolve_entry-->>resolve_fs: resolved filesystem entry
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes a clear summary and verification results, but it omits several required template sections, including linked issues, implementation notes, risk and rollout, and checklist completion. Add the required Linked Issues, Implementation Notes, Risk & Rollout, and completed checklist sections, and include the requested test-output evidence.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the FUSE mutation-testing fix addressed by the changes.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cargo-mutants-struct-field
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/cargo-mutants-struct-field

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment on lines +136 to +137
pub(crate) fn session_mount_options(session_id: &str) -> FuseMountOptions {
FuseMountOptions { session_id: Some(session_id.to_string()), ..Default::default() }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: On Windows, these default options are passed to CowMountHandle::from_options, which derives an unset cow_dir as backing/.sharecli-cow, even when CoW is disabled. The Unix implementation derives backing/.sharecli-cow-staging for the same options, so equivalent session mounts expose and operate on different staging roots across platforms. Set the platform-independent non-CoW default explicitly or make the Windows implementation follow the documented InterceptFsOptions contract. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Windows and Unix mounts expose different default staging roots.
- ⚠️ Commit/discard operations target platform-specific directories.
- ⚠️ Existing staging data is not portable across supported platforms.

Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sharecli-fuse/src/session_registry.rs
**Line:** 136:137
**Comment:**
	*Api Mismatch: On Windows, these default options are passed to `CowMountHandle::from_options`, which derives an unset `cow_dir` as `backing/.sharecli-cow`, even when CoW is disabled. The Unix implementation derives `backing/.sharecli-cow-staging` for the same options, so equivalent session mounts expose and operate on different staging roots across platforms. Set the platform-independent non-CoW default explicitly or make the Windows implementation follow the documented `InterceptFsOptions` contract.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/sharecli-fuse/mutants.toml`:
- Around line 28-32: Update the FuseSessionRegistry exclusion in mutants.toml so
it covers only methods that require a live FUSE mount, preserving mutation
coverage for list, resolve_fs, and unmount’s no-registration path.
Alternatively, add unit tests for those no-mount paths and retain them in the
examine set, while keeping the existing session_mount_options handling
unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 46b05b8e-5d8c-4e29-b2f7-1a4d463db97f

📥 Commits

Reviewing files that changed from the base of the PR and between fdc1c4d and ce431fc.

📒 Files selected for processing (3)
  • crates/sharecli-fuse/mutants.toml
  • crates/sharecli-fuse/src/session_registry.rs
  • docs/ops/mutants-hard-gate.md
📜 Review details
⏰ Context from checks skipped due to timeout. (31)
  • GitHub Check: Guardrail (nextest)
  • GitHub Check: Loom (sharecli-sync)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Lint & Format
  • GitHub Check: test
  • GitHub Check: macos_native (macos-latest)
  • GitHub Check: lint
  • GitHub Check: fuse-smoke-runner unit
  • GitHub Check: linux_container (ubuntu-24.04)
  • GitHub Check: dashboard keyboard Tab-cycle
  • GitHub Check: linux_native (ubuntu-24.04)
  • GitHub Check: live pool probe (soft)
  • GitHub Check: windows_winfsp (windows-latest)
  • GitHub Check: codeql
  • GitHub Check: SAST Analysis
  • GitHub Check: Dependency Audit
  • GitHub Check: cargo bench (gate)
  • GitHub Check: hyperfine healthz (soft)
  • GitHub Check: Unit Tests
  • GitHub Check: cargo bench (soft)
  • GitHub Check: coverage
  • GitHub Check: Reproducible build (L52)
  • GitHub Check: Offline check after fetch (soft)
  • GitHub Check: Offline build after fetch (soft)
  • GitHub Check: dashboard PNG hard diff
  • GitHub Check: healthz soak (soft)
  • GitHub Check: healthz load burst (soft)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
  • GitHub Check: linux_native (ubuntu-24.04)
  • GitHub Check: windows_winfsp (windows-latest)
🧰 Additional context used
📓 Path-based instructions (3)
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use UTF-8 encoding for all text files; do not use Windows-1252 smart quotes or other special characters.

Use UTF-8 for all text files.

Files:

  • crates/sharecli-fuse/mutants.toml
  • crates/sharecli-fuse/src/session_registry.rs
  • docs/ops/mutants-hard-gate.md
**/*.{rs,toml}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,toml}: Use Rust edition 2021 and the pinned toolchain from rust-toolchain.toml; keep code compatible with the configured stable compiler, rustfmt, and clippy.
Ensure Rust code passes formatting, clippy with -D warnings, and the locked all-features test suite; CI uses RUSTFLAGS=-D warnings.
Use PascalCase for Rust types, snake_case for functions, methods, and modules, and SCREAMING_SNAKE_CASE for constants.

Files:

  • crates/sharecli-fuse/mutants.toml
  • crates/sharecli-fuse/src/session_registry.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Use Rust for the project and validate Rust changes with Cargo build, Cargo test, and Cargo clippy.

**/*.rs: For new Rust modules, create the test file before the implementation; for bug fixes, write a failing test before the fix; for refactors, ensure existing tests pass before and after.
Use idiomatic, language-appropriate error handling, never use unwrap or expect in production Rust code, and log all errors with structured logging.

Files:

  • crates/sharecli-fuse/src/session_registry.rs
🔇 Additional comments (2)
crates/sharecli-fuse/src/session_registry.rs (1)

130-139: LGTM!

Also applies to: 206-207, 229-230, 315-316, 326-327, 600-614

docs/ops/mutants-hard-gate.md (1)

108-112: LGTM!

Comment thread crates/sharecli-fuse/mutants.toml Outdated
@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@kilo-code-bot

kilo-code-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Merge with notes

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
crates/sharecli-fuse/src/session_registry.rs 556 Redundant Ok()? pattern: mounts.values().next().ok_or_else(...) already returns Result<&V, anyhow::Error>. Wrapping it in Ok(...)? unwraps the Result with ? only to re-wrap it immediately. The match arm can return the Result directly without Ok() and without ?.
Files Reviewed (1 file)
  • crates/sharecli-fuse/src/session_registry.rs - 1 issue

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 3195caf)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3195caf)

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (4 files)
  • crates/sharecli-fuse/src/session_registry.rs - No new issues; prior expect panic and Windows cow-root divergence resolved in later commits
  • crates/sharecli-fuse/src/cow_session.rs - No new issues
  • crates/sharecli-fuse/mutants.toml - No new issues; prior non-ASCII and broad exclusion resolved
  • docs/ops/mutants-hard-gate.md - No new issues

Previous review (commit 17556ec)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • crates/sharecli-fuse/src/session_registry.rs
  • crates/sharecli-fuse/mutants.toml
  • docs/ops/mutants-hard-gate.md
  • crates/sharecli-ipc/src/handler.rs
  • crates/sharecli-ipc/src/log_buffer.rs
  • crates/sharecli-ipc/src/ws_client.rs

Reviewed by step-3.7-flash · Input: 66.4K · Output: 15K · Cached: 434.7K

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/sharecli-fuse/mutants.toml`:
- Around line 26-36: Replace the non-ASCII “≥27” comparison with the ASCII form
“>= 27” in the explanatory comment at crates/sharecli-fuse/mutants.toml lines
26-36 and the corresponding documentation at docs/ops/mutants-hard-gate.md lines
104-117; make no other changes.

In `@crates/sharecli-fuse/src/session_registry.rs`:
- Around line 547-560: In the single-mount branch of
FuseSessionRegistry::resolve_entry, replace mounts.values().next().expect("one
mount") with a non-panicking anyhow error path while preserving the existing
Result behavior. Do not add logging unless resolve_fs introduces a production
boundary that handles and logs these errors.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 779b07eb-83c8-46ce-b2d4-56e7818818a1

📥 Commits

Reviewing files that changed from the base of the PR and between ce431fc and 5ccb552.

📒 Files selected for processing (4)
  • crates/sharecli-fuse/mutants.toml
  • crates/sharecli-fuse/src/cow_session.rs
  • crates/sharecli-fuse/src/session_registry.rs
  • docs/ops/mutants-hard-gate.md
📜 Review details
⏰ Context from checks skipped due to timeout. (29)
  • GitHub Check: Rust
  • GitHub Check: OSV / GHSA lockfile scan (required)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: cargo bench (gate)
  • GitHub Check: hyperfine healthz (soft)
  • GitHub Check: cargo bench (soft)
  • GitHub Check: Lint & Format
  • GitHub Check: SAST Analysis
  • GitHub Check: axe dashboard (WCAG 2.x Level A)
  • GitHub Check: Reproducible build (L52)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: dashboard PNG hard diff
  • GitHub Check: windows_winfsp (windows-latest)
  • GitHub Check: Dependency Audit
  • GitHub Check: linux_native (ubuntu-24.04)
  • GitHub Check: live pool probe (soft)
  • GitHub Check: healthz soak (soft)
  • GitHub Check: healthz load burst (soft)
  • GitHub Check: codeql
  • GitHub Check: coverage
  • GitHub Check: Offline build after fetch (soft)
  • GitHub Check: Unit Tests
  • GitHub Check: Offline check after fetch (soft)
  • GitHub Check: Kilo Code Review
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
  • GitHub Check: windows_winfsp (windows-latest)
  • GitHub Check: linux_native (ubuntu-24.04)
🧰 Additional context used
📓 Path-based instructions (3)
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use UTF-8 encoding for all text files; do not use Windows-1252 smart quotes or other special characters.

Use UTF-8 for all text files.

Files:

  • crates/sharecli-fuse/src/cow_session.rs
  • crates/sharecli-fuse/mutants.toml
  • docs/ops/mutants-hard-gate.md
  • crates/sharecli-fuse/src/session_registry.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Use Rust for the project and validate Rust changes with Cargo build, Cargo test, and Cargo clippy.

**/*.rs: For new Rust modules, create the test file before the implementation; for bug fixes, write a failing test before the fix; for refactors, ensure existing tests pass before and after.
Use idiomatic, language-appropriate error handling, never use unwrap or expect in production Rust code, and log all errors with structured logging.

Files:

  • crates/sharecli-fuse/src/cow_session.rs
  • crates/sharecli-fuse/src/session_registry.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,toml}: Use Rust edition 2021 and the pinned toolchain from rust-toolchain.toml; keep code compatible with the configured stable compiler, rustfmt, and clippy.
Ensure Rust code passes formatting, clippy with -D warnings, and the locked all-features test suite; CI uses RUSTFLAGS=-D warnings.
Use PascalCase for Rust types, snake_case for functions, methods, and modules, and SCREAMING_SNAKE_CASE for constants.

Files:

  • crates/sharecli-fuse/src/cow_session.rs
  • crates/sharecli-fuse/mutants.toml
  • crates/sharecli-fuse/src/session_registry.rs
🔇 Additional comments (2)
crates/sharecli-fuse/src/cow_session.rs (1)

32-38: LGTM!

Also applies to: 214-236

crates/sharecli-fuse/src/session_registry.rs (1)

206-230: LGTM!

Also applies to: 315-327, 475-485, 646-793

Comment on lines +26 to +36
# * FuseSessionRegistry mount entry points (mount_background/_with,
# mount_foreground/_with, mount_inner, mount_winfsp, all platform
# variants) + with_context_mount — mounting can only be exercised through
# a live mount (no /dev/fuse on the lane); the cfg(windows) twins are
# unobservable on the Linux-only lane. The no-mount registry surface
# (global, normalize_key, list, resolve_fs, unmount's no-registration
# path) is NOT excluded: it is covered by registry_no_mount_tests, and
# the mount entry points share the pure `session_mount_options` helper
# whose struct-literal `delete field` mutants are caught by a unit test
# (cargo-mutants >= 27 pushes `delete field` mutants past exclude_re,
# so keep such literals in testable helpers).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace non-ASCII comparison symbols.

  • crates/sharecli-fuse/mutants.toml#L26-L36: Replace ≥27 with >= 27.
  • docs/ops/mutants-hard-gate.md#L104-L117: Replace ≥27 with >= 27.

As per coding guidelines, use UTF-8 text files but “do not use Windows-1252 smart quotes or other special characters.”

📍 Affects 2 files
  • crates/sharecli-fuse/mutants.toml#L26-L36 (this comment)
  • docs/ops/mutants-hard-gate.md#L104-L117
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/sharecli-fuse/mutants.toml` around lines 26 - 36, Replace the
non-ASCII “≥27” comparison with the ASCII form “>= 27” in the explanatory
comment at crates/sharecli-fuse/mutants.toml lines 26-36 and the corresponding
documentation at docs/ops/mutants-hard-gate.md lines 104-117; make no other
changes.

Source: Coding guidelines

Comment thread crates/sharecli-fuse/src/session_registry.rs
@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

1 similar comment
@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@KooshaPari KooshaPari left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve pending review

@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

KooshaPari and others added 5 commits August 10, 2026 03:37
The Mutation Testing lane installs the latest cargo-mutants (27.1.0) and
examines 261 fuse mutants, missing 6: the new \delete field\ operator
targets the FuseMountOptions literals in the mount entry points and is
pushed straight into the examine set, bypassing exclude_re (visit.rs
pushes StructField mutants without the allows_mutant filter).

Fix by extracting the shared \session_mount_options\ helper so the
session-id wiring is unit-testable without a live mount:
- the four platform entry points (Linux/macOS + Windows variants) now
  share one literal; the redundant \serialize: true\ (already the
  Default) is dropped, eliminating the equivalent mutants;
- the remaining \delete field session_id\ mutant is caught by
  \session_mount_options_pins_session_id\.

Local parity run (cargo-mutants 27.1.0, --timeout 60 --jobs 8, same
config): 257 mutants, 222 caught, 35 unviable, 0 missed.
Addresses the PR 727 review:

- mutants.toml: narrow the FuseSessionRegistry exclusion from the whole
  impl to the mount-bound entry points only
  ("replace FuseSessionRegistry::mount_" / "delete ! in
  FuseSessionRegistry::mount_"). FnValue mutant names embed the function
  without an "in <fn>" suffix, so the broad "FuseSessionRegistry::"
  pattern silently excluded testable methods: global, normalize_key,
  list, resolve_fs, and unmount's no-registration path now stay in the
  examine set. The cfg(windows) / other-platform resolve_fs twins are
  excluded by return type (unobservable on the Linux-only lane).
- session_registry.rs: new resolve_entry helper shared by the Unix and
  WinFsp resolve_fs paths gives the no-mount resolution contract one
  tested implementation (also removes the platform-twin == mutants). New
  registry_no_mount_tests populates the registry directly to exercise
  global (singleton identity), normalize_key (fallback + canonical),
  list (empty + registered), resolve_fs (empty/sole/by-mountpoint/
  multiple), and unmount (unregistered errors) without a live mount.
- cow_session.rs: CowMountHandle::from_options now derives the CoW root
  per the documented InterceptFsOptions contract (.sharecli-cow when cow,
  else .sharecli-cow-staging), matching the Unix InterceptFs path instead
  of always using .sharecli-cow (WinFsp divergence flagged in review);
  covered by cow_handle_default_root_follows_documented_contract.

Local parity run (cargo-mutants 27.1.0, --timeout 60 --jobs 8): 266
mutants, 228 caught, 38 unviable, 0 missed.
cargo fmt with stable 1.96.0 to match the ci-gate toolchain (FuseMountEntry literal, err().expect and multi-assert reflows).
@KooshaPari
KooshaPari force-pushed the fix/cargo-mutants-struct-field branch from cbc2b30 to 3195caf Compare August 10, 2026 10:37
@github-actions

Copy link
Copy Markdown

Quality Gate Report

❌ Unit Tests: FAILED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

2 similar comments
@github-actions

Copy link
Copy Markdown

Quality Gate Report

❌ Unit Tests: FAILED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@github-actions

Copy link
Copy Markdown

Quality Gate Report

❌ Unit Tests: FAILED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@KooshaPari
KooshaPari dismissed stale reviews from coderabbitai[bot] and coderabbitai[bot] August 10, 2026 10:57

Resolved via branch updates

The auto-commit daemon's 67bfcad dropped the Ok(...) wrapper around the
ok_or_else(...)? expression, so the None arm yields &V while the Some arm
yields anyhow::Result<&V> (E0308, ci-gate test failure) and its one-line
reflow tripped rustfmt. Restore the wrapped form with the short message
matching the empty-registry variant; the single-mount arm stays
non-panicking as CodeRabbit requested.
@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Aug 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

}
None => match mounts.len() {
0 => anyhow::bail!("fuse: no active FUSE mounts registered (run `fuse mount` first)"),
1 => Ok(mounts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Redundant Ok()? pattern

mounts.values().next().ok_or_else(...) already returns Result<&V, anyhow::Error>. Wrapping it in Ok(...)? unwraps the Result with ? only to re-wrap it immediately. The match arm can return the Result directly without Ok() and without ?.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@github-actions

Copy link
Copy Markdown

Quality Gate Report

✅ Unit Tests: PASSED
⏭️ E2E Tests: SKIPPED (no e2e directory)
⏭️ Integration Tests: SKIPPED (no integration directory)
✅ FR Annotations: VALID

@KooshaPari KooshaPari closed this Aug 13, 2026
@KooshaPari
KooshaPari deleted the fix/cargo-mutants-struct-field branch August 13, 2026 01:19
KooshaPari added a commit that referenced this pull request Aug 14, 2026
Recreates the reviewed-and-validated #727 fix (closed without merging) as a
fresh change on current main. The Mutation Testing hard gate has been red on
every main push since #722: cargo-mutants 27.1.0's new `delete field`
mutants bypass exclude_re, leaving 6 survivors in the FuseMountOptions
struct literals of the mount entry points.

- Extract session_mount_options(session_id) pure helper shared by all four
  mount entry points; drop the redundant `serialize: true` (already the
  Default), eliminating the equivalent mutants.
- Narrow mutants.toml exclusions to the genuinely mount-bound mount_*
  entry points (genre-aware regexes) and cover the no-mount registry
  surface (global, normalize_key, list, resolve_fs, unmount) with the new
  registry_no_mount_tests module via the shared resolve_entry resolver.
- Align CowMountHandle::from_options with the documented contract: derive
  {backing}/.sharecli-cow when cow, else .sharecli-cow-staging.
- resolve_entry single-mount arm is non-panicking (ok_or_else path).

Verified: 266 mutants, 228 caught, 38 unviable, 0 missed (cargo-mutants
27.1.0); 51 lib tests; fmt + cargo check clean.

FR reference: FR-003 (mutants hard gate), FR-009 (FUSE IO Intercept)
mergify Bot pushed a commit that referenced this pull request Aug 14, 2026
Recreates the reviewed-and-validated #727 fix (closed without merging) as a
fresh change on current main. The Mutation Testing hard gate has been red on
every main push since #722: cargo-mutants 27.1.0's new `delete field`
mutants bypass exclude_re, leaving 6 survivors in the FuseMountOptions
struct literals of the mount entry points.

- Extract session_mount_options(session_id) pure helper shared by all four
  mount entry points; drop the redundant `serialize: true` (already the
  Default), eliminating the equivalent mutants.
- Narrow mutants.toml exclusions to the genuinely mount-bound mount_*
  entry points (genre-aware regexes) and cover the no-mount registry
  surface (global, normalize_key, list, resolve_fs, unmount) with the new
  registry_no_mount_tests module via the shared resolve_entry resolver.
- Align CowMountHandle::from_options with the documented contract: derive
  {backing}/.sharecli-cow when cow, else .sharecli-cow-staging.
- resolve_entry single-mount arm is non-panicking (ok_or_else path).

Verified: 266 mutants, 228 caught, 38 unviable, 0 missed (cargo-mutants
27.1.0); 51 lib tests; fmt + cargo check clean.

FR reference: FR-003 (mutants hard gate), FR-009 (FUSE IO Intercept)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants