Skip to content

feat(native): report attachment errors natively - #1038

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-attachment-errors
Oct 8, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-attachment-errors

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

Under native-preview, the attachments stage returned nothing on invalid input, so Python attached it again just to raise its own error.

Changes

Native code now raises Python's exact P001 error at the same point. Unsupported inputs still defer to Python.

  • Audits: implicit-argument overrides (opaque values at any depth defer), missing arguments and unrenderable values before SQL expansion; severity and run scope after it.
  • Function headers: staged errors, so earlier arguments and columns expand first.
  • Templates: ${...} errors in sources and functions; model config unchanged.
  • @param: malformed or undeclared references and unclosed text.
  • @@var: unknown variables and unclosed text. As in Python, only ' and " double, so doubled backticks end one segment and start another.
  • Cursor intrinsics, seed pairing.

Bridge rule: an error skips the re-run only if neither its text nor whether it fires depends on macro-expanded SQL. Marked bridge_independent=True:

  • audit argument and render errors: raw definition SQL and arguments
  • audit severity and run scope: authored or project values
  • function header and template errors: header and YAML values
  • @param: raw test body
  • @@var: authored SQL, before macros
  • seed pairing: file names

Not marked: cursor intrinsics, which are checked on macro-expanded SQL. The re-run stays until slice 2.

Verification

  • cargo test --workspace --all-features, clippy and fmt (1.99.0)
  • Parity tests against Python on generated multi-fault inputs, with minimum counts of marked errors.
  • Backtick differential against substitute_sql_vars; 30k backtick fuzz: no mismatches.
  • E2E on eight failing projects across three engines: identical errors, error_type CompileInputError, macros once (cursor intrinsic: twice under preview).
  • make compiler-differential (CI flags, 260 identical), -shipped (254), tests/e2e/scripts/compiler_differential, make check-ci, hygiene

@kvlonge
kvlonge force-pushed the feat/native-attachment-errors branch from 47bc863 to 101e9d3 Compare October 8, 2026 17:53
@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 19:30
@kvlonge
kvlonge merged commit ee19894 into main Oct 8, 2026
38 checks passed
@kvlonge
kvlonge deleted the feat/native-attachment-errors branch October 8, 2026 20:11
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