Expand description
Pipeline orchestration for the brink ink compiler.
Driver wraps a ProjectDb and provides higher-level operations:
file discovery, analysis orchestration, diagnostic collection, and
LIR input preparation. Both the compiler (one-shot) and LSP (long-lived)
use Driver as their entry point.
Structs§
- Analysis
Options - Tooling options for analysis: the registered host manifest and the severity policy for its external checks. Defaults to no manifest.
- Analysis
Result - The output of cross-file semantic analysis.
- Compile
Product - Outcome of the full pipeline: compiled
StoryDataor the diagnostics that prevented it. Batch compile = pull this one query (spec §5). - Diagnostic
Report - Partitioned diagnostics after suppression filtering.
- Driver
- Pipeline orchestration wrapper around
ProjectDb. - FileId
- Opaque identifier for a source file within a multi-file project.
- GitRev
- Git-revision
SourceTree: reads keys/contents from a git revision viagit show <rev>:<path>— the fix path for #1224’s baseline-diff bug (brink ide effects-diff --revreading nothing because the old closure-only seam couldn’t enumerate). - Lint
Policy - The resolved
[lints]policy (issue #1160): per-code severity overrides plus the blanketdeny-warningsflag. Bundled as its own small, cheaply-PartialEq-comparable value — rather than as two loose scalars — sobrink-db’s severity-partitioning call sites can share one narrow salsa projection the same wayTypePolicyalready does (seebrink-db’stype_policy_query/lint_policy_querydoc comments for the cutoff argument). - LirProduct
- Outcome of the pipeline through LIR lowering, mirroring
brink-compiler’scompile_lirstage sequence exactly. - Project
Db - Stateful incremental project database.
- RealFs
- Real-filesystem
SourceTree: walks a root directory and enumerates.brinkkeys, keyed by root-relative path. Enumeration goes through the sharedbrink_source_tree::Walk, so it never descends intobrink_source_tree::IGNORED_DIR_NAMES(target/,.git/,node_modules/— issue #1381 hand-rolled that prune here; issue #1433 moved the enforcement into the walk itself, where it can’t be forgotten), so a stray build-output or dependency tree underrootis never enumerated.readserves any key lazily off disk — it never eagerly reads the tree, so one malformed/unreadable file elsewhere underrootcannot fail areadof an unrelated key (issue #1357).
Enums§
- Dialect
- Compiler dialect: gates T1b brink-extension syntax. Default
StrictInk— divergence from the oracle-anchored ink subset is a visible, one-time, per-project choice (docs/t1b-surface-spec.md §1). - Discover
Error - Errors from file discovery.
- Lint
Level - A
[lints]table entry’s severity (issue #1160) — mirrors Rust’s own[lints]levels.Warnis every diagnostic code’s implicit level when[lints]doesn’t mention it, so it doubles as this type’sDefault. - Type
Policy typesproject policy (docs/typed-mode-spec.md §1).Gradualis the pre-flip behavior —Unknownunifies with anything, annotations are optional seasoning, and the strict checks do not run.Strictrequiresdialect = brink.
Traits§
- Source
Tree - A source of
.brinkfiles: enumerate what exists under a root (held by the implementation since construction — see the module docs), and read any key, whether or not enumeration returned it.
Functions§
- effective_
severity - The severity a diagnostic code should actually be reported at, given the
project’s
typespolicy and resolved[lints]policy — the single seam every diagnostic-partitioning site must call instead of the rawbrink_ir::DiagnosticCode::severitydefault. - is_
native - Whether
pathis a native.brinksource file — an extension test only, matchingbrink-db’s internalfile_languageclassification. This is the dispatch every discovery caller (brink-compiler’sprepare_driver,brink-cli’sload_git_baseline) uses to pickdiscover_native+RealFs/GitRev(native) overcrate::Driver::discover(ink,INCLUDEBFS). - native_
source_ root - Resolve a project’s source root from an entry file’s path: the directory
containing the nearest
brink.tomlfound by walking up from the entry (brink-project-config’s discovery), or — if none exists — the entry’s own directory (decision-log 2026-07-22 “native module identity … source root”: the explicit, documented single-file-project mode, not a silent fallback). - native_
source_ root_ with_ warnings - Like
native_source_root, but additionally reports warnings when the bounded walk stepped over abrink.toml. Returns both the resolved root and any discovery warnings that should be reported to the user. - relative_
key - Convert
pathto the root-relative keyRealFs/GitRevwould key it under — the inverse of “joinrootwith a key,” used by discovery callers to look up theFileIda just-discovered entry landed on. Bothrootandpathare lexically absolutized first (viastd::path::absolute, which resolves./..without touching the filesystem) so the strip is exact regardless of how each was spelled relative to the process’s cwd — e.g.root = ".",path = "story/main.brink"androot = "story",path = "./story/main.brink"both key as"story/main.brink".