1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Repository scanners. Deterministic surface classification by path and filename.
//!
//! Walks a target directory, hashes every file with SHA-256, and assigns
//! each one a `SourceClass` taxonomy bucket (e.g. `ProjectAdr`,
//! `EngineeringDoctrinePrinciple`, `ProjectAgentFile`, `BlockedSurface`).
//! Classification is **content-agnostic by design** — it never reads prose
//! to decide what something is, only path and filename.
//!
//! Block rules cover runtime exhaust (`.cordance/`, `.git/`, `.claude/cache/`,
//! `node_modules/`, `target/`, …), secret/credential filenames (`id_rsa`,
//! `.env`, `secrets.json`, `Credentials.*`), and OS junk (`.DS_Store`,
//! `Thumbs.db`). Case folding keeps `SECRET-FOO.TXT` blocked alongside
//! `secret-foo.txt` on default-case-insensitive NTFS / APFS.
//!
//! # Golden path
//!
//! ```no_run
//! use camino::Utf8PathBuf;
//!
//! let target = Utf8PathBuf::from(".");
//! let sources = cordance_scan::scan_repo(&target).expect("scan succeeds");
//!
//! for record in &sources {
//! if record.blocked {
//! eprintln!(
//! "blocked: {} ({})",
//! record.path,
//! record.blocked_reason.as_deref().unwrap_or("?"),
//! );
//! } else {
//! println!(
//! "{:?}: {} ({} bytes)",
//! record.class, record.path, record.size_bytes,
//! );
//! }
//! }
//! ```
use Utf8PathBuf;
use ;
/// Top-level scan entrypoint. Delegates to `walker::walk`.
/// Classify a path using only its repo-relative location. No content reads.