Skip to content

refactor(native): read planner audits, functions, seeds and sources through native views - #1215

Merged
kvlonge merged 4 commits into
mainfrom
refactor/planner-native-resources
Oct 22, 2026
Merged

kvlonge merged 4 commits into
mainfrom
refactor/planner-native-resources

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Why

The planner read compiled audits, functions, seeds and sources by generic attribute lookup. That hides which native view each read depends on and blocks moving planning onto plain Rust records. Models already go through one counted native accessor. This applies the same treatment to the other resource kinds.

Changes

  • audit_reads, function_reads, seed_reads and source_reads return each attribute the planner reads from that kind's native view, built exactly as its Python attribute is. Any other object is counted in the compiled_view_fallbacks stage counter and then read by attribute.
  • resource_reads handles name, key, deps, destination, schema_entry and references for sites that read every resource kind alike.
  • Planning code now reads through these helpers: audit entries and attachment, source deferral, relations, identity hashes, function, seed and scenario entries, warehouse checks, and command and clone plans. Reads selected by a name stored in a variable now use typed reader tables.
  • The fallback integration test also plans the waffle shop fixture, so sources, seeds, functions and audits are proven to be read natively.

No behaviour, output, diagnostics or API changes.

Verification

  • Compiler differential: 373/373. Planner differential: 11/11, after each commit.
  • Plan output is byte-identical on two large synthetic projects. The fallback counter is 0 for compile and plan on those projects and on waffle shop.
  • Runtime instruction counts (dense compile, config build, import, warm and cold sqb plan) are at parity, within ±0.2%.
  • Build work: clean release +0.35%, incremental +0.22%.
  • Rule budgets unchanged. Focused unit, integration and e2e tests pass, and so do clippy -D warnings and make check-ci.

`audit_reads` returns each audit attribute the planner reads from the
native audit view, built exactly as its Python attribute is, and
counts any other object in `compiled_view_fallbacks` before reading it
by attribute. Audit plan entries, audit attachment, relation scopes
and source deferral read audits through it. The fallback test now also
plans the waffle shop fixture, whose sources, seeds, functions and
audits are all read natively.
…cessor

`function_reads` returns each function attribute the planner reads
from the native function view, built exactly as its Python attribute
is, and counts any other object in `compiled_view_fallbacks`. Function
plan entries, identity hashes, relation locations and clone plans read
functions through it.
…elds natively

`seed_reads` and `source_reads` return the seed and source attributes
the planner reads from their native views, and `resource_reads` reads
a name, key, dependency keys, destination, schema entry or references
from whichever native view a resource is. Each counts any other object
in `compiled_view_fallbacks`. Seed, source, scenario, clone, command,
identity, scope and warehouse planning read through them; seed plan
entries keep reading their own attributes.
@kvlonge
kvlonge enabled auto-merge (squash) October 22, 2026 07:53
@kvlonge
kvlonge merged commit 0e7bf40 into main Oct 22, 2026
44 checks passed
@kvlonge
kvlonge deleted the refactor/planner-native-resources branch October 22, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant