Expand description
The SourceTree seam (decision-log “Native source-loading seam: a
SourceTree trait with a map-backed impl; the root is caller-supplied”,
2026-07-22; issue #1278): a host-agnostic way to enumerate and read
native .brink source files.
Extracted from brink-db into this L0 leaf crate (decision-log
2026-07-23, issue #1323 ruling on #1325) so both brink-db (native
discovery) and brink-project-config (config discovery, #1312) can
depend on it without a
project-config -> brink-db -> brink-analyzer -> project-config cycle.
brink-db re-exports SourceTree so brink_db::SourceTree still
resolves for existing consumers.
InMemory is brink-web’s discovery seam directly; the host-only
implementations (RealFs, GitRev) live in brink-driver and back
brink_driver::discover_native (issue #1288) — a normal native compile
and the brink ide git-baseline diff path, respectively.
§The contract
SourceTree::list enumerates every source key under a caller-supplied
root, sorted deterministically by key — never in filesystem/OS
iteration order, which is unspecified and can vary between runs. Keys are
root-relative (forward-slash-joined, matching how .brink module paths
are derived downstream). SourceTree::read reads the source text for a
key previously returned by list.
The root itself is never discovered inside the seam (no implementation
walks upward looking for a project marker) — it is always supplied by the
caller, which resolves it however is appropriate for that host (a
brink.toml walk-up for the CLI, a pushed project root for web/LSP).
Structs§
- InMemory
- Map-backed
SourceTree: the test and web seam.
Traits§
- Source
Tree - A source of
.brinkfiles: enumerate what exists under a root, and read any key that enumeration returned.