-
Notifications
You must be signed in to change notification settings - Fork 0
fix(lanes): green the cargo-mutants matrix and repin cosign action #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,5 +10,65 @@ | |
| # * parallelism 4 (use `--jobserver-tasks 4` on the CLI) | ||
| # When this file is loaded via `--config`, those CLI flags should accompany | ||
| # the cargo-mutants invocation in CI/local. | ||
| # | ||
| # Triage (mirrors the survivor-triage table in docs/ops/mutants-hard-gate.md): | ||
| # * src/bin/* — CLI probe utilities (fuse-mount-smoke, fuse-runtime-probe, | ||
| # mfmount-probe) are macOS/daemon glue with no testable surface, the same | ||
| # terminal-bound class as the thermal-tui `replace run` exclusion. | ||
| # * src/winfsp_mount.rs — Windows-only (cfg(windows)); on the Linux lane the | ||
| # mutations compile to no-ops and can never be observed. | ||
| # * src/mount_smoke.rs — privileged-mount smoke harness; requires a live | ||
| # kernel mount (CI has no /dev/fuse). | ||
| # * Filesystem impls + mount/install helpers — fuser's `Reply*` constructors | ||
| # are pub(crate), so the callbacks (lookup/getattr/readdir/open/read/write/ | ||
| # create/mknod/unlink/mkdir/rmdir/rename/setattr) and the created-entry | ||
| # helpers can only be exercised through a live kernel mount; mount-bound. | ||
| # * FuseSessionRegistry methods + with_context_mount — registry state is | ||
| # only reachable through a live mount (no registration API exists), so | ||
| # every method is mount-bound. | ||
| # * backend.rs macFUSE capability probes (fskit_*, kernel_backend_loaded, | ||
| # probe_runtime) — cfg'd-out on Linux; the `&&` -> `||` fskit_approved | ||
| # line is equivalent there (both operands are false). | ||
| # * provenance.rs windows ADS helpers (ads_path / set_attr / get_attr) — | ||
| # cfg(windows); no-ops on the Linux lane. | ||
| # * Equivalent mutants: AgentsConf::empty -> Default (derive Default is the | ||
| # identical pattern set); strip_mount_prefix `<`->`<=` / `==`->`!=` (the | ||
| # guarded branches are unreachable); global_read_cache_meters (documented | ||
| # Default stub); commit_pending EXDEV-guard -> true (the copy fallback is | ||
| # behavior-identical for EXDEV; the widened guard only fires on non-EXDEV | ||
| # rename errors that the CI lane cannot produce). | ||
| # Everything else (InterceptFs no-mount methods, CowMountHandle, AgentCowStore, | ||
| # AgentsConf, WriteSerialize, caches, meters, inode/path mapping, backend | ||
| # selection, provenance session id) is covered by tests/. | ||
|
|
||
| # Glob paths are relative to the WORKSPACE root (cargo-mutants | ||
| # `tree_relative_path`), not the crate root. | ||
| exclude_globs = [ | ||
| "crates/sharecli-fuse/src/bin/*", | ||
| "crates/sharecli-fuse/src/winfsp_mount.rs", | ||
| "crates/sharecli-fuse/src/mount_smoke.rs", | ||
| ] | ||
|
|
||
| exclude_globs = ["tests/*"] | ||
| exclude_re = [ | ||
| "impl Filesystem for SharedInterceptFs", | ||
| "impl Filesystem for InterceptFs", | ||
| "mount_with_session", | ||
| "replace mount -> anyhow::Result<\\(\\)> with Ok\\(\\(\\)\\)", | ||
| "install_created_entry", | ||
| "FuseSessionRegistry::", | ||
| "with_context_mount", | ||
| "fskit_framework_available", | ||
| "fskit_approval_requested", | ||
| "fskit_backend_approved", | ||
| "kernel_backend_loaded", | ||
| "in probe_runtime", | ||
| "ads_path", | ||
| "set_attr", | ||
| "get_attr", | ||
| "replace AgentsConf::empty -> Self with Default::default()", | ||
| "replace < with <= in strip_mount_prefix", | ||
| "replace == with != in strip_mount_prefix", | ||
| "replace > with >= in NegativeDentryCache::is_negative", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
ast-grep outline crates/sharecli-fuse/src \
--items all --type function > /tmp/fuse-functions.txt
rg -n -A40 -B5 'fn is_negative|NegativeDentryCache' \
crates/sharecli-fuse/srcRepository: KooshaPari/sharecli Length of output: 24206 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
if command -v cargo >/dev/null 2>&1; then
if ! cargo mutants --help >/dev/null 2>&1; then
echo "cargo-mutants command unavailable"
exit 0
fi
echo "cargo-mutants version:"
cargo mutants --version
echo "mutant list output:"
cargo mutants --list --output-format json 2>/tmp/cargo_mutants_logs.json | \
python3 - <<'PY'
import sys, json
data = json.load(sys.stdin)
for x in data.get("file", []):
name = x.get("name") or ""
if "NegativeDentryCache::is_negative" in name:
print(json.dumps({
"file": x.get("srcfile"),
"line": x.get("line"),
"col": x.get("col"),
"function": x.get("function"),
"name": name,
"replacement": x.get("replacement")
}))
PY
else
echo "cargo command unavailable"
fi
# Behavioral probe for source-level time comparison semantics.
python3 - <<'PY'
expires_at = 100
now_expiring = 100
now_past = 101
for now, label in [(now_expiring, "expired"), (now_past, "past")]:
current_gt = expires_at > now
current_ge = expires_at >= now
changed = current_gt != current_ge
print(f"{label}: expires_at={expires_at} now={now} current_gt={current_gt} current_ge={current_ge} changed={changed}")
PYRepository: KooshaPari/sharecli Length of output: 191 Add a deterministic boundary test or justify the
🤖 Prompt for AI Agents |
||
| "global_read_cache_meters", | ||
| "replace match guard err.raw_os_error\\(\\) == Some\\(libc_exdev\\(\\)\\) with true", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,15 +21,29 @@ | |
| //! cross-test contamination of `SHARECLI_FUSE_BACKEND`. Tests do NOT | ||
| //! require a live FUSE mount — they exercise the pure negotiation | ||
| //! contract and `mount_with_session`'s error-shape contract. | ||
| //! | ||
| //! Platform split: the override-handling tests (fskit / kernel / invalid / | ||
| //! deterministic) run on Linux and macOS because `select_backend` honors | ||
| //! `SHARECLI_FUSE_BACKEND` on both. The no-override test and the two | ||
| //! mount-error-envelope tests are macOS-only: on Linux/Windows the backend is | ||
| //! documented as always `Unavailable` (`backend.rs`) and the Linux mount path | ||
| //! goes straight to `fuser::mount` without backend negotiation, so those | ||
| //! assertions cannot hold there. | ||
|
Comment on lines
+24
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Align the platform documentation with the test branches. The module documentation says that the no-override test is macOS-only. The test runs on Linux and asserts Proposed documentation fix-//! `SHARECLI_FUSE_BACKEND` on both. The no-override test and the two
-//! mount-error-envelope tests are macOS-only: on Linux/Windows the backend is
-//! documented as always `Unavailable` (`backend.rs`) and the Linux mount path
-//! goes straight to `fuser::mount` without backend negotiation, so those
-//! assertions cannot hold there.
+//! `SHARECLI_FUSE_BACKEND` on both. The no-override test runs on both
+//! supported platforms with platform-specific expectations. The two
+//! mount-error-envelope tests are macOS-only because the backend is
+//! documented as `Unavailable` on non-macOS and the Linux mount path goes
+//! straight to `fuser::mount` without backend negotiation.
-/// Backend selection — when no env var is set, `select_backend` returns
+/// On macOS, when no env var is set, `select_backend` returnsAlso applies to: 139-148 🤖 Prompt for AI Agents |
||
|
|
||
| #![cfg(any(target_os = "linux", target_os = "macos"))] | ||
|
|
||
| //! The mount-error-envelope tests below are macOS-only; on Linux their | ||
| //! imports would be unused, so gate them alongside. | ||
|
|
||
| #[cfg(target_os = "macos")] | ||
| use std::fs; | ||
| #[cfg(target_os = "macos")] | ||
| use std::path::Path; | ||
| use std::sync::Mutex; | ||
| #[cfg(target_os = "macos")] | ||
| use tempfile::TempDir; | ||
|
|
||
| use sharecli_fuse::{select_backend, FuseBackend}; | ||
| use tempfile::TempDir; | ||
|
|
||
| /// Serialize env-var-mutating tests so the `SHARECLI_FUSE_BACKEND` slot | ||
| /// never carries state across tests. (Different env var keys can run in | ||
|
|
@@ -111,13 +125,27 @@ fn backend_select_kernel_override_is_respected() { | |
| matches!(backend, FuseBackend::Kernel | FuseBackend::Unavailable), | ||
| "kernel override MUST yield Kernel or Unavailable (got {backend:?})" | ||
| ); | ||
| // On Linux the macFUSE kext can never load (`kmutil` does not exist), so | ||
| // the kernel override degrades closed deterministically — a mutant that | ||
| // widens the loaded-guard to unconditional would return Kernel here. | ||
| #[cfg(target_os = "linux")] | ||
| assert_eq!( | ||
| backend, | ||
| FuseBackend::Unavailable, | ||
| "on Linux the kernel override MUST degrade to Unavailable (got {backend:?})" | ||
| ); | ||
| } | ||
|
|
||
| /// Backend selection — when no env var is set, `select_backend` returns | ||
| /// either `Kernel` (when loaded) or `Fskit` (the documented macOS | ||
| /// fallback). It MUST never return `Unavailable` without an explicit | ||
| /// override — operators who did not opt out expect at least one of the | ||
| /// two macFUSE paths to be picked. | ||
| /// | ||
| /// On non-macOS the contract is the mirror image: the FUSE layer is | ||
| /// platform-native (libfuse3 / WinFsp) and `backend.rs` documents the | ||
| /// backend as always `Unavailable`, so no-override MUST degrade to | ||
| /// `Unavailable` rather than pretending a macFUSE backend exists. | ||
| #[test] | ||
| #[serial_test::serial] | ||
| fn backend_select_no_override_picks_kernel_or_fskit() { | ||
|
|
@@ -126,11 +154,18 @@ fn backend_select_no_override_picks_kernel_or_fskit() { | |
| std::env::remove_var("SHARECLI_FUSE_BACKEND"); | ||
| let backend = select_backend(); | ||
| restore_env("SHARECLI_FUSE_BACKEND", prev); | ||
| #[cfg(target_os = "macos")] | ||
| assert_ne!( | ||
| backend, | ||
| FuseBackend::Unavailable, | ||
| "no-override selection MUST yield Kernel or Fskit (got {backend:?})" | ||
| ); | ||
| #[cfg(not(target_os = "macos"))] | ||
| assert_eq!( | ||
| backend, | ||
| FuseBackend::Unavailable, | ||
| "non-macOS has no macFUSE backend; no-override MUST degrade to Unavailable (got {backend:?})" | ||
| ); | ||
| } | ||
|
|
||
| /// Backend selection — calling `select_backend` twice with the same | ||
|
|
@@ -155,8 +190,13 @@ fn backend_select_is_deterministic_for_same_state() { | |
| /// (so the operator can see *why* the mount failed without digging into | ||
| /// `kmutil`). We don't require a live FUSE backend for this test — we | ||
| /// only require the error envelope to be correct. | ||
| /// | ||
| /// macOS-only: the Linux mount path skips backend negotiation entirely | ||
| /// (`fuser::mount` direct), so the backend-unavailable envelope exists | ||
| /// only on macOS. | ||
| #[test] | ||
| #[serial_test::serial] | ||
| #[cfg(target_os = "macos")] | ||
| fn mount_failure_unavailable_backend_mentions_backend() { | ||
| let _guard = BACKEND_ENV_LOCK.lock().expect("env lock"); | ||
| let prev = std::env::var("SHARECLI_FUSE_BACKEND").ok(); | ||
|
|
@@ -189,8 +229,13 @@ fn mount_failure_unavailable_backend_mentions_backend() { | |
| /// surface the mountpoint path so the operator can correlate the | ||
| /// failure with their `--mountpoint` flag. This catches regressions in | ||
| /// the error wrapping in `lib.rs`. | ||
| /// | ||
| /// macOS-only: on Linux `fuser::mount` reports bare io errors (e.g. | ||
| /// `No such file or directory`) without the mountpoint, and there is no | ||
| /// macFUSE negotiation error to wrap. | ||
| #[test] | ||
| #[serial_test::serial] | ||
| #[cfg(target_os = "macos")] | ||
| fn mount_failure_invalid_mountpoint_mentions_path() { | ||
| let _guard = BACKEND_ENV_LOCK.lock().expect("env lock"); | ||
| let prev = std::env::var("SHARECLI_FUSE_BACKEND").ok(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: KooshaPari/sharecli
Length of output: 17425
🏁 Script executed:
Repository: KooshaPari/sharecli
Length of output: 248
🏁 Script executed:
Repository: KooshaPari/sharecli
Length of output: 22255
🏁 Script executed:
Repository: KooshaPari/sharecli
Length of output: 16498
Do not classify the EXDEV guard mutation as equivalent.
WriteSerialize::commit_pendingonly falls back to copy+remove whenfs::renamereturnslibc::EXDEV; it returnsWriteSerializeError::Iofor other rename errors. The existing tests exercise EXDEV and regular errors, but there is no EXDEV cross-device coverage and non-EXDEV fallback is not equivalent. Keep this as an explicit CI-lane limitation or add deterministic coverage.🤖 Prompt for AI Agents