Repository navigation
fix(expr): quote explicit symbol literal operands - #27
morsel-ray wants to merge 2 commits into
Conversation
Lower only actual SYM atoms through quote so query/source names and ambient globals cannot capture Expr::Lit data. Do not mutate retained values or coerce SYM to STR. Preserve explicit Col references, vector literals and call heads; test standalone, global and projection/column collisions.
|
I have put this back in draft, despite the green debug/release jobs. A separate compatibility check exposed a gap in my lowering: the public The WHERE/name-collision regressions still pass, but they do not cover these special-form operand roles. I am keeping this out of merge readiness while refining the boundary; no default core behavior or STR coercion change is proposed. |
|
@singaraiona, one API-contract choice before I take this out of draft. My proposed compatibility scope is to preserve raw name operands for explicit The remaining boundary is arbitrary Is that bounded contract acceptable, or must those literal-name Call compositions also remain source-compatible? If the latter, I should design an explicit operand-role/syntax API rather than expand a spelling whitelist. I prefer preserving the explicit builtin Operations and documenting the dynamic Call boundary, but have not implemented or selected that policy on your behalf. A header-flag-only shortcut is insufficient: a separate default-core control with a genuinely quoted SYM atom selected B instead of literal A when the source also had column A (same row count). Explicit quote ASTs prevent that capture. No STR coercion or native-core semantic change is proposed here. |
Fix
Expr::Lit(Value::sym("A"))currently lowers to a bare native SYM, which the evaluator/query compiler can interpret as a name. Emit an explicit(quote datum)only for actual SYM atoms. This preserves the symbol value without converting it to STR or changing attributes on the retained caller value.Expr::Col, operation/call heads, STR/numeric literals and vector literals keep their existing lowering. This does not introduce general quoted-LIST support.Regressions
col(...)must still resolve the binding.Validation I ran
Reproduced #26 on the supplied source pins: Rust
8dc87922, core override870e0ecc, q69b42105. The original example intentionally exited zero while printingName: 'A' undefined; its STR case returned one row. Both new regression functions fail on the old production lowering (AST-shape assertion / Name error), not during compilation.With this fix,
cargo test -p rayforce --test expr(11/11) andcargo test -p rayforce --test query(12/12) pass for both:870e0ecc.3.0.1 / 0aa2d6af, through the actual vendored staging path withRAYFORCE_SRCunset.Both used q
69b42105; the same standalone example now returns one row for both SYM and STR on both pairs. Its temporary source was kept as an external reproduction artifact; permanent coverage is in the two test modules.Toolchain: Rust/Cargo 1.92.0, Clang/libclang 18 (not the reporter's 21). Dependencies were prepared into a captured lock, then Cargo ran offline. These are targeted source-pair tests, not a full Rust suite, MSRV 1.74, published-crate archive, real-q or sanitizer certification. No core/pin/dependency/version changes.
Fixes #26.