Skip to main content

Module discovery

Module discovery 

Source

Structs§

ParsedFile
A parsed .bynk file: its source, AST, and the two path forms it needs.
RecoveredSources
#1710: what a file the strict parse rejects still yields, from its recovering parse: a ParsedFile per unit it recovered, the names of the declarations recovery had to skip (references to them are known names, not unknown ones; #1663’s Decision B), and the recovering parse’s diagnostics. files is empty when no unit survived (a broken header); the diagnostics still come from this recovery, with real spans. These files are for diagnostics only: the strict parse’s error still stands, so nothing they belong to is ever emitted.

Functions§

case_effective_tier
v0.118: a case’s effective tier — its own as <tier>, else the suite default, else unit.
check_file_directory_conflicts
discover_bynk_files
discover_project_files
Slice A: the .bynk files these roots contain — the same walk compile_project performs, honouring exclude and the tool’s own out/ node_modules caches.
holds_bynk_source
#3242: whether any .bynk file sits under dir, walked as discovery walks (hidden directories and the out/node_modules caches skipped).
is_project_boundary
#3242: whether dir is the root of another project: it holds its own bynk.toml. Discovery never crosses such a boundary, the way it never enters out/. The directory a walk starts at is not tested, only the subdirectories below it, so a project’s own root is never its own boundary.
nested_projects
#3242: the projects nested below root: each directory under it holding its own bynk.toml, outermost only (a project’s own subtree isn’t entered), in path order. Walked as discovery walks, skipping excludes, hidden directories and the tool’s out and node_modules caches. root itself is not reported even if it holds a manifest.
parse_sources
Parse already-read source text into a ParsedFile. The read happens at the call site (v0.24): the pipeline owns the text for snapshots and per-file error attribution, and the overlay supplies unsaved buffers. Slice 0: prefix is this tree’s project-root-relative include prefix (src, tests, …), empty for a single-root project. It builds each file’s identity_path; source_path stays relative to root (the tree), which is what unit validation reads. See ParsedFile.
parse_sources_recovering
#1710: parse_sources for a file whose strict parse failed, from the recovering parse the parse cache keeps beside that failure. None only when there is none: the source didn’t lex.
read_adapter_binding
An adapter’s .binding.ts module: overlay-first (an open, unsaved binding buffer), else a real disk read. Content-ownership track (#1086) scope note, found under slice 5’s implementation: unlike a project’s .bynk sources — enumerable ahead of time by extension, and this track’s actual charter — a binding module’s path is only known once its declaring adapter has been parsed (adapter … { binding: "…" }), so no discovery walk (bynk-testkit, bynk-driver::discovery) can pre-populate it into a sources map the way .bynk files are. Keeping a disk-read fallback here — the CLI’s real production path has always worked exactly this way, #1077/#1081 notwithstanding — is a deliberate, narrow carve-out, not a straggler.
read_adapter_include
#2321: read one file an adapter binding … includes [ … ] list names, as bytes. Binary, so the text overlay (unsaved editor buffers) does not apply: an included module is always the file on disk.
read_source
Read a source file from the overlay (keyed by canonicalised absolute path; falls back to the literal path so a not-yet-created overlay entry still matches). Every caller into this module now supplies a complete overlay — content-ownership track (#1086) slice 5 removed the disk-read fallback this used to have on a miss, so an incomplete overlay is a real NotFound error here, not a silent disk read.
suite_effective_tier_is_system
v0.118: whether a suite’s effective tier is system — the suite default is system, or any case opts up to system. Such a suite is emitted via the wired cross-Worker (Integration) machinery; otherwise it stays in-process (Test).