From 070f8756a0590265abc342f9e3d8ae994a7273ad Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Thu, 10 Sep 2026 17:18:49 -0400 Subject: [PATCH 1/3] chore: pin promql parser fork --- crates/frontend-promql/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/frontend-promql/Cargo.toml b/crates/frontend-promql/Cargo.toml index 30238756..477ce4fe 100644 --- a/crates/frontend-promql/Cargo.toml +++ b/crates/frontend-promql/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" [dependencies] asap-types = { path = "../types" } -# ProjectASAP's pinned parser is the shared parser contract used by the backend -# and control plane. It carries the evaluated PromQL extensions documented in -# `promql.rs`; syntax outside that contract must fail closed at adapters. -promql-parser = { git = "https://github.com/ProjectASAP/promql-parser", rev = "c51beafb361af4cc95ed62ae377862c660ceb757" } +# Shared ProjectASAP parser contract. Keep this immutable revision aligned +# with backend parsing and treat newly parsed functions as unsupported until +# the frontend lowerer gives them an explicit semantic mapping. +promql-parser = { git = "https://github.com/ProjectASAP/promql-parser", rev = "d7606436bde05efe19c5398fe2122faa49062f7d" } [dev-dependencies] asap-aware-mapping = { path = "../asap-aware-mapping" } From 8628fd7e6d1f24db20eeff5d2dc6420b89c106e3 Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Thu, 10 Sep 2026 17:18:55 -0400 Subject: [PATCH 2/3] chore: update parser lockfile --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d21e40d1..10afb460 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2308,8 +2308,8 @@ dependencies = [ [[package]] name = "promql-parser" -version = "0.9.0" -source = "git+https://github.com/ProjectASAP/promql-parser?rev=c51beafb361af4cc95ed62ae377862c660ceb757#c51beafb361af4cc95ed62ae377862c660ceb757" +version = "0.10.0" +source = "git+https://github.com/ProjectASAP/promql-parser?rev=d7606436bde05efe19c5398fe2122faa49062f7d#d7606436bde05efe19c5398fe2122faa49062f7d" dependencies = [ "cfgrammar", "chrono", From 6d60232c903bd2c65f5a30529cd855261a236fcd Mon Sep 17 00:00:00 2001 From: zz_y Date: Thu, 10 Sep 2026 15:23:35 -0600 Subject: [PATCH 3/3] test(promql): keep new reducers exact-only --- .../frontend-promql/tests/promql_lowering.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/frontend-promql/tests/promql_lowering.rs b/crates/frontend-promql/tests/promql_lowering.rs index 39c88515..f22db0e2 100644 --- a/crates/frontend-promql/tests/promql_lowering.rs +++ b/crates/frontend-promql/tests/promql_lowering.rs @@ -18,6 +18,24 @@ fn lower(q: &str) -> QueryExpr { lower_promql(q, AccuracyTarget::Exact).unwrap_or_else(|e| panic!("lower failed for {q:?}: {e}")) } +#[test] +fn newly_parsed_metricsql_reducers_fail_closed_without_lowering_semantics() { + for query in [ + "distinct_over_time(cpu_usage[5m])", + "entropy_over_time(cpu_usage[5m])", + ] { + promql_parser::parser::parse(query) + .unwrap_or_else(|error| panic!("pinned parser must accept {query:?}: {error}")); + assert!( + matches!( + lower_promql(query, AccuracyTarget::Exact), + Err(LoweringError::UnsupportedFunction(_)) + ), + "{query:?} must remain exact-only until the lowerer defines its semantics" + ); + } +} + // ── Bare selectors & label matchers (folded onto Scan.predicates) ─────────────── #[test]