Skip to content

feat(native): assemble project resource facts natively behind the preview engine - #1066

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-project-integration
Oct 9, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-project-integration

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

M4i part 1: project resource assembly runs natively behind native-preview. Results match Python byte for byte, or native defers with a record.

Changes

  • Rust assembly/project/: model, function and audit deps; managed source and seed destinations via the shared template evaluator; model and hook syntax checks for exactly the SQL Python validates.
  • Python uses the facts, skips its own expansion and validation, and replays ENV/CTX reads into COMPILE_INPUT_READS. Anything else defers to unchanged Python with a project_assembly record.
  • Review fixes:
    • The syntax check uses the shared parser-dialect guard (lineage/main/parser_dialect.rs). A dialect this parser build lacks (e.g. trino) defers with unsupported_dialect. New failure case assembly-hook-syntax-unbuilt-dialect.
    • ENV names are resolved by Python's os.environ.get and sent with the request, so Windows' case-insensitive keys match Python. Unsent names defer.
  • Deleted: the assemble_native_project stub and assemble_project_by_engine seam. No oracle Python deleted.
  • Changed expectations:
    • test_native_analysis_seams now records assemble_native_project_resources, which returns NativeProjectResources, not None.
    • _assemble_compiled_model drops seed_names, which model_build_deps never read.
  • New tests: integration parity (Python calls 0, reads match), deferral cases and a simulated Windows environment; Rust tests checked against Python.

Verification

  • Sabotage (reverted):
    • stage always defers → 6/6 fail;
    • managed source ignored → parity fails;
    • no read replay → parity fails;
    • no dialect guard → differential fails on the new case;
    • os.environ snapshot → Windows case fails.
  • CI-flag differential: 321 identical. Preview deferrals: only syntax_error ×3 and unsupported_dialect ×1. validate wheel calls 176→22.
  • Touched tests, compile E2E, differential E2E, make check-ci, make test, cargo test/clippy/fmt on 1.99.0, hygiene.

…view engine

Native project assembly derives model, function and audit dependencies, managed source and seed destinations (with variable, environment and context templates and their recorded reads), and model and hook syntax validation. Anything native cannot reproduce exactly hands the whole resource assembly back to Python with a project_assembly deferral record.
…ENV names through Python

The native syntax check now uses the shared parser-dialect guard, so an adapter dialect this parser build lacks defers with unsupported_dialect instead of accepting SQL Python rejects. ENV template names are resolved by Python's own os.environ lookup and sent with the request, so Windows' case-insensitive keys behave as in Python; a name the request does not carry defers.
@kvlonge
kvlonge enabled auto-merge October 9, 2026 12:42
@kvlonge
kvlonge added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit daf0620 Oct 9, 2026
38 checks passed
@kvlonge
kvlonge deleted the feat/native-project-integration branch October 9, 2026 15:43
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