Scry.Frontend (scry v0.1.22)

Copy Markdown View Source

The disk-beam roux frontend: Scry.Analysis's frontend contract, satisfied from the .beam files the stock compilers just produced.

Registers the same query names as planchette's in-memory compile frontend — roux dispatches by name, so the shared analysis layer works over either without change. What this frontend provides:

  • :beam_meta input — module => %{path, hash}. The driver (Scry.Scanner) sets it from an mtime/size-prefiltered scan, hashing content only for files that moved; a recompiled-but-identical beam produces an equal value and advances nothing.
  • :module_set input — :all => sorted [module], the project's analyzed modules.
  • :env_fingerprint input — :all => toolchain/rule-environment map (Scry.Runner builds it); :high durability so an upgrade invalidates the whole graph.
  • :module_beam query — beam bytes, read from disk. The read itself is untracked; the tracked signal is the :beam_meta value, and roux's early cutoff backdates downstream work when re-read bytes compare equal (a touch re-reads one file and recomputes nothing else).
  • :module_source / :module_map / :file_of queries — source attribution from each beam's compile_info.

Durability: everything here is :medium or :high — never :low. Durability propagates as the minimum over dependencies, and :low derived memos are dropped from the manifest, which would evict the fact memos that make warm starts worth having.

Planchette's focus surface (Planchette.Focus) additionally wants :source_text and :declared_modules; this frontend deliberately does not provide them — the compiler never demands those queries, and roux is demand-driven, so their absence costs nothing.

Summary

Functions

file_of(db, module)

@spec file_of(Roux.Database.t(), term()) :: String.t() | :external

module_beam(db, module)

@spec module_beam(Roux.Database.t(), term()) ::
  {:ok, binary()} | :external | {:error, term()}

module_map(db, atom)

@spec module_map(Roux.Database.t(), term()) :: %{optional(module()) => String.t()}

module_source(db, module)

@spec module_source(Roux.Database.t(), term()) :: String.t() | :external