Repository navigation
refactor: port reference checks, compile-input attachment and semantic completion to the native extension - #1095
Merged
Merged
Conversation
Production only extracts references without an origin from Python (typed macro arguments); located scan errors and P012 locations are produced by the native model, function and hook loops. The Python origin mapping, its SqlReferenceOrigin/SqlReferenceSourceMap models and the refs.native wrapper are deleted; their located cases stay covered by the Rust locating tests and the E2E reference-error suites.
The explicit-reference report and the planner's audit-gate and hook-read edges read models, sources, seeds, functions, audits and Python hooks straight from the project views in Rust, and the report is built as Python's compile models natively. Python keeps only the user-code owners (functions, loader definitions and their literal SQL). The JSON request builders and response decoding are deleted.
The audit, SQL test and SQL hook SQL checks read their inputs from the project views and build the CompilerDiagnostic results in Rust; get_resource_sql_diagnostics is a one-call wrapper.
…ogue natively The compile driver reports each error-severity scope finding through the diagnostic collector from Rust, with the same key and CompilerDiagnostic Python built; diagnostics/scope.py is deleted. semantic_help_catalogue reads the native catalogue the diagnostics already use, replacing the duplicated Python table. model_schema_enum_declarations had no caller, and context_templates' expand_config_templates and build_run_context_values were single-use pass-throughs.
…atively The runtime relation guard and the planner's old-name checks call the same native remedy and P008 old-name message the compile-time explicit-reference check uses; the Python duplicates are deleted.
The compile usages read schema declarations and the resolver's schema and enum records from Python objects in Rust, report S006 through the collector and build the UsageRecords; the named_declarations package is deleted and its caller uses the native function directly.
Compile-input attachment runs in native bindings: effective config, target and cache context, the declaration scope, the model input loop with its class dictionary, resource and check attachment, and the compiled record and update helpers. The Python attachment and compiled_project modules are removed; the compile driver and callers use the native functions. The inspection of user Python resources for missing-description diagnostics stays in Python.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Phase 1 of the Rust-hosted SQLBuild port (CHI-589): move compiler stages from Python into the native extension and delete the Python they replace.
Changes
compiler/compiled_projectPython package andcompile/_helpers/attachmentare deleted.fastCargo profile andmake fast-nativefor incremental local rebuilds (13s vs 137s for a one-line change); CI and wheels still userelease.Intentional differences:
_VisibleModelDeclarationsis nowVisibleModelDeclarations; misuse-only inputs can raise different exception types; e2e seam key renamed tocomplete_semantic_project.Verification
make check-ci; public-repository hygiene scan.