pub struct WorktreeWatchConfig {Show 15 fields
pub forbidden_paths: Vec<String>,
pub forbidden_folders: Vec<String>,
pub banned_words: Vec<String>,
pub idle_after_seconds: Option<u64>,
pub cold_after_seconds: Option<u64>,
pub hot_commit_check_seconds: Option<u64>,
pub warm_commit_check_seconds: Option<u64>,
pub cold_commit_check_seconds: Option<u64>,
pub max_commit_checks_per_tick: Option<usize>,
pub parent_rescan_seconds: Option<u64>,
pub rank_persist_seconds: Option<u64>,
pub max_hot_repos: Option<usize>,
pub max_fs_watches: Option<usize>,
pub spool_retention_days: Option<u64>,
pub repo_ranks: Vec<WorktreeWatchRepoRank>,
}Expand description
Client-side filters + adaptive scheduling for xbp worktree-watch (never sent to the server).
Configured in the global ~/.xbp/config.yaml (or platform equivalent) and
in ~/.xbp/.xbp-worktree-ignore (gitignore-style patterns; mcps/ is seeded by default):
worktree_watch:
forbidden_paths:
- secrets/
- apps/web/.env.local
forbidden_folders:
- .cache
- coverage
banned_words:
- credential
- private-key
# Adaptive resource control (defaults shown)
idle_after_seconds: 180 # no FS activity → warm
cold_after_seconds: 600 # no activity → cold (unwatch FS; release Windows locks)
hot_commit_check_seconds: 12
warm_commit_check_seconds: 120
cold_commit_check_seconds: 300
parent_rescan_seconds: 300
rank_persist_seconds: 120
max_hot_repos: 4
max_fs_watches: 6 # concurrent recursive FS watches (hot+warm budget)
max_commit_checks_per_tick: 6 # cap git HEAD probes per loop (CPU)
spool_retention_days: 7 # prune synced jsonl + old .seen markers
repo_ranks: # maintained by the watcher (activity score)
- root: C:/Users/you/Documents/GitHub/xbp
score: 12.5
last_event_at: "2026-07-22T12:00:00Z"
rank: 1Fields§
§forbidden_paths: Vec<String>Relative path prefixes (repo-root relative). Nested under a watched tree is still blocked.
Examples: secrets, secrets/, apps/web/.turbo, **/dist is NOT glob — use folder names.
forbidden_folders: Vec<String>Directory / path-segment names blocked anywhere in the relative path.
banned_words: Vec<String>Case-insensitive substrings; if any appear in the relative path, the path is ignored.
idle_after_seconds: Option<u64>Seconds without FS mutations before a repo cools from hot → warm (default 180).
cold_after_seconds: Option<u64>Seconds without activity before warm → cold (unwatch FS handles; default 600).
hot_commit_check_seconds: Option<u64>How often to poll git rev-parse HEAD for hot repos (default 12).
warm_commit_check_seconds: Option<u64>Commit check interval for warm repos (default 120).
cold_commit_check_seconds: Option<u64>Commit check interval for cold repos (default 300).
max_commit_checks_per_tick: Option<usize>Max git HEAD probes per watch loop tick under a parent cover (default 6).
Caps CPU when dozens of warm repos would otherwise all fire at once.
parent_rescan_seconds: Option<u64>Discover new/vanished repos under a parent cover (default 180).
rank_persist_seconds: Option<u64>How often to write repo_ranks back into global config (default 60).
max_hot_repos: Option<usize>Cap how many repos stay in the hot tier at once (default 6).
max_fs_watches: Option<usize>Max concurrent recursive filesystem watches under a parent cover (default 8). Hot repos are preferred; remaining budget goes to highest-score warm repos.
spool_retention_days: Option<u64>Days to keep .synced.*.jsonl and old dedupe .seen markers (default 7).
repo_ranks: Vec<WorktreeWatchRepoRank>Activity ranking (highest score first). Updated by the watcher.
Implementations§
Source§impl WorktreeWatchConfig
impl WorktreeWatchConfig
pub fn idle_after_seconds(&self) -> u64
pub fn cold_after_seconds(&self) -> u64
pub fn hot_commit_check_seconds(&self) -> u64
pub fn warm_commit_check_seconds(&self) -> u64
pub fn cold_commit_check_seconds(&self) -> u64
pub fn parent_rescan_seconds(&self) -> u64
pub fn rank_persist_seconds(&self) -> u64
pub fn max_hot_repos(&self) -> usize
Sourcepub fn max_fs_watches(&self) -> usize
pub fn max_fs_watches(&self) -> usize
Concurrent recursive FS watches under a parent cover (default 6).
Sourcepub fn max_commit_checks_per_tick(&self) -> usize
pub fn max_commit_checks_per_tick(&self) -> usize
Max git HEAD probes per parent-watch loop iteration (default 6).
pub fn spool_retention_days(&self) -> u64
Trait Implementations§
Source§impl Clone for WorktreeWatchConfig
impl Clone for WorktreeWatchConfig
Source§fn clone(&self) -> WorktreeWatchConfig
fn clone(&self) -> WorktreeWatchConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorktreeWatchConfig
impl Debug for WorktreeWatchConfig
Source§impl Default for WorktreeWatchConfig
impl Default for WorktreeWatchConfig
Source§fn default() -> WorktreeWatchConfig
fn default() -> WorktreeWatchConfig
Source§impl<'de> Deserialize<'de> for WorktreeWatchConfig
impl<'de> Deserialize<'de> for WorktreeWatchConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for WorktreeWatchConfig
impl PartialEq for WorktreeWatchConfig
Source§impl Serialize for WorktreeWatchConfig
impl Serialize for WorktreeWatchConfig
impl StructuralPartialEq for WorktreeWatchConfig
Auto Trait Implementations§
impl Freeze for WorktreeWatchConfig
impl RefUnwindSafe for WorktreeWatchConfig
impl Send for WorktreeWatchConfig
impl Sync for WorktreeWatchConfig
impl Unpin for WorktreeWatchConfig
impl UnsafeUnpin for WorktreeWatchConfig
impl UnwindSafe for WorktreeWatchConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more