Commit 344262c
feat(core): filesystem timestamp-granularity probe with ctime fallback and per-directory gitignore cascade (#141)
Implements DESIGN s5.2 step 2 end-to-end plus the true per-directory
gitignore cascade (both prior `TODO(M3)`s in the scanner/exclude
modules).
## Timestamp-granularity probe + ctime fallback
- On the first scan of a source, a write-stat probe measures the
filesystem's effective mtime granularity (bounded by a ~2.2s budget so
even 2s-resolution FAT32 resolves in one probe). The result is persisted
per-source (migration `0009`); later scans reuse it. A probe I/O failure
degrades to "fine" for that cycle only and re-probes next scan.
- Change detection stays `(size, mtime_ns)` on fine filesystems (zero
extra cost). On a coarse FS (granularity > 1s), a stat-matched file is
re-hashed when its ctime/inode-birth post-dates the last scan boundary
or its mtime falls within one granularity window of it - catching
within-quantum in-place edits that a pure mtime compare misses.
- Decision logic is pure (`granularity_is_coarse`,
`coarse_fs_needs_rehash`) and unit-tested across the rule branches.
## Per-directory gitignore cascade
- Replaces the flattened single-matcher approximation with
directory-scoped cascading scopes: nested `.gitignore`/`.ignore` files
apply at their own depth and deeper files override shallower ones,
preserving negation/re-include semantics.
- The repo-level `.git/info/exclude` and global-gitignore tiers are
anchored at the source root per git semantics (second commit fixes the
tier being scoped to `.git/info/`, which made its rules match nothing).
Verified: 310 driven-core lib tests green, fmt clean, clippy `-D
warnings` clean workspace-wide, `cargo check --workspace` clean, `.sqlx`
regenerated for the migration.
Refs #34
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QZQVP2tUuTLh8oL31D8heC
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 95fbd9a commit 344262c
34 files changed
Lines changed: 1165 additions & 181 deletions
File tree
- .sqlx
- crates
- driven-chaos/src/scenarios
- driven-cli
- src
- tests
- driven-core
- src
- migrations
- state
- tests
- src-tauri/src
- commands
Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
0 commit comments